/* Urigami — Netflix-style TV UI.
 * Optimized for 1920x1080 + D-pad navigation.
 *
 * Typography:
 *   • Inter (sans-serif) — body, UI, meta text
 *   • Outfit (sans-serif display) — titles, hero headings
 *   Both loaded from Google Fonts; the app falls back to system fonts
 *   when the network isn't available.
 */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800;900&display=swap");

:root {
  --bg: #0e0e10;
  --bg-elev: #17171b;
  --fg: #f5f5f7;
  --fg-dim: #a3a3ad;
  --accent: #e53935;
  --accent-hover: #ff5147;
  --card-radius: 10px;
  --focus-ring: 4px solid #ffffff;
  --focus-scale: 1.08;
  --row-gap: 48px;
  --card-w: 320px;
  --card-h: 180px;
  --hero-h: 720px;
  /* UI / body stack — Inter is a modern geometric sans, tuned for screens.
     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 has cleaner terminals and feels premium on
     large hero headings and the home title. */
  --font-display: "Outfit", "Inter", -apple-system, "Helvetica Neue",
                  Arial, sans-serif;
}

* { 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; }

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

/* ==========================================================
 * Launch / Home page (clean front screen for LG webOS)
 * ========================================================== */
.home-body {
  overflow: hidden;
  background: radial-gradient(ellipse at top, #16161b 0%, #0a0a0c 100%);
}
.home-root {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 40px 80px 60px;
  box-sizing: border-box;
  z-index: 1;
}
.home-root > * { z-index: 2; position: relative; }

/* -- Ambient backdrop with floating cranes ---------------------------- */
.home-bg {
  position: absolute; inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.home-bg .ambient-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(229, 57, 53, 0.18), transparent 42%),
    radial-gradient(circle at 85% 80%, rgba(110, 160, 255, 0.10), transparent 50%);
  opacity: 1;
  filter: none;
}
.crane {
  position: absolute;
  opacity: 0.10;
  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.06; }
@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: -2px;
  margin: 0 0 12px;
  color: var(--fg);
  text-shadow: 0 6px 22px rgba(0,0,0,0.55);
}
.home-tagline {
  font-size: 26px;
  color: var(--fg-dim);
  margin: 0 0 14px;
  letter-spacing: 0.3px;
}
.home-time {
  color: rgba(255,255,255,0.45);
  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: 14px;
  border: 2px solid transparent;
  color: #fff;
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
  background: rgba(255,255,255,0.08);
}
.home-btn.home-btn-continue {
  background: var(--accent);
  box-shadow: 0 10px 30px rgba(229,57,53,0.35);
}
.home-btn.home-btn-continue:hover,
.home-btn.home-btn-continue.focused {
  background: var(--accent-hover);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 18px 42px rgba(229,57,53,0.55);
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.home-btn.home-btn-browse {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
}
.home-btn.home-btn-browse:hover,
.home-btn.home-btn-browse.focused {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.55);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 36px rgba(0,0,0,0.55);
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.home-btn.is-disabled {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.35);
  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.01em;
  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: rgba(255,255,255,0.06);
  color: var(--fg);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
  min-height: 160px;
}
.tile:hover,
.tile.focused {
  background: rgba(229,57,53,0.16);
  border-color: rgba(229,57,53,0.6);
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 16px 32px rgba(0,0,0,0.5);
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.tile-icon {
  width: 52px; height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  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: rgba(255,255,255,0.35);
  font-size: 15px;
  letter-spacing: 0.3px;
  padding-top: 40px;
}

/* ==========================================================
 * Ambient backdrop (subtle origami pattern behind everything)
 * ========================================================== */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(229, 57, 53, 0.10), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(70, 150, 255, 0.08), transparent 50%);
  opacity: 0.45;
  filter: saturate(0.9);
}
/* Drop `assets/ambient-pattern.png` in the folder and re-add a url() here to overlay it. */
.app > * { position: relative; z-index: 1; }

/* ==========================================================
 * Top navigation bar
 * ========================================================== */
.nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 80px;
  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 220ms ease, padding 220ms ease;
}
.nav-bar.scrolled {
  background: rgba(14, 14, 16, 0.92);
  padding: 12px 80px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.55);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
a.nav-brand-link {
  text-decoration: none;
  color: inherit;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 120ms ease, transform 120ms ease;
}
a.nav-brand-link:hover,
a.nav-brand-link.focused {
  background: rgba(255,255,255,0.08);
  transform: scale(1.03);
  outline: 2px solid rgba(255,255,255,0.25);
  outline-offset: 2px;
}
.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(229,57,53,0.35);
}
/* If logo loads, hide the wordmark fallback (logo already contains type) */
.nav-brand:has(.brand-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: 500;
  letter-spacing: 0.3px;
  padding: 8px 6px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease, transform 120ms ease;
}
.nav-link.active { color: #fff; font-weight: 700; }
.nav-link:hover, .nav-link.focused {
  color: #fff;
  border-bottom-color: var(--accent);
  transform: translateY(-1px);
}

.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);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background 120ms ease, transform 120ms ease;
  cursor: pointer;
}
.nav-search:hover, .nav-search.focused {
  background: rgba(255,255,255,0.22);
  transform: scale(1.07);
}
.nav-profile {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
  color: #fff;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  position: relative;
}
.nav-profile:hover, .nav-profile.focused {
  transform: scale(1.07);
  box-shadow: 0 0 0 2px #fff, 0 8px 20px rgba(229,57,53,0.6);
}
.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 loads, hide fallback. */
.nav-profile:has(.profile-avatar) .profile-fallback { display: none; }

/* -------- Hero -------- */
.hero {
  position: relative;
  width: 100%;
  height: var(--hero-h);
  overflow: hidden;
  background: linear-gradient(180deg, #1a1a1f 0%, var(--bg) 100%);
  margin-top: 0; /* nav is fixed, hero starts at top of viewport */
}
.hero-brand {
  height: 64px;
  width: auto;
  margin-bottom: 18px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
  display: block;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(0.45);
  opacity: 0;
  transition: opacity 900ms ease;
}
.hero-bg.is-visible { opacity: 1; }

/* Rotation dots at the bottom-right of the hero. */
.hero-dots {
  position: absolute;
  right: 80px;
  bottom: 28px;
  display: flex;
  gap: 8px;
  z-index: 3;
}
.hero-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: width 200ms ease, background 200ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.hero-dot:hover {
  background: rgba(255,255,255,0.6);
  transform: scale(1.2);
}
.hero-dot.focused {
  outline: 2px solid #fff;
  outline-offset: 3px;
  transform: scale(1.2);
}
.hero-dot.active {
  width: 28px;
  border-radius: 6px;
  background: var(--accent);
}

/* Manual prev/next arrow buttons on the sides of the hero. */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 58px; height: 58px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  z-index: 3;
  border: 2px solid rgba(255,255,255,0.25);
  transition: opacity 200ms ease, background 150ms ease, transform 150ms ease, border-color 150ms ease;
}
.hero:hover .hero-arrow { opacity: 0.7; }
.hero-arrow:hover,
.hero-arrow.focused {
  opacity: 1;
  background: rgba(0,0,0,0.7);
  border-color: #fff;
  transform: translateY(-50%) scale(1.06);
}
.hero-arrow-prev { left: 24px; }
.hero-arrow-next { right: 24px; }

.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,14,16,0) 30%, rgba(14,14,16,1) 100%);
}
.hero-overlay {
  position: absolute;
  left: 80px; bottom: 120px;
  max-width: 900px;
  z-index: 2;
}
.hero-title {
  font-size: 72px;
  font-weight: 800;
  margin: 0 0 20px;
  letter-spacing: -1px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.hero-meta {
  font-size: 24px;
  color: var(--fg-dim);
  margin: 0 0 32px;
}
.hero-actions { display: flex; gap: 20px; }

.btn {
  padding: 16px 32px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 22px;
  transition: transform 120ms ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: rgba(255,255,255,0.2); color: #fff; }

/* -------- Rows -------- */
.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;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.row-icon {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  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: rgba(255,255,255,0.35);
  font-size: 14px;
  letter-spacing: 0.3px;
}
.footer-mark { font-family: "Noto Sans JP", inherit; }
.row-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 20px 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.row-track::-webkit-scrollbar { display: none; }

.card {
  flex: 0 0 auto;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--card-radius);
  background: var(--bg-elev);
  position: relative;
  overflow: hidden;
  transition: transform 150ms ease, box-shadow 150ms ease;
  scroll-snap-align: start;
  cursor: pointer;
}
.card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.card .card-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px 14px;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
  opacity: 0; transition: opacity 150ms ease;
}
.card .card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .card-sub {
  font-size: 14px;
  color: var(--fg-dim);
  margin-top: 4px;
}
.card .duration-badge {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.75);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
}

/* Focus state — for D-pad and tab navigation */
.focused, .card.focused, .btn.focused, .pbtn.focused {
  outline: var(--focus-ring);
  outline-offset: 4px;
  transform: scale(var(--focus-scale));
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  z-index: 3;
}
.card.focused .card-overlay { opacity: 1; }

/* -------- Empty state -------- */
.empty-state {
  padding: 160px 80px;
  text-align: center;
}
.empty-state h2 { font-size: 42px; margin-bottom: 16px; }
.empty-state code {
  background: var(--bg-elev);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.95em;
}

/* -------- Player -------- */
.player-body {
  background: #000;
  overflow: hidden;
}
.player-root {
  position: fixed; inset: 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: 80px 80px 50px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85) 40%);
  opacity: 1;
  transition: opacity 250ms ease, transform 250ms ease;
}
.player-hud.hidden { opacity: 0; pointer-events: none; transform: translateY(12px); }

.player-title { font-size: 40px; font-weight: 800; margin: 0 0 8px; max-width: 1400px; }
.player-sub { color: var(--fg-dim); font-size: 22px; margin-bottom: 28px; }

/* Scrubber (focusable slider) */
.player-progress {
  margin-bottom: 24px;
  padding: 8px 0;
  outline: none;
  border-radius: 6px;
  transition: transform 150ms ease;
}
.player-progress:focus,
.player-progress.focused {
  transform: scale(1.01);
}
.player-progress .bar {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: visible;
  cursor: pointer;
}
.player-progress:focus .bar,
.player-progress.focused .bar {
  height: 10px;
  background: rgba(255,255,255,0.3);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}
.player-progress .buffered {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: rgba(255,255,255,0.35);
  border-radius: 4px;
  width: 0%;
  transition: width 200ms linear;
}
.player-progress .fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--accent);
  border-radius: 4px;
  width: 0%;
}
.player-progress .thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 120ms ease;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.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 */
.player-controls {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.pbtn {
  padding: 14px 26px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  font-size: 20px; font-weight: 600;
  transition: transform 120ms ease, background 120ms ease;
}
.pbtn:hover { background: rgba(255,255,255,0.25); }
.pbtn.primary { background: var(--accent); }
.pbtn.primary:hover { background: var(--accent-hover); }
.hint {
  color: var(--fg-dim);
  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 200ms ease;
  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 */
.player-flash {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  padding: 20px 32px;
  background: rgba(0,0,0,0.55);
  border-radius: 16px;
  color: #fff;
  font-size: 48px; font-weight: 800;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.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); }
}

/* Volume pill */
.player-volume {
  position: absolute;
  top: 60px; right: 80px;
  background: rgba(0,0,0,0.7);
  padding: 14px 20px;
  border-radius: 999px;
  display: flex; align-items: center; gap: 14px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
  z-index: 5;
}
.player-volume.show {
  opacity: 1;
  transform: translateY(0);
}
.player-volume .vol-icon { font-size: 24px; }
.player-volume .vol-bar {
  width: 160px; height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px; overflow: hidden;
}
.player-volume .vol-fill {
  height: 100%;
  background: var(--accent);
  width: 100%;
}

/* Error overlay */
.player-error {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.85);
  padding: 48px 64px;
  border-radius: 16px;
  text-align: center;
  z-index: 6;
}
.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 */
.player-upnext {
  position: absolute;
  right: 60px; bottom: 260px;
  background: rgba(0,0,0,0.8);
  padding: 18px 22px;
  border-radius: 12px;
  max-width: 360px;
  border-left: 4px solid var(--accent);
  z-index: 4;
  transition: opacity 250ms ease, transform 250ms ease;
}
.player-upnext.hidden {
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
}
.player-upnext .chip-label {
  color: var(--fg-dim);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.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-dim);
}
.player-upnext kbd {
  background: rgba(255,255,255,0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
}

/* ==========================================================
 * Card quick-action popover (Play / More Info on click)
 * ========================================================== */
.card-action {
  position: fixed; inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 200ms ease;
}
.card-action.hidden { display: none; }
.card-action.closing { opacity: 0; pointer-events: none; }
.card-action-scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
}
.card-action-panel {
  position: relative;
  width: min(720px, 92vw);
  background: #141417;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  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 ease forwards;
}

/* Close button in top-right of the panel. */
.card-action-close-x {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 3;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 120ms ease, transform 120ms ease, border-color 120ms ease;
}
.card-action-close-x:hover,
.card-action-close-x.focused {
  background: #fff;
  color: #000;
  border-color: #fff;
  transform: scale(1.08);
}

/* Hero image band at the top of the panel with fade to card body. */
.card-action-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a0c;
  overflow: hidden;
}
.card-action-thumb {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.05);
}
.card-action-hero-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg,
      rgba(20,20,23,0) 0%,
      rgba(20,20,23,0) 50%,
      rgba(20,20,23,0.55) 82%,
      #141417 100%),
    linear-gradient(90deg,
      rgba(20,20,23,0.45) 0%,
      rgba(20,20,23,0) 35%);
  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: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: #fff;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  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;
  margin-top: 2px;
}
.card-action .badge-match {
  color: #46d369;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
}
.card-action .meta-rating {
  border: 1px solid rgba(255,255,255,0.35);
  padding: 0 6px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 18px;
  display: inline-block;
}
.card-action-channel {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  margin-top: 2px;
}

/* Action row: white Play (primary), ghost-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: #fff;
  color: #000;
  padding: 11px 26px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.15);
  transition: background 120ms ease, transform 120ms ease, box-shadow 150ms ease;
}
.card-action .btn-primary .btn-glyph {
  font-size: 18px;
  line-height: 1;
}
.card-action .btn-primary:hover,
.card-action .btn-primary.focused {
  background: #fff;
  color: #000;
  outline: 3px solid #fff;
  outline-offset: 3px;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 10px 24px rgba(255, 255, 255, 0.25);
}
.card-action .btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 11px 22px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 120ms ease, transform 120ms ease, border-color 120ms ease;
}
.card-action .btn-secondary:hover,
.card-action .btn-secondary.focused {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.55);
  outline: 2px solid #fff;
  outline-offset: 3px;
  transform: translateY(-1px) scale(1.03);
}
.card-action .btn-icon {
  width: 44px; height: 44px;
  margin-left: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.35);
  font-size: 18px;
}
.card-action .btn-icon:hover,
.card-action .btn-icon.focused {
  background: rgba(255, 255, 255, 0.18);
  border-color: #fff;
  transform: scale(1.08);
}

/* ==========================================================
 * Netflix-style "More Info" modal
 * ========================================================== */
.info-modal {
  position: fixed; inset: 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 ease;
}
.info-modal.hidden {
  display: none;
}
.info-modal.closing {
  opacity: 0;
  pointer-events: none;
}
.info-modal-scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(2px);
}
.info-modal-card {
  position: relative;
  width: 100%;
  max-width: 1100px;
  background: #181818;
  color: var(--fg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.75);
  transform: translateY(0);
  animation: info-pop-in 260ms ease both;
}
.info-modal.closing .info-modal-card {
  animation: info-pop-out 200ms ease forwards;
}
@keyframes info-pop-in {
  from { transform: translateY(30px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}
@keyframes info-pop-out {
  to { transform: translateY(30px) scale(0.96); opacity: 0; }
}

.info-close {
  position: absolute;
  top: 22px; right: 22px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(24, 24, 24, 0.85);
  color: #fff;
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
  transition: background 120ms ease, transform 120ms ease;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.35);
}
.info-close:hover,
.info-close.focused {
  background: #fff;
  color: #000;
  transform: scale(1.06);
}

/* Hero backdrop */
.info-hero {
  position: relative;
  height: 520px;
  background: #000;
}
.info-hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 25%;
  filter: brightness(0.75) saturate(1.1);
}
.info-hero-gradient {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(24,24,24,0) 0%, rgba(24,24,24,0.2) 55%, #181818 100%),
    linear-gradient(90deg, rgba(24,24,24,0.6) 0%, rgba(24,24,24,0) 40%);
}
.info-hero-content {
  position: absolute;
  left: 56px; right: 56px; bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.info-title {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 0;
  max-width: 820px;
  text-shadow: 0 4px 18px rgba(0,0,0,0.55);
  line-height: 1.08;
}
.info-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.info-actions .btn-primary {
  background: #fff;
  color: #000;
  padding: 14px 34px;
  font-size: 22px;
  font-weight: 700;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.info-actions .btn-primary:hover,
.info-actions .btn-primary.focused {
  background: #e6e6e6;
}
.info-actions .btn-glyph {
  font-size: 22px;
}
.btn-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(42, 42, 42, 0.7);
  color: #fff;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.5);
  transition: background 120ms ease, transform 120ms ease, border-color 120ms ease;
}
.btn-icon:hover,
.btn-icon.focused {
  background: rgba(100, 100, 100, 0.75);
  border-color: #fff;
  transform: scale(1.06);
}

/* 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;
  margin-bottom: 18px;
}
.badge-match {
  color: #46d369;
  font-weight: 700;
  font-size: 18px;
}
.meta-rating {
  border: 1px solid rgba(255,255,255,0.45);
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.info-description {
  font-size: 20px;
  line-height: 1.45;
  color: #e8e8e8;
  margin: 0;
  white-space: pre-wrap;
  max-height: 180px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  transition: max-height 260ms ease, background 120ms ease;
}
.info-description:hover,
.info-description.focused {
  background: rgba(255, 255, 255, 0.04);
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 4px;
}
/* "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, #181818 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: rgba(255,255,255,0.55); margin-right: 6px; }
.info-body-side .chip {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: #ddd;
  padding: 2px 10px;
  border-radius: 4px;
  margin: 2px 4px 2px 0;
  font-size: 14px;
}

/* Sections */
.info-section {
  padding: 30px 56px;
}
.info-section-title {
  font-size: 26px;
  font-weight: 700;
  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: #2f2f2f;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 150ms ease, box-shadow 150ms ease;
  text-align: left;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
}
.sim-card:hover,
.sim-card.focused {
  transform: scale(1.03);
  box-shadow: 0 14px 28px rgba(0,0,0,0.55);
  outline: 3px solid #fff;
  outline-offset: 0;
  z-index: 2;
}
.sim-thumb {
  aspect-ratio: 16 / 9;
  background: #111;
  background-size: cover;
  background-position: center;
  position: relative;
}
.sim-thumb .sim-duration {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.8);
  font-size: 13px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
}
.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; }
.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: 13px;
  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: rgba(255,255,255,0.5);
  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; }

/* Debug overlay */
.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: 8px;
  z-index: 7;
  pointer-events: none;
}
.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;
}

/* ==========================================================
 * 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: none;
  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 120ms ease, transform 150ms ease, outline-color 120ms ease;
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.legal-back:hover {
  background: rgba(255,255,255,0.14);
}
.legal-back:focus,
.legal-back.focused {
  outline-color: #fff;
  background: rgba(255,255,255,0.18);
  transform: scale(1.05);
}
.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: 700;
  letter-spacing: -0.5px;
}
.legal-page h2 {
  margin: 48px 0 12px;
  font-size: 26px;
  font-weight: 600;
  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);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}
.legal-page a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(229,57,53,0.4);
  transition: color 120ms ease, border-color 120ms ease;
}
.legal-page a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}
.legal-page a:focus,
.legal-page a.focused {
  outline: 2px solid #fff;
  outline-offset: 3px;
  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-left: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-link {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 120ms ease, background 120ms ease, transform 150ms ease, outline-color 120ms ease;
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.footer-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.footer-link:focus,
.footer-link.focused {
  color: #fff;
  outline-color: #fff;
  background: rgba(255,255,255,0.1);
  transform: scale(1.05);
}
.footer-link.is-current {
  color: var(--accent);
}

/* Let the home hint wrap onto two lines and still look tidy. */
.home-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* 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; }
}

/* ============================================================================
 * Responsive breakpoints
 *
 * The default layout is TV-first (1920×1080). These breakpoints scale it down
 * for desktop web (≤1536px), tablet (≤1024px), and phone (≤720px), keeping the
 * visual language but right-sizing the type, hit targets, spacing, and grids.
 * ============================================================================ */

/* -------- Desktop web (laptop to small 1080p monitors) -------- */
@media (max-width: 1536px) {
  :root {
    --hero-h: 600px;
    --card-w: 280px;
    --card-h: 158px;
    --row-gap: 40px;
  }
  body { font-size: 20px; }

  /* Top nav & hero */
  .nav-bar { padding: 16px 48px; }
  .nav-bar.scrolled { padding: 10px 48px; }
  .hero-overlay { left: 56px; bottom: 96px; }
  .hero-title { font-size: 60px; }
  .hero-meta  { font-size: 22px; }
  .hero-brand { height: 56px; }
  .hero-arrow { width: 52px; height: 52px; font-size: 36px; }

  /* Rows */
  .rows { padding: 32px 56px 96px; }
  .row-title { font-size: 26px; }

  /* Home page */
  .home-root { padding: 36px 56px 48px; }
  .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 { grid-template-columns: 360px 1fr; width: min(820px, 88vw); }
  .card-action-thumb { width: 360px; }
}

/* -------- Tablet & small landscape (≤1024px) -------- */
@media (max-width: 1024px) {
  :root {
    --hero-h: 480px;
    --card-w: 240px;
    --card-h: 135px;
    --row-gap: 32px;
  }
  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-overlay { left: 32px; right: 32px; bottom: 64px; }
  .hero-title { font-size: 44px; }
  .hero-meta  { font-size: 18px; }
  .hero-brand { height: 44px; margin-bottom: 12px; }
  .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: 6px; }

  .rows { padding: 24px 28px 72px; }
  .row-title { font-size: 22px; }
  .row-icon { width: 32px; height: 32px; }
  .row-icon img { width: 22px; height: 22px; }
  .card .card-title { font-size: 16px; }

  /* Home page */
  .home-root { padding: 28px 28px 36px; min-height: 100vh; }
  .home-top { margin-bottom: 20px; }
  .home-brand { padding: 10px 0 28px; }
  .home-logo { height: 76px; margin-bottom: 14px; }
  .home-title { font-size: 56px; letter-spacing: -1px; }
  .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: 10px; }
  .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: min(600px, 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; }
  .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) {
  :root {
    --hero-h: auto;
    --card-w: 220px;
    --card-h: 124px;
    --row-gap: 26px;
  }
  body { font-size: 16px; }

  /* Top nav */
  .nav-bar { padding: 8px 16px; }
  .nav-bar.scrolled { padding: 6px 16px; }
  .brand-logo { height: 40px; }
  .brand-wordmark { font-size: 18px; }

  /* Hero — block layout: image band on top, text/CTA block below on a
     solid background so title + buttons stay readable without relying
     on a gradient overlay. */
  .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: 220px;
    filter: brightness(0.7);
    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; }
  .hero-overlay {
    position: relative;
    padding: 18px 16px 24px;
    max-width: 100%;
    left: auto; right: auto; bottom: auto;
    background: #0e0e10;
    z-index: 2;
  }
  /* Keep arrows + dots overlaid on the image band. */
  .hero-arrow {
    top: calc(56px + 110px); /* nav + half the image band */
    transform: translateY(-50%);
  }
  .hero-dots {
    right: 12px;
    bottom: auto;
    top: calc(56px + 220px - 20px);
  }
  .hero-title { font-size: 30px; margin-bottom: 10px; }
  .hero-meta  { font-size: 15px; margin-bottom: 18px; }
  .hero-brand { height: 34px; margin-bottom: 8px; }
  .hero-actions { flex-wrap: wrap; gap: 10px; }
  .hero-actions .btn { padding: 10px 18px; font-size: 16px; flex: 1 1 auto; }
  .hero-arrow { width: 36px; height: 36px; font-size: 24px; border-width: 1px; }
  .hero-arrow-prev { left: 6px; }
  .hero-arrow-next { right: 6px; }
  .hero-dots { right: 16px; bottom: 12px; gap: 5px; }
  .hero-dot { width: 8px; height: 8px; }
  .hero-dot.active { width: 18px; }

  /* Rows */
  .rows { padding: 16px 16px 60px; 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: 12px 0; }
  .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; letter-spacing: -0.5px; 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;
    min-height: 100vh;
  }
  .info-hero { height: 240px; }
  .info-hero-content { left: 16px; right: 16px; bottom: 16px; gap: 12px; }
  .info-title {
    font-size: 22px; line-height: 1.15;
    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: 10px 20px;
    font-size: 16px;
    flex: 0 0 auto;
  }
  .btn-icon { width: 40px; height: 40px; font-size: 16px; border-width: 1px; }
  .info-close { top: 10px; right: 10px; width: 36px; height: 36px; 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: 13px; }

  /* 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: 36px; height: 36px; font-size: 16px; }
  .card-action-body { padding: 0 16px 18px; margin-top: -36px; gap: 8px; }
  .card-action-title { font-size: 22px; line-height: 1.15; }
  .card-action-meta-line { font-size: 13px; gap: 8px; }
  .card-action-channel { font-size: 13px; }
  .card-action-buttons { gap: 8px; margin-top: 10px; }
  .card-action .btn-primary,
  .card-action .btn-secondary { padding: 9px 16px; font-size: 15px; }
  .card-action .btn-icon { width: 40px; height: 40px; font-size: 16px; }

  /* Player HUD — condensed on phone. */
  .player-hud { padding: 36px 16px 20px; }
  .player-title { font-size: 20px; }
  .player-sub   { font-size: 13px; margin-bottom: 14px; }
  .player-progress .times { font-size: 13px; }
  .player-controls { gap: 6px; flex-wrap: wrap; }
  .pbtn { padding: 8px 12px; font-size: 14px; border-radius: 6px; }
  .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-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; }
  :root { --card-w: 180px; --card-h: 101px; }
  .row-title { font-size: 17px; }
}

/* ==========================================================
 * Cookie / privacy consent banner (web/js/consent.js)
 * ========================================================== */
.consent-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 10000;
  background: rgba(23, 23, 27, 0.96);
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: consent-fade-in 180ms ease-out;
}
.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(229,57,53,0.4);
}
.consent-text a:hover { color: var(--accent-hover); }
.consent-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.consent-btn {
  appearance: none;
  border: none;
  font: inherit;
  font-size: 15px;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, transform 150ms ease;
}
.consent-btn-deny {
  background: rgba(255,255,255,0.08);
  color: var(--fg);
}
.consent-btn-deny:hover { background: rgba(255,255,255,0.16); }
.consent-btn-accept {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.consent-btn-accept:hover { background: var(--accent-hover); }
.consent-btn:focus { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes consent-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { 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 rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 150ms ease;
}
.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: 2px solid #fff;
  outline-offset: 2px;
  transform: scale(1.03);
}
