/*
 * Bopster TV (receiver.html + bigscreen.html): js/tv/tv-core.js builds the frame,
 * js/tv/tv-show.js the scenes. Everything inside #tvStage is laid out on a fixed
 * 1920x1080 canvas that fitStage() scales to the screen, so px here are "1080p px"
 * on every TV. Read from across the room: body copy never under 30px.
 *
 * body.tv-lite (Chromecast, smart TVs, slow screens): no blur, no moving orbs,
 * lighter shadows. Never use backdrop-filter outside a tv-lite override.
 */
:root {
    --tv-bg: #0b0718;
    --tv-ink: #ffffff;
    --tv-soft: rgba(255, 255, 255, .72);
    --tv-faint: rgba(255, 255, 255, .5);
    --tv-line: rgba(255, 255, 255, .14);
    --tv-panel: rgba(23, 14, 48, .78);
    --tv-panel-2: rgba(38, 22, 76, .82);
    --tv-violet: #a78bfa;
    --tv-pink: #f472b6;
    --tv-cyan: #22d3ee;
    --tv-gold: #facc15;
    --tv-green: #4ade80;
    --tv-grad: linear-gradient(100deg, #f472b6 0%, #c084fc 45%, #22d3ee 100%);
    --tv-spring: cubic-bezier(.34, 1.56, .64, 1);
    --tv-ease: cubic-bezier(.22, 1, .36, 1);
    --rail-w: 440px;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: var(--tv-bg); }
body.tv-app {
    color: var(--tv-ink);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- backdrop + video */
#tvBackdrop { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #2a1258 0%, #120a2a 48%, #07040f 100%); }
.tv-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: tvOrb 26s ease-in-out infinite alternate; }
.tv-orb-a { width: 60vmax; height: 60vmax; left: -18vmax; top: -22vmax; background: #7c3aed; }
.tv-orb-b { width: 48vmax; height: 48vmax; right: -16vmax; bottom: -20vmax; background: #db2777; animation-delay: -9s; }
.tv-orb-c { width: 34vmax; height: 34vmax; right: 18vmax; top: -12vmax; background: #0891b2; opacity: .35; animation-delay: -17s; }
.tv-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 72px 72px; mask-image: radial-gradient(80% 70% at 50% 40%, #000 30%, transparent 85%); -webkit-mask-image: radial-gradient(80% 70% at 50% 40%, #000 30%, transparent 85%); }
@keyframes tvOrb { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); } }
body.tv-lite .tv-orb { animation: none; filter: none; opacity: .28; background: radial-gradient(closest-side, currentColor, transparent); }
body.tv-lite .tv-orb-a { color: #7c3aed; } body.tv-lite .tv-orb-b { color: #db2777; } body.tv-lite .tv-orb-c { color: #0891b2; }

#youtubePlayerContainer { position: fixed; inset: 0; opacity: 0; pointer-events: none; transition: opacity 1.2s ease; z-index: 1; }
#youtubePlayerContainer.video-visible { opacity: 1; }
#youtubePlayerContainer iframe, #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Over the video the stage keeps a dark scrim so the copy stays readable. */
#tvScrim { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; background: linear-gradient(90deg, rgba(8,4,20,.88) 0%, rgba(8,4,20,.55) 50%, rgba(8,4,20,.82) 100%); }
body.tv-video #tvScrim { opacity: 1; }

/* ---------------------------------------------------------------- stage */
#tvViewport { position: fixed; inset: 0; z-index: 3; overflow: hidden; }
#tvStage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
/* "Hide the UI" in Live: only the music video stays, so its scrim goes too. */
body.tv-ui-hidden #tvStage, body.tv-ui-hidden #tvScrim { opacity: 0; transition: opacity .6s ease; }

.tv-top { position: absolute; left: 56px; right: 56px; top: 34px; height: 92px; display: flex; align-items: center; gap: 32px; z-index: 20; }
.tv-brand { height: 64px; width: auto; filter: drop-shadow(0 6px 18px rgba(0,0,0,.4)); }
.tv-progress { display: flex; align-items: center; gap: 18px; padding: 12px 26px 12px 22px; border-radius: 999px; background: var(--tv-panel); border: 1px solid var(--tv-line); position: relative; overflow: hidden; }
.tv-progress-round { font-size: 30px; font-weight: 900; letter-spacing: -.01em; }
.tv-progress-phase { font-size: 26px; font-weight: 700; color: var(--tv-cyan); padding-left: 18px; border-left: 2px solid var(--tv-line); }
.tv-progress-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.08); display: none; }
.tv-progress.has-bar .tv-progress-bar { display: block; }
.tv-progress-bar i { display: block; height: 100%; background: var(--tv-grad); transition: width .8s var(--tv-ease); }
.tv-top-right { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.tv-now { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-radius: 999px; background: var(--tv-panel); border: 1px solid var(--tv-line); font-size: 24px; font-weight: 700; color: var(--tv-soft); }
.tv-eq { display: inline-flex; align-items: flex-end; gap: 4px; height: 26px; }
.tv-eq i { width: 6px; border-radius: 3px; background: var(--tv-grad); animation: tvEq 1s ease-in-out infinite; }
.tv-eq i:nth-child(2) { animation-delay: -.3s; } .tv-eq i:nth-child(3) { animation-delay: -.6s; } .tv-eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes tvEq { 0%, 100% { height: 6px; } 50% { height: 26px; } }
.tv-join { display: flex; align-items: center; gap: 16px; padding: 8px 22px 8px 8px; border-radius: 22px; background: var(--tv-panel); border: 1px solid var(--tv-line); }
.tv-join canvas { width: 96px; height: 96px; border-radius: 14px; background: #fff; display: block; }
.tv-join-copy { display: flex; flex-direction: column; line-height: 1.1; }
.tv-join-copy small { font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tv-faint); }
.tv-join-copy b { font-size: 40px; font-weight: 900; letter-spacing: .08em; }
.tv-join-copy span { font-size: 18px; color: var(--tv-soft); }
#statusIndicator { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; font-size: 18px; font-weight: 700; color: var(--tv-faint); }
#statusIndicator .tv-dot { width: 12px; height: 12px; border-radius: 50%; background: #f87171; box-shadow: 0 0 0 4px rgba(248,113,113,.2); }
#statusIndicator.is-connected .tv-dot { background: var(--tv-green); box-shadow: 0 0 0 4px rgba(74,222,128,.18); }
/* Once connected the label goes; the dot stays as a quiet "we're live". */
#statusIndicator.is-connected #statusText { display: none; }

/* ---------------------------------------------------------------- scenes */
#tvScenes { position: absolute; left: 56px; right: 56px; top: 150px; bottom: 210px; z-index: 5; transition: right .6s var(--tv-ease); }
body.has-rail #tvScenes { right: calc(56px + var(--rail-w) + 40px); }
body[data-tv-scene="lobby"] #tvScenes, body[data-tv-scene="standings"] #tvScenes, body[data-tv-scene="final"] #tvScenes, body[data-tv-scene="idle"] #tvScenes, body[data-tv-scene="rules"] #tvScenes { bottom: 190px; }
body.tv-host-off #tvScenes { bottom: 56px; }
.tv-scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translateY(26px) scale(.985); transition: opacity .55s var(--tv-ease), transform .7s var(--tv-ease), visibility 0s linear .55s; }
.tv-scene.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .55s var(--tv-ease) .12s, transform .7s var(--tv-ease) .12s, visibility 0s; }

.tv-kicker { display: inline-flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--tv-cyan); }
.tv-h1 { margin: 10px 0 0; font-size: 84px; line-height: 1.02; font-weight: 900; letter-spacing: -.025em; text-wrap: balance; }
.tv-lead { margin: 18px 0 0; font-size: 34px; line-height: 1.3; color: var(--tv-soft); font-weight: 500; max-width: 1100px; text-wrap: pretty; }
.tv-live-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--tv-pink); box-shadow: 0 0 0 0 rgba(244,114,182,.7); animation: tvPulse 1.6s infinite; }
@keyframes tvPulse { 70% { box-shadow: 0 0 0 16px rgba(244,114,182,0); } 100% { box-shadow: 0 0 0 0 rgba(244,114,182,0); } }

.tv-chips { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.tv-chip { display: inline-flex; align-items: center; gap: 12px; padding: 12px 22px; border-radius: 999px; background: var(--tv-panel-2); border: 1px solid var(--tv-line); font-size: 28px; font-weight: 700; }
.tv-chip i { font-style: normal; font-size: 30px; }
.tv-chip--label { background: none; border: 0; padding-left: 0; color: var(--tv-faint); text-transform: uppercase; letter-spacing: .1em; font-size: 22px; }
.tv-chip--label i { display: none; }

/* Avatars: initials on the player's own hue (the phones use the same one). */
.tv-av { --h: 280; flex: none; display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-size: 22px; font-weight: 900; color: #120a26; background: linear-gradient(135deg, hsl(var(--h) 85% 76%), hsl(calc(var(--h) + 28) 80% 62%)); box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.tv-av--sm { width: 40px; height: 40px; font-size: 16px; }
.tv-av--lg { width: 80px; height: 80px; font-size: 32px; }
.tv-av--xl { width: 120px; height: 120px; font-size: 46px; box-shadow: 0 0 0 5px rgba(255,255,255,.18), 0 16px 34px rgba(0,0,0,.35); }
.tv-av--xxl { width: 260px; height: 260px; font-size: 100px; box-shadow: 0 0 0 8px rgba(255,255,255,.2), 0 0 120px hsl(var(--h) 90% 60% / .55); }

/* ---------------------------------------------------------------- the card */
#tvParking { position: absolute; width: 0; height: 0; overflow: hidden; }
.tv-card-slot { position: relative; display: grid; place-items: center; }
.tv-card-slot--big .flip-card { width: 560px; height: 560px; }
.tv-card-slot--reveal .flip-card { width: 320px; height: 320px; }
.flip-card { position: relative; flex: none; width: 360px; height: 360px; perspective: 1600px; animation: tvCardIdle 7s ease-in-out infinite; }
.flip-card.is-empty { display: none; }
@keyframes tvCardIdle { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-14px) rotate(1deg); } }
.flip-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1s var(--tv-spring); }
.flip-card.flip .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 15px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background-size: cover; background-position: center; border-radius: 32px; border: 1px solid rgba(255,255,255,.2); box-shadow: 0 40px 90px rgba(0,0,0,.6), 0 0 80px rgba(167,139,250,.25); }
.flip-card-front::after, .flip-card-back::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(128deg, rgba(255,255,255,.22) 0%, transparent 26%, transparent 70%, rgba(255,255,255,.06) 100%); }
.flip-card-back { transform: rotateY(180deg); color: #0b0d1a; }
#cardTextContainer p { margin: 0; padding: 0; line-height: 1.2; }
#qrCanvas { max-width: 100%; height: auto; border-radius: 8px; }
.shape-layer { position: absolute; display: none; z-index: 5; pointer-events: none; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; font-family: 'Inter', sans-serif; line-height: 1; }
.custom-design-layout { display: block !important; padding: 0 !important; }
/* Never transition transform on the card text: it carries the saved X/Y and italic. */
#qrCanvas, #songTitle, #songYear, #songArtist { position: relative; z-index: 10; transition: opacity .3s ease, color .2s ease; }
body.tv-lite .flip-card-front, body.tv-lite .flip-card-back { box-shadow: 0 24px 50px rgba(0,0,0,.55); }

/* ---------------------------------------------------------------- Bopstarr, the host */
#tvHost { position: absolute; left: 40px; bottom: 26px; height: 190px; right: calc(56px + var(--rail-w) + 40px); display: flex; align-items: flex-end; gap: 6px; z-index: 15; pointer-events: none; transition: opacity .5s ease, transform .5s var(--tv-ease); }
body:not(.has-rail) #tvHost { right: 56px; }
body.tv-host-off #tvHost { opacity: 0; transform: translateY(40px); }
.tv-host-dj { flex: none; width: 210px; height: 210px; margin-bottom: -18px; filter: drop-shadow(0 18px 26px rgba(10,0,40,.6)); animation: tvBob 2.6s ease-in-out infinite; }
.tv-host-dj img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tv-host-dj.hop { animation: tvHop .6s var(--tv-spring), tvBob 2.6s ease-in-out .6s infinite; }
@keyframes tvBob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@keyframes tvHop { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-36px) scale(1.06, .94); } 70% { transform: translateY(4px) scale(.96, 1.05); } 100% { transform: translateY(0) scale(1); } }
.tv-bubble { position: relative; margin-bottom: 52px; max-width: 1080px; padding: 22px 34px 24px; border-radius: 30px 30px 30px 8px; background: #fff; color: #1b0f3a; box-shadow: 0 18px 40px rgba(0,0,0,.35); opacity: 0; transform: translateY(14px) scale(.96); transform-origin: 0 100%; }
.tv-bubble.has-line { opacity: 1; transform: none; transition: opacity .35s ease, transform .45s var(--tv-spring); }
.tv-bubble.pop { animation: tvBubble .5s var(--tv-spring); }
@keyframes tvBubble { 0% { transform: translateY(14px) scale(.92); opacity: .4; } 100% { transform: none; opacity: 1; } }
.tv-bubble b { display: block; font-size: 18px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; background: var(--tv-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tv-bubble p { margin: 4px 0 0; font-size: 34px; line-height: 1.22; font-weight: 800; text-wrap: balance; }
.tv-bubble::before { content: ""; position: absolute; left: -16px; bottom: 6px; border: 16px solid transparent; border-right-color: #fff; border-bottom-color: #fff; border-radius: 0 0 4px 0; }

/* ---------------------------------------------------------------- rail (leaderboard) */
#tvRail { position: absolute; right: 56px; top: 150px; bottom: 40px; width: var(--rail-w); z-index: 10; padding: 26px 24px; border-radius: 34px; background: var(--tv-panel); border: 1px solid var(--tv-line); box-shadow: 0 30px 70px rgba(0,0,0,.35); animation: tvRailIn .7s var(--tv-ease); overflow: hidden; }
@keyframes tvRailIn { from { opacity: 0; transform: translateX(40px); } }
.tv-rail-title { margin: 0 6px 16px; font-size: 22px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; color: var(--tv-faint); }
.tv-rail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tv-rail-row { position: relative; display: grid; grid-template-columns: 34px 56px 1fr auto; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; border-radius: 22px; background: rgba(255,255,255,.05); border: 2px solid transparent; transition: background .4s ease, border-color .4s ease; }
.tv-rail-rank { font-size: 26px; font-weight: 900; color: var(--tv-faint); text-align: center; }
.tv-rail-row:first-child .tv-rail-rank { color: var(--tv-gold); }
.tv-rail-name { min-width: 0; display: flex; flex-direction: column; font-size: 28px; font-weight: 800; line-height: 1.12; overflow: hidden; }
.tv-rail-name em { font-style: normal; font-size: 14px; font-weight: 900; letter-spacing: .1em; color: var(--tv-gold); }
.tv-rail-name small { font-size: 18px; font-weight: 700; color: var(--tv-soft); }
.tv-rail-name { white-space: nowrap; text-overflow: ellipsis; }
.tv-rail-score { font-size: 38px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tv-rail-row.is-turn { background: rgba(34,211,238,.14); border-color: var(--tv-cyan); }
.tv-rail-row.is-turn small { color: var(--tv-cyan); }
.tv-rail-row.is-locked small { color: var(--tv-green); }
.tv-rail-row.is-locked small::before { content: "🔒 "; }
.tv-rail-row.is-best { background: rgba(250,204,21,.14); border-color: var(--tv-gold); }
.tv-rail-row.is-best small { color: var(--tv-gold); }
.tv-rail-row.is-away { opacity: .55; }
.tv-gain { position: absolute; right: -6px; top: -12px; font-style: normal; font-size: 22px; font-weight: 900; padding: 4px 12px; border-radius: 999px; background: var(--tv-green); color: #062012; animation: tvGain 1s var(--tv-spring); }
@keyframes tvGain { from { transform: translateY(16px) scale(.4); opacity: 0; } }
.tv-rail-more { margin: 14px 8px 0; font-size: 22px; color: var(--tv-faint); font-weight: 700; }

/* ---------------------------------------------------------------- idle */
[data-scene="idle"] { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.tv-idle-dj, .tv-final-dj { width: 440px; height: 440px; filter: drop-shadow(0 30px 40px rgba(10,0,40,.6)); animation: tvBob 3s ease-in-out infinite; }
.tv-idle-dj img, .tv-final-dj img, .tv-idle-dj bopstarr-3d, .tv-final-dj bopstarr-3d { width: 100%; height: 100%; object-fit: contain; display: block; }
.tv-idle-dj bopstarr-3d img, .tv-final-dj bopstarr-3d img { width: 100%; height: 100%; object-fit: contain; }
[data-scene="idle"] .tv-lead { margin-inline: auto; }

/* ---------------------------------------------------------------- lobby */
[data-scene="lobby"] { display: grid; grid-template-columns: 520px 1fr; gap: 72px; align-items: start; padding-top: 10px; }
.tv-lobby-join { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.tv-lobby-qr { padding: 26px; border-radius: 44px; background: #fff; box-shadow: 0 40px 90px rgba(0,0,0,.5), 0 0 0 10px rgba(167,139,250,.25); animation: tvQr 4s ease-in-out infinite; }
@keyframes tvQr { 0%, 100% { box-shadow: 0 40px 90px rgba(0,0,0,.5), 0 0 0 10px rgba(167,139,250,.25); } 50% { box-shadow: 0 40px 90px rgba(0,0,0,.5), 0 0 0 22px rgba(244,114,182,.18); } }
.tv-lobby-qr canvas { display: block; width: 400px; height: 400px; }
.tv-lobby-code { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.tv-lobby-code small { font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--tv-faint); }
.tv-lobby-code b { font-size: 92px; font-weight: 900; letter-spacing: .12em; padding: .04em .1em .06em; background: var(--tv-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tv-lobby-code span { font-size: 28px; color: var(--tv-soft); font-weight: 600; }
.tv-lobby-room { min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.tv-lobby-players { display: flex; flex-wrap: wrap; gap: 26px 30px; margin-top: 40px; min-height: 200px; align-content: flex-start; }
.tv-lobby-player { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 150px; text-align: center; }
.tv-lobby-player b { font-size: 26px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-lobby-player em { margin-top: -6px; font-style: normal; font-size: 14px; font-weight: 900; letter-spacing: .1em; color: var(--tv-gold); }
.tv-lobby-player.is-new { animation: tvJoin .9s var(--tv-spring); }
.tv-lobby-player.is-away { opacity: .5; }
@keyframes tvJoin { 0% { transform: scale(.2) translateY(60px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.tv-lobby-ghost { display: flex; gap: 30px; }
.tv-lobby-ghost span { width: 120px; height: 120px; border-radius: 50%; border: 4px dashed rgba(255,255,255,.18); animation: tvGhost 2.4s ease-in-out infinite; }
.tv-lobby-ghost span:nth-child(2) { animation-delay: .3s; } .tv-lobby-ghost span:nth-child(3) { animation-delay: .6s; } .tv-lobby-ghost span:nth-child(4) { animation-delay: .9s; }
@keyframes tvGhost { 50% { border-color: rgba(167,139,250,.6); transform: scale(1.05); } }
.tv-lobby-rules { margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--tv-line); }
.tv-lobby-rules-title { font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--tv-faint); }
.tv-lobby-rules .tv-chips { margin-top: 16px; }

/* ---------------------------------------------------------------- rules */
[data-scene="rules"] { display: flex; flex-direction: column; align-items: center; text-align: center; }
.tv-rules-track { position: relative; flex: 1; width: 100%; margin-top: 20px; }
.tv-rule { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transform: translateX(120px); transition: opacity .6s var(--tv-ease), transform .8s var(--tv-ease); }
.tv-rule.is-on { opacity: 1; transform: none; }
.tv-rule.is-past { transform: translateX(-120px); }
.tv-rule-icon { display: grid; place-items: center; width: 220px; height: 220px; border-radius: 60px; font-size: 120px; background: linear-gradient(145deg, rgba(167,139,250,.35), rgba(34,211,238,.18)); border: 1px solid var(--tv-line); box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.tv-rule.is-on .tv-rule-icon { animation: tvRuleIcon .9s var(--tv-spring); }
@keyframes tvRuleIcon { from { transform: scale(.4) rotate(-12deg); } }
.tv-rule-num { margin-top: -30px; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--tv-grad); color: #160a30; font-size: 32px; font-weight: 900; box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.tv-rule h2 { margin: 30px 0 0; font-size: 92px; font-weight: 900; letter-spacing: -.025em; line-height: 1; }
.tv-rule p { margin: 22px 0 0; max-width: 1240px; font-size: 40px; line-height: 1.3; color: var(--tv-soft); font-weight: 600; text-wrap: balance; }
.tv-rule .tv-rule-extra { margin-top: 18px; font-size: 32px; color: var(--tv-gold); font-weight: 800; }
.tv-rules-dots { display: flex; gap: 14px; margin-top: 10px; }
.tv-rules-dots i { width: 60px; height: 10px; border-radius: 5px; background: rgba(255,255,255,.15); transition: background .4s ease; }
.tv-rules-dots i.is-on { background: var(--tv-grad); }

/* ---------------------------------------------------------------- listen */
[data-scene="listen"] { display: grid; grid-template-columns: auto 1fr; gap: 80px; align-items: center; }
.tv-listen-copy { min-width: 0; }
.tv-bigeq { display: flex; align-items: flex-end; gap: 10px; height: 110px; margin-top: 48px; opacity: .35; transition: opacity .5s ease; }
.tv-bigeq i { flex: none; width: 18px; height: 16px; border-radius: 9px; background: var(--tv-grad); background-size: 100% 110px; background-position: bottom; }
[data-scene="listen"].is-playing .tv-bigeq { opacity: 1; }
[data-scene="listen"].is-playing .tv-bigeq i { animation: tvBigEq 1.1s ease-in-out infinite; }
.tv-bigeq i:nth-child(3n) { animation-delay: -.35s !important; } .tv-bigeq i:nth-child(3n+1) { animation-delay: -.7s !important; } .tv-bigeq i:nth-child(4n) { animation-duration: .8s !important; }
@keyframes tvBigEq { 0%, 100% { height: 16px; } 50% { height: 110px; } }

/* ---------------------------------------------------------------- beat */
[data-scene="beat"] { --beat-period: .5s; display: grid; grid-template-columns: 460px 1fr; gap: 70px; align-items: center; }
.tv-beat-ring { position: relative; width: 460px; height: 460px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(closest-side, rgba(167,139,250,.28), rgba(23,14,48,.6)); }
.tv-beat-ring span { position: absolute; inset: 0; border-radius: 50%; border: 6px solid rgba(34,211,238,.5); animation: tvRing 1.6s ease-out infinite; }
.tv-beat-ring span + span { animation-delay: .8s; border-color: rgba(244,114,182,.5); }
.tv-beat-ring b { font-size: 180px; line-height: 1.1; padding: 0 .08em; font-weight: 900; font-variant-numeric: tabular-nums; background: var(--tv-grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: tvBob 1.6s ease-in-out infinite; }
.tv-beat-ring small { font-size: 30px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--tv-soft); }
[data-scene="beat"].is-result .tv-beat-ring span { animation-duration: calc(var(--beat-period) * 2); }
[data-scene="beat"].is-result .tv-beat-ring b { animation: tvBeatBop var(--beat-period) ease-in-out infinite; }
@keyframes tvRing { from { transform: scale(.55); opacity: 1; } to { transform: scale(1.05); opacity: 0; } }
@keyframes tvBeatBop { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-18px) scale(1.04, .97); } }
.tv-beat-players { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 36px; }
.tv-beat-player { display: inline-flex; align-items: center; gap: 12px; padding: 10px 22px 10px 10px; border-radius: 999px; background: rgba(255,255,255,.07); border: 2px solid transparent; font-size: 28px; opacity: .55; transition: all .4s ease; }
.tv-beat-player.is-done { opacity: 1; border-color: rgba(74,222,128,.5); }
.tv-beat-player.is-top { border-color: var(--tv-gold); background: rgba(250,204,21,.14); }
.tv-beat-player small { font-size: 22px; color: var(--tv-soft); }
.tv-beat-player em { font-style: normal; font-weight: 900; color: var(--tv-green); }

/* ---------------------------------------------------------------- guess + timeline */
[data-scene="guess"] { display: flex; flex-direction: column; }
.tv-guess-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; }
.tv-turn { display: flex; align-items: center; gap: 20px; padding: 18px 34px 18px 18px; border-radius: 999px; background: rgba(34,211,238,.13); border: 2px solid rgba(34,211,238,.6); flex: none; }
.tv-turn b { display: block; font-size: 38px; font-weight: 900; }
.tv-turn small { display: block; font-size: 22px; font-weight: 700; color: var(--tv-soft); }
.tv-turn.pop { animation: tvBubble .55s var(--tv-spring); }
.tv-turn.is-done { background: rgba(250,204,21,.12); border-color: rgba(250,204,21,.6); padding-left: 30px; }
.tv-turn-drum { font-size: 60px; animation: tvDrum .26s ease-in-out infinite alternate; }
@keyframes tvDrum { from { transform: rotate(-8deg); } to { transform: rotate(8deg) translateY(-4px); } }

.tv-timeline { position: relative; flex: 1; min-height: 360px; margin-top: 20px; }
[data-scene="guess"] .tv-timeline { margin-bottom: 24px; }
.tv-tl-axis { position: absolute; left: 30px; right: 30px; bottom: 70px; height: 12px; border-radius: 6px; background: linear-gradient(90deg, rgba(244,114,182,.5), rgba(167,139,250,.5), rgba(34,211,238,.5)); }
.tv-tl-tick { position: absolute; left: var(--x); top: -10px; width: 4px; height: 32px; margin-left: -2px; border-radius: 2px; background: rgba(255,255,255,.4); }
.tv-tl-tick b { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); font-size: 28px; font-weight: 800; color: var(--tv-faint); }
.tv-tl-pins { position: absolute; left: 30px; right: 30px; top: 0; bottom: 82px; z-index: 2; }
.tv-pin { --lvl: 0; position: absolute; left: var(--x); bottom: 0; display: flex; flex-direction: column; align-items: center; transform: translateX(-50%); transition: left .8s var(--tv-ease), opacity .5s ease; z-index: calc(10 - var(--lvl)); }
.tv-pin-stem { order: 3; width: 4px; height: calc(30px + var(--lvl) * 78px); border-radius: 2px; background: hsl(var(--h) 85% 70%); box-shadow: 0 0 14px hsl(var(--h) 90% 60% / .6); }
.tv-pin-year, .tv-pin-who { order: 1; }
.tv-pin-who { order: 2; display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 4px 14px 4px 4px; border-radius: 999px; background: rgba(12,6,30,.86); border: 2px solid hsl(var(--h) 85% 70%); }
.tv-pin-who b { font-size: 22px; font-weight: 800; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-pin-year { font-size: 40px; font-weight: 900; line-height: 1; color: hsl(var(--h) 90% 80%); text-shadow: 0 4px 14px rgba(0,0,0,.5); }
.tv-pin em { order: 0; font-style: normal; font-size: 22px; font-weight: 900; padding: 2px 12px; border-radius: 999px; margin-bottom: 6px; background: rgba(255,255,255,.12); }
.tv-pin.is-new { animation: tvPinDrop .9s var(--tv-spring); }
@keyframes tvPinDrop { 0% { transform: translate(-50%, -220px); opacity: 0; } 60% { opacity: 1; } 100% { transform: translate(-50%, 0); } }
.tv-pin.is-dim { opacity: .45; }
.tv-pin.is-best .tv-pin-who { border-color: var(--tv-gold); box-shadow: 0 0 30px rgba(250,204,21,.6); }
.tv-pin.is-best em { background: var(--tv-gold); color: #241800; }
/* The marker uses the same percentage as the pins, measured over the axis width. */
.tv-tl-answer { position: absolute; left: 30px; right: 30px; top: 0; bottom: 64px; pointer-events: none; z-index: 1; }
.tv-tl-answer b { position: absolute; left: var(--x); top: calc(100% - 8px); transform: translateX(-50%); padding: 10px 26px; border-radius: 22px; background: var(--tv-gold); color: #241800; font-size: 52px; font-weight: 900; box-shadow: 0 0 60px rgba(250,204,21,.7); z-index: 20; }
.tv-tl-answer::after { content: ""; position: absolute; left: var(--x); top: 0; bottom: 0; width: 6px; margin-left: -3px; border-radius: 3px; background: linear-gradient(to bottom, transparent, var(--tv-gold)); }
.tv-tl-answer.land b { animation: tvLand 1s var(--tv-spring); }
@keyframes tvLand { 0% { transform: translate(-50%, -420px) scale(1.4); opacity: 0; } 100% { transform: translate(-50%, 0); opacity: 1; } }
.tv-tl-answer::before { content: ""; position: absolute; left: var(--x); bottom: -4px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: var(--tv-gold); box-shadow: 0 0 24px rgba(250,204,21,.8); }
.tv-timeline.is-empty .tv-tl-pins::after { content: ""; }
[data-scene="guess"].pins-hidden .tv-timeline { flex: 0 0 200px; min-height: 200px; opacity: .55; }
.tv-locked { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 10px; min-height: 0; }
.tv-locked-chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 20px 8px 8px; border-radius: 999px; background: rgba(74,222,128,.12); border: 2px solid rgba(74,222,128,.5); font-size: 26px; animation: tvJoin .7s var(--tv-spring); }
.tv-locked-chip i { font-style: normal; }
.tv-locked-note { font-size: 26px; color: var(--tv-faint); font-weight: 600; }
.tv-locked:empty { display: none; }
.tv-timeline--compact { flex: none; height: 330px; min-height: 0; margin-top: 18px; }
.tv-timeline--compact .tv-pin-year { font-size: 30px; }
.tv-timeline--compact .tv-pin-who b { font-size: 18px; max-width: 120px; }
.tv-timeline--compact .tv-pin-stem { height: calc(20px + var(--lvl) * 58px); }
.tv-timeline--compact .tv-tl-answer b { font-size: 40px; padding: 6px 20px; }
.tv-timeline--compact .tv-tl-tick b { font-size: 22px; }

/* ---------------------------------------------------------------- choice */
[data-scene="choice"] { display: flex; flex-direction: column; }
.tv-choice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.tv-clock { --p: 1; position: relative; flex: none; width: 170px; height: 170px; display: grid; place-items: center; }
.tv-clock svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.tv-clock circle { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 12; }
.tv-clock .tv-clock-arc { stroke: var(--tv-cyan); stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: calc(327 * (1 - var(--p))); transition: stroke-dashoffset 1s linear, stroke .3s ease; }
.tv-clock b { font-size: 64px; font-weight: 900; }
.tv-clock.is-low .tv-clock-arc { stroke: var(--tv-pink); }
.tv-clock.is-low b { color: var(--tv-pink); animation: tvTick .5s ease-in-out infinite alternate; }
@keyframes tvTick { to { transform: scale(1.12); } }
.tv-choice-options { display: grid; gap: 22px; margin-top: 36px; }
.tv-option { display: flex; align-items: center; gap: 28px; padding: 26px 36px 26px 26px; border-radius: 30px; background: var(--tv-panel-2); border: 2px solid var(--tv-line); animation: tvOption .7s var(--tv-spring) both; animation-delay: calc(var(--i) * .12s); }
@keyframes tvOption { from { transform: translateX(-80px); opacity: 0; } }
.tv-option-letter { flex: none; display: grid; place-items: center; width: 80px; height: 80px; border-radius: 24px; background: var(--tv-grad); color: #160a30; font-size: 44px; font-weight: 900; }
.tv-option b { font-size: 46px; font-weight: 800; line-height: 1.15; }
.tv-choice-count { margin-top: 26px; }

/* ---------------------------------------------------------------- title (name the song) */
[data-scene="title"] { display: grid; grid-template-columns: 420px 1fr; gap: 70px; align-items: center; }
.tv-spot { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.tv-spot b { font-size: 46px; font-weight: 900; text-align: center; }
.tv-spot .tv-av--xxl { animation: tvSpot 2.4s ease-in-out infinite; }
@keyframes tvSpot { 50% { transform: scale(1.04); box-shadow: 0 0 0 14px rgba(255,255,255,.18), 0 0 160px hsl(var(--h) 90% 60% / .7); } }
.tv-title-states { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.tv-tstate { display: inline-flex; align-items: center; gap: 10px; padding: 8px 20px 8px 8px; border-radius: 999px; background: rgba(255,255,255,.07); font-size: 26px; border: 2px solid transparent; }
.tv-tstate i { font-style: normal; font-weight: 900; }
.tv-tstate.is-correct { border-color: var(--tv-green); } .tv-tstate.is-correct i { color: var(--tv-green); }
.tv-tstate.is-wrong, .tv-tstate.is-incorrect { border-color: rgba(248,113,113,.7); } .tv-tstate.is-wrong i, .tv-tstate.is-incorrect i { color: #f87171; }

/* ---------------------------------------------------------------- sing */
[data-scene="sing"] { display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; }
.tv-sing-logo { height: 120px; width: auto; margin-bottom: 18px; }
.tv-sing-lines { display: flex; flex-direction: column; gap: 14px; margin-top: 40px; }
.tv-sing-lines span { font-size: 56px; font-weight: 800; line-height: 1.2; }
.tv-sing-lines span:last-of-type { color: var(--tv-cyan); }
.tv-sing-lines b { font-size: 90px; line-height: .6; background: var(--tv-grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: tvPulseText 1.2s ease-in-out infinite; }
@keyframes tvPulseText { 50% { opacity: .35; } }

/* ---------------------------------------------------------------- reveal */
/* Card | year, song, points | bonus result (or the song's story) — and underneath, the
   full-width timeline, or (.is-lyrics) the live lyrics. Without guessing ("plain") there is
   no timeline and the card is bigger. */
[data-scene="reveal"] { display: grid; grid-template-columns: 330px minmax(0, 1fr) 380px; grid-template-rows: auto minmax(0, 1fr); column-gap: 44px; align-items: start; }
.tv-card-slot--reveal { grid-column: 1; grid-row: 1; padding-top: 14px; }
.tv-reveal-main { grid-column: 2; grid-row: 1; min-width: 0; }
.tv-reveal-side { grid-column: 3; grid-row: 1; min-width: 0; padding-top: 14px; }
.tv-reveal-side > .tv-bonus-result:not(:empty) ~ * { display: none; }
[data-scene="reveal"] .tv-timeline--compact { grid-column: 1 / -1; grid-row: 2; align-self: end; width: 100%; }
[data-scene="reveal"].is-lyrics .tv-timeline--compact { display: none; }
[data-scene="reveal"].is-plain { grid-template-columns: 460px minmax(0, 1fr) 420px; grid-template-rows: auto auto; align-content: center; height: 100%; }
[data-scene="reveal"].is-plain .tv-card-slot--reveal { grid-row: 1 / span 2; align-self: center; padding-top: 0; }
[data-scene="reveal"].is-plain .tv-card-slot--reveal .flip-card { width: 440px; height: 440px; }
.tv-meta { font-size: 26px; line-height: 1.4; color: var(--tv-soft); }
.tv-meta p { margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tv-meta .tv-chips { margin-top: 14px; gap: 10px; }
.tv-meta .tv-chip { font-size: 20px; padding: 6px 16px; }
/* Gradient text is only painted inside its own box: tight letter-spacing and line-height
   push the glyph edges out of it, so the box gets room and gives it back with margins. */
.tv-reveal-year { font-size: 180px; line-height: 1; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; background: var(--tv-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding: .04em .12em .06em 0; margin: 0 -.12em -.1em 0; }
.tv-reveal-year.is-landed { animation: tvYear .7s var(--tv-spring); }
@keyframes tvYear { 0% { transform: scale(1.18); } 100% { transform: none; } }
.tv-reveal-song b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 52px; font-weight: 900; line-height: 1.08; letter-spacing: -.015em; }
.tv-reveal-song span { display: block; margin-top: 6px; font-size: 36px; font-weight: 600; color: var(--tv-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-points { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.tv-point { display: inline-flex; align-items: center; gap: 10px; padding: 8px 22px 8px 8px; border-radius: 999px; background: rgba(74,222,128,.13); border: 2px solid rgba(74,222,128,.55); font-size: 28px; animation: tvJoin .7s var(--tv-spring) both; }
.tv-point i { font-style: normal; font-weight: 900; color: var(--tv-green); }
.tv-point small { font-size: 20px; color: var(--tv-soft); font-weight: 700; }
.tv-point.is-none { background: rgba(255,255,255,.06); border-color: var(--tv-line); color: var(--tv-soft); padding-left: 22px; }
.tv-bonus-result:empty { display: none; }
.tv-br { padding: 22px 26px; border-radius: 26px; background: var(--tv-panel); border: 1px solid var(--tv-line); }
.tv-br-kicker { font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; color: var(--tv-cyan); }
.tv-br-opt { --v: 0; position: relative; display: flex; align-items: center; gap: 16px; margin-top: 10px; padding: 10px 16px; border-radius: 16px; overflow: hidden; font-size: 26px; opacity: .6; }
.tv-br-opt::before { content: ""; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: rgba(255,255,255,.08); transition: width 1s var(--tv-ease); }
.tv-br-opt > * { position: relative; }
.tv-br-opt span { font-weight: 900; color: var(--tv-faint); }
.tv-br-opt i { margin-left: auto; font-style: normal; font-weight: 900; }
.tv-br-opt.is-correct { opacity: 1; border: 2px solid var(--tv-green); }
.tv-br-opt.is-correct::before { background: rgba(74,222,128,.22); }
.tv-br p { margin: 12px 0 0; font-size: 26px; font-weight: 700; }
.tv-br-lines span { display: block; margin-top: 8px; font-size: 32px; font-weight: 800; }
[data-scene="reveal"].is-plain .tv-reveal-year { font-size: 160px; }
/* "Everyone answers": a wider side column for everyone's answers (2026-11-13). While the host
   checks them the rows wait (dots); with the points they turn green/grey and show +n. */
[data-scene="reveal"].is-party { grid-template-columns: 270px minmax(0, 1fr) 500px; column-gap: 36px; }
[data-scene="reveal"].is-party .tv-reveal-side { grid-row: 1 / -1; align-self: stretch; min-height: 0; padding-top: 0; }
[data-scene="reveal"].is-party .tv-timeline--compact { grid-column: 1 / 3; }
[data-scene="reveal"].is-party .tv-reveal-year { font-size: 140px; }
[data-scene="reveal"].is-party .tv-reveal-song b { font-size: 44px; -webkit-line-clamp: 1; }
[data-scene="reveal"].is-party .tv-reveal-song span { font-size: 30px; }
[data-scene="reveal"].is-party .tv-points { margin-top: 16px; }
[data-scene="reveal"].is-party .tv-point small { display: none; } /* the answers board says why */
.tv-pa { padding: 16px 18px; max-height: 100%; overflow: hidden; }
.tv-pa ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; }
.tv-pa-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 30px auto; align-items: center; gap: 12px; padding: 6px 12px 6px 8px; border-radius: 16px; background: rgba(255,255,255,.05); border: 2px solid transparent; animation: tvJoin .6s var(--tv-spring) both; animation-delay: calc(var(--i) * 70ms); transition: background .5s var(--tv-ease), border-color .5s var(--tv-ease); }
.tv-pa-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.tv-pa-copy b { font-size: 22px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-pa-copy span { font-size: 22px; font-weight: 600; color: var(--tv-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-pa-copy span.is-empty { color: var(--tv-faint); }
.tv-pa-year { display: flex; flex-direction: column; align-items: flex-end; font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.05; }
.tv-pa-year small { font-size: 17px; font-weight: 800; color: var(--tv-faint); }
.tv-pa-year.is-exact small { color: var(--tv-green); }
.tv-pa-mark { font-style: normal; font-size: 26px; font-weight: 900; text-align: center; color: var(--tv-faint); }
.tv-pa-row > em { font-style: normal; font-size: 24px; font-weight: 900; color: var(--tv-green); min-width: 44px; text-align: right; }
.tv-pa-row > em.is-zero { color: var(--tv-faint); }
.tv-pa-row.is-right { background: rgba(74,222,128,.14); border-color: rgba(74,222,128,.55); }
.tv-pa-row.is-right .tv-pa-mark { color: var(--tv-green); }
.tv-pa-row.is-wrong { opacity: .78; }
.tv-pa p { margin: 10px 0 0; font-size: 20px; color: var(--tv-soft); }
.tv-point.is-checking { background: rgba(255,255,255,.06); border-color: var(--tv-line); color: var(--tv-soft); padding-left: 18px; gap: 14px; }
.tv-dots { display: inline-flex; gap: 5px; align-items: center; }
.tv-dots i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .35; animation: tvDots 1.2s ease-in-out infinite; }
.tv-dots i:nth-child(2) { animation-delay: .2s; }
.tv-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes tvDots { 0%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-4px); } }
body.tv-lite .tv-dots i, body.tv-lite .tv-pa-row { animation: none; }
/* Live lyrics: the bottom row, wide, big; only the far edges fade. */
.tv-lyrics-slot { display: none; grid-column: 2 / -1; grid-row: 2; align-self: stretch; min-height: 0; padding-top: 18px; }
[data-scene="reveal"].is-lyrics .tv-lyrics-slot { display: block; }
[data-scene="reveal"].is-plain .tv-lyrics-slot { height: 360px; }
#liveLyricsPanel { height: 100%; display: flex; flex-direction: column; }
.live-lyrics-head { font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; color: var(--tv-cyan); }
.live-lyrics-viewport { position: relative; flex: 1; min-height: 160px; overflow: hidden; mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent); }
.live-lyrics-lines { position: absolute; left: 0; right: 0; top: 0; transition: transform .5s var(--tv-ease); }
.lyr-line { display: block; padding: 6px 0; font-size: 46px; line-height: 1.2; font-weight: 800; color: rgba(255,255,255,.32); transition: color .3s ease, transform .3s ease; transform-origin: 0 50%; }
.lyr-line.active { color: #fff; transform: scale(1.03); }
.lyr-line.next { color: rgba(255,255,255,.62); }

/* ---------------------------------------------------------------- standings */
[data-scene="standings"] { display: flex; flex-direction: column; max-width: 1400px; margin: 0 auto; }
[data-scene="standings"] .tv-h1 { font-size: 72px; }
.tv-stand { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; }
.tv-stand-row { display: grid; grid-template-columns: 60px 56px minmax(260px, 420px) 1fr 90px 110px; align-items: center; gap: 22px; padding: 6px 26px 6px 14px; border-radius: 22px; background: var(--tv-panel); border: 1px solid var(--tv-line); animation: tvStand .7s var(--tv-ease) both; animation-delay: calc(var(--i) * .08s); }
@keyframes tvStand { from { transform: translateY(40px); opacity: 0; } }
.tv-stand-row.is-first { background: linear-gradient(90deg, rgba(250,204,21,.22), rgba(23,14,48,.8)); border-color: rgba(250,204,21,.6); }
.tv-stand-rank { font-size: 40px; font-weight: 900; text-align: center; color: var(--tv-faint); }
.tv-stand-row.is-first .tv-stand-rank { color: var(--tv-gold); }
.tv-stand-name { min-width: 0; display: flex; align-items: center; gap: 14px; }
.tv-stand-name b { font-size: 38px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-stand-name i { font-style: normal; font-size: 22px; font-weight: 900; padding: 2px 12px; border-radius: 999px; }
.tv-stand-name i.is-up { background: rgba(74,222,128,.18); color: var(--tv-green); }
.tv-stand-name i.is-down { background: rgba(248,113,113,.16); color: #f87171; }
.tv-stand-bar { height: 16px; border-radius: 8px; background: rgba(255,255,255,.07); overflow: hidden; }
.tv-stand-bar i { display: block; height: 100%; width: calc(var(--w) * 100%); border-radius: 8px; background: linear-gradient(90deg, hsl(var(--h) 85% 65%), hsl(calc(var(--h) + 30) 85% 70%)); animation: tvBar 1.2s var(--tv-ease) both; animation-delay: calc(var(--i) * .08s + .2s); }
@keyframes tvBar { from { width: 0; } }
.tv-stand-row em { font-style: normal; font-size: 30px; font-weight: 900; color: var(--tv-green); text-align: right; }
.tv-stand-score { font-size: 52px; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- final */
[data-scene="final"] { display: flex; flex-direction: column; align-items: center; text-align: center; }
.tv-final-dj { position: absolute; left: 20px; top: 40px; width: 380px; height: 380px; }
.tv-final-title { font-size: 110px; line-height: 1.12; padding: .04em .1em .06em; background: var(--tv-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tv-podium { display: flex; align-items: flex-end; justify-content: center; gap: 30px; margin-top: auto; }
.tv-step { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 330px; animation: tvStep .9s var(--tv-spring) both; }
.tv-step.rank-1 { animation-delay: .9s; } .tv-step.rank-2 { animation-delay: .5s; } .tv-step.rank-3 { animation-delay: .2s; }
@keyframes tvStep { from { transform: translateY(160px); opacity: 0; } }
.tv-step b { font-size: 40px; font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-step-score { font-size: 34px; font-weight: 900; color: var(--tv-gold); }
.tv-step small { font-size: 22px; color: var(--tv-soft); font-weight: 700; min-height: 2.4em; }
.tv-step-block { width: 100%; display: grid; place-items: center; border-radius: 26px 26px 0 0; background: linear-gradient(180deg, rgba(167,139,250,.5), rgba(23,14,48,.9)); border: 1px solid var(--tv-line); }
.tv-step-block i { font-style: normal; font-size: 90px; font-weight: 900; color: rgba(255,255,255,.9); }
.tv-step.rank-1 .tv-step-block { height: 250px; background: linear-gradient(180deg, rgba(250,204,21,.65), rgba(60,40,10,.9)); }
.tv-step.rank-2 .tv-step-block { height: 180px; }
.tv-step.rank-3 .tv-step-block { height: 130px; background: linear-gradient(180deg, rgba(244,114,182,.5), rgba(23,14,48,.9)); }
.tv-step.rank-1 .tv-av { width: 160px; height: 160px; font-size: 60px; box-shadow: 0 0 0 6px var(--tv-gold), 0 0 80px rgba(250,204,21,.6); }
.tv-final-wait { margin: 18px 0 0; font-size: 26px; color: var(--tv-faint); font-weight: 700; }

/* ---------------------------------------------------------------- overlays */
#tvReactions { position: absolute; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.tv-reaction { position: absolute; left: var(--x); bottom: 160px; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: tvFloat 3.6s cubic-bezier(.2,.7,.3,1) forwards; }
.tv-reaction b { font-size: 104px; line-height: 1; filter: drop-shadow(0 10px 18px rgba(0,0,0,.5)); }
.tv-reaction small { padding: 4px 16px; border-radius: 999px; color: #0c1020; background: hsl(var(--h, 280) 80% 72%); font-size: 22px; font-weight: 900; white-space: nowrap; }
@keyframes tvFloat { 0% { opacity: 0; transform: translate(-50%, 60px) scale(.6); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.08); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -620px) scale(.92) rotate(-6deg); } }
body.tv-lite .tv-reaction b { filter: none; }

#celebrationLayer { position: absolute; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti-piece { position: absolute; top: -40px; left: var(--x); width: var(--w); height: var(--h); background: var(--c); border-radius: 3px; animation: tvConfetti var(--fall) cubic-bezier(.25,.6,.4,1) var(--delay) forwards; }
@keyframes tvConfetti { to { transform: translate(var(--drift), 1180px) rotate(var(--spin)); opacity: .9; } }

#loadingOverlay { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 45; display: none; align-items: center; gap: 14px; padding: 12px 24px; border-radius: 999px; background: var(--tv-panel); border: 1px solid var(--tv-line); font-size: 22px; font-weight: 700; color: var(--tv-soft); }
#loadingOverlay.show { display: flex; }
.tv-spinner { width: 28px; height: 28px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--tv-cyan); animation: tvSpin .8s linear infinite; }
@keyframes tvSpin { to { transform: rotate(360deg); } }

#fullscreenPrompt { position: absolute; right: 56px; bottom: 40px; z-index: 60; display: none; align-items: center; gap: 14px; padding: 16px 28px; border-radius: 999px; background: #fff; color: #1b0f3a; font-size: 26px; font-weight: 800; cursor: pointer; box-shadow: 0 20px 40px rgba(0,0,0,.4); }
#fullscreenPrompt.visible { display: flex; }
#fullscreenPrompt span { font-size: 34px; }

/* ---------------------------------------------------------------- pairing page (bigscreen.bopster.app) */
#bigScreenLaunchOverlay { position: absolute; inset: 0; z-index: 70; display: grid; place-items: center; }
body.tv-pairing .tv-top, body.tv-pairing #tvScenes, body.tv-pairing #tvHost, body.tv-pairing #tvRail { display: none; }
.tv-pair { display: grid; grid-template-columns: 280px minmax(0, 1fr) 440px; gap: 56px; align-items: center; width: 1640px; padding: 70px 80px; border-radius: 56px; background: var(--tv-panel); border: 1px solid var(--tv-line); box-shadow: 0 50px 120px rgba(0,0,0,.5); }
.tv-pair-dj img { width: 300px; height: 300px; object-fit: contain; animation: tvBob 2.6s ease-in-out infinite; }
.tv-pill { display: inline-block; padding: 8px 20px; border-radius: 999px; background: rgba(34,211,238,.15); color: var(--tv-cyan); font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.tv-pair-copy h1 { margin: 18px 0 0; font-size: 76px; line-height: 1; font-weight: 900; letter-spacing: -.025em; }
.tv-pair-copy p { margin: 20px 0 0; font-size: 32px; line-height: 1.35; color: var(--tv-soft); }
.tv-pair-form { display: flex; gap: 16px; margin-top: 36px; }
.tv-pair-form input { flex: 1; min-width: 0; padding: 20px 26px; border-radius: 22px; border: 2px solid var(--tv-line); background: rgba(0,0,0,.3); color: #fff; font: 900 44px/1 'Inter', sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.tv-pair-form input:focus { outline: none; border-color: var(--tv-cyan); }
.tv-pair-form button { padding: 0 40px; border: 0; border-radius: 22px; background: var(--tv-grad); color: #160a30; font: 900 34px/1 'Inter', sans-serif; cursor: pointer; }
.tv-pair-form button:disabled { opacity: .5; }
#bigScreenLaunchStatus { display: block; margin-top: 18px; font-size: 24px; color: var(--tv-faint); font-weight: 600; min-height: 1.4em; }
#bigScreenLaunchStatus.is-error { color: #fda4af; }
.tv-pair-qr { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.tv-pair-qr canvas { width: 400px; height: 400px; padding: 22px; border-radius: 36px; background: #fff; }
.tv-pair-qr b { font-size: 56px; font-weight: 900; letter-spacing: .1em; }

/* ---------------------------------------------------------------- lite + reduced motion */
body.tv-lite .tv-host-dj, body.tv-lite #tvRail, body.tv-lite .tv-lobby-qr { filter: none; box-shadow: none; }
body.tv-lite .tv-host-dj { filter: drop-shadow(0 10px 12px rgba(10,0,40,.5)); }
body.tv-lite .tv-pin-stem, body.tv-lite .tv-pin.is-best .tv-pin-who { box-shadow: none; }
body.tv-lite .tv-av--xxl { box-shadow: 0 0 0 8px rgba(255,255,255,.2); }
body.tv-lite .tv-spot .tv-av--xxl, body.tv-lite .tv-lobby-qr { animation: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
    .tv-reaction { animation: tvFade 2.6s ease forwards !important; animation-duration: 2.6s !important; }
    @keyframes tvFade { 0%, 100% { opacity: 0; } 15%, 80% { opacity: 1; } }
}

/* Player mascots (2026-11): the round portrait fills the avatar on a glow in the mascot's colour. */
.tv-av--mascot { overflow: hidden; color: transparent; background: radial-gradient(circle at 38% 30%, #5b2a9e, #150c2e 78%); background: radial-gradient(circle at 38% 30%, color-mix(in srgb, var(--mc) 62%, #2a1458), #150c2e 78%); box-shadow: 0 0 0 3px var(--mc); }
.tv-av--mascot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tv-av--mascot.tv-av--xl { box-shadow: 0 0 0 5px var(--mc), 0 16px 34px rgba(0,0,0,.35); }
.tv-av--mascot.tv-av--xxl { box-shadow: 0 0 0 8px var(--mc), 0 0 120px var(--mc); }
.tv-step.rank-1 .tv-av--mascot { box-shadow: 0 0 0 6px var(--tv-gold), 0 0 80px rgba(250,204,21,.6); }
body.tv-lite .tv-av--mascot.tv-av--xxl { box-shadow: 0 0 0 8px var(--mc); }
