/* =====================================================================
   BABILONIA TV — linguaggio visivo da piattaforma streaming
   Nero vero, rosso del logo, Archivo largo e pesante per i titoli.
   ===================================================================== */
:root {
  --black: #000000;
  --surface: #141414;
  --raised: #232323;
  --line: #2f2f2f;
  --red: #e50914;
  --red-hover: #f6121d;
  --white: #ffffff;
  --mute: #b3b3b3;
  --dim: #808080;
  --ok: #46d369;

  --font: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; border-radius: 4px; }

/* ===================== BOTTONI ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 4px; cursor: pointer; text-decoration: none;
  font-weight: 700; font-size: 16px; padding: 10px 18px; line-height: 1.2;
  transition: background-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-lg { padding: 16px 28px; font-size: 20px; }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-hover); }
.btn-glass { background: rgba(109, 109, 110, 0.7); color: var(--white); }
.btn-glass:hover { background: rgba(109, 109, 110, 0.45); }
.btn-play { background: var(--white); color: var(--black); padding: 12px 26px; font-size: 18px; }
.btn-play:hover { background: rgba(255, 255, 255, 0.78); }

/* ===================== NAV ===================== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: 68px; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  transition: background-color 0.3s;
}
.nav.solid { background-color: var(--black); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-word {
  font-weight: 900; font-stretch: 125%; font-size: 22px; letter-spacing: -0.02em;
  color: var(--red);
}
.nav-right { display: flex; align-items: center; gap: 18px; min-width: 0; }
.nav-link { font-size: 15px; font-weight: 600; color: var(--white); text-decoration: none; opacity: 0.88; }
.nav-link:hover { opacity: 1; text-decoration: underline; }
.status-pill {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 14px; color: var(--mute);
}
#headerStatus { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #555; flex-shrink: 0; }
.dot.active { background: var(--ok); }
.dot.searching { background: #e5b609; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

body:not(.state-app) .app-only { display: none; }
body.state-app .landing-only { display: none; }

/* ===================== HERO + PARETE DI SCHERMI ===================== */
.hero {
  position: relative; overflow: hidden;
  min-height: min(100vh, 860px);
  display: grid; place-items: center;
  padding: 120px var(--gutter) 88px;
  border-bottom: 8px solid var(--raised);
}
.wall-frame { position: absolute; inset: 0; overflow: hidden; }
.wall {
  position: absolute; left: 50%; top: 50%;
  width: 150%; min-width: 1500px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
  transform: translate(-50%, -50%) rotate(-8deg) scale(1.05);
}
.tile {
  position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden;
  background: var(--tile-bg);
  display: flex; align-items: center; justify-content: center;
}
.tile::after { /* grana da schermo */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 3px);
}
.tile-word {
  font-weight: 900; font-stretch: 112%; font-size: clamp(30px, 3.2vw, 52px);
  color: rgba(255,255,255,0.9); letter-spacing: -0.01em; line-height: 1;
  font-family: var(--font), "Noto Sans", "Segoe UI", "Yu Gothic", "Malgun Gothic", "Nirmala UI", sans-serif;
  margin-top: -18px;
}
.tile-cap {
  position: absolute; left: 8%; right: 8%; bottom: 9%; z-index: 1;
  text-align: center; font-size: 13px; font-weight: 600; line-height: 1.3;
  background: rgba(0,0,0,0.72); padding: 5px 8px; border-radius: 3px;
}
.tile-cap .cap-text { display: inline-block; transition: opacity 0.35s, transform 0.35s; }
.tile-cap.swapping .cap-text { opacity: 0; transform: translateY(4px); }
.tile-cap .eq { display: none; gap: 2px; margin-right: 6px; vertical-align: middle; height: 10px; align-items: flex-end; }
.tile-cap.dubbed .eq { display: inline-flex; }
.tile-cap .eq i { width: 2px; height: 100%; background: var(--red); animation: eq 0.9s ease-in-out infinite; }
.tile-cap .eq i:nth-child(2) { animation-delay: -0.3s; }
.tile-cap .eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

.hero-shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 62% 58% at 50% 48%, rgba(0,0,0,0.86) 0%, rgba(0,0,0,0.6) 55%, rgba(0,0,0,0.5) 75%, rgba(0,0,0,0.78) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.95) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 880px; text-align: center; }
.hero-title {
  margin: 0 0 20px;
  font-weight: 900; font-stretch: 115%;
  font-size: clamp(38px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero-sub {
  margin: 0 auto 32px; max-width: 640px;
  font-size: clamp(17px, 1.6vw, 21px); line-height: 1.5; color: #e5e5e5; text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-meta { margin: 16px 0 0; font-size: 15px; color: var(--mute); }

.waiting {
  margin: 28px auto 0; max-width: 620px; text-align: left;
  display: flex; gap: 18px; align-items: flex-start;
  background: rgba(20,20,20,0.88); border-left: 4px solid var(--red);
  padding: 18px 22px; border-radius: 4px;
}
.waiting-title { margin: 0 0 4px; font-weight: 800; font-size: 18px; }
.waiting-text { margin: 0; color: var(--mute); font-size: 15px; line-height: 1.55; }
.waiting-text + .waiting-text { margin-top: 8px; }
.radar { position: relative; width: 22px; height: 22px; flex-shrink: 0; margin-top: 3px; border-radius: 50%; background: var(--red); }
.radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--red); animation: radar 1.6s ease-out infinite; }
@keyframes radar { from { transform: scale(1); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }

/* ===================== BLOCCHI FUNZIONE ===================== */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center;
  max-width: 1200px; margin: 0 auto; width: 100%;
  padding: clamp(56px, 8vw, 96px) var(--gutter);
  border-bottom: 8px solid var(--raised);
}
.feature + .feature, .feature + .steps { position: relative; }
.landing > section:not(.hero) { border-bottom: 8px solid var(--raised); }
.landing { display: flex; flex-direction: column; }
.landing > .feature { max-width: none; padding-left: max(var(--gutter), calc((100% - 1200px) / 2)); padding-right: max(var(--gutter), calc((100% - 1200px) / 2)); }
.feature-flip .feature-text { order: 2; }
.feature h2, .steps h2, .faq h2 {
  margin: 0 0 16px;
  font-weight: 900; font-stretch: 112%; font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance;
}
.feature p { margin: 0; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.5; color: #d6d6d6; max-width: 32em; }
.feature-visual { display: flex; justify-content: center; }

/* Voci */
.voices { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 14px; }
.voice-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; background: var(--surface); padding: 14px 16px; border-radius: 6px; }
.avatar { width: 44px; height: 44px; border-radius: 4px; }
.a1 { background: linear-gradient(135deg, #e50914, #7a0510); }
.a2 { background: linear-gradient(135deg, #f5a524, #8a4b00); }
.a3 { background: linear-gradient(135deg, #3d7bfd, #12307a); }
.wave { display: flex; align-items: center; gap: 4px; height: 30px; }
.wave i { flex: 1; border-radius: 2px; background: currentColor; height: 30%; }
.w1 { color: #e50914; } .w2 { color: #f5a524; } .w3 { color: #3d7bfd; }
.wave i:nth-child(odd) { height: 70%; } .wave i:nth-child(3n) { height: 45%; } .wave i:nth-child(4n) { height: 95%; } .wave i:nth-child(5n) { height: 25%; }
.w2 i:nth-child(even) { height: 80%; } .w3 i:nth-child(3n+1) { height: 60%; }
.voice-name { font-size: 14px; font-weight: 700; color: var(--mute); }

/* Timeline spot */
.timeline { width: 100%; max-width: 480px; }
.tl-track { display: flex; gap: 4px; height: 64px; }
.tl-seg { border-radius: 4px; }
.tl-seg.dub { background: var(--red); }
.tl-seg.ad { background: repeating-linear-gradient(135deg, #3a3a3a 0 8px, #2a2a2a 8px 16px); }
.tl-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-size: 15px; color: var(--mute); }
.tl-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sw.dub { background: var(--red); }
.sw.ad { background: repeating-linear-gradient(135deg, #4a4a4a 0 4px, #2a2a2a 4px 8px); }

/* Portatile */
.laptop { width: 100%; max-width: 480px; }
.laptop-screen { background: #1c1c1c; border-radius: 12px 12px 0 0; padding: 12px; border: 1px solid #333; }
.ls-frame {
  aspect-ratio: 16 / 10; border-radius: 3px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #263a52 0%, #0f1722 55%, #2b1a12 100%);
}
.ls-frame::before { content: ""; position: absolute; left: 0; right: 0; bottom: 30%; height: 38%; background: linear-gradient(180deg, transparent, rgba(0,0,0,0.6)); }
.ls-sub { position: absolute; left: 10%; right: 10%; bottom: 10%; text-align: center; background: rgba(0,0,0,0.75); padding: 6px 10px; border-radius: 3px; font-size: 15px; font-weight: 600; }
.ls-chip {
  position: absolute; top: 8%; right: 5%; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; background: rgba(0,0,0,0.6); padding: 4px 8px; border-radius: 3px;
}
.ls-chip .eq, .tile-cap .eq { gap: 2px; height: 10px; align-items: flex-end; }
.ls-chip .eq { display: inline-flex; }
.ls-chip .eq i { width: 2px; height: 100%; background: var(--red); animation: eq 0.9s ease-in-out infinite; }
.ls-chip .eq i:nth-child(2) { animation-delay: -0.3s; }
.ls-chip .eq i:nth-child(3) { animation-delay: -0.6s; }
.ls-progress { position: absolute; left: 5%; right: 5%; bottom: 4%; height: 3px; background: rgba(255,255,255,0.25); }
.ls-progress span { display: block; width: 62%; height: 100%; background: var(--red); }
.laptop-base { height: 14px; margin: 0 -6%; background: linear-gradient(180deg, #3a3a3a, #1d1d1d); border-radius: 0 0 14px 14px; }

/* ===================== TRE PASSI (numeri giganti) ===================== */
.steps { padding: clamp(56px, 8vw, 96px) var(--gutter); max-width: 1300px; width: 100%; margin: 0 auto; }
.landing > .steps { max-width: none; padding-left: max(var(--gutter), calc((100% - 1200px) / 2)); padding-right: max(var(--gutter), calc((100% - 1200px) / 2)); }
.step-row { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-row li { display: flex; align-items: flex-end; gap: 0; min-width: 0; }
.step-num {
  font-weight: 900; font-stretch: 62%; font-size: clamp(150px, 15vw, 220px); line-height: 0.78;
  color: var(--black); -webkit-text-stroke: 4px #595959;
  letter-spacing: -0.06em; flex-shrink: 0; margin-right: -4px; user-select: none;
}
.step-body { position: relative; background: var(--surface); border-radius: 6px; padding: 20px; flex: 1; min-height: 150px; }
.step-body h3 { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.step-body p { margin: 0; font-size: 15.5px; color: var(--mute); line-height: 1.5; }

/* ===================== FAQ ===================== */
.faq { padding: clamp(56px, 8vw, 96px) var(--gutter); width: 100%; max-width: 1000px; margin: 0 auto; }
.landing > .faq { max-width: none; padding-left: max(var(--gutter), calc((100% - 1000px) / 2)); padding-right: max(var(--gutter), calc((100% - 1000px) / 2)); }
.faq h2 { text-align: center; margin-bottom: 28px; }
.faq details { background: var(--raised); margin-bottom: 8px; }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 22px 64px 22px 26px; font-size: clamp(18px, 2vw, 24px); font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: #414141; }
.faq summary::after {
  content: ""; position: absolute; right: 26px; top: 50%; width: 22px; height: 22px; margin-top: -11px;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
  transition: transform 0.25s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 22px 26px 26px; border-top: 1px solid var(--black); font-size: clamp(17px, 1.8vw, 21px); line-height: 1.55; color: #e5e5e5; }
.final-cta { text-align: center; margin-top: 40px; }

/* ===================== FOOTER ===================== */
.site-footer { margin-top: auto; padding: 48px var(--gutter) 56px; color: var(--dim); }
.disclaimer { max-width: 900px; margin: 0 auto 18px; font-size: 13.5px; line-height: 1.6; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; font-size: 14px; }
.footer-links a { color: var(--mute); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.footer-links a:hover { color: var(--white); }

/* ===================== PLAYER (STATO 2) ===================== */
body.state-app .landing { display: none; }
body:not(.state-app) .app { display: none; }
body.state-app { background: var(--surface); }
body.state-app .nav { background: var(--black); }
.landing, .app { transition: opacity 0.4s ease; }
.fade-out, .fade-in-start { opacity: 0; }

.app { padding: 68px 0 32px; }
.player-stage {
  position: relative; width: 100%; background: var(--black);
  aspect-ratio: 16 / 9; max-height: calc(100vh - 68px - 92px);
  overflow: hidden;
}
.player-stage:fullscreen { max-height: none; height: 100%; }
.player-stage > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--black); }
.hidden-v { visibility: hidden; z-index: 1; }
.active-v { visibility: visible; z-index: 2; }

.stage-controls { position: absolute; top: 16px; right: 16px; z-index: 20; display: flex; gap: 8px; }
.ctrl {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 36px; padding: 0 12px;
  background: rgba(0,0,0,0.55); color: var(--white); border: 1px solid rgba(255,255,255,0.35); border-radius: 4px;
  font-weight: 800; font-size: 13px; cursor: pointer;
}
.ctrl:hover { background: rgba(0,0,0,0.8); border-color: var(--white); }
.ctrl[aria-pressed="true"] { background: var(--white); color: var(--black); border-color: var(--white); }

.idle-backdrop {
  position: absolute; inset: 0; z-index: 8;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 24px var(--gutter);
  background:
    radial-gradient(ellipse 80% 70% at 50% 40%, rgba(229,9,20,0.10) 0%, transparent 60%),
    linear-gradient(180deg, #0a0a0a 0%, #000 100%);
}
.picker { width: 100%; max-width: 760px; }
.picker-title {
  margin: 0 0 20px; text-align: center;
  font-weight: 900; font-stretch: 112%; font-size: clamp(26px, 3.6vw, 44px); letter-spacing: -0.02em; line-height: 1.05;
}
.source-tabs { display: flex; justify-content: center; gap: 4px; margin-bottom: 16px; }
.tab-btn {
  background: none; border: 0; color: var(--mute); cursor: pointer;
  padding: 8px 14px; font-size: 15px; font-weight: 700;
  border-bottom: 3px solid transparent;
}
.tab-btn:hover { color: var(--white); }
.tab-btn.active { color: var(--white); border-bottom-color: var(--red); }
.picker-row { display: flex; gap: 10px; align-items: stretch; }
.source-box { flex: 1; display: flex; gap: 10px; min-width: 0; }
.picker input[type="text"] {
  width: 100%; min-width: 0; padding: 14px 16px; font-size: 17px;
  background: rgba(22,22,22,0.85); color: var(--white);
  border: 1px solid rgba(128,128,128,0.7); border-radius: 4px; outline: none;
}
.picker input[type="text"]:focus { border-color: var(--white); }
.file-pick {
  flex: 1; display: flex; align-items: center; justify-content: center; cursor: pointer;
  padding: 14px 16px; border: 1px dashed rgba(128,128,128,0.8); border-radius: 4px; color: var(--mute); font-size: 16px;
  background: rgba(22,22,22,0.85);
}
.file-pick:hover { border-color: var(--white); color: var(--white); }
.file-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.form-error { margin: 12px 0 0; color: #ff6f6f; font-size: 15px; text-align: center; }

.loading { text-align: center; max-width: 560px; }
.loading-title { margin: 0 0 6px; font-weight: 800; font-size: clamp(20px, 2.4vw, 28px); }
.loading-sub { margin: 0; color: var(--mute); font-size: 16px; }
.spinner { width: 54px; height: 54px; margin: 0 auto 20px; border-radius: 50%; border: 4px solid rgba(229,9,20,0.25); border-top-color: var(--red); animation: spin 0.9s linear infinite; display: none; }
.spinner.on { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { width: min(360px, 80%); height: 4px; margin: 18px auto 0; background: rgba(255,255,255,0.15); overflow: hidden; border-radius: 2px; }
.progress span { display: block; height: 100%; width: 0; background: var(--red); transition: width 0.6s ease; }

.subtitle-overlay { position: absolute; bottom: 9%; left: 8%; right: 8%; z-index: 15; text-align: center; pointer-events: none; }
.subtitle-text {
  display: inline-block; background: rgba(0,0,0,0.75); color: var(--white);
  font-size: clamp(16px, 2.2vw, 30px); font-weight: 600; line-height: 1.3; padding: 6px 16px; border-radius: 3px;
}

/* Pre-roll */
.preroll { position: absolute; inset: 0; z-index: 30; background: var(--black); }
.preroll video { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.ad-label { position: absolute; left: 16px; bottom: 16px; font-size: 13px; font-weight: 800; background: #f5c518; color: #000; padding: 3px 8px; border-radius: 3px; }
.ad-badge {
  position: absolute; top: 16px; right: 16px; max-width: min(380px, 70%);
  background: rgba(0,0,0,0.78); border-left: 3px solid var(--red);
  padding: 10px 14px; border-radius: 3px; font-size: 14px; line-height: 1.45; color: #e5e5e5;
}
.ad-badge b { color: var(--white); }
.ad-badge .mini-progress { height: 3px; background: rgba(255,255,255,0.15); margin-top: 8px; overflow: hidden; }
.ad-badge .mini-progress span { display: block; height: 100%; background: var(--ok); transition: width 0.6s; }
.ad-skip, .ad-unmute {
  position: absolute; right: 16px; background: rgba(0,0,0,0.75); color: var(--white);
  border: 1px solid rgba(255,255,255,0.5); border-radius: 3px; padding: 10px 18px; font-weight: 700; cursor: pointer; font-size: 15px;
}
.ad-skip { bottom: 16px; }
.ad-unmute { bottom: 68px; padding: 8px 12px; }

.engine-lost {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 40;
  background: var(--surface); border-left: 4px solid var(--red); padding: 18px 22px; border-radius: 4px;
  display: flex; flex-direction: column; gap: 6px; max-width: 380px; font-size: 15px;
}
.engine-lost span { color: var(--mute); }

/* Barra sotto il player */
.now-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px var(--gutter); min-height: 76px; }
.now-info { min-width: 0; }
.now-title { margin: 0; font-weight: 800; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-stats { margin: 2px 0 0; font-size: 14px; color: var(--mute); }

.row-title { margin: 0 0 12px; font-size: 20px; font-weight: 800; }
.settings, .playlist-row { padding: 8px var(--gutter) 24px; }
.settings-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.field-label { display: block; font-size: 13px; color: var(--mute); margin-bottom: 6px; }
.settings select {
  width: 100%; padding: 11px 12px; background: var(--raised); color: var(--white);
  border: 1px solid transparent; border-radius: 4px; font-size: 15px; outline: none; cursor: pointer;
}
.settings select:focus { border-color: var(--white); }

/* Playlist come fila di riquadri */
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.row-head input {
  max-width: 260px; width: 100%; padding: 8px 12px; background: var(--black); color: var(--white);
  border: 1px solid #444; border-radius: 4px; font-size: 14px; outline: none;
}
.row-head input:focus { border-color: var(--white); }
.ch-list {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 16%);
  gap: 8px; overflow-x: auto; padding: 4px 0 14px; scroll-snap-type: x proximity;
  scrollbar-color: #555 transparent;
}
.ch-item {
  scroll-snap-align: start;
  aspect-ratio: 16 / 9; border: 0; border-radius: 4px; cursor: pointer; text-align: left;
  padding: 10px 12px; display: flex; align-items: flex-end;
  color: var(--white); font-weight: 700; font-size: 14px; line-height: 1.25;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.85) 100%), var(--tile-bg, var(--raised));
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden; word-break: break-word;
}
.ch-item:hover, .ch-item:focus-visible { transform: scale(1.04); box-shadow: 0 0 0 2px var(--white); z-index: 1; }
.ch-item.selected { box-shadow: 0 0 0 3px var(--red); }
.ch-empty { padding: 12px 0; color: var(--mute); font-size: 15px; }

/* Banner */
.ad-slot { display: flex; justify-content: center; align-items: center; overflow: hidden; }
.ad-slot-sidebar { margin: 8px var(--gutter) 0; }
.ad-slot img { max-width: 100%; height: auto; display: block; border-radius: 4px; }
.ad-slot iframe { border: 0; max-width: 100%; }
.house-ad {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none;
  width: 100%; max-width: 520px; padding: 16px 20px; border-radius: 4px; background: var(--raised); border-left: 4px solid #f5c518;
}
.house-ad strong { font-size: 16px; }
.house-ad span { font-size: 14px; color: var(--mute); }
a.house-ad:hover { background: #2c2c2c; }
.ad-slot-pause { width: 100%; max-width: 520px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 960px) {
  .feature { grid-template-columns: 1fr; text-align: center; }
  .feature p { margin: 0 auto; }
  .feature-flip .feature-text { order: 0; }
  .step-row { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-stage { max-height: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { height: 60px; }
  .brand-word { font-size: 18px; }
  .nav-link { display: none; }
  .hero { padding-top: 100px; min-height: 92vh; }
  .wall { min-width: 900px; grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .tile-cap { font-size: 11px; }
  .hero-shade { background: linear-gradient(180deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.74) 50%, rgba(0,0,0,0.95) 100%); }
  .hero-actions .btn { width: 100%; }
  .btn-lg { font-size: 18px; padding: 14px 20px; }
  .waiting { flex-direction: column; gap: 12px; }
  .faq summary { padding: 18px 54px 18px 18px; }
  .faq summary::after { right: 18px; width: 18px; height: 18px; margin-top: -9px; }
  .faq details p { padding: 18px; }
  .app { padding-top: 60px; }
  .picker-row { flex-direction: column; }
  .picker-title { margin-bottom: 12px; }
  .source-tabs { margin-bottom: 10px; }
  .tab-btn { padding: 6px 8px; font-size: 14px; }
  .player-stage { aspect-ratio: auto; min-height: 380px; }
  .ad-slot-pause { display: none !important; }
  .ad-badge { font-size: 12px; padding: 7px 10px; top: 10px; right: 10px; max-width: 78%; }
  .stage-controls { top: 10px; left: 10px; right: auto; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .ch-list { grid-auto-columns: 46%; }
  .row-head { flex-direction: column; align-items: stretch; gap: 0; }
  .row-head input { max-width: none; margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
