/* reels-share — single full-viewport dark portrait surface.
   Force-dark on the PAGE (not a Flutter Colors.black); wide screens letterbox a
   centered 9:16 column. One token source: this file + the SSR theme-color meta. */
:root {
  --bg: #0E0F12;
  --fg: #FFFFFF;
  --pill-bg: #FFFFFF;
  --pill-fg: rgba(0, 0, 0, 0.87);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  height: 100%;
  overscroll-behavior-y: contain;
}

/* iOS URL-bar-safe full height + safe-area insets. */
.feed {
  height: 100svh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

.reel {
  position: relative;
  height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  touch-action: pan-y;
}

/* Letterbox a centered 9:16 column on wide screens. */
.reel-video {
  width: 100%;
  height: 100%;
  max-width: calc(100svh * 9 / 16);
  object-fit: contain;
  background: #000;
  touch-action: pan-y;
}

.reel-title {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  /* RTL / long-title overflow guard (SD-07). */
  max-height: 3.9em;
  overflow: hidden;
}

/* One primary CTA per screen — fixed thumb-zone install pill (A3/A6). */
.install {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-fg);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 3;
}
.install-badge { display: block; }

/* Tap-for-sound cue (v7 audio fix) — a deliberate, owner-approved reversal of
   the prior "no muted badge" decision: the browser autoplay policy cannot be
   beaten before a real gesture, so this is the honest affordance for that
   window. Top-right, safe-area-aware, well clear of the bottom-anchored
   install pill (.install) and .reel-title (both bottom-anchored). Visibility
   is toggled via the `hidden` attribute from app.js/sound-core.js's
   onSoundStateChange — SSR-hidden by default (no-JS / both deploy-skew
   directions never show a dead affordance). */
.sound-cue {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--fg);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.sound-cue[hidden] { display: none; }
.sound-cue:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

/* Generic / ineligible card (state 4) + crawler <noscript> card + the
   snap-in-feed terminal cards (end-card, retry-card — .playback-terminal).
   The terminal cards are full-height/snap-aligned like .reel so they can
   join the scroll feed and the playback singleton (app.js observes them
   through the same IntersectionObserver as .reel). */
.generic, .og-card, .playback-terminal {
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.end-card, .retry-card { background: #101114; }
.generic h1, .og-card h1, .playback-terminal h2 { font-size: 1.4rem; margin: 0 0 8px; }
.generic p, .og-card p, .playback-terminal p { opacity: 0.8; margin: 0 0 16px; max-width: 32ch; }
.retry-button {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: transparent;
  color: var(--fg);
  font-weight: 600;
}
.retry-button:disabled { opacity: 0.6; }

.feed-sentinel { height: 1px; }

.discover-page {
  min-height: 100svh;
  overflow: auto;
}

.discover {
  min-height: 100svh;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: calc(32px + env(safe-area-inset-top)) 16px calc(104px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.discover-header h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  line-height: 1.2;
}

.discover-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.discover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.discover-card {
  min-height: 112px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #17191f;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.discover-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.86rem;
  font-weight: 700;
}

.discover-label {
  font-size: 0.96rem;
  font-weight: 650;
}

@media (prefers-reduced-motion: reduce) {
  .feed { scroll-behavior: auto; }
}

/* Legal/compliance pages (/help/*) — a normal flowing document layout.
   .og-card/.generic/.discover are viewport-height-constrained for the reel
   surface and would clip real legal copy, so this gets its own class set. */
.legal-page {
  min-height: 100svh;
  overflow: auto;
}

.legal {
  min-height: 100svh;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: calc(32px + env(safe-area-inset-top)) 16px calc(64px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}
.legal-nav a { color: var(--fg); }
.legal-nav-current { color: rgba(255, 255, 255, 0.6); }
.legal-nav-sep { color: rgba(255, 255, 255, 0.35); }

.legal h1 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.2;
}

.legal-byline {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #17191f;
}
.legal-section h2 { margin: 0; font-size: 1.1rem; }
.legal-section p, .legal-section li { color: rgba(255, 255, 255, 0.85); line-height: 1.5; }
.legal-section ul { margin: 0; padding-left: 1.2em; }
.legal-section a:not(.cta-button) { color: var(--fg); }
.legal-note { color: rgba(255, 255, 255, 0.6); font-size: 0.86rem; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cta-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-fg);
  font-weight: 600;
  text-decoration: none;
}
.cta-button--whatsapp {
  background: transparent;
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.table-wrap { overflow-x: auto; }
.legal table {
  border-collapse: collapse;
  width: 100%;
  min-width: 420px;
}
.legal th, .legal td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.88rem;
}
.legal th { color: rgba(255, 255, 255, 0.6); font-weight: 600; }
