/* ============================================================================
 * URIGAMI — "CINEMA" design system.
 * Netflix-style origami video service. TV-first (1920×1080 + D-pad), scaled
 * down for desktop, tablet, phone; special handling for legacy webOS TVs.
 *
 * Essence: true-black OLED base · refined crimson accent ramp · glass hairline
 * panels · heavy Outfit display type, tight leading · multi-stop hero scrims ·
 * luminous glowing focus ring for D-pad · layered shadow lifts · swift 200ms
 * ease-out motion.
 *
 * Typography:
 *   • Inter (400–700) — body, UI, meta text
 *   • Outfit (700 + 900 ONLY — no other weights are loaded) — display titles
 *   Both loaded from Google Fonts via <link> in each page's <head>; system
 *   fonts are the offline fallback.
 *
 * ── COMPATIBILITY CONVENTIONS (MANDATORY for every edit) ────────────────────
 * This file is flattened by scripts/flatten-css-vars.py into
 * web/tv/css/style-flat.css and served to Chrome 38 / WebKit 538 TVs.
 * Re-run the flattener whenever this file changes.
 *
 *  1. FALLBACK-FIRST: a plain px/% declaration must come BEFORE any
 *     min()/max()/clamp()/env()/svh/dvh use of the same property.
 *  2. Use top/right/bottom/left — NEVER the `inset` shorthand.
 *  3. aspect-ratio only as progressive enhancement inside @supports, AFTER a
 *     padding-top intrinsic-ratio fallback (old parsers skip @supports).
 *  4. NEVER use :has().
 *  5. :focus-visible (and any modern selector) always in a STANDALONE rule —
 *     never comma-grouped with plain selectors (old parsers drop the whole
 *     rule when one selector in the list is unknown).
 *  6. Media features (hover), (pointer), (prefers-reduced-motion),
 *     (orientation), (max-height) are SAFE — Chrome 38 evaluates unknown
 *     features as false and skips the block.
 *  7. Inside @media blocks use DIRECT property overrides, never :root token
 *     overrides (the flattener inlines tokens at their base value).
 *  8. backdrop-filter only as enhancement on top of a solid/semi-transparent
 *     fallback background (via @supports or a later declaration).
 *  9. Custom-property values must be LITERAL (no var() inside a token) so the
 *     flattener never has to resolve chains.
 * ========================================================================== */

/* Self-hosted fonts (static instances, latin) — no third-party requests. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/inter-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/outfit-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/outfit-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/outfit-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/outfit-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/assets/fonts/outfit-900.woff2') format('woff2');
}


/* ==========================================================================
 * 1 · DESIGN TOKENS
 * ========================================================================== */
:root {
  /* Foundation — true-black OLED base + elevated surface ramp */
  --bg: #000000;
  --bg-elev: #101014;
  --surface-1: #0b0b0e;   /* glass base fill, stages, panels */
  --surface-2: #101014;   /* modals, sheets */
  --surface-3: #17171c;   /* nested cards, chips */
  --hairline: rgba(255, 255, 255, 0.10);      /* every panel edge */
  --hairline-hi: rgba(255, 255, 255, 0.18);   /* hover / active edges */

  /* Ink ramp — never drop meta/hint ink below 0.55 alpha (WCAG AA floor) */
  --fg: #f7f7f8;                              /* titles, primary text */
  --fg-dim: #b9b9c3;                          /* body, meta, credits */
  --fg-faint: rgba(255, 255, 255, 0.55);      /* hints, footers — MINIMUM */

  /* Crimson ramp */
  --accent-soft: #ff8078;     /* crimson-300 — glow text, player kicker */
  --accent-hover: #ff544b;    /* crimson-400 — hover fill, badge text */
  --accent: #e63c37;          /* crimson-500 — accent text on black (5.1:1) */
  --accent-strong: #d92b26;   /* crimson-600 — button fill, white text = AA */
  --accent-pressed: #a81f1b;  /* crimson-700 — pressed state */
  --accent-deep: #3d0f0d;     /* crimson-900 — tint washes, ambient radials */
  --glow: rgba(230, 60, 55, 0.45);

  /* Shape */
  --radius-xs: 6px;           /* badges, chips */
  --radius-sm: 10px;          /* buttons */
  --card-radius: 12px;        /* cards */
  --radius-lg: 16px;          /* panels, modals */

  /* Elevation */
  --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 40px 120px rgba(0, 0, 0, 0.75);

  /* THE luminous focus treatment — white ring + crimson halo + deep drop.
     Applied as box-shadow by .focused (D-pad) and :focus-visible (keyboard). */
  --focus-ring: 0 0 0 3px #ffffff, 0 0 0 5px rgba(230, 60, 55, 0.35),
                0 0 34px 4px rgba(230, 60, 55, 0.45),
                0 18px 44px rgba(0, 0, 0, 0.7);
  --focus-scale: 1.06;

  /* Motion — swift, then still */
  --ease-swift: cubic-bezier(0.2, 0, 0, 1);
  --t-micro: 120ms;
  --t-standard: 200ms;
  --t-overlay: 320ms;

  /* Layout */
  --row-gap: 48px;
  --card-w: 320px;
  --card-h: 180px;
  --hero-h: 760px;

  /* UI / body stack — Inter. Japanese glyphs (e.g. 鶴) fall through to
     Noto Sans JP / system CJK. */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans JP", "Hiragino Sans",
          "Yu Gothic", sans-serif;
  /* Display stack — Outfit (700/900 only). */
  --font-display: "Outfit", "Inter", -apple-system, "Helvetica Neue",
                  Arial, sans-serif;
}

/* ==========================================================================
 * 2 · BASE
 * ========================================================================== */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font-family: var(--font);
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  font-size: 22px;
  line-height: 1.45;
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -0.005em;
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }

/* webOS UA stylesheet forces font-family:"LG Display-Regular" on plain
   elements, and a UA *direct* rule beats an *inherited* author value —
   so un-styled text (taglines, times, footers) silently drops our brand
   font (and turns serif in the simulator, where LG's font is absent).
   An author-origin `inherit` on every element restores normal cascade;
   any element with its own author font rule still wins on specificity. */
* { font-family: inherit; }

/* First-paint staleness guard: some TV engines rasterize fallback glyphs
   before the webfonts land and never re-shape (font-display swap's swap
   never happens). consent.js adds .fonts-loaded when the FontFaceSet
   resolves; these equivalent-but-differently-written stacks change the
   computed value's identity, forcing a re-shape with the loaded faces. */
html.fonts-loaded body { font-family: "Inter", "Outfit", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
html.fonts-loaded h1, html.fonts-loaded h2, html.fonts-loaded h3 { font-family: "Outfit", "Inter", Arial, sans-serif; }

button {
  font-family: inherit;
  font-size: inherit;
  background: none; border: 0; color: inherit;
  cursor: pointer;
}

/* TV wrapper hooks: .tv-only is hidden unless html.is-tv;
   .browser-only is hidden under html.is-tv (see §18). */
.tv-only { display: none; }

/* ==========================================================================
 * 3 · FOCUS SYSTEM
 * One luminous treatment everywhere: bright white ring, soft crimson glow,
 * slight scale. D-pad focus = .focused class; keyboard = :focus-visible.
 * ========================================================================== */
.focused, .card.focused, .btn.focused, .pbtn.focused {
  outline: none;
  box-shadow: var(--focus-ring);
  transform: scale(var(--focus-scale));
  z-index: 3;
}

/* Standalone rule — rule 5: never comma-group :focus-visible. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  z-index: 3;
}

/* ==========================================================================
 * 4 · HOME / LAUNCH PAGE
 * ========================================================================== */
.home-body {
  overflow-x: hidden;
  overflow-y: auto;                 /* short-viewport safety: allow scroll */
  background: #000000;
}
.home-root {
  position: relative;
  min-height: 100vh;                /* fallback first */
  min-height: 100svh;               /* PE: small-viewport units */
  display: flex;
  flex-direction: column;
  padding: 40px 80px 60px;
  /* Notched phones (iOS Dynamic Island): keep the crane/logo out of the
     status-bar cutout. Fallback-first: explicit px fallback, then env(). */
  padding-top: 40px;
  padding-top: max(40px, env(safe-area-inset-top, 0px) + 16px);
  box-sizing: border-box;
  z-index: 1;
}
.home-root > * { z-index: 2; position: relative; }

/* -- Ambient backdrop with floating cranes (Cinema: near-black, crimson-deep
      washes only — reads as a faint stage glow on OLED) ------------------- */
.home-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.home-bg .ambient-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background:
    radial-gradient(circle at 16% 12%, rgba(61, 15, 13, 0.75), transparent 46%),
    radial-gradient(circle at 84% 88%, rgba(230, 60, 55, 0.05), transparent 52%);
  opacity: 1;
  filter: none;
}
.crane {
  position: absolute;
  opacity: 0.07;
  filter: blur(0.5px);
  animation: crane-float 18s ease-in-out infinite alternate;
}
.crane img { width: 100%; height: 100%; display: block; object-fit: contain; }
.crane .crane-glyph {
  display: block;
  font-family: "Noto Sans JP", serif;
  font-size: 220px;
  color: var(--accent);
  line-height: 1;
  opacity: 0.9;
}
.crane-1 { top: 8%;   left: 6%;   width: 260px; height: 260px; animation-delay: 0s; }
.crane-2 { top: 45%;  right: 8%;  width: 200px; height: 200px; animation-delay: -6s; transform: scaleX(-1); animation-name: crane-float-rev; }
.crane-3 { bottom: 6%; left: 35%; width: 160px; height: 160px; animation-delay: -12s; opacity: 0.05; }
@keyframes crane-float {
  0%   { transform: translateY(0)     rotate(-4deg); }
  100% { transform: translateY(-14px) rotate(3deg); }
}
@keyframes crane-float-rev {
  0%   { transform: scaleX(-1) translateY(0)     rotate(4deg); }
  100% { transform: scaleX(-1) translateY(-18px) rotate(-3deg); }
}

/* -- Top bar (minimal, no links) ---------------------------------------- */
.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 30px;
}

/* -- Brand block --------------------------------------------------------- */
.home-brand {
  text-align: center;
  padding: 10px 0 40px;
}
.home-logo {
  height: 110px;
  margin: 0 auto 18px;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.7));
  display: block;
}
.home-title {
  font-size: 96px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.98;
  margin: 0 0 12px;
  color: var(--fg);
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.6);
}
.home-tagline {
  font-size: 26px;
  color: var(--fg-dim);
  margin: 0 0 14px;
  letter-spacing: 0.3px;
}
.home-time {
  color: var(--fg-faint);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}

/* -- Home primary buttons (Continue / Browse) --------------------------- */
.home-actions {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 28px;
  margin: 20px auto 0;
  flex-wrap: wrap;
  max-width: 1100px;
}
.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 30px 48px;
  min-width: 440px;
  min-height: 132px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  color: #fff;
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift),
              background var(--t-standard) var(--ease-swift),
              border-color var(--t-standard) var(--ease-swift),
              opacity var(--t-standard) var(--ease-swift);
  background: rgba(255, 255, 255, 0.08);
}
.home-btn.home-btn-continue {
  background: var(--accent-strong);
  box-shadow: 0 10px 30px rgba(230, 60, 55, 0.35);
}
.home-btn.home-btn-continue:hover {
  background: var(--accent-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 42px rgba(230, 60, 55, 0.5);
}
.home-btn.home-btn-continue.focused {
  background: var(--accent-strong);
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--focus-ring);
}
.home-btn.home-btn-browse {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--hairline);
}
.home-btn.home-btn-browse:hover {
  background: rgba(255, 255, 255, 0.17);
  border-color: var(--hairline-hi);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-2);
}
.home-btn.home-btn-browse.focused {
  background: rgba(255, 255, 255, 0.14);
  border-color: transparent;
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--focus-ring);
}
.home-btn.is-disabled {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}
.home-btn.is-disabled .home-btn-glyph { opacity: 0.35; }
.home-btn-glyph {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}
.home-btn-label {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}
.home-btn-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.home-btn-sub {
  font-size: 16px;
  font-weight: 500;
  margin-top: 6px;
  opacity: 0.85;
  max-width: 380px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -- Secondary tile grid ------------------------------------------------- */
.home-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin: 0 auto;
  width: 100%;
  max-width: 1480px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 22px;
  background: var(--surface-1);
  color: var(--fg);
  text-decoration: none;
  border: 1px solid var(--hairline);
  border-radius: var(--card-radius);
  transition: transform var(--t-standard) var(--ease-swift),
              background var(--t-standard) var(--ease-swift),
              border-color var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift);
  min-height: 160px;
  box-shadow: var(--shadow-1);
}
.tile:hover {
  background: rgba(230, 60, 55, 0.12);
  border-color: rgba(230, 60, 55, 0.55);
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-2);
}
.tile.focused {
  background: rgba(230, 60, 55, 0.12);
  border-color: transparent;
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--focus-ring);
}
.tile-icon {
  width: 52px; height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font-size: 28px;
}
.tile-icon img { width: 32px; height: 32px; object-fit: contain; }
.tile-icon .tile-glyph { line-height: 1; }
.tile-label {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.tile-sub {
  font-size: 15px;
  color: var(--fg-dim);
  line-height: 1.35;
}
.tile.tile-disabled .tile-label { color: rgba(255, 255, 255, 0.6); }
.tile.tile-disabled .tile-icon { opacity: 0.45; }

/* -- Hint footer ---------------------------------------------------------- */
.home-hint {
  margin-top: auto;
  text-align: center;
  color: var(--fg-faint);
  font-size: 15px;
  letter-spacing: 0.3px;
  padding-top: 40px;
}
/* Let the home hint wrap onto two lines and still look tidy. */
.home-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
 * 5 · AMBIENT BACKDROP (browse/legal pages)
 * ========================================================================== */
.ambient-bg {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 8%, rgba(61, 15, 13, 0.6), transparent 46%),
    radial-gradient(circle at 82% 92%, rgba(230, 60, 55, 0.05), transparent 50%);
  opacity: 0.6;
  filter: none;
}
/* Drop `assets/ambient-pattern.png` in the folder and re-add a url() here to overlay it. */
.app > * { position: relative; z-index: 1; }

/* ==========================================================================
 * 6 · TOP NAVIGATION BAR (floating glass once scrolled)
 * ========================================================================== */
.nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 80px;
  /* iPhone notch: fallback first, then env() */
  padding-top: 18px;
  padding-top: max(18px, env(safe-area-inset-top));
  z-index: 50;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.45) 80%, transparent 100%);
  transition: background var(--t-standard) var(--ease-swift),
              padding var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift);
}
.nav-bar.scrolled {
  background: rgba(11, 11, 14, 0.88);
  padding: 12px 80px;
  padding-top: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--hairline);
  box-shadow: var(--shadow-2);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .nav-bar.scrolled {
    background: rgba(11, 11, 14, 0.58);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
  }
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
a.nav-brand-link {
  text-decoration: none;
  color: inherit;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--t-micro) ease-out, transform var(--t-micro) ease-out;
}
a.nav-brand-link:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.03);
}
a.nav-brand-link.focused {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.03);
  box-shadow: var(--focus-ring);
}
.brand-logo {
  height: 72px;
  width: auto;
  display: block;
}
.brand-wordmark {
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.08em;
  font-family: var(--font-display);
  text-shadow: 0 2px 12px rgba(230, 60, 55, 0.35);
}
/* JS (UrigamiEnv.markBrandLogo, in consent.js / tv inline scripts) stamps
   `has-logo` on .nav-brand once the logo <img> has REALLY loaded
   (naturalWidth > 0). Only then hide the wordmark fallback — if the image
   never loads the wordmark stays visible. Plain class selector; :has() is
   banned (rule 4). */
.nav-brand.has-logo .brand-wordmark { display: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: center;
  max-width: 600px;
}
.nav-link {
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 8px 6px;
  border-bottom: 2px solid transparent;
  transition: color var(--t-micro) ease-out,
              border-color var(--t-micro) ease-out,
              transform var(--t-micro) ease-out;
}
.nav-link.active { color: #fff; font-weight: 700; border-bottom-color: var(--accent); }
.nav-link:hover {
  color: #fff;
  border-bottom-color: var(--accent);
  transform: translateY(-1px);
}
.nav-link.focused {
  color: #fff;
  border-bottom-color: transparent;
  transform: translateY(-1px);
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-search {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--hairline);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-micro) ease-out,
              border-color var(--t-micro) ease-out,
              transform var(--t-micro) ease-out;
  cursor: pointer;
}
.nav-search:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--hairline-hi);
  transform: scale(1.07);
}
.nav-search.focused {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.07);
  box-shadow: var(--focus-ring);
}
.nav-profile {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ff544b 0%, #a81f1b 70%, #5a1512 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t-micro) ease-out, box-shadow var(--t-micro) ease-out;
  position: relative;
}
.nav-profile:hover {
  transform: scale(1.07);
  box-shadow: 0 0 0 2px #fff, 0 8px 20px rgba(230, 60, 55, 0.6);
}
.nav-profile.focused {
  transform: scale(1.07);
  box-shadow: var(--focus-ring);
}
.profile-avatar {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.profile-fallback {
  font-family: "Noto Sans JP", "Yu Gothic", sans-serif;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
/* If avatar is present, hide fallback (sibling selector — no :has()). */
.profile-avatar ~ .profile-fallback { display: none; }

/* ==========================================================================
 * 7 · HERO — taller, cinematic, multi-stop scrims, kinetic title
 * ========================================================================== */
.hero {
  position: relative;
  width: 100%;
  height: 760px;               /* fallback first (also what TVs get) */
  height: min(820px, 78vh);    /* PE: cap on short desktop windows */
  overflow: hidden;
  background: #000;
  margin-top: 0;               /* nav is fixed, hero starts at top of viewport */
}
.hero-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-size: cover; background-position: center;
  filter: brightness(0.8) saturate(1.02);
  opacity: 0;
  transition: opacity 700ms ease;   /* hero crossfade */
}
.hero-bg.is-visible {
  opacity: 1;
  animation: hero-kenburns 14s ease-in-out both;  /* slow Ken Burns drift */
}
@keyframes hero-kenburns {
  0%   { transform: scale(1); }
  100% { transform: scale(1.055); }
}

/* Multi-stop scrims — eased stops so bright thumbs never wash the type and
   there is no gray banding. Vertical + horizontal in one paint. */
.hero-bg::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background:
    linear-gradient(180deg,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.22) 12%,
      rgba(0, 0, 0, 0)    30%,
      rgba(0, 0, 0, 0)    48%,
      rgba(0, 0, 0, 0.18) 62%,
      rgba(0, 0, 0, 0.5)  76%,
      rgba(0, 0, 0, 0.85) 91%,
      #000                100%),
    linear-gradient(90deg,
      rgba(0, 0, 0, 0.88) 0%,
      rgba(0, 0, 0, 0.7)  16%,
      rgba(0, 0, 0, 0.45) 34%,
      rgba(0, 0, 0, 0.22) 52%,
      rgba(0, 0, 0, 0.07) 70%,
      rgba(0, 0, 0, 0)    86%);
}

/* Rotation dots at the bottom-right of the hero. */
.hero-dots {
  position: absolute;
  right: 80px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
}
.hero-dot {
  position: relative;   /* anchors the expanded ::before hit area */
  width: 12px; height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);              /* ≥0.6 for visibility */
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);          /* dark ring on bright art */
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: width var(--t-standard) var(--ease-swift),
              background var(--t-standard) var(--ease-swift),
              transform var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift);
}
/* Expanded touch target (≥44px tall; width limited by dot pitch). */
.hero-dot::before {
  content: "";
  position: absolute;
  top: -16px; right: -6px; bottom: -16px; left: -6px;
}
.hero-dot:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.2);
}
.hero-dot.focused {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.2);
  box-shadow: var(--focus-ring);
}
.hero-dot.active {
  width: 28px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(230, 60, 55, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.6);
}

/* Pause/resume toggle for the hero rotation. Sits to the RIGHT of the dots
   row (dots are anchored at right: 80px, so the 0–80px strip is free).
   Glyph is swapped by JS (⏸/▶); state hook is [aria-pressed="true"] when
   paused. Ring comes from the shared .focused / :focus-visible rules. */
.hero-rotate-toggle {
  position: absolute;
  right: 22px;
  bottom: 16px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(11, 11, 14, 0.6);
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  line-height: 34px;              /* glyph centering without flex */
  text-align: center;
  padding: 0;
  cursor: pointer;
  z-index: 3;
  transition: background var(--t-standard) var(--ease-swift),
              color var(--t-standard) var(--ease-swift),
              transform var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift);
}
.hero-rotate-toggle:hover {
  background: rgba(23, 23, 28, 0.85);
  color: #ffffff;
  transform: scale(1.1);
}
.hero-rotate-toggle.focused {
  background: rgba(23, 23, 28, 0.85);
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: var(--focus-ring);
}
/* Paused state: crimson wash so the "rotation is off" state reads at a glance. */
.hero-rotate-toggle[aria-pressed="true"] {
  color: #ffffff;
  border-color: rgba(255, 84, 75, 0.6);
  background: rgba(61, 15, 13, 0.7);
}

/* Manual prev/next arrows. Invisible arrows must never swallow taps:
   opacity 0 always pairs with pointer-events: none. */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 58px; height: 58px;
  border-radius: 50%;
  background: rgba(11, 11, 14, 0.6);
  color: #fff;
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  border: 1px solid var(--hairline);
  transition: opacity var(--t-standard) var(--ease-swift),
              background var(--t-micro) ease-out,
              transform var(--t-standard) var(--ease-swift),
              border-color var(--t-micro) ease-out;
}
.hero:hover .hero-arrow { opacity: 0.7; pointer-events: auto; }
.hero-arrow:hover {
  opacity: 1;
  pointer-events: auto;
  background: rgba(11, 11, 14, 0.85);
  border-color: var(--hairline-hi);
  transform: translateY(-50%) scale(1.06);
}
.hero-arrow.focused {
  opacity: 1;
  pointer-events: auto;
  background: rgba(11, 11, 14, 0.85);
  border-color: transparent;
  transform: translateY(-50%) scale(1.06);
  box-shadow: var(--focus-ring);
}
.hero-arrow-prev { left: 24px; }
.hero-arrow-next { right: 24px; }

.hero-overlay {
  position: absolute;
  left: 80px; bottom: 120px;
  max-width: 900px;
  z-index: 2;
}
.hero-title {
  font-size: 84px;
  font-weight: 900;
  line-height: 0.98;
  margin: 0 0 20px;
  letter-spacing: -0.025em;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.6);
  animation: hero-title-in 600ms var(--ease-swift) both;
}
@keyframes hero-title-in {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}
.hero-meta {
  font-size: 24px;
  font-weight: 500;
  color: var(--fg-dim);
  margin: 0 0 32px;
}
.hero-actions { display: flex; gap: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 16px 32px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  transition: background var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift),
              transform var(--t-standard) var(--ease-swift);
}
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover {
  background: var(--accent-hover);      /* large bold text: AA-large ✓ */
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(230, 60, 55, 0.45);
}
.btn-primary:active { background: var(--accent-pressed); transform: translateY(0); box-shadow: none; }
.btn-secondary {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  border: 1px solid var(--hairline);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.17);
  border-color: var(--hairline-hi);
}
.btn-secondary:active { background: rgba(255, 255, 255, 0.07); }

/* ==========================================================================
 * 8 · ROWS + CARDS
 * ========================================================================== */
.rows {
  padding: 40px 80px 120px;
  display: flex; flex-direction: column;
  gap: var(--row-gap);
}
.row {
  position: relative;
}
.row-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.row-icon {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--hairline);
  font-size: 22px;
  flex-shrink: 0;
}
.row-icon img {
  width: 24px; height: 24px;
  object-fit: contain;
  display: block;
}
.home-footer {
  padding: 40px 80px 60px;
  text-align: center;
  color: var(--fg-faint);
  font-size: 14px;
  letter-spacing: 0.3px;
}
.footer-mark { font-family: "Noto Sans JP", inherit; }

/* Track: padded so the focus ring + 1.06 scale never clips at row edges;
   the negative margins keep cards visually aligned with the row title. */
.row-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 24px 28px 28px;
  margin: -4px -28px -8px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.row-track::-webkit-scrollbar { display: none; }

/* Desktop pointer ergonomics: a thin scrollbar appears while hovering the
   track. (hover:hover) is skipped by TVs and touch devices. */
@media (hover: hover) {
  .row-track::-webkit-scrollbar { display: block; height: 8px; }
  .row-track::-webkit-scrollbar-track { background: transparent; }
  .row-track::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
  }
  .row-track:hover::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); }
  .row-track:hover::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }
  .row-track { scrollbar-width: none; }
  .row-track:hover { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
}

.card {
  flex: 0 0 auto;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--card-radius);
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
  transition: transform var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift),
              border-color var(--t-standard) var(--ease-swift);
  scroll-snap-align: start;
  cursor: pointer;
}
.card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.card .card-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px 16px;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0)    36%,
    rgba(0, 0, 0, 0.28) 58%,
    rgba(0, 0, 0, 0.62) 78%,
    rgba(0, 0, 0, 0.88) 100%);
  opacity: 0;
  transition: opacity var(--t-standard) var(--ease-swift);
}
.card .card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.card .card-sub {
  font-size: 14px;
  color: var(--fg-dim);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
/* Tiny glass chip for the duration. */
.card .duration-badge {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--hairline);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Pointer affordance: reveal the title overlay on hover (mouse users were
   blind to titles before) and lift the card. */
.card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-2);
  border-color: var(--hairline-hi);
  z-index: 2;
}
.card:hover .card-overlay { opacity: 1; }

/* D-pad focus: luminous ring + lift (scale comes from the shared .focused
   rule in §3). */
.card.focused { border-color: transparent; }
.card.focused .card-overlay { opacity: 1; }

/* ==========================================================================
 * 9 · EMPTY STATE
 * ========================================================================== */
.empty-state {
  padding: 160px 80px;
  text-align: center;
}
.empty-state h2 { font-size: 42px; margin-bottom: 16px; }
.empty-state code {
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.95em;
}

/* ==========================================================================
 * 10 · PLAYER
 * ========================================================================== */
.player-body {
  background: #000;
  overflow: hidden;
}
.player-root {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}
.player-root.cursor-hidden { cursor: none; }
.player-video {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}
.player-hud {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 96px 80px 50px;
  /* iPhone notch / home bar — fallbacks first, then env() */
  padding-left: 80px;
  padding-left: max(80px, env(safe-area-inset-left));
  padding-right: 80px;
  padding-right: max(80px, env(safe-area-inset-right));
  padding-bottom: 50px;
  padding-bottom: max(50px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg,
    rgba(0, 0, 0, 0.9)  0%,
    rgba(0, 0, 0, 0.62) 38%,
    rgba(0, 0, 0, 0.25) 68%,
    rgba(0, 0, 0, 0)    100%);
  opacity: 1;
  transition: opacity 250ms var(--ease-swift), transform 250ms var(--ease-swift);
}
.player-hud.hidden { opacity: 0; pointer-events: none; transform: translateY(12px); }

.player-title {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 8px;
  max-width: 1400px;
}
.player-sub { color: var(--fg-dim); font-size: 22px; margin-bottom: 28px; }

/* Scrubber (focusable slider) — generously padded hit area; the visible bar
   is only 8px but the touch target is the whole padded block. */
.player-progress {
  margin-bottom: 16px;
  padding: 16px 0;
  outline: none;
  border-radius: var(--radius-xs);
  transition: transform var(--t-micro) ease-out;
  touch-action: none;
}
.player-progress:focus,
.player-progress.focused {
  transform: scale(1.005);
  box-shadow: none;   /* the bar carries the focus treatment, not the block */
}
.player-progress .bar {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  overflow: visible;
  cursor: pointer;
  transition: height var(--t-micro) ease-out, box-shadow var(--t-micro) ease-out;
}
.player-progress:focus .bar,
.player-progress.focused .bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 18px 2px rgba(230, 60, 55, 0.45);
}
.player-progress .buffered {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.30);
  border-radius: 999px;
  width: 0%;
  transition: width 200ms linear;
}
.player-progress .fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, #d92b26, #ff544b);
  border-radius: 999px;
  width: 0%;
}
.player-progress .thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform var(--t-micro) ease-out;
  pointer-events: none;
  box-shadow: 0 0 0 4px rgba(230, 60, 55, 0.35), 0 0 14px rgba(230, 60, 55, 0.45);
}
.player-progress:hover .thumb,
.player-progress:focus .thumb,
.player-progress.focused .thumb {
  transform: translate(-50%, -50%) scale(1);
}
.player-progress .times {
  display: flex; justify-content: space-between;
  margin-top: 10px;
  color: var(--fg-dim);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

/* Control buttons — glass pills, crimson primary. */
.player-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.pbtn {
  padding: 14px 26px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 20px; font-weight: 600;
  transition: transform var(--t-micro) ease-out,
              background var(--t-micro) ease-out,
              border-color var(--t-micro) ease-out;
}
.pbtn:hover { background: rgba(255, 255, 255, 0.18); border-color: var(--hairline-hi); }
.pbtn.primary {
  background: var(--accent-strong);
  border-color: transparent;
  box-shadow: 0 6px 24px rgba(230, 60, 55, 0.35);
}
.pbtn.primary:hover { background: var(--accent-strong); box-shadow: 0 8px 30px rgba(230, 60, 55, 0.55); }
.pbtn.primary:active { background: var(--accent-pressed); }
.hint {
  color: var(--fg-faint);
  font-size: 15px;
  margin: 14px 0 0;
  letter-spacing: 0.2px;
}

/* Spinner */
.player-spinner {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity var(--t-standard) var(--ease-swift);
  pointer-events: none;
  z-index: 4;
}
.player-spinner.show { opacity: 1; }
.player-spinner .ring {
  width: 72px; height: 72px;
  border: 5px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Play/pause / seek flash glyph — glass panel flash. */
.player-flash {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  padding: 20px 32px;
  background: rgba(11, 11, 14, 0.72);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  color: #fff;
  font-size: 48px; font-weight: 800;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  box-shadow: var(--shadow-2);
}
.player-flash.show {
  animation: flash 600ms ease-out forwards;
}
@keyframes flash {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  25%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}

/* Tap-to-play affordance (autoplay rejected) — Cinema glass disc with a
   crimson hover/focus fill. Consolidated from web/player.html's temp block. */
.player-tap-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 128px; height: 128px;
  padding: 0;
  border: 1px solid var(--hairline-hi);
  border-radius: 50%;
  background: rgba(11, 11, 14, 0.72);
  color: #fff;
  font-size: 52px;
  line-height: 126px;
  text-align: center;
  cursor: pointer;
  z-index: 7;
  box-shadow: var(--shadow-2);
  transition: background var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift),
              border-color var(--t-standard) var(--ease-swift);
}
.player-tap-play:hover {
  background: var(--accent-strong);
  border-color: transparent;
  box-shadow: 0 10px 34px rgba(230, 60, 55, 0.5);
  outline: none;
}
/* Own rule so the centering translate survives the shared .focused scale. */
.player-tap-play:focus,
.player-tap-play.focused {
  background: var(--accent-strong);
  border-color: transparent;
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: var(--focus-ring);
  outline: none;
}
.player-tap-play.hidden { display: none; }

/* Volume pill — glass. */
.player-volume {
  position: absolute;
  top: 60px; right: 80px;
  background: rgba(11, 11, 14, 0.82);
  border: 1px solid var(--hairline);
  padding: 14px 20px;
  border-radius: 999px;
  display: flex; align-items: center; gap: 14px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--t-standard) var(--ease-swift),
              transform var(--t-standard) var(--ease-swift);
  pointer-events: none;
  z-index: 5;
  box-shadow: var(--shadow-1);
}
.player-volume.show {
  opacity: 1;
  transform: translateY(0);
}
.player-volume .vol-icon { font-size: 24px; }
.player-volume .vol-bar {
  width: 160px; height: 5px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px; overflow: hidden;
}
.player-volume .vol-fill {
  height: 100%;
  background: #fff;
  width: 100%;
}

/* Error overlay — glass panel. */
.player-error {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(16, 16, 20, 0.96);
  border: 1px solid var(--hairline);
  padding: 48px 64px;
  border-radius: var(--radius-lg);
  text-align: center;
  z-index: 6;
  box-shadow: var(--shadow-3);
}
.player-error.hidden { display: none; }
.player-error h2 { margin: 0 0 12px; font-size: 36px; }
.player-error p { margin: 0 0 24px; color: var(--fg-dim); }

/* Up-next chip — glass panel with a crimson signal edge. */
.player-upnext {
  position: absolute;
  right: 60px; bottom: 260px;
  background: rgba(11, 11, 14, 0.85);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--accent);
  padding: 18px 22px;
  border-radius: var(--card-radius);
  max-width: 360px;
  z-index: 4;
  transition: opacity 250ms var(--ease-swift),
              transform 250ms var(--ease-swift),
              border-color var(--t-micro) ease-out,
              box-shadow var(--t-micro) ease-out;
  box-shadow: var(--shadow-1);
}
.player-upnext:hover {
  border-color: var(--hairline-hi);
  border-left-color: var(--accent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}
.player-upnext.hidden {
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
}
.player-upnext .chip-label {
  color: var(--fg-faint);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.player-upnext .chip-title {
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0 8px;
  line-height: 1.3;
}
.player-upnext .chip-hint {
  font-size: 14px;
  color: var(--fg-faint);
}
.player-upnext kbd {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--hairline);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
}
/* The chip is a <button> in the markup: reset UA styles, keep the look.
   (Consolidated from web/player.html's temp block.) */
button.player-upnext {
  display: block;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
button.player-upnext .chip-label,
button.player-upnext .chip-title,
button.player-upnext .chip-hint { display: block; }
/* Own rule so focus doesn't inherit the generic scale (chip slides in/out via
   translateX; a transform override would fight the hidden state). */
button.player-upnext:focus,
button.player-upnext.focused {
  outline: none;
  transform: none;
  border-color: transparent;
  border-left-color: var(--accent);
  box-shadow: var(--focus-ring);
}

/* Debug overlay (revealed by player.js with ?debug=1). */
.player-debug {
  position: absolute;
  top: 20px; left: 20px;
  max-width: 520px;
  background: rgba(0, 0, 0, 0.72);
  color: #7fff8d;
  font-family: "Menlo", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.35;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  z-index: 7;
  pointer-events: none;
}
/* Class rules beat the UA's [hidden] { display: none } — force it. */
.player-debug[hidden] { display: none !important; }
.player-debug .dbg-state {
  color: #b0ffcf;
  margin-bottom: 6px;
  white-space: pre;
}
.player-debug .dbg-log {
  margin: 0;
  max-height: 280px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-all;
  color: #e4ffe4;
}

/* ==========================================================================
 * 11 · CARD QUICK-ACTION POPOVER (Play / More Info on click)
 * ========================================================================== */
.card-action {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity var(--t-standard) var(--ease-swift);
}
.card-action.hidden { display: none; }
.card-action.closing { opacity: 0; pointer-events: none; }
.card-action-scrim {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(3px);              /* PE on top of the solid scrim */
  -webkit-backdrop-filter: blur(3px);
}
.card-action-panel {
  position: relative;
  width: 720px;                            /* fallback pair — no min() */
  max-width: 92vw;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-3);
  animation: info-pop-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.card-action.closing .card-action-panel {
  animation: info-pop-out 200ms var(--ease-swift) forwards;
}

/* Close button in top-right of the panel. */
.card-action-close-x {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 3;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(11, 11, 14, 0.72);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 1px solid var(--hairline);
  transition: background var(--t-micro) ease-out,
              transform var(--t-micro) ease-out,
              border-color var(--t-micro) ease-out;
}
.card-action-close-x:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--hairline-hi);
  transform: scale(1.08);
}
.card-action-close-x.focused {
  background: rgba(255, 255, 255, 0.14);
  border-color: transparent;
  transform: scale(1.08);
  box-shadow: var(--focus-ring);
}

/* Hero image band at the top of the panel with fade into the panel body.
   Intrinsic-ratio fallback first; aspect-ratio only as PE (rule 3). */
.card-action-hero {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 56.25%;                     /* 16:9 fallback */
  background: var(--surface-1);
  overflow: hidden;
}
@supports (aspect-ratio: 16 / 9) {
  .card-action-hero {
    height: auto;
    padding-top: 0;
    aspect-ratio: 16 / 9;
  }
}
.card-action-thumb {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.05);
}
.card-action-hero-fade {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background:
    linear-gradient(180deg,
      rgba(16, 16, 20, 0)    0%,
      rgba(16, 16, 20, 0)    46%,
      rgba(16, 16, 20, 0.25) 64%,
      rgba(16, 16, 20, 0.6)  82%,
      rgba(16, 16, 20, 0.92) 94%,
      #101014                100%),
    linear-gradient(90deg,
      rgba(16, 16, 20, 0.45) 0%,
      rgba(16, 16, 20, 0.18) 20%,
      rgba(16, 16, 20, 0)    38%);
  pointer-events: none;
}

/* Body sits below the hero with title + meta + action row. */
.card-action-body {
  padding: 0 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: -56px; /* slight overlap onto the fade for a cinematic feel */
  position: relative;
  z-index: 2;
}
.card-action-title {
  font-family: var(--font-display);
  margin: 0;
  font-size: 36px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.65);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-action-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--fg-dim);
  font-size: 15px;
  font-weight: 500;
  margin-top: 2px;
}
.card-action .badge-match {
  color: #46d369; /* Netflix-style match green (Cinema mockup) */
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
}
.card-action .meta-rating {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline-hi);
  color: var(--fg-dim);
  padding: 0 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 20px;
  display: inline-block;
}
.card-action-channel {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  margin-top: 2px;
}

/* Action row: crimson Play (primary), glass More Info, circular + icon. */
.card-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}
.card-action .btn-primary {
  background: var(--accent-strong);
  color: #fff;
  padding: 11px 26px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(230, 60, 55, 0.3);
  transition: background var(--t-standard) var(--ease-swift),
              transform var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift);
}
.card-action .btn-primary .btn-glyph {
  font-size: 18px;
  line-height: 1;
}
.card-action .btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 30px rgba(230, 60, 55, 0.45);
}
.card-action .btn-primary.focused {
  background: var(--accent-strong);
  transform: translateY(-1px) scale(1.03);
  box-shadow: var(--focus-ring);
}
.card-action .btn-secondary {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 600;
  border: 1px solid var(--hairline);
  transition: background var(--t-micro) ease-out,
              transform var(--t-micro) ease-out,
              border-color var(--t-micro) ease-out;
}
.card-action .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.17);
  border-color: var(--hairline-hi);
  transform: translateY(-1px) scale(1.02);
}
.card-action .btn-secondary.focused {
  background: rgba(255, 255, 255, 0.14);
  border-color: transparent;
  transform: translateY(-1px) scale(1.03);
  box-shadow: var(--focus-ring);
}
.card-action .btn-icon {
  width: 44px; height: 44px;
  margin-left: 4px;
  border: 1px solid var(--hairline-hi);
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
}
.card-action .btn-icon:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  transform: scale(1.08);
}
.card-action .btn-icon.focused {
  background: rgba(255, 255, 255, 0.16);
  border-color: transparent;
  transform: scale(1.08);
  box-shadow: var(--focus-ring);
}

/* ==========================================================================
 * 12 · "MORE INFO" MODAL
 * ========================================================================== */
.info-modal {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 40px 0 80px;
  opacity: 1;
  transition: opacity 240ms var(--ease-swift);
}
.info-modal.hidden {
  display: none;
}
.info-modal.closing {
  opacity: 0;
  pointer-events: none;
}
.info-modal-scrim {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(3px);              /* PE on top of the solid scrim */
  -webkit-backdrop-filter: blur(3px);
}
.info-modal-card {
  position: relative;
  width: 100%;
  max-width: 1100px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--fg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-3);
  transform: translateY(0);
  animation: info-pop-in 260ms var(--ease-swift) both;
}
.info-modal.closing .info-modal-card {
  animation: info-pop-out 200ms var(--ease-swift) forwards;
}
@keyframes info-pop-in {
  0%   { transform: translateY(30px) scale(0.97); opacity: 0; }
  100% { transform: translateY(0)    scale(1);    opacity: 1; }
}
@keyframes info-pop-out {
  100% { transform: translateY(30px) scale(0.97); opacity: 0; }
}

.info-close {
  position: absolute;
  top: 22px; right: 22px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(11, 11, 14, 0.72);
  color: #fff;
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
  transition: background var(--t-micro) ease-out,
              transform var(--t-micro) ease-out,
              border-color var(--t-micro) ease-out;
  cursor: pointer;
  border: 1px solid var(--hairline);
}
.info-close:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--hairline-hi);
  transform: scale(1.06);
}
.info-close.focused {
  background: rgba(255, 255, 255, 0.14);
  border-color: transparent;
  transform: scale(1.06);
  box-shadow: var(--focus-ring);
}

/* Hero backdrop dissolving into the panel through a multi-stop scrim. */
.info-hero {
  position: relative;
  height: 520px;
  background: #000;
}
.info-hero-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-size: cover;
  background-position: center 25%;
  filter: brightness(0.85) saturate(1.05);
}
.info-hero-gradient {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background:
    linear-gradient(180deg,
      rgba(16, 16, 20, 0.15) 0%,
      rgba(16, 16, 20, 0)    28%,
      rgba(16, 16, 20, 0.2)  55%,
      rgba(16, 16, 20, 0.72) 78%,
      rgba(16, 16, 20, 0.95) 92%,
      #101014                100%),
    linear-gradient(90deg,
      rgba(16, 16, 20, 0.6)  0%,
      rgba(16, 16, 20, 0.25) 22%,
      rgba(16, 16, 20, 0)    42%);
}
.info-hero-content {
  position: absolute;
  left: 56px; right: 56px; bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.info-title {
  font-size: 58px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 820px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.65);
  line-height: 1.02;
}
.info-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.info-actions .btn-primary {
  background: var(--accent-strong);
  color: #fff;
  padding: 14px 34px;
  font-size: 22px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(230, 60, 55, 0.3);
}
.info-actions .btn-primary:hover {
  background: var(--accent-hover);      /* 22px bold: AA-large ✓ */
}
.info-actions .btn-primary.focused {
  background: var(--accent-strong);
}
.info-actions .btn-glyph {
  font-size: 22px;
}
.btn-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline-hi);
  transition: background var(--t-micro) ease-out,
              transform var(--t-micro) ease-out,
              border-color var(--t-micro) ease-out;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  transform: scale(1.06);
}
.btn-icon.focused {
  background: rgba(255, 255, 255, 0.16);
  border-color: transparent;
  transform: scale(1.06);
  box-shadow: var(--focus-ring);
}

/* Body: description + side metadata */
.info-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  padding: 30px 56px 10px;
}
.info-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: var(--fg-dim);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 18px;
}
.badge-match {
  color: #46d369; /* Netflix-style match green (Cinema mockup) */
  font-weight: 700;
  font-size: 18px;
}
.meta-rating {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline-hi);
  color: var(--fg-dim);
  padding: 1px 8px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.info-description {
  font-size: 20px;
  line-height: 1.55;
  color: #c9c9d2;
  margin: 0;
  white-space: pre-wrap;
  max-height: 180px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: max-height 260ms var(--ease-swift), background var(--t-micro) ease-out;
}
.info-description:hover {
  background: rgba(255, 255, 255, 0.04);
}
.info-description.focused {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--focus-ring);
  transform: none;   /* text block: ring only, no scale */
}
/* "Show more" affordance at the bottom when collapsed. */
.info-description::after {
  content: "Show more ▾";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 56px;
  padding-top: 22px;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: linear-gradient(180deg, transparent, #101014 55%);
  pointer-events: none;
}
/* Expanded state (toggled by JS on click/Enter). */
.info-description.expanded {
  max-height: 1200px; /* effectively uncap; will auto-fit content */
}
.info-description.expanded::after {
  content: "";
  height: 0;
  padding: 0;
  background: none;
}
/* If the description actually fits without overflow, hide the affordance. */
.info-description.no-overflow::after { display: none; }
.info-body-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 16px;
  color: var(--fg-dim);
}
.side-row { line-height: 1.4; }
.side-label { color: var(--fg-faint); margin-right: 6px; }
.info-body-side .chip {
  display: inline-block;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline);
  color: var(--fg-dim);
  padding: 2px 10px;
  border-radius: 999px;
  margin: 2px 4px 2px 0;
  font-size: 14px;
}

/* Sections */
.info-section {
  padding: 30px 56px;
}
.info-section-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
  color: #fff;
}

/* More Like This grid */
.info-similar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.sim-card {
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  border-radius: var(--card-radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift),
              border-color var(--t-standard) var(--ease-swift);
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
}
.sim-card:hover {
  transform: translateY(-3px);
  border-color: var(--hairline-hi);
  box-shadow: var(--shadow-2);
  z-index: 2;
}
.sim-card.focused {
  transform: scale(1.03);
  border-color: transparent;
  box-shadow: var(--focus-ring);
  z-index: 2;
}
/* Intrinsic-ratio fallback first; aspect-ratio as PE (rule 3). */
.sim-thumb {
  height: 0;
  padding-top: 56.25%;                    /* 16:9 fallback */
  background: #0b0b0e;
  background-size: cover;
  background-position: center;
  position: relative;
}
@supports (aspect-ratio: 16 / 9) {
  .sim-thumb {
    height: auto;
    padding-top: 0;
    aspect-ratio: 16 / 9;
  }
}
.sim-thumb .sim-duration {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--hairline);
  font-size: 13px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
}
.sim-meta {
  padding: 14px 16px 18px;
}
.sim-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--fg-dim);
  font-size: 14px;
  margin-bottom: 8px;
}
.sim-row .sim-match { color: #46d369; font-weight: 700; } /* match green */
.sim-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.sim-channel {
  font-size: 14px;
  color: var(--fg-dim);
}

/* About section */
.info-about {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 18px;
  row-gap: 10px;
  margin: 0;
}
.info-about dt {
  color: var(--fg-faint);
  font-size: 14px;
}
.info-about dd {
  margin: 0;
  color: #e8e8e8;
  font-size: 15px;
}

/* Hide scrollbar inside modal while keeping it scrollable. */
.info-modal::-webkit-scrollbar { display: none; }
.info-modal { scrollbar-width: none; }

/* ==========================================================================
 * 13 · LEGAL PAGES (Terms of Use, Privacy Policy)
 * ========================================================================== */
.legal-body {
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
}
.legal-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 80px 0;
}
.legal-back {
  appearance: none;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  font: inherit;
  font-size: 18px;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-micro) ease-out,
              transform var(--t-standard) var(--ease-swift),
              border-color var(--t-micro) ease-out;
}
.legal-back:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--hairline-hi);
}
.legal-back:focus,
.legal-back.focused {
  outline: none;
  background: rgba(255, 255, 255, 0.14);
  border-color: transparent;
  transform: scale(1.05);
  box-shadow: var(--focus-ring);
}
.legal-page {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 80px 40px;
  line-height: 1.6;
}
.legal-page .effective {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--fg-dim);
  font-style: italic;
  letter-spacing: 0.3px;
}
.legal-page h1 {
  margin: 0 0 24px;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.legal-page h2 {
  margin: 48px 0 12px;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
}
.legal-page p,
.legal-page li {
  font-size: 19px;
  color: var(--fg-dim);
  margin: 0 0 14px;
}
.legal-page strong { color: var(--fg); font-weight: 600; }
.legal-page code {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--hairline);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}
.legal-page a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(230, 60, 55, 0.4);
  transition: color var(--t-micro) ease-out, border-color var(--t-micro) ease-out;
}
.legal-page a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}
.legal-page a:focus,
.legal-page a.focused {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 3px;
}
.legal-footer {
  position: relative;
  z-index: 2;
}

/* ---- Footer links (used on index, browse, terms, privacy) --------------- */
.footer-links {
  display: inline-flex;
  gap: 24px;
  margin: 0;              /* was margin-left: 24px — pushed the row off-center */
  flex-wrap: wrap;
  justify-content: center;
}
.footer-link {
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  transition: color var(--t-micro) ease-out,
              background var(--t-micro) ease-out,
              transform var(--t-standard) var(--ease-swift);
}
.footer-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.footer-link:focus,
.footer-link.focused {
  color: #fff;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
  box-shadow: var(--focus-ring);
}
.footer-link.is-current {
  color: var(--accent);
}

/* Let the browse-page footer stack mark + links vertically with breathing room. */
.home-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

@media (max-width: 720px) {
  .legal-top    { padding: 24px 20px 0; }
  .legal-page   { padding: 32px 20px; }
  .legal-page h1 { font-size: 34px; }
  .legal-page h2 { font-size: 22px; margin-top: 36px; }
  .legal-page p,
  .legal-page li { font-size: 17px; }
}

/* ============================================================================
 * 14 · RESPONSIVE BREAKPOINTS
 *
 * The default layout is TV-first (1920×1080). These breakpoints scale it down
 * for desktop web (≤1536px), tablet (≤1024px), and phone (≤720px).
 * Rule 7: direct property overrides only — never :root token overrides.
 * ============================================================================ */

/* -------- Desktop web (laptop to small 1080p monitors) -------- */
@media (max-width: 1536px) {
  body { font-size: 20px; }

  /* Top nav & hero */
  .nav-bar { padding: 16px 48px; }
  .nav-bar.scrolled { padding: 10px 48px; }
  .hero {
    height: 600px;                /* fallback first */
    height: min(640px, 74vh);
  }
  .hero-overlay { left: 56px; bottom: 96px; }
  .hero-title { font-size: 64px; }
  .hero-meta  { font-size: 22px; }
  .hero-arrow { width: 52px; height: 52px; font-size: 36px; }

  /* Rows */
  .rows { padding: 32px 56px 96px; gap: 40px; }
  .row-title { font-size: 26px; }
  .card { width: 280px; height: 158px; }

  /* Home page */
  .home-root { padding: 36px 56px 48px; padding-top: 36px; padding-top: max(36px, env(safe-area-inset-top, 0px) + 14px); }
  .home-title { font-size: 76px; }
  .home-tagline { font-size: 24px; }
  .home-logo { height: 96px; }
  .home-btn { min-width: 380px; min-height: 120px; padding: 26px 40px; }
  .home-btn-title { font-size: 26px; }

  /* Info modal */
  .info-modal-card { max-width: 960px; }
  .info-hero { height: 460px; }
  .info-title { font-size: 50px; }
  .info-similar-grid { grid-template-columns: repeat(3, 1fr); }

  /* Card action popover */
  .card-action-panel { width: 820px; max-width: 88vw; }
}

/* -------- Tablet & small landscape (≤1024px) -------- */
@media (max-width: 1024px) {
  body { font-size: 18px; }

  .nav-bar { padding: 12px 28px; }
  .nav-bar.scrolled { padding: 10px 28px; }
  .brand-logo { height: 52px; }
  .brand-wordmark { font-size: 24px; }

  .hero {
    height: 480px;                /* fallback first */
    height: min(520px, 70vh);
  }
  .hero-overlay { left: 32px; right: 32px; bottom: 64px; }
  .hero-title { font-size: 46px; }
  .hero-meta  { font-size: 18px; }
  .hero-actions { gap: 12px; }
  .hero-actions .btn { padding: 12px 22px; font-size: 18px; }
  .hero-arrow { width: 44px; height: 44px; font-size: 30px; }
  .hero-arrow-prev { left: 12px; }
  .hero-arrow-next { right: 12px; }
  .hero-dots { right: 32px; bottom: 20px; gap: 8px; }
  /* No free strip right of the dots here — stack the toggle above them. */
  .hero-rotate-toggle { right: 32px; bottom: 48px; width: 32px; height: 32px; font-size: 13px; line-height: 30px; }

  .rows { padding: 24px 28px 72px; gap: 32px; }
  .row-title { font-size: 22px; }
  .row-icon { width: 32px; height: 32px; }
  .row-icon img { width: 22px; height: 22px; }
  .row-track { padding: 20px 24px 24px; margin: -4px -24px -8px; }
  .card { width: 240px; height: 135px; }
  .card .card-title { font-size: 16px; }

  /* Home page */
  .home-root { padding: 28px 28px 36px; padding-top: 28px; padding-top: max(28px, env(safe-area-inset-top, 0px) + 12px); }
  .home-top { margin-bottom: 20px; }
  .home-brand { padding: 10px 0 28px; }
  .home-logo { height: 76px; margin-bottom: 14px; }
  .home-title { font-size: 56px; }
  .home-tagline { font-size: 18px; }
  .home-time { font-size: 15px; }
  .home-actions { gap: 16px; margin-top: 8px; }
  .home-btn { min-width: 300px; min-height: 96px; padding: 20px 28px; gap: 14px; }
  .home-btn-glyph { font-size: 28px; }
  .home-btn-title { font-size: 22px; }
  .home-btn-sub { font-size: 14px; max-width: 300px; }
  .crane-1 { width: 180px; height: 180px; }
  .crane-2 { width: 140px; height: 140px; }
  .crane-3 { width: 110px; height: 110px; }

  /* Info modal */
  .info-modal-card { max-width: 860px; border-radius: 14px; }
  .info-hero { height: 380px; }
  .info-hero-content { left: 32px; right: 32px; bottom: 28px; gap: 20px; }
  .info-title { font-size: 38px; }
  .info-body { padding: 22px 32px 10px; gap: 32px; }
  .info-section { padding: 22px 32px; }
  .info-section-title { font-size: 22px; }
  .info-similar-grid { grid-template-columns: repeat(2, 1fr); }

  /* Card action popover — tablet */
  .card-action-panel { width: 600px; max-width: 92vw; border-radius: 14px; }
  .card-action-body  { padding: 0 24px 22px; margin-top: -44px; }
  .card-action-title { font-size: 28px; }

  /* Player HUD */
  .player-hud {
    padding: 48px 32px 28px;
    padding-left: 32px;
    padding-left: max(32px, env(safe-area-inset-left));
    padding-right: 32px;
    padding-right: max(32px, env(safe-area-inset-right));
    padding-bottom: 28px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
  .player-title { font-size: 28px; }
  .player-sub   { font-size: 16px; margin-bottom: 18px; }
  .player-controls { gap: 10px; }
  .pbtn { padding: 10px 18px; font-size: 16px; }
  .hint { font-size: 13px; }
}

/* -------- Phone (≤720px) -------- */
@media (max-width: 720px) {
  body { font-size: 16px; }

  /* Top nav */
  .nav-bar {
    padding: 8px 16px;
    padding-top: 8px;
    padding-top: max(8px, env(safe-area-inset-top));
  }
  .nav-bar.scrolled {
    padding: 6px 16px;
    padding-top: 6px;
    padding-top: max(6px, env(safe-area-inset-top));
  }
  .brand-logo { height: 40px; }
  .brand-wordmark { font-size: 18px; }

  /* Hero — block layout: image band on top, text/CTA block below on a
     solid true-black background so title + buttons stay readable. */
  .hero {
    height: auto;
    min-height: auto;
    padding-top: 56px; /* clear the fixed nav */
    display: block;
  }
  .hero-bg {
    position: relative; /* flow in, no absolute stacking */
    width: 100%;
    height: 240px;
    filter: brightness(0.85);
    display: block;
  }
  /* Only the visible crossfade layer occupies space; the hidden one
     collapses so we don't get a double-height band on mobile. */
  .hero-bg:not(.is-visible) { display: none; }
  /* Vertical-only scrim on the band; the text block below is solid. */
  .hero-bg::after {
    background: linear-gradient(180deg,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.18) 14%,
      rgba(0, 0, 0, 0)    32%,
      rgba(0, 0, 0, 0)    52%,
      rgba(0, 0, 0, 0.25) 68%,
      rgba(0, 0, 0, 0.6)  82%,
      rgba(0, 0, 0, 0.9)  94%,
      #000                100%);
  }
  .hero-overlay {
    position: relative;
    padding: 18px 16px 24px;
    padding-left: 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: 16px;
    padding-right: max(16px, env(safe-area-inset-right));
    max-width: 100%;
    left: auto; right: auto; bottom: auto;
    background: #000;
    z-index: 2;
  }
  .hero-title { font-size: 32px; margin-bottom: 10px; }
  .hero-meta  { font-size: 15px; margin-bottom: 18px; }
  .hero-actions { flex-wrap: wrap; gap: 10px; }
  .hero-actions .btn {
    padding: 12px 18px;
    font-size: 16px;
    flex: 1 1 auto;
    justify-content: center;
    min-height: 48px;
  }

  /* Arrows + dots stay overlaid on the image band. ONE rule each —
     the old duplicate .hero-dots rules left an invisible strip that
     swallowed taps down the hero's right side. */
  .hero-arrow {
    top: calc(56px + 120px); /* nav + half the image band */
    transform: translateY(-50%);
    width: 40px; height: 40px;
    font-size: 26px;
    border-width: 1px;
  }
  .hero-arrow-prev { left: 8px; }
  .hero-arrow-next { right: 8px; }
  .hero-dots {
    right: 16px;
    bottom: auto;
    top: calc(56px + 240px - 30px); /* pinned to the bottom of the band */
    gap: 10px;
  }
  .hero-dot { width: 9px; height: 9px; }
  .hero-dot.active { width: 20px; }
  /* Keep the expanded hit area tall (44px); width is capped by dot pitch. */
  .hero-dot::before {
    top: -18px; right: -5px; bottom: -18px; left: -5px;
  }
  /* Toggle sits above the dots, pinned inside the image band. */
  .hero-rotate-toggle {
    right: 16px;
    bottom: auto;
    top: 216px;                      /* fallback first */
    top: calc(56px + 240px - 80px);  /* 80px above the band's bottom edge */
    width: 32px; height: 32px;
    font-size: 13px; line-height: 30px;
  }

  /* Rows */
  .rows {
    padding: 16px 16px 60px;
    padding-left: 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: 16px;
    padding-right: max(16px, env(safe-area-inset-right));
    gap: 22px;
  }
  .row-title { font-size: 18px; gap: 8px; }
  .row-icon { width: 28px; height: 28px; border-radius: 6px; }
  .row-icon img { width: 18px; height: 18px; }
  .row-track { gap: 12px; padding: 14px 16px 18px; margin: -2px -16px -6px; }
  .card { width: 220px; height: 124px; }
  .card .duration-badge { font-size: 12px; padding: 2px 6px; }
  .card .card-title { font-size: 14px; }

  /* Home page — single-column buttons, tighter spacing. */
  .home-root { padding: 20px 16px 24px; }
  .home-top { margin-bottom: 16px; }
  .home-brand { padding: 4px 0 18px; }
  .home-logo { height: 60px; margin-bottom: 10px; }
  .home-title { font-size: 40px; margin-bottom: 8px; }
  .home-tagline { font-size: 15px; margin-bottom: 6px; }
  .home-time { font-size: 13px; }
  .home-actions {
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
    align-items: stretch;
  }
  .home-btn {
    min-width: 0;
    width: 100%;
    min-height: 80px;
    padding: 16px 20px;
    gap: 14px;
  }
  .home-btn-glyph { font-size: 24px; }
  .home-btn-title { font-size: 18px; }
  .home-btn-sub { font-size: 13px; max-width: 100%; white-space: normal; }
  .crane-1 { width: 120px; height: 120px; top: 6%; left: -4%; }
  .crane-2 { width: 100px; height: 100px; }
  .crane-3 { display: none; }

  /* Info modal — fullscreen sheet on phone. */
  .info-modal { padding: 0; }
  .info-modal-card {
    max-width: 100%;
    width: 100%;
    border-radius: 0;
    border: 0;
    min-height: 100vh;              /* fallback first */
    min-height: 100svh;             /* PE: small-viewport units */
  }
  .info-hero { height: 260px; }
  .info-hero-content { left: 16px; right: 16px; bottom: 16px; gap: 12px; }
  .info-title {
    font-size: 24px; line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    -webkit-line-clamp: 2;
  }
  .info-actions {
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  /* Play takes content width, not full row, so icons don't wrap. */
  .info-actions .btn-primary {
    padding: 11px 20px;
    font-size: 16px;
    flex: 0 0 auto;
    min-height: 44px;
  }
  .btn-icon { width: 44px; height: 44px; font-size: 16px; }
  .info-close { top: 10px; right: 10px; width: 44px; height: 44px; font-size: 16px; }
  .info-body {
    padding: 18px 16px 6px;
    gap: 20px;
    grid-template-columns: 1fr; /* stack description over sidebar */
  }
  .info-meta-line { gap: 10px; font-size: 14px; flex-wrap: wrap; }
  .info-description {
    font-size: 15px;
    max-height: none; /* let description flow fully on phone */
  }
  .info-description::after { display: none; } /* drop fade cut-off */
  .info-section { padding: 18px 16px; }
  .info-section-title { font-size: 18px; margin-bottom: 14px; }
  .info-similar-grid { grid-template-columns: 1fr; gap: 12px; }
  .info-about { grid-template-columns: max-content 1fr; column-gap: 12px; }
  .info-about dt, .info-about dd { font-size: 14px; }

  /* Card action popover — phone (full-width sheet feel). */
  .card-action-panel {
    width: 94vw;
    max-width: 94vw;
    border-radius: 12px;
  }
  .card-action-close-x { top: 10px; right: 10px; width: 44px; height: 44px; font-size: 16px; }
  .card-action-body { padding: 0 16px 18px; margin-top: -36px; gap: 8px; }
  .card-action-title { font-size: 24px; line-height: 1.1; }
  .card-action-meta-line { font-size: 14px; gap: 8px; }
  .card-action-channel { font-size: 14px; }
  .card-action-buttons { gap: 8px; margin-top: 10px; }
  .card-action .btn-primary,
  .card-action .btn-secondary { padding: 10px 16px; font-size: 15px; min-height: 44px; }
  .card-action .btn-icon { width: 44px; height: 44px; font-size: 16px; }

  /* Player HUD — condensed on phone. */
  .player-hud {
    padding: 36px 16px 20px;
    padding-left: 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: 16px;
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .player-title { font-size: 20px; }
  .player-sub   { font-size: 13px; margin-bottom: 14px; }
  .player-progress { padding: 18px 0; }
  .player-progress .times { font-size: 13px; }
  .player-controls { gap: 6px; flex-wrap: wrap; }
  .pbtn { padding: 10px 14px; font-size: 14px; min-height: 44px; min-width: 44px; }
  .hint { display: none; } /* phone users know the buttons */
  .player-flash { font-size: 34px; padding: 14px 22px; }
  .player-volume { top: 16px; right: 16px; padding: 8px 14px; }
  .player-volume .vol-bar { width: 90px; }
  .player-tap-play { width: 96px; height: 96px; font-size: 40px; line-height: 94px; }
  .player-upnext {
    right: 12px; bottom: 180px;
    max-width: 72vw;
    padding: 12px 14px;
  }
  .player-upnext .chip-title { font-size: 15px; }
}

/* -------- Very small phones (≤380px) -------- */
@media (max-width: 380px) {
  .home-title { font-size: 34px; }
  .home-logo  { height: 52px; }
  .card { width: 180px; height: 101px; }
  .row-title { font-size: 17px; }
}

/* ============================================================================
 * 15 · SHORT / LANDSCAPE VIEWPORTS (phones held sideways, tiny windows)
 * ============================================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  /* Home page compresses to fit a single short screen. */
  .home-root { padding: 14px 28px 18px; }
  .home-top { margin-bottom: 8px; }
  .home-brand { padding: 0 0 12px; }
  .home-logo { height: 44px; margin-bottom: 6px; }
  .home-title { font-size: 34px; margin-bottom: 4px; }
  .home-tagline { font-size: 14px; margin-bottom: 4px; }
  .home-time { font-size: 12px; }
  .home-actions { gap: 12px; margin-top: 4px; }
  .home-btn { min-height: 64px; padding: 12px 20px; }
  .home-btn-title { font-size: 18px; }
  .home-btn-sub { display: none; }
  .home-hint { padding-top: 14px; font-size: 12px; }

  /* Hero shrinks; overlay hugs the bottom. */
  .hero {
    height: 320px;                 /* fallback first */
    height: min(360px, 92vh);
  }
  .hero-overlay { bottom: 32px; }
  .hero-title { font-size: 36px; margin-bottom: 8px; }
  .hero-meta { font-size: 14px; margin-bottom: 12px; }
  .hero-actions .btn { padding: 10px 18px; font-size: 15px; }
  .hero-dots { bottom: 12px; }
  .hero-rotate-toggle { bottom: 6px; width: 28px; height: 28px; font-size: 12px; line-height: 26px; }

  /* Player HUD — slim variant. */
  .player-hud {
    padding: 20px 32px 12px;
    padding-bottom: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .player-title { font-size: 18px; margin-bottom: 2px; }
  .player-sub { font-size: 12px; margin-bottom: 8px; }
  .player-progress { margin-bottom: 8px; padding: 10px 0; }
  .player-progress .times { margin-top: 4px; font-size: 12px; }
  .player-controls { gap: 6px; }
  .pbtn { padding: 8px 14px; font-size: 13px; min-height: 40px; }
  .hint { display: none; }
  /* Reposition floating chrome so it clears the slim HUD. */
  .player-upnext { bottom: auto; top: 16px; right: 16px; max-width: 50vw; padding: 10px 14px; }
  .player-upnext .chip-title { font-size: 14px; margin: 2px 0 4px; }
  .player-volume { top: 16px; right: auto; left: 16px; padding: 8px 14px; }
  .player-volume .vol-bar { width: 80px; }
}

/* ============================================================================
 * 16 · REDUCED MOTION
 * Decorative motion stops; the buffering spinner keeps spinning (it is
 * status, not decoration). Chrome 38 skips this block harmlessly.
 * ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  html, body { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .crane { animation: none !important; }
  .hero-bg { transition: none; animation: none !important; }  /* crossfade = cut */
  .hero-title { animation: none !important; }
  .player-spinner .ring { animation: spin 0.9s linear infinite !important; }
}

/* ============================================================================
 * 17 · TOUCH ERGONOMICS — (hover:none) / (pointer:coarse)
 * Nothing may hide behind hover on touch devices. Chrome 38 evaluates these
 * features as false and skips the blocks (TVs get the is-tv rules instead).
 * ============================================================================ */
@media (hover: none) {
  /* Card titles are persistent — there is no hover to reveal them. */
  .card .card-overlay { opacity: 1; }
  /* Hero arrows always visible (dimmed) and tappable. */
  .hero-arrow { opacity: 0.7; pointer-events: auto; }
  /* No hover scrollbar affordance. */
  .row-track { scrollbar-width: none; }
  .row-track::-webkit-scrollbar { display: none; }
}

@media (pointer: coarse) {
  /* ≥44px touch targets. */
  .pbtn { min-height: 44px; min-width: 44px; }
  .btn-icon { min-width: 44px; min-height: 44px; }
  .info-close { min-width: 44px; min-height: 44px; }
  .card-action-close-x { min-width: 44px; min-height: 44px; }
  .footer-link { padding: 12px 14px; }
  .consent-btn { min-height: 44px; }
  .player-progress { padding: 18px 0; }
  .hero-rotate-toggle { min-width: 44px; min-height: 44px; line-height: 42px; }
}

/* ============================================================================
 * 18 · LEGACY TV MODE — html.is-tv (set by the webOS wrapper / TV pages)
 * ~5% overscan-safe gutters, bottom chrome lifted ≥48px, 10-foot type floor
 * (~20px for meta/badges/footers), always-visible hero arrows.
 * ============================================================================ */
html.is-tv .browser-only { display: none !important; }
html.is-tv .tv-only { display: block; }

/* Overscan-safe gutters (~5% each side). */
html.is-tv .nav-bar { padding-left: 5%; padding-right: 5%; padding-top: 28px; }
html.is-tv .nav-bar.scrolled { padding-top: 20px; }
html.is-tv .rows { padding-left: 5%; padding-right: 5%; padding-bottom: 96px; }
html.is-tv .hero-overlay { left: 5%; bottom: 132px; max-width: 60%; }
html.is-tv .home-root { padding: 48px 5% 64px; }
html.is-tv .home-footer { padding-left: 5%; padding-right: 5%; padding-bottom: 72px; }
html.is-tv .legal-top { padding-left: 5%; padding-right: 5%; padding-top: 48px; }
html.is-tv .legal-page { padding-left: 5%; padding-right: 5%; }
html.is-tv .empty-state { padding-left: 5%; padding-right: 5%; }

/* Bottom-anchored chrome lifted clear of overscan (≥48px). */
html.is-tv .hero-dots { bottom: 56px; right: 5%; }
/* Toggle stacks above the dots, right edges aligned, clear of the 5% overscan. */
html.is-tv .hero-rotate-toggle { right: 5%; bottom: 84px; width: 48px; height: 48px; font-size: 20px; line-height: 46px; }
html.is-tv .consent-banner { bottom: 56px; left: 5%; right: 5%; }
html.is-tv .player-hud {
  padding-left: 5%;
  padding-right: 5%;
  padding-bottom: 64px;
}
html.is-tv .player-volume { top: 64px; right: 5%; }
html.is-tv .player-upnext { right: 5%; bottom: 280px; }
html.is-tv .player-debug { top: 48px; left: 5%; }

/* Hero arrows: no hover on a remote — always visible. */
html.is-tv .hero-arrow { opacity: 1; pointer-events: auto; }

/* 10-foot type floor: meta/badges/hints/footers ≥ ~20px at 1080p. */
html.is-tv .card .card-title { font-size: 22px; }
html.is-tv .card .card-sub { font-size: 20px; }
html.is-tv .card .duration-badge { font-size: 20px; padding: 4px 10px; }
html.is-tv .hero-meta { font-size: 26px; }
html.is-tv .hint { font-size: 20px; }
html.is-tv .home-hint { font-size: 20px; }
html.is-tv .home-time { font-size: 20px; }
html.is-tv .home-footer { font-size: 20px; }
html.is-tv .footer-link { font-size: 20px; }
html.is-tv .badge-match { font-size: 20px; }
html.is-tv .meta-rating { font-size: 20px; }
html.is-tv .info-meta-line { font-size: 22px; }
html.is-tv .info-about dt { font-size: 20px; }
html.is-tv .info-about dd { font-size: 20px; }
html.is-tv .info-body-side { font-size: 20px; }
html.is-tv .info-body-side .chip { font-size: 20px; }
html.is-tv .sim-row { font-size: 20px; }
html.is-tv .sim-title { font-size: 22px; }
html.is-tv .sim-channel { font-size: 20px; }
html.is-tv .sim-thumb .sim-duration { font-size: 20px; }
html.is-tv .card-action-meta-line { font-size: 20px; }
html.is-tv .card-action-channel { font-size: 20px; }
html.is-tv .card-action .badge-match { font-size: 20px; }
html.is-tv .card-action .meta-rating { font-size: 20px; }
html.is-tv .player-sub { font-size: 24px; }
html.is-tv .player-progress .times { font-size: 20px; }
html.is-tv .player-upnext .chip-label { font-size: 20px; }
html.is-tv .player-upnext .chip-hint { font-size: 20px; }
html.is-tv .consent-text { font-size: 20px; }
html.is-tv .consent-btn { font-size: 20px; }
html.is-tv .tile-sub { font-size: 20px; }
html.is-tv .home-btn-sub { font-size: 20px; }

/* ============================================================================
 * 19 · 4K / ULTRAWIDE (≥2200px) — direct scale-up of cards and type
 * ============================================================================ */
@media (min-width: 2200px) {
  body { font-size: 26px; }
  .nav-bar { padding: 24px 120px; }
  .nav-bar.scrolled { padding: 16px 120px; }
  .brand-logo { height: 88px; }
  .nav-link { font-size: 22px; }
  .hero {
    height: 1000px;                /* fallback first */
    height: min(1080px, 78vh);
  }
  .hero-overlay { left: 120px; bottom: 160px; max-width: 1200px; }
  .hero-title { font-size: 112px; }
  .hero-meta { font-size: 30px; }
  .btn { font-size: 28px; padding: 20px 42px; }
  .rows { padding: 56px 120px 160px; gap: 64px; }
  .row-title { font-size: 36px; }
  .row-track { gap: 28px; padding: 32px 36px 36px; margin: -4px -36px -8px; }
  .card { width: 420px; height: 236px; }
  .card .card-title { font-size: 24px; }
  .card .card-sub { font-size: 18px; }
  .card .duration-badge { font-size: 18px; padding: 4px 10px; }
  .hero-arrow { width: 72px; height: 72px; font-size: 52px; }
  .hero-dots { right: 120px; bottom: 40px; }
  .hero-dot { width: 15px; height: 15px; }
  .hero-dot.active { width: 36px; }
  .hero-rotate-toggle { right: 34px; bottom: 22px; width: 52px; height: 52px; font-size: 22px; line-height: 50px; }
  .info-modal-card { max-width: 1400px; }
  .info-title { font-size: 72px; }
  .player-title { font-size: 52px; }
  .player-sub { font-size: 26px; }
  .pbtn { font-size: 24px; padding: 18px 32px; }
  .home-title { font-size: 120px; }
  .home-btn { min-width: 520px; min-height: 156px; }
}

/* ==========================================================================
 * 20 · COOKIE / PRIVACY CONSENT BANNER (web/js/consent.js)
 * ========================================================================== */
.consent-banner {
  position: fixed;
  left: 20px;
  left: max(20px, env(safe-area-inset-left));
  right: 20px;
  right: max(20px, env(safe-area-inset-right));
  bottom: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 10000;
  background: rgba(16, 16, 20, 0.94);
  color: var(--fg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  animation: consent-fade-in 180ms ease-out;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .consent-banner {
    background: rgba(16, 16, 20, 0.72);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
  }
}
.consent-banner-inner {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 18px 24px;
  flex-wrap: wrap;
  max-width: 1280px;
  margin: 0 auto;
}
.consent-text {
  margin: 0;
  flex: 1 1 320px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-dim);
}
.consent-text a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(230, 60, 55, 0.4);
}
.consent-text a:hover { color: var(--accent-hover); }
.consent-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.consent-btn {
  appearance: none;
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-micro) ease-out,
              transform var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift);
}
.consent-btn-deny {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--hairline);
  color: var(--fg);
}
.consent-btn-deny:hover { background: rgba(255, 255, 255, 0.16); }
/* Accept: crimson-600 fill — white label clears AA (4.86:1) and stays on
   the same fill on hover (glow lift instead of a lighter, failing fill). */
.consent-btn-accept {
  background: var(--accent-strong);
  color: #fff;
  font-weight: 600;
}
.consent-btn-accept:hover {
  background: var(--accent-strong);
  box-shadow: 0 6px 20px rgba(230, 60, 55, 0.45);
  transform: translateY(-1px);
}
.consent-btn:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}
.consent-btn.focused {
  outline: none;
  box-shadow: var(--focus-ring);
  transform: scale(1.03);
}
@keyframes consent-fade-in {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
@media (max-width: 540px) {
  .consent-banner-inner { padding: 14px 16px; gap: 12px; }
  .consent-actions { width: 100%; justify-content: flex-end; }
}

/* Inline "change your consent" button inside the Privacy Policy body. */
.consent-change-btn {
  appearance: none;
  border: 1px solid var(--hairline-hi);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-micro) ease-out,
              border-color var(--t-micro) ease-out,
              transform var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift);
}
.consent-change-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}
.consent-change-btn:focus,
.consent-change-btn.focused {
  outline: none;
  border-color: transparent;
  box-shadow: var(--focus-ring);
  transform: scale(1.03);
}

/* ==========================================================================
 * 21 · SEARCH
 * Nav magnifier → inline expanding input → full-page results grid.
 * Markup: browse.html (.nav-right > .nav-search-box + #search-results).
 * JS: js/search.js (shared scoring) + js/app.js (UI wiring). While a query
 * is non-empty, js adds body.search-active: the hero + rows hide and the
 * results section shows. The magnifier button itself reuses .nav-search
 * from §6. All rules below follow conventions 1–9 from the file header
 * (fallback-first, no inset, no :has(), standalone modern selectors,
 * direct overrides in @media).
 * ========================================================================== */

/* -- The search cluster (right side of the nav bar) ----------------------- */
.nav-search-box {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: background var(--t-standard) var(--ease-swift),
              border-color var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift);
}
/* Expanded: a glass pill wraps magnifier + input + clear. */
.nav-search-box.expanded {
  background: rgba(11, 11, 14, 0.88);
  border-color: var(--hairline);
  box-shadow: var(--shadow-1);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .nav-search-box.expanded {
    background: rgba(11, 11, 14, 0.6);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
  }
}
/* Inside the pill the magnifier drops its own chrome — the pill provides it. */
.nav-search-box.expanded .nav-search {
  background: transparent;
  border-color: transparent;
}
.nav-search-box.expanded .nav-search:hover { background: rgba(255, 255, 255, 0.10); }
.nav-search svg { width: 20px; height: 20px; display: block; }

/* The inline input: collapsed to zero width until the box expands. */
.nav-search-input {
  width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 18px;
  letter-spacing: 0.01em;
  caret-color: var(--accent);
  outline: none;
  transition: width var(--t-standard) var(--ease-swift),
              opacity var(--t-micro) ease-out;
}
.nav-search-box.expanded .nav-search-input {
  width: 220px;               /* fallback first (rule 1) */
  width: min(340px, 42vw);
  padding-right: 6px;
  opacity: 1;
  pointer-events: auto;
}
/* Standalone modern selectors (rule 5) — one per rule, never comma-grouped. */
.nav-search-input::placeholder { color: var(--fg-faint); }
.nav-search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.nav-search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
/* D-pad focus: luminous ring but no scale — scaled text looks broken. */
.nav-search-input.focused {
  box-shadow: var(--focus-ring);
  transform: none;
  border-radius: 999px;
}

/* Clear (✕) — appears only while the query is non-empty. */
.nav-search-clear {
  width: 36px;
  height: 36px;
  margin-right: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-dim);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--t-micro) ease-out, color var(--t-micro) ease-out;
}
.nav-search-clear:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-search-clear.focused {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: var(--focus-ring);
}
/* The flex rule above outranks the UA's [hidden]{display:none} — force it
   (same trap as the wrapper's splash overlays). */
.nav-search-clear[hidden] { display: none !important; }

/* -- View switch: search replaces hero + rows ------------------------------ */
body.search-active .hero { display: none; }
body.search-active .rows { display: none; }
/* No hero behind the fixed nav while searching — keep the bar solid. */
body.search-active .nav-bar {
  background: rgba(11, 11, 14, 0.92);
  border-bottom: 1px solid var(--hairline);
}

.search-results { display: none; }
body.search-active .search-results {
  display: block;
  padding: 156px 80px 120px;  /* top padding clears the fixed nav bar */
  min-height: 70vh;
}

.search-heading {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
  color: var(--fg);
}

/* Results grid — flex-wrap fallback first, then real Grid (old parsers keep
   the flex layout; grid-* declarations are simply dropped). */
.search-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
/* Cards reuse the exact row-card markup but go fluid: intrinsic 16:9 via
   padding-top (rule 3 — no aspect-ratio needed at all). */
.search-grid .card {
  width: 100%;
  height: 0;
  padding-top: 56.25%;
}
.search-grid .card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Empty state. */
.search-empty {
  padding: 60px 0 40px;
  text-align: center;
}
.search-empty h2 {
  font-size: 30px;
  margin: 0 0 10px;
  color: var(--fg);
}
.search-empty p {
  font-size: 17px;
  margin: 0;
  color: var(--fg-faint);
}
.search-empty[hidden] { display: none !important; }

/* -- Responsive (rule 7: direct property overrides only) ------------------ */
@media (max-width: 1536px) {
  body.search-active .search-results { padding: 150px 56px 96px; }
  .search-heading { font-size: 26px; }
}

@media (max-width: 1024px) {
  body.search-active .search-results { padding: 116px 28px 72px; }
  .search-heading { font-size: 22px; }
  .search-grid { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .nav-search-box.expanded .nav-search-input {
    width: 180px;             /* fallback first */
    width: min(280px, 40vw);
  }
}

@media (max-width: 720px) {
  body.search-active .search-results {
    padding: 96px 16px 60px;
    padding-left: 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: 16px;
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .search-heading { font-size: 18px; margin-bottom: 14px; }
  .search-grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .search-empty h2 { font-size: 22px; }
  .search-empty p { font-size: 15px; }
  .nav-search-box.expanded .nav-search-input {
    width: 150px;             /* fallback first */
    width: min(210px, 46vw);
    font-size: 16px;
  }
}

@media (min-width: 2200px) {
  body.search-active .search-results { padding: 190px 120px 160px; }
  .search-heading { font-size: 36px; }
  .search-grid { gap: 28px; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
  .nav-search-box.expanded .nav-search-input {
    width: 320px;             /* fallback first */
    width: min(460px, 30vw);
    font-size: 22px;
  }
}

/* Touch ergonomics — ≥44px targets (mirrors §17). */
@media (pointer: coarse) {
  .nav-search-clear { min-width: 44px; min-height: 44px; }
}

/* ==========================================================================
 * 22 · LOADING & ERROR STATES
 * Skeleton ghost rows (static markup inside #rows on browse.html — cleared
 * by js/app.js the moment real rows render) + the catalog load-error panel
 * whose Retry button js/app.js builds when videos.json fails to load.
 * Obeys the header conventions: solid fallbacks first, no inset shorthand,
 * no :has(), direct overrides inside @media, no new custom properties.
 * Flattened into web/tv/css/style-flat.css like everything else; TV-side
 * size overrides live in web/tv/css/tv.css.
 * ========================================================================== */

/* -- Skeleton ghost rows --------------------------------------------------- */
/* Ghost blocks share the card geometry so real rows land with no reflow
   jump. Solid surface fill comes FIRST; the animated sheen is a gradient
   re-declaration that old parsers simply drop (leaving the solid block). */
.skeleton-heading,
.skeleton-card {
  background: var(--surface-2);
  background: linear-gradient(100deg,
    #101014 35%,
    #17171c 46%,
    #1e1e24 50%,
    #17171c 54%,
    #101014 65%);
  background-size: 200% 100%;
  border: 1px solid rgba(255, 255, 255, 0.07);
  -webkit-animation: skeleton-shimmer 1.8s linear infinite;
  animation: skeleton-shimmer 1.8s linear infinite;
}
/* Stands in for the .row-title line (28px type + 10px gap). */
.skeleton-heading {
  width: 260px;
  max-width: 40%;
  height: 30px;
  border-radius: var(--radius-xs);
  margin: 3px 0 13px;
}
.skeleton-card {
  flex: 0 0 auto;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--card-radius);
}
/* Ghosts aren't content — the track must not scroll (or show a scrollbar). */
.skeleton-track { overflow-x: hidden; }

/* Subtle shimmer: a background-position sweep — no layout or paint storms.
   Both prefixed and unprefixed so Chrome 38 (prefixed-era) and WebKit 538
   pick it up; unknown at-rules are skipped harmlessly by anything older. */
@-webkit-keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Reduced motion: static ghosts, no shimmer (§16's global clamp would
   already neuter it — this makes the intent explicit). */
@media (prefers-reduced-motion: reduce) {
  .skeleton-heading,
  .skeleton-card {
    -webkit-animation: none !important;
    animation: none !important;
  }
}

/* Ghost cards track the real .card size at every breakpoint (§14 / §19). */
@media (max-width: 1536px) {
  .skeleton-card { width: 280px; height: 158px; }
}
@media (max-width: 1024px) {
  .skeleton-card { width: 240px; height: 135px; }
  .skeleton-heading { height: 26px; margin: 2px 0 10px; }
}
@media (max-width: 720px) {
  .skeleton-card { width: 220px; height: 124px; }
  .skeleton-heading { width: 200px; height: 22px; margin: 2px 0 8px; }
}
@media (max-width: 380px) {
  .skeleton-card { width: 180px; height: 101px; }
}
@media (min-width: 2200px) {
  .skeleton-card { width: 420px; height: 236px; }
  .skeleton-heading { width: 340px; height: 38px; }
}

/* -- Catalog load-error panel ----------------------------------------------- */
/* Built by js/app.js inside #rows when videos.json fails to load; the
   Retry button reuses the Cinema .btn btn-primary (§7). */
.load-error {
  padding: 100px 40px 140px;
  text-align: center;
}
.load-error h2 {
  font-size: 42px;
  margin: 0 0 12px;
}
.load-error p {
  font-size: 19px;
  color: var(--fg-dim);
  margin: 0 0 32px;
}

/* Overscan-safe gutters on legacy TVs (mirrors §18's .empty-state rule). */
html.is-tv .load-error { padding-left: 5%; padding-right: 5%; }

@media (max-width: 720px) {
  .load-error { padding: 64px 20px 90px; }
  .load-error h2 { font-size: 26px; }
  .load-error p { font-size: 16px; }
}

/* ==========================================================================
 * 23 · AD BREAKS
 * VAST ad overlay on the player page (js/vast.js + js/ads.js + player.js).
 * #ad-overlay covers #player-root with its own #ad-video; while a break runs
 * the root carries .ad-active and every piece of content chrome (HUD,
 * up-next, spinner, flash glyph, volume pill) is suppressed so the overlay
 * owns the frame. True-black stage, glass chips, crimson signal dot — no
 * yellow. Obeys the header conventions: fallback-first, top/right/bottom/left
 * (never `inset`), standalone :focus-visible rules, direct @media overrides.
 * ========================================================================== */
.ad-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #000;
  /* Above HUD / up-next(4) / flash(5) / volume(5); BELOW the shared
     tap-to-play disc (7), which restarts the AD while a break runs. */
  z-index: 6;
}
/* Class rules beat the UA's [hidden] { display: none } — force it. */
.ad-overlay[hidden] { display: none !important; }

.ad-video {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;   /* tap/click toggles pause */
}

/* Glass "Ad" chip — top-left, luminous crimson signal dot. */
.ad-badge {
  position: absolute;
  top: 40px; left: 80px;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  background: rgba(11, 11, 14, 0.72);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--fg);
  font-size: 16px; font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: var(--shadow-1);
  pointer-events: none;
  z-index: 2;
}
.ad-badge .ad-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--glow);
}

/* Countdown chip — top-right, tabular numerals ("Ad · 0:12"). */
.ad-countdown {
  position: absolute;
  top: 40px; right: 80px;
  padding: 9px 18px;
  background: rgba(11, 11, 14, 0.72);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--fg-dim);
  font-size: 16px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-1);
  pointer-events: none;
  z-index: 2;
}

/* Skip / Visit actions — glass pills, bottom-right, ≥44px targets.
   Announced politely when Skip appears (aria-live on the container). */
.ad-actions {
  position: absolute;
  right: 80px; bottom: 64px;
  /* Phone home-bar / notch clearance — plain fallbacks above, env() after. */
  right: max(80px, env(safe-area-inset-right));
  bottom: max(64px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  z-index: 2;
}
.ad-skip,
.ad-visit {
  min-height: 44px;
  padding: 12px 26px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--fg);
  font-size: 19px; font-weight: 600;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-micro) ease-out,
              background var(--t-micro) ease-out,
              border-color var(--t-micro) ease-out,
              box-shadow var(--t-micro) ease-out;
}
.ad-skip:hover,
.ad-visit:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--hairline-hi);
}
.ad-skip[hidden],
.ad-visit[hidden] { display: none !important; }
/* TV shells: no browser to open a clickthrough in — the ad is watch-or-skip
   only (also what the LG submission self-checklist declares). */
html.is-tv .ad-visit { display: none !important; }

/* Luminous D-pad focus — the global .focused rule (§3) supplies the ring +
   scale; these add the brightened glass fill. */
.ad-skip.focused,
.ad-visit.focused {
  background: rgba(255, 255, 255, 0.16);
  border-color: transparent;
}
/* Standalone rules — convention 5: never comma-group :focus-visible. */
.ad-skip:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: transparent;
}
.ad-visit:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: transparent;
}

/* While a break runs, content chrome disappears — the overlay owns the frame. */
.player-root.ad-active .player-hud { display: none; }
.player-root.ad-active .player-upnext { display: none; }
.player-root.ad-active .player-spinner { display: none; }
.player-root.ad-active .player-flash { display: none; }
.player-root.ad-active .player-volume { display: none; }

/* Legacy TV shells: no pointer → no clickthrough; chips pulled inside the
   ~5% overscan-safe frame; 10-foot type floor (§18). */
html.is-tv .ad-visit { display: none !important; }
html.is-tv .ad-badge { top: 48px; left: 5%; font-size: 20px; }
html.is-tv .ad-countdown { top: 48px; right: 5%; font-size: 20px; }
html.is-tv .ad-actions { right: 5%; bottom: 64px; }
html.is-tv .ad-skip { font-size: 22px; padding: 14px 30px; }

/* Phones / small windows — tighter chip geometry (direct overrides, §14). */
@media (max-width: 720px) {
  .ad-badge { top: 14px; left: 14px; padding: 6px 13px; font-size: 13px; }
  .ad-countdown { top: 14px; right: 14px; padding: 6px 13px; font-size: 13px; }
  .ad-actions {
    right: 16px; bottom: 20px;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    gap: 10px;
  }
  .ad-skip,
  .ad-visit { font-size: 16px; padding: 11px 20px; }
}

/* ==========================================================================
 * 24 · AD CONSENT
 * "Ads keep Urigami free" dialog (js/ad-consent.js) + the Privacy-page
 * "Privacy choices" status line. Shown at most once, right before the first
 * ad would have played, only where consent is required (EEA / unknown
 * timezone). Glass card centered over a dim scrim; dismissible ONLY via the
 * two buttons or Back. Obeys the header conventions: fallback-first,
 * top/right/bottom/left (never `inset`), standalone :focus-visible rules,
 * direct @media overrides.
 * ========================================================================== */
.ad-consent {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  /* Above every page surface incl. the ad overlay (6) and the cookie
     consent banner (10000) — an ad question outranks a cookie question. */
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  animation: ad-consent-fade-in 180ms ease-out;
}

.ad-consent-card {
  width: 100%;
  max-width: 520px;                /* px fallback first (convention 1) */
  max-width: min(520px, 92vw);
  padding: 28px 30px;
  background: rgba(16, 16, 20, 0.94);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  color: var(--fg);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .ad-consent-card {
    background: rgba(16, 16, 20, 0.78);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
  }
}

.ad-consent-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--fg);
}

.ad-consent-body {
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-dim);
}
.ad-consent-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(230, 60, 55, 0.4);
}
.ad-consent-body a:hover { color: var(--accent-hover); }

.ad-consent-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.ad-consent-btn {
  appearance: none;
  border: 1px solid transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  min-height: 48px;                /* touch-target floor (≥48px) */
  padding: 12px 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-micro) ease-out,
              transform var(--t-standard) var(--ease-swift),
              box-shadow var(--t-standard) var(--ease-swift);
}
/* Primary "Allow ads": crimson-600 fill — white label clears AA; hover keeps
   the same fill (glow lift instead of a lighter, failing fill). */
.ad-consent-allow {
  background: var(--accent-strong);
  color: #fff;
}
.ad-consent-allow:hover {
  background: var(--accent-strong);
  box-shadow: 0 6px 20px rgba(230, 60, 55, 0.45);
  transform: translateY(-1px);
}
/* Secondary "No ads": quiet glass pill. */
.ad-consent-deny {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--hairline);
  color: var(--fg);
}
.ad-consent-deny:hover { background: rgba(255, 255, 255, 0.16); }

/* Luminous D-pad focus + keyboard focus (standalone rules — convention 5). */
.ad-consent-btn.focused {
  outline: none;
  box-shadow: var(--focus-ring);
  transform: scale(1.03);
}
.ad-consent-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  transform: scale(1.03);
}

@keyframes ad-consent-fade-in {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

/* Privacy-page "Privacy choices" status line ("Video ads: allowed / …"). */
.adchoice-status {
  color: var(--fg);
  font-weight: 600;
}

/* Phones: tighter card, stacked full-width buttons (primary on top). */
@media (max-width: 540px) {
  .ad-consent { padding: 16px; }
  .ad-consent-card { padding: 22px 20px; }
  .ad-consent-title { font-size: 22px; }
  .ad-consent-body { font-size: 15px; margin-bottom: 18px; }
  .ad-consent-actions { flex-direction: column; }
  .ad-consent-btn { width: 100%; }
}

/* 10-foot shells (Android TV wrapper loads this site with ?tv=1). */
html.is-tv .ad-consent-card { max-width: 640px; padding: 32px 36px; }
html.is-tv .ad-consent-title { font-size: 32px; }
html.is-tv .ad-consent-body { font-size: 20px; }
html.is-tv .ad-consent-btn { font-size: 20px; padding: 14px 32px; }
