.moments-body { height: 100dvh; overflow: hidden; background: #05070b; }

.moments-topbar {
  position: relative;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(44px, 1fr);
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid rgba(37, 44, 58, 0.82);
  background: rgba(7, 10, 15, 0.96);
  padding: 0 1.25rem;
  backdrop-filter: blur(18px);
}

.moments-topbar .social-primary-nav { min-height: 64px; }
.moments-topbar .topbar-avatar { justify-self: end; }

.moments-page { position: relative; width: 100%; max-width: none; height: calc(100dvh - 64px); overflow: hidden; margin: 0; background: radial-gradient(circle at 50% 50%, rgba(20, 26, 38, 0.72), #05070b 58%); padding: 0; }
.moments-feed { width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scroll-snap-type: y mandatory; scrollbar-width: none; }
.moments-feed::-webkit-scrollbar { display: none; }
.moment-slide { display: grid; place-items: center; width: 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; padding: 0.7rem 5.5rem; }
.moment-frame { position: relative; height: min(calc(100dvh - 82px), 830px); max-width: calc(100vw - 10rem); aspect-ratio: 9 / 16; overflow: hidden; border: 1px solid rgba(167, 176, 192, 0.28); border-radius: 10px; background: #020305; box-shadow: 0 26px 70px rgba(0, 0, 0, 0.52), 0 0 0 1px rgba(47, 128, 255, 0.05); }
.moment-slide.is-active .moment-frame { border-color: rgba(47, 128, 255, 0.46); box-shadow: 0 26px 80px rgba(0, 0, 0, 0.58), 0 0 28px rgba(47, 128, 255, 0.12); }
.moment-media-shell, .moment-media-shell > video, .moment-embed-host, .moment-embed-host iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.moment-media-shell { display: grid; place-items: center; background: #020305; }
.moment-media-shell > video { object-fit: contain; cursor: pointer; }
.moment-embed-host iframe { z-index: 2; border: 0; background: #000; }
.moment-poster { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: #05070b; }
.moment-poster::after { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.24)); content: ""; }
.moment-poster img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.68) saturate(0.9); transform: scale(1.03); }
.moment-poster i { position: absolute; z-index: 1; display: grid; place-items: center; width: 58px; height: 58px; border: 1px solid rgba(244,247,251,.38); border-radius: 50%; background: rgba(7,10,15,.7); color: #fff; font-size: 1.1rem; font-style: normal; padding-left: 3px; backdrop-filter: blur(10px); }
.moment-provider-mark, .moment-unavailable { color: var(--secondary); font-size: 0.82rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.moment-embed-host.is-playing .moment-poster { opacity: 0; pointer-events: none; }
.moment-top-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.52) 0, transparent 24%, transparent 56%, rgba(0,0,0,.88) 100%); }
.moment-game-badge { position: absolute; top: 1rem; left: 1rem; z-index: 4; border: 1px solid rgba(56,189,248,.42); border-radius: 4px; background: rgba(7,10,15,.66); color: #a8e4ff; font-size: 0.56rem; font-weight: 900; letter-spacing: 0.1em; padding: 0.3rem 0.42rem; backdrop-filter: blur(8px); }

.moment-actions { position: absolute; right: 0.72rem; bottom: 5.2rem; z-index: 5; display: grid; justify-items: center; gap: 0.75rem; }
.moment-actions button, .moment-actions > a:not(.moment-author-avatar) { display: grid; justify-items: center; gap: 0.18rem; min-width: 42px; border: 0; background: transparent; color: #fff; cursor: pointer; filter: drop-shadow(0 2px 5px rgba(0,0,0,.7)); }
.moment-actions button > span, .moment-actions > a > span { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(244,247,251,.2); border-radius: 50%; background: rgba(7,10,15,.68); font-size: 1.03rem; backdrop-filter: blur(8px); transition: transform 180ms ease, border-color 180ms ease, background 180ms ease; }
.moment-actions button:hover > span, .moment-actions > a:hover > span { transform: scale(1.08); border-color: rgba(47,128,255,.72); background: rgba(47,128,255,.34); }
.moment-actions button.is-active > span { border-color: rgba(255,77,94,.72); background: rgba(255,77,94,.26); color: #ff7f8b; }
.moment-actions b { color: #f4f7fb; font-size: 0.62rem; font-variant-numeric: tabular-nums; }
.moment-author-avatar { position: relative; display: flex; margin-bottom: 0.1rem; }
.moment-author-avatar::after { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 16px; height: 16px; border: 2px solid #080b10; border-radius: 50%; background: var(--ct); color: #fff; content: "+"; font-size: 0.7rem; font-weight: 900; }
.moment-author-avatar .social-avatar { border: 2px solid rgba(244,247,251,.7); }

.moment-caption { position: absolute; right: 4.25rem; bottom: 1rem; left: 1rem; z-index: 4; display: grid; gap: 0.45rem; color: #fff; text-shadow: 0 2px 8px #000; }
.moment-caption > a:first-child { display: flex; align-items: baseline; gap: 0.45rem; color: #fff; }
.moment-caption > a strong { font-size: 0.84rem; }
.moment-caption > a span, .moment-caption p { color: rgba(244,247,251,.78); font-size: 0.68rem; }
.moment-caption p { display: -webkit-box; overflow: hidden; margin: 0; line-height: 1.48; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.moment-source { display: inline-flex; align-items: center; gap: 0.35rem; justify-self: start; max-width: 100%; color: #dce7f7; font-size: 0.62rem; font-weight: 800; }
.moment-source span { color: var(--secondary); }

.moments-scope-switch { position: absolute; top: 0.85rem; left: 50%; z-index: 12; display: flex; gap: 0.18rem; transform: translateX(-50%); border: 1px solid rgba(244,247,251,.16); border-radius: 7px; background: rgba(7,10,15,.78); padding: 0.2rem; backdrop-filter: blur(12px); }
.moments-scope-switch button { min-width: 96px; min-height: 34px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.7rem; font-weight: 850; }
.moments-scope-switch button.is-active { background: rgba(244,247,251,.12); color: #fff; }
.moments-stepper { position: absolute; top: 50%; left: calc(50% + 260px); z-index: 10; display: grid; justify-items: center; gap: 0.6rem; transform: translateY(-50%); }
.moments-stepper button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 50%; background: #0d111a; color: var(--text); cursor: pointer; font-size: 1rem; transition: transform 180ms ease, border-color 180ms ease, background 180ms ease; }
.moments-stepper button:hover:not(:disabled) { transform: scale(1.07); border-color: rgba(47,128,255,.68); background: #141a26; }
.moments-stepper button:disabled { opacity: 0.3; cursor: default; }
.moments-stepper span { color: var(--muted); font-size: 0.6rem; font-variant-numeric: tabular-nums; }
.moments-loading, .moments-empty { display: grid; place-content: center; justify-items: center; gap: 0.7rem; width: 100%; height: 100%; color: var(--secondary); text-align: center; }
.moments-loading { grid-auto-flow: column; }
.moments-loading i { width: 8px; height: 8px; border-radius: 50%; background: var(--ct); animation: moments-pulse 900ms ease-in-out infinite alternate; }
.moments-loading i:nth-child(2) { animation-delay: 160ms; }
.moments-loading i:nth-child(3) { animation-delay: 320ms; }
.moments-empty > span { color: var(--secondary); font-size: 2rem; }
.moments-empty p { max-width: 320px; margin: 0; }
.moments-empty button { border: 1px solid var(--border); border-radius: 6px; background: #141a26; color: var(--text); cursor: pointer; padding: 0.55rem 0.8rem; }
@keyframes moments-pulse { to { opacity: .25; transform: translateY(-6px); } }

@media (max-width: 760px) {
  .moments-topbar { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 58px; padding: 0 0.65rem; }
  .moments-topbar .social-brand strong, .moments-topbar .social-brand span { display: none; }
  .moments-topbar .social-brand img { width: 30px; height: 30px; }
  .moments-topbar .social-primary-nav { min-height: 58px; gap: 0; }
  .moments-topbar .social-primary-nav a { min-width: 70px; padding: 0 0.4rem; }
  .moments-topbar .social-primary-nav b { font-size: 0.65rem; }
  .moments-page { height: calc(100dvh - 58px); }
  .moment-slide { padding: 0; }
  .moment-frame { width: 100%; height: 100%; max-width: none; border: 0; border-radius: 0; aspect-ratio: auto; }
  .moments-scope-switch { top: 0.65rem; }
  .moments-stepper { display: none; }
  .moment-actions { right: max(0.55rem, env(safe-area-inset-right)); bottom: max(5.25rem, calc(env(safe-area-inset-bottom) + 4.6rem)); }
  .moment-caption { bottom: max(0.85rem, env(safe-area-inset-bottom)); left: max(0.75rem, env(safe-area-inset-left)); }
}

@media (prefers-reduced-motion: reduce) {
  .moments-feed { scroll-behavior: auto; }
  .moments-loading i { animation: none; }
  .moment-frame, .moment-actions span, .moments-stepper button { transition: none; }
}
