/* Shared screen (/tv/): the room and the game, shown big on a TV or a laptop. The picture is laid out once on a
   1280×720 stage and scaled to the screen (main.ts fitStage), so a laptop and a TV show the same thing.
   It reuses the phones' components and looks: the game header's cube and timer (game-header.css), the answers
   as on the phones' .quiz-option, PlayerAvatar chips, the round reveal (reveal-results.js), the answer marks,
   the game-end hero and board (game-end.css). Fonts as on the phones: the system font for questions and
   answers, Unbounded for titles. Colours: the playing game's palette (COMMON/roomplay-palettes.html), the
   same tokens as quiz-theme.css / mel-theme.css, picked by body[data-tv-game]. */
body[data-tv-game="quiz"] {
    --bg-primary: #100f36;
    --bg-end: #0b0a28;
    --bg-secondary: #211759;
    --tv-surface: #100f36;
    --tv-line: rgb(255 255 255 / 16%);
    --accent: #6640ba;
    --accent-ink: #fff;
    --gold: #d5ae58;
    --text-primary: #fff;
    --text-secondary: #d6cfe8;
    --rp-correct: #30c883;
    --rp-correct-ink: #17191f;
    --rp-wrong: #fe7b90;
    --rp-wrong-ink: #17191f;
    --rp-countdown-accent: #d5ae58;
    --rp-countdown-accent-ink: #17191f;
    --ps-accent: #6640ba;
    --game-end-primary: #d5ae58;
    --game-end-secondary: #6640ba;
}
body[data-tv-game="melody"] {
    --bg-primary: #45218a;
    --bg-end: #3a1c76;
    --bg-secondary: #2a1758;
    --tv-surface: #2a1758;
    --tv-line: rgb(255 255 255 / 12%);
    --accent: #a677ef;
    --accent-ink: #17191f;
    --gold: #edc945;
    --text-primary: #fff;
    --text-secondary: #d9ccf5;
    --rp-correct: #30c883;
    --rp-correct-ink: #17191f;
    --rp-wrong: #fe7b90;
    --rp-wrong-ink: #17191f;
    --rp-countdown-accent: #a677ef;
    --rp-countdown-accent-ink: #17191f;
    --ps-accent: #a677ef;
    --game-end-primary: #edc945;
    --game-end-secondary: #a677ef;
}
/* «Смехлыст» (qp-theme.css): purple page, light «joke card» paper for the prompts and answers (dark ink), teal for
   highlights (on the purple 5.2:1), the deep purple panel under the reveal and the boards. */
body[data-tv-game="quiplash"] {
    --bg-primary: #542580;
    --bg-end: #46206b;
    --bg-secondary: #3c1a5e;
    --tv-surface: #3c1a5e;
    --tv-line: rgb(255 255 255 / 14%);
    --accent: #743cae;
    --accent-ink: #fff;
    --gold: #73c3b6;
    --text-primary: #fff;
    --text-secondary: #d8c8e8;
    --rp-correct: #30c883;
    --rp-correct-ink: #17191f;
    --rp-wrong: #fd8295;
    --rp-wrong-ink: #17191f;
    --rp-countdown-accent: #73c3b6;
    --rp-countdown-accent-ink: #17191f;
    --ps-accent: #743cae;
    --game-end-primary: #73c3b6;
    --game-end-secondary: #743cae;
    --qp-paper: #f4eff8;
    --qp-ink: #17191f;
    --qp-ink-accent: #5e3a86;
}
/* «100 к 1» (hk-theme.css): the show's blue, the navy board, answers flipping to yellow with the red diamond. */
body[data-tv-game="100-to-1"] {
    --bg-primary: #1258ae;
    --bg-end: #0f4c98;
    --bg-secondary: #163a75;
    --tv-surface: #163a75;
    --tv-line: rgb(255 255 255 / 14%);
    --accent: #ffd43a;
    --accent-ink: #17191f;
    --gold: #ffd43a;
    --text-primary: #fff;
    --text-secondary: #d6e6fa;
    --rp-correct: #5feda5;
    --rp-correct-ink: #17191f;
    --rp-wrong: #fec4bd;
    --rp-wrong-ink: #17191f;
    --rp-countdown-accent: #ffd43a;
    --rp-countdown-accent-ink: #17191f;
    --ps-accent: #ffd43a;
    --game-end-primary: #ffd43a;
    --game-end-secondary: #d63a39;
    --hk-yellow: #ffd43a;
    --hk-red: #d63a39;
    --hk-deep: #0b2550;
    --hk-ink: #17191f;
}
/* «Бредовуха» (fb-theme.css): the maroon banner, cream cards with dark ink, ochre for the gap, the letters and the
   timer, sage for decor only; the truth on the deep maroon with the green edge, as on the phones. */
body[data-tv-game="fibbage"] {
    --bg-primary: #70292c;
    --bg-end: #5a2023;
    --bg-secondary: #5a2023;
    --tv-surface: #4e1a1d;
    --tv-line: rgb(240 229 198 / 16%);
    --accent: #eba332;
    --accent-ink: #17191f;
    --gold: #eba332;
    --text-primary: #fff;
    --text-secondary: #e9d3d0;
    --rp-correct: #83ca6a;
    --rp-correct-ink: #17191f;
    --rp-wrong: #b14330;
    --rp-wrong-ink: #fff;
    --rp-countdown-accent: #eba332;
    --rp-countdown-accent-ink: #17191f;
    --ps-accent: #eba332;
    --game-end-primary: #eba332;
    --game-end-secondary: #9ba592;
    --fb-ink: #17191f;
    --fb-ink-muted: #5c4a3a;
    --fb-cream: #f0e5c6;
    --fb-ochre: #eba332;
    --fb-maroon: #70292c;
    --fb-panel-deep: #4e1a1d;
    --fb-sage: #9ba592;
}
/* «Детектор правды» (td-theme.css): the yellow page with dark ink, the near-black cards with white text, orange for
   numbers, the timer and the leader; the only light page on the screen, so the page's text is ink and the cards set
   their own white (see the «Детектор правды» block below). */
body[data-tv-game="truth-detector"] {
    --bg-primary: #f0cb19;
    --bg-end: #e6c010;
    --bg-secondary: #272723;
    --tv-surface: #272723;
    --tv-line: rgb(255 255 255 / 12%);
    --accent: #272723;
    --accent-ink: #fff;
    --gold: #e88629;
    --text-primary: #17191f;
    --text-secondary: #3d3a2a;
    --rp-correct: #77c15c;
    --rp-correct-ink: #17191f;
    --rp-wrong: #fd826a;
    --rp-wrong-ink: #17191f;
    --rp-countdown-accent: #272723;
    --rp-countdown-accent-ink: #fff;
    --ps-accent: #272723;
    --game-end-primary: #e88629;
    --game-end-secondary: #272723;
    --particle-rgb: 39, 39, 35;
    --td-ink: #17191f;
    --td-surface: #272723;
    --td-on-surface: #fff;
    --td-on-surface-muted: #c9c6b8;
    --tv-code-color: var(--td-ink);
    --tv-count-bg: var(--td-orange);
    --tv-count-ink: var(--td-ink);
    --td-orange: #e88629;
}
/* «Что за мем?» (wdym-theme.css): the white page with ink, light grey cards, teal for actions and letters, purple for
   highlights (the code, who has played, the leader); the memes keep their colours. A light page, as «Детектор правды»:
   see the «Что за мем?» block below. */
body[data-tv-game="whatdoyoumeme"] {
    --bg-primary: #ffffff;
    --bg-end: #f1f0f6;
    --bg-secondary: #f1f0f6;
    --tv-surface: #ffffff;
    --tv-line: #dddbe6;
    --accent: #267c86;
    --accent-ink: #fff;
    --gold: #7e3c9b;
    --text-primary: #17191f;
    --text-secondary: #4a4d57;
    --rp-correct: #107d4e;
    --rp-correct-ink: #fff;
    --rp-wrong: #b73d56;
    --rp-wrong-ink: #fff;
    --rp-countdown-accent: #267c86;
    --rp-countdown-accent-ink: #fff;
    --ps-accent: #267c86;
    --game-end-primary: #7e3c9b;
    --game-end-secondary: #267c86;
    --particle-rgb: 23, 25, 31;
    --light-ink: #17191f;
    --light-card: #ffffff;
}
/* «Рисовач» (df-theme.css): the paper page with the blue drawing grid, white cards with ink, pink for actions and
   highlights, the dark ink card under the real title. A light page too. */
body[data-tv-game="drawful"] {
    --bg-primary: #f0eeeb;
    --bg-end: #f0eeeb;
    --bg-secondary: #ffffff;
    --tv-surface: #ffffff;
    --tv-line: #e4e1dd;
    --accent: #c61d76;
    --accent-ink: #fff;
    --gold: #c61d76;
    --text-primary: #17191f;
    --text-secondary: #5a5650;
    --rp-correct: #30c883;
    --rp-correct-ink: #17191f;
    --rp-wrong: #bb3f58;
    --rp-wrong-ink: #fff;
    --rp-countdown-accent: #c61d76;
    --rp-countdown-accent-ink: #fff;
    --ps-accent: #c61d76;
    --game-end-primary: #c61d76;
    --game-end-secondary: #252525;
    --particle-rgb: 37, 37, 37;
    --light-ink: #17191f;
    --light-card: #ffffff;
    --df-ink: #252525;
    --df-grid: rgb(139 169 198 / 30%);
    --df-on-ink-muted: #d6d3cc;
}
/* «Joking Hazard» (jh-theme.css): the white comic page with ink, the deck's black frames, blue for actions and letters,
   green for highlights (who has played, the leader, the pick), red only for the red bonus card. A light page too. */
body[data-tv-game="jokinghazard"] {
    --bg-primary: #ffffff;
    --bg-end: #f6f6f0;
    --bg-secondary: #f6f6f0;
    --tv-surface: #ffffff;
    --tv-line: #dcdcd4;
    --accent: #236b92;
    --accent-ink: #fff;
    --gold: #4f7a1e;
    --text-primary: #17191f;
    --text-secondary: #4a4d55;
    --rp-correct: #4e7705;
    --rp-correct-ink: #fff;
    --rp-wrong: #a92f4b;
    --rp-wrong-ink: #fff;
    --rp-countdown-accent: #236b92;
    --rp-countdown-accent-ink: #fff;
    --ps-accent: #236b92;
    --game-end-primary: #236b92;
    --game-end-secondary: #77aa32;
    --particle-rgb: 23, 25, 31;
    --light-ink: #17191f;
    --light-card: #ffffff;
    --jh-red: #e53945;
}
/* «Как хорошо ты меня знаешь?» (km-theme.css): the terracotta page, cream label cards with ink, brick for actions,
   navy for panels and the answer that was right. */
body[data-tv-game="knowme"] {
    --bg-primary: #b64035;
    --bg-end: #a83a30;
    --bg-secondary: #313555;
    --tv-surface: #313555;
    --tv-line: rgb(255 242 220 / 18%);
    --accent: #822d29;
    --accent-ink: #fff;
    --gold: #fff2dc;
    --text-primary: #fff;
    --text-secondary: #fff2dc;
    --rp-correct: #9bd387;
    --rp-correct-ink: #17191f;
    --rp-wrong: #88322e;
    --rp-wrong-ink: #fff;
    --rp-countdown-accent: #fff2dc;
    --rp-countdown-accent-ink: #17191f;
    --ps-accent: #822d29;
    --game-end-primary: #fff2dc;
    --game-end-secondary: #313555;
    --km-ink: #17191f;
    --km-ink-muted: #5c4a3a;
    --km-cream: #fff2dc;
    --km-brick: #822d29;
    --km-navy: #313555;
}
/* «Что бы ты выбрал?» (wyr-theme.css): the blue page, white text, side A cyan (ink text) and side B crimson (white
   text) as equal choices, never right or wrong; the darker blue for panels. */
body[data-tv-game="wouldyourather"] {
    --bg-primary: #006bcb;
    --bg-end: #005db3;
    --bg-secondary: #004e99;
    --tv-surface: #004e99;
    --tv-line: rgb(255 255 255 / 22%);
    --accent: #ca003d;
    --accent-ink: #fff;
    --gold: #00bce9;
    --text-primary: #fff;
    --text-secondary: #e8f3ff;
    --rp-correct: #72feb5;
    --rp-correct-ink: #17191f;
    --rp-wrong: #fdd2d3;
    --rp-wrong-ink: #17191f;
    --rp-countdown-accent: #00bce9;
    --rp-countdown-accent-ink: #17191f;
    --ps-accent: #ca003d;
    --game-end-primary: #00bce9;
    --game-end-secondary: #ca003d;
    --wyr-ink: #17191f;
    --tv-code-color: #fff;
    --wyr-a: #00bce9;
    --wyr-b: #ca003d;
}
/* «Кто из нас» (wm-theme.css): the near-black page, dark grey cards, crimson for fills, rose for text accents and
   the hearts, light grey for the rest. */
body[data-tv-game="whosmostlikelyto"] {
    --bg-primary: #171719;
    --bg-end: #1e1e21;
    --bg-secondary: #262629;
    --tv-surface: #262629;
    --tv-line: rgb(228 227 229 / 14%);
    --accent: #a51043;
    --accent-ink: #fff;
    --gold: #ff7aa2;
    --text-primary: #fff;
    --text-secondary: #b4b3b8;
    --rp-correct: #30c883;
    --rp-correct-ink: #17191f;
    --rp-wrong: #fe7b90;
    --rp-wrong-ink: #17191f;
    --rp-countdown-accent: #a51043;
    --rp-countdown-accent-ink: #fff;
    --ps-accent: #a51043;
    --game-end-primary: #ff7aa2;
    --game-end-secondary: #a51043;
    --wm-rose: #e0336e;
    --wm-rose-text: #ff7aa2;
    --wm-crimson: #a51043;
}
/* «Я никогда не» (cutout-theme.css): the near-black wine page, wine-dark cards, crimson for fills, blush for text
   accents and the hearts. The «Кто из нас» step's tokens (--wm-*) carry it (the step is shared: nhie-stage.css). */
body[data-tv-game="neverhaveiever"] {
    --bg-primary: #171316;
    --bg-end: #1d1619;
    --bg-secondary: #2a1d24;
    --tv-surface: #2a1d24;
    --tv-line: rgb(241 218 221 / 14%);
    --accent: #bc2438;
    --accent-ink: #fff;
    --gold: #f7a1ac;
    --text-primary: #fff;
    --text-secondary: #c9b4b8;
    --rp-correct: #75c259;
    --rp-correct-ink: #17191f;
    --rp-wrong: #fd7276;
    --rp-wrong-ink: #17191f;
    --rp-countdown-accent: #bc2438;
    --rp-countdown-accent-ink: #fff;
    --ps-accent: #bc2438;
    --game-end-primary: #f7a1ac;
    --game-end-secondary: #bc2438;
    --wm-rose: #e04a5e;
    --wm-rose-text: #f7a1ac;
    --wm-crimson: #bc2438;
}
/* «Имаджинариум» (im-theme.css): the amber box page with ink, cream cards with ink, ink panels with white (like the
   box's title plate) for players and scores; the card artwork keeps its colours. A light page, as «Детектор правды». */
body[data-tv-game="imaginarium"] {
    --bg-primary: #de781b;
    --bg-end: #d26f16;
    --bg-secondary: #422c35;
    --tv-surface: #422c35;
    --tv-line: rgb(255 240 202 / 18%);
    --accent: #422c35;
    --accent-ink: #fff;
    --gold: #72b3d9;
    --text-primary: #17191f;
    --text-secondary: #2b1e14;
    --rp-correct: #a0c892;
    --rp-correct-ink: #17191f;
    --rp-wrong: #dc9789;
    --rp-wrong-ink: #17191f;
    --rp-countdown-accent: #422c35;
    --rp-countdown-accent-ink: #fff;
    --ps-accent: #422c35;
    --game-end-primary: #fff0ca;
    --game-end-secondary: #422c35;
    --particle-rgb: 66, 44, 53;
    --light-ink: #17191f;
    --light-card: #fff0ca;
    --im-ink: #422c35;
    --im-cream: #fff0ca;
    --im-on-ink: #fff;
    --im-on-ink-muted: #e6dcc9;
    --tv-code-color: var(--im-ink);
    --tv-count-bg: var(--gold);
    --tv-count-ink: #17191f;
}
/* «Геоугадайка» (geo-theme.css): the indigo page, the deep indigo cards, globe green for the highlights, the timer
   and the scores (ink on it), the red of the actions for the map's lines and the flag. */
body[data-tv-game="geoguessr"] {
    --bg-primary: #302778;
    --bg-end: #281f68;
    --bg-secondary: #211c54;
    --tv-surface: #211c54;
    --tv-line: rgb(255 255 255 / 14%);
    --accent: #d63037;
    --accent-ink: #fff;
    --gold: #9bcb31;
    --text-primary: #fff;
    --text-secondary: #c9c4f0;
    --rp-correct: #9bcb31;
    --rp-correct-ink: #17191f;
    --rp-wrong: #fe726d;
    --rp-wrong-ink: #17191f;
    --rp-countdown-accent: #9bcb31;
    --rp-countdown-accent-ink: #17191f;
    --ps-accent: #d63037;
    --game-end-primary: #9bcb31;
    --game-end-secondary: #d63037;
    --geo-green: #9bcb31;
    --geo-red: #d63037;
    --geo-surface: #211c54;
    --geo-ink: #17191f;
}
:root {
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-display: 'Unbounded', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; }
body {
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-end) 100%);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden;
    transition: background-color .4s ease;
}
.hidden { display: none !important; }

/* Background: the cover's big soft spheres drifting at the edges (particles.js, body[data-rp-spheres]). Their
   colours (the game's palette, muted) and fading (.7 in the room and the countdown, .3 in every playing view)
   come from the shared rule in particles.js (scripts/generate-sphere-colors.js), the same as on the phones and
   the PC. */

/* ── The stage ── */
.tv {
    position: absolute; z-index: 1; top: 0; left: 0;
    width: 1280px; height: 720px; padding: 28px 40px;
    transform-origin: 0 0;
}
.tv-view { display: none; position: absolute; inset: 0; padding: 28px 40px; }
.tv-view.active { display: flex; animation: tv-in .45s cubic-bezier(.2, .8, .2, 1) both; }
body.tv-in-game .tv-view { top: 92px; padding-top: 0; }
@keyframes tv-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes tv-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

.tv-title {
    font-family: var(--font-display); font-weight: 800; font-size: 44px;
    letter-spacing: -.035em; line-height: 1.1; text-wrap: balance;
}
.tv-subtitle { font-weight: 700; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.tv-lead { color: var(--text-secondary); font-size: 19px; line-height: 1.45; max-width: 520px; text-wrap: balance; }
.tv-hint { color: var(--text-secondary); font-size: 18px; line-height: 1.45; }
.tv-count {
    min-width: 34px; padding: 2px 10px; border-radius: 999px;
    background: var(--tv-count-bg, var(--accent)); color: var(--tv-count-ink, var(--accent-ink)); font-size: 16px; text-align: center;
}

/* ── Top bar: the phones' game header (round · cube + roomplay · timer), big ── */
.tv-top {
    position: absolute; z-index: 3; top: 22px; left: 40px; right: 40px; height: 56px;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.tv-top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tv-round {
    padding: 9px 18px; border-radius: 999px; background: var(--tv-surface); border: 1px solid var(--tv-line);
    color: var(--text-secondary); font-size: 18px; font-weight: 600; white-space: nowrap;
}
.tv-round:empty { display: none; }
.tv-mode { color: var(--gold); font-size: 17px; font-weight: 700; white-space: nowrap; }
.tv-brand-row { display: inline-flex; align-items: center; gap: 9px; }
.tv-brand-row .rp-gh-cube { width: 44px; height: 44px; }
.tv-brand-row .rp-gh-word { font-size: 23px; }
.tv-timer.rp-gh-timer {
    justify-self: end; min-width: 60px; height: 60px; border-radius: 30px; font-size: 26px;
    font-family: var(--font-body);
}
/* «Шкала» (lu-theme.css): the deep indigo page, cream paper cards, amber for the scale's top end and the hearts,
   mint for the low end. The line's tokens (--lul-*) carry it (the line is shared: lineup-line.css). */
body[data-tv-game="lineup"] {
    --bg-primary: #23305E;
    --bg-end: #1c2750;
    --bg-secondary: #2c3a6e;
    --tv-surface: #2c3a6e;
    --tv-line: rgb(255 244 226 / 14%);
    --accent: #FFB23E;
    --accent-ink: #1E1A2E;
    --gold: #FFB23E;
    --text-primary: #FFF4E2;
    --text-secondary: #c9c3d8;
    --rp-correct: #3FC7B0;
    --rp-correct-ink: #1E1A2E;
    --rp-wrong: #ff8a7a;
    --rp-wrong-ink: #1E1A2E;
    --rp-countdown-accent: #FFB23E;
    --rp-countdown-accent-ink: #1E1A2E;
    --ps-accent: #FFB23E;
    --game-end-primary: #FFB23E;
    --game-end-secondary: #3FC7B0;
    --lul-ink: #1E1A2E;
    --lul-card: #FFF4E2;
    --lul-accent: #FFB23E;
    --lul-low: #3FC7B0;
    --lul-wrong: #C2362B;
}
body[data-tv-game="lineup"] .tv-timer:not(.rp-gh-timer--low) { color: var(--lul-ink); background: var(--lul-accent); }
.tv-lu-main { display: flex; flex-direction: column; gap: clamp(10px, 1.6vh, 20px); width: min(1500px, 100%); margin: 0 auto; flex: 1; min-height: 0; }
.tv-lu-status { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 800; font-size: clamp(18px, 2.2vh, 30px); color: var(--text-secondary); }
.tv-lu-lives { display: inline-flex; gap: 8px; color: var(--gold); font-size: clamp(22px, 3vh, 40px); }
.tv-lu-heart.is-lost { opacity: .25; }
.tv-lu-step { margin: 0; text-align: center; font-weight: 800; font-size: clamp(20px, 2.6vh, 36px); color: var(--text-primary); }
.tv-lu-step.is-verdict { color: var(--rp-wrong); }
.tv-lu-step.is-verdict.is-good { color: var(--rp-correct); }
body[data-tv-game="quiz"] .tv-timer:not(.rp-gh-timer--low) { color: var(--gold); border: 1px solid var(--gold); background: var(--tv-surface); }
body[data-tv-game="melody"] .tv-timer:not(.rp-gh-timer--low) { color: var(--accent-ink); background: var(--accent); }
body[data-tv-game="quiplash"] .tv-timer:not(.rp-gh-timer--low) { color: var(--qp-ink); background: var(--gold); }
body[data-tv-game="100-to-1"] .tv-timer:not(.rp-gh-timer--low) { color: var(--hk-ink); background: var(--hk-yellow); }
body[data-tv-game="geoguessr"] .tv-timer:not(.rp-gh-timer--low) { color: var(--geo-ink); background: var(--geo-green); }
body[data-tv-game="fibbage"] .tv-timer:not(.rp-gh-timer--low) { color: var(--fb-ink); background: var(--fb-ochre); }
body[data-tv-game="truth-detector"] .tv-timer:not(.rp-gh-timer--low) { color: var(--td-ink); background: var(--td-orange); }
body[data-tv-game="whatdoyoumeme"] .tv-timer:not(.rp-gh-timer--low) { color: #fff; background: var(--accent); }
body[data-tv-game="drawful"] .tv-timer:not(.rp-gh-timer--low) { color: #fff; background: var(--accent); }
body[data-tv-game="knowme"] .tv-timer:not(.rp-gh-timer--low) { color: var(--km-ink); background: var(--km-cream); }
body[data-tv-game="wouldyourather"] .tv-timer:not(.rp-gh-timer--low) { color: var(--wyr-ink); background: var(--wyr-a); }
body[data-tv-game="imaginarium"] .tv-timer:not(.rp-gh-timer--low) { color: var(--im-on-ink); background: var(--im-ink); }
body[data-tv-game="jokinghazard"] .tv-timer:not(.rp-gh-timer--low) { color: #fff; background: var(--accent); }

/* ── Connect ── */
.tv-connect { flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.tv-cube { width: 96px; height: 96px; filter: drop-shadow(0 6px 18px rgb(0 0 0 / 35%)); animation: tv-float 3.6s ease-in-out infinite; }
@keyframes tv-float { 50% { transform: translateY(-8px) rotate(-4deg); } }
.tv-connect .tv-lead { margin-bottom: 12px; }
.tv-connect-form { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tv-connect-label { color: var(--text-secondary); font-size: 17px; }
.tv-code-input {
    width: 300px; padding: 8px 12px; border-radius: 18px;
    background: var(--tv-surface); border: 2px solid var(--tv-line); color: var(--text-primary);
    font-family: var(--font-display); font-size: 46px; font-weight: 800; letter-spacing: .3em; text-align: center;
    text-transform: uppercase; outline: none;
}
.tv-code-input:focus-visible { border-color: var(--gold); }
.tv-code-input::placeholder { color: rgb(255 255 255 / 25%); }
/* The phones' CTA: gradient, shine, a soft pulse; press animation. */
.tv-button {
    position: relative; overflow: hidden; min-height: 56px; padding: 12px 38px; border-radius: 30px; border: 0; cursor: pointer;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
    color: var(--accent-ink); font-family: inherit; font-weight: 700; font-size: 19px;
    box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 45%, transparent);
    animation: tv-cta-pulse 2.4s ease-in-out infinite; transition: transform .12s ease;
}
.tv-button::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
    background: linear-gradient(100deg, transparent, rgb(255 255 255 / 35%), transparent);
    transform: skewX(-20deg); animation: tv-shine 3.2s ease-in-out infinite;
}
.tv-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
/* Press: game-motion.css (body[data-rp-press]), like every RoomPlay button. */
@keyframes tv-cta-pulse { 50% { box-shadow: 0 12px 36px color-mix(in srgb, var(--accent) 70%, transparent); } }
@keyframes tv-shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.tv-error { min-height: 1.4em; color: var(--text-secondary); font-size: 16px; }

/* ── Room ── */
.tv-lobby { gap: 44px; align-items: stretch; }
.tv-join {
    flex: 0 0 440px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; text-align: center;
}
.tv-brand-row--lobby { margin-bottom: 4px; }
.tv-join .tv-title { font-size: 38px; max-width: 100%; text-wrap: balance; }
.tv-qr-card {
    background: #fff; border-radius: 22px; padding: 14px; line-height: 0;
    box-shadow: 0 16px 40px rgb(0 0 0 / 30%); animation: tv-pop .6s .1s cubic-bezier(.2, .8, .2, 1) both;
}
.tv-qr-card img { width: 236px; height: 236px; image-rendering: pixelated; }
.tv-code-label { color: var(--text-secondary); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.tv-code { font-family: var(--font-display); font-weight: 800; font-size: 64px; letter-spacing: .14em; line-height: 1; color: var(--tv-code-color, var(--gold)); }
/* The join hint sits on its own soft backing: the drifting spheres (cream ones too) pass under it, and bare
   secondary text over them became unreadable (owner 2026-10-28: «нижний текст не читается»). */
.tv-join .tv-lead {
    font-size: 16px; max-width: 400px; padding: 8px 16px; border-radius: 16px;
    color: var(--text-primary); background: color-mix(in srgb, var(--bg-primary) 78%, transparent);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tv-room {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px;
    padding: 30px; border-radius: 26px; background: var(--bg-secondary); border: 1px solid var(--tv-line);
}
.tv-game-tag { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; font-weight: 700; font-size: 18px; color: var(--text-secondary); }
.tv-game-tag img { width: 40px; height: 40px; border-radius: 10px; }
.tv-status { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.2; letter-spacing: -.03em; text-wrap: balance; }
.tv-players {
    list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px; overflow: hidden; align-content: start;
}
.tv-player {
    display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 14px;
    border-radius: 16px; background: var(--tv-surface); border: 1px solid var(--tv-line);
    font-size: 19px; font-weight: 600;
    animation: tv-pop .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms);
}
.tv-player .rp-player { flex: 1; min-width: 0; gap: .5em; }
.tv-player .rp-player-avatar { font-size: 1.15em; }
.tv-player.is-away { opacity: .45; }
/* Already on the list when it redraws: stays put (main.ts renderLobby). */
.tv-player.is-kept { animation: none; }
/* «Микроанимации» 7 (owner 2026-11-10): «Читает правила», «Выбирает…» sway slowly, each out of step with the others;
   turning «Готов» hops the card once. `transform` adds to the cut-paper `rotate`/`translate` of the card. */
.tv-player.is-busy { animation: tv-pop .45s cubic-bezier(.2, .8, .2, 1) both, tv-sway 2.6s ease-in-out .45s infinite; animation-delay: calc(var(--i, 0) * 60ms), var(--sway, 0s); transform-origin: 50% 0; }
.tv-player.is-kept.is-busy { animation: tv-sway 2.6s ease-in-out infinite; animation-delay: var(--sway, 0s); }
.tv-player.is-just-ready { animation: tv-chip-hop .55s cubic-bezier(.3, 1.45, .5, 1) both; }
.tv-player.is-just-ready .tv-player-status { animation: tv-mark-stamp .42s cubic-bezier(.3, 1.45, .5, 1) .1s both; transform-origin: 0 50%; }
@keyframes tv-sway { 0%, 100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.4deg); } }
.tv-badge {
    flex: none; padding: 3px 9px; border-radius: 999px;
    background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--gold);
    font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.tv-badge--done { background: color-mix(in srgb, var(--rp-correct) 22%, transparent); color: var(--rp-correct); }

/* ── Question ── */
.tv-question { flex-direction: column; gap: 18px; }
/* The question itself (media, question, answers A–D as cut-paper cards) is ../question-stage.css, shared with a PC
   player's stage (shared/client/question-stage.ts); the base .tv-option card there serves the other views too. */
/* The album cover of the reveal swells on the beat while the song plays on (as on the phones). */
body.has-music-player .tv .rr-context-image {
    scale: calc(1 + var(--music-level, 0) * 0.04 + var(--music-beat, 0) * 0.08);
}
body[data-tv-game="quiz"] .tv .vinyl-base { box-shadow: 0 0 0 8px rgb(102 64 186 / 38%); }
body[data-tv-game="quiz"] .tv .audio-player-bar { background: var(--bg-secondary); border: 1px solid var(--tv-line); }
body[data-tv-game="quiz"] .tv .audio-progress-fill { background: linear-gradient(90deg, #8f6ae0, var(--gold)); }
body[data-tv-game="melody"] .tv .vinyl-base { box-shadow: 0 0 0 8px rgb(166 119 239 / 40%); }
body[data-tv-game="melody"] .tv .audio-player-bar { background: var(--bg-secondary); border: 1px solid var(--tv-line); }


/* Who has answered: PlayerAvatar chips that light up with the answer mark (never what they picked). */
.tv-foot { display: flex; align-items: center; gap: 16px; min-height: 62px; padding-right: 250px; padding-bottom: 6px; }
.tv-answered { flex: none; color: var(--text-secondary); font-weight: 600; font-size: 18px; }
.tv-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.tv-chip {
    position: relative; display: inline-flex; align-items: center; padding: 7px 18px 7px 8px;
    border-radius: 999px; background: var(--tv-surface); border: 2px solid var(--tv-line);
    font-size: 24px; font-weight: 600; opacity: .5;
    transition: opacity .25s, border-color .25s, background-color .25s;
}
.tv-chip .rp-player { max-width: 200px; }
/* A big room: the chips stay readable from the sofa but fit in two lines. */
.tv-chips.is-crowd { gap: 6px; }
.tv-chips.is-crowd .tv-chip { font-size: 21px; padding: 5px 12px 5px 6px; }
.tv-chips.is-crowd .tv-chip-mark { margin-left: 6px; width: 24px; height: 24px; font-size: 15px; }
.tv-chip-mark {
    display: none; margin-left: 10px; width: 28px; height: 28px; border-radius: 50%;
    background: var(--gold); color: var(--rp-correct-ink); font-size: 17px; place-items: center;
}
.tv-chip.is-done { opacity: 1; border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--tv-surface)); }
.tv-chip.is-done .tv-chip-mark { display: inline-grid; }
/* «Микроанимации» 1 (owner 2026-11-10): the one who just answered hops like a pinned slip of paper and the mark lands on
   the chip as a stamp (was a plain pop). */
.tv-chip.is-new { animation: tv-chip-hop .55s cubic-bezier(.3, 1.45, .5, 1) both; }
.tv-chip.is-new .tv-chip-mark { animation: tv-mark-stamp .42s cubic-bezier(.3, 1.45, .5, 1) .12s both; }
@keyframes tv-chip-hop { 0% { transform: none; } 35% { transform: translateY(-6px) rotate(-3deg) scale(1.06); } 100% { transform: none; } }
@keyframes tv-mark-stamp { from { opacity: 0; transform: scale(2.2) rotate(-18deg); } }
/* «Полоска очков» (owner 2026-11-02): in the games with points the chip carries the score, the leader first
   (main.ts renderAnswered), as the phones' strip (shared/client/score-strip.ts). */
.tv-chip-score { margin-left: 10px; font-family: var(--font-display); font-weight: 800; color: var(--gold); }
.tv-chips.is-crowd .tv-chip-score { margin-left: 6px; }
/* A big room (owner 2026-11-04 «на пк и тв достаточно места, чтобы расположить всех, например в 2 ряда»): from 7
   players «Ответили N из M» goes above the chips and the smaller chips take the whole width up to the QR, so ten
   players fit in two rows (before, they wrapped beside the label into 3–4 rows and pushed the round up). */
.tv-foot:has(> .tv-chips > .tv-chip:nth-child(7)) { flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 8px; }
.tv-chips:has(> .tv-chip:nth-child(7)) { gap: 8px 6px; }
.tv-chips:has(> .tv-chip:nth-child(7)) .tv-chip { min-width: 0; font-size: 19px; padding: 4px 10px 4px 6px; }
.tv-chips:has(> .tv-chip:nth-child(7)) .tv-chip .rp-player { min-width: 0; max-width: 170px; }
.tv-chips:has(> .tv-chip:nth-child(7)) :is(.tv-chip-mark, .tv-chip-score) { flex: none; }
.tv-chips:has(> .tv-chip:nth-child(7)) .tv-chip-mark { margin-left: 6px; width: 24px; height: 24px; font-size: 15px; }
.tv-chips:has(> .tv-chip:nth-child(7)) .tv-chip-score { margin-left: 6px; }

/* ── Round end: reveal-results.js, laid out for the wide screen ── */
.tv-reveal { padding-bottom: 0; }
.tv-reveal-box { position: relative; flex: 1; min-height: 0; }
/* The answers and the scores (layout and sizes, one look with a PC player's stage): ../question-stage.css .qs-reveal. */
.tv-reveal-box[data-crowd] .rr-leaderboard { gap: 6px; }
.tv-reveal-box[data-crowd] .rr-lb-row { height: min(52px, calc((556px - (var(--tv-rows, 1) - 1) * 6px) / var(--tv-rows, 1))); border-radius: 14px; }
.tv-reveal-box[data-crowd] .rr-lb-pos, .tv-reveal-box[data-crowd] .rr-lb-avatar { width: 32px; height: 32px; font-size: 15px; }
.tv-reveal-box[data-crowd] .rr-lb-name { font-size: 21px; }
.tv-reveal-box[data-crowd] .rr-lb-score { font-size: 22px; }
.tv-reveal-box[data-crowd] .rr-lb-delta { font-size: 17px; }
body[data-tv-game="quiz"] .tv .rr-lb-score { color: var(--gold); }
body[data-tv-game="melody"] .tv .rr-option { background: var(--tv-surface); border-color: rgb(255 255 255 / 10%); }
body[data-tv-game="melody"] .tv .rr-option.rr-type-correct { border-color: color-mix(in srgb, var(--rp-correct) 55%, transparent); background: linear-gradient(color-mix(in srgb, var(--rp-correct) 12%, transparent), color-mix(in srgb, var(--rp-correct) 12%, transparent)), var(--tv-surface); }
body[data-tv-game="melody"] .tv .rr-option.rr-type-wrong { border-color: color-mix(in srgb, var(--rp-wrong) 30%, transparent); }
body[data-tv-game="melody"] .tv .rr-voter { color: #fff; background: rgb(255 255 255 / 12%); }
body[data-tv-game="melody"] .tv .rr-leaderboard-title { color: var(--text-secondary); }
body[data-tv-game="melody"] .tv .rr-lb-row { --tv-lb-bg: var(--tv-surface); --tv-lb-line: rgb(255 255 255 / 10%); }
body[data-tv-game="melody"] .tv .rr-lb-row.rr-leading { --tv-lb-line: var(--gold); }
body[data-tv-game="melody"] .tv .rr-lb-pos { color: var(--text-secondary); background: rgb(255 255 255 / 12%); }
body[data-tv-game="melody"] .tv .rr-lb-pos:is(.rr-gold, .rr-silver, .rr-bronze) { color: #fff; }
body[data-tv-game="melody"] .tv .rr-lb-score { color: var(--gold); }

/* ── «Голосование за игру»: the next game, voted on the phones ──
   Left: the question, who has spent their three votes. Right: a live ranking of cut-paper strips, the bar
   filling to the votes (the leader's in gold), the voters' faces, the count bumping. Then the room's pick. */
.tv-gv { gap: 40px; align-items: stretch; }
.tv-gv-side { flex: 0 0 400px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.tv-gv-side .tv-brand-row { align-self: flex-start; }
.tv-gv-side .tv-title { font-size: 46px; }
.tv-gv-side .tv-lead { font-size: 19px; }
.tv-gv-voted { margin-top: 10px; font-weight: 700; font-size: 22px; color: var(--gold); }
.tv-gv-chips .tv-chip { font-size: 19px; padding: 5px 14px 5px 6px; }
.tv-gv-chips .tv-chip .rp-player { max-width: 150px; }
.tv-gv-chips .tv-chip-mark { width: 24px; height: 24px; font-size: 15px; margin-left: 8px; }
.tv-gv-board { position: relative; flex: 1; min-width: 0; margin: 64px 0 20px; }
.tv-gv-row {
    position: absolute; left: 0; right: 0; top: calc(var(--rank, 0) * 78px); height: 66px;
    display: flex; align-items: center; gap: 16px; padding: 0 22px 0 12px; overflow: hidden;
    background: var(--tv-surface); border: 2px solid var(--tv-line);
    border-radius: var(--cut-1); box-shadow: var(--cut-shadow); rotate: -.6deg;
    transition: top .55s cubic-bezier(.3, 1.3, .5, 1), opacity .3s ease;
    animation: tv-row-in .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--rank, 0) * 70ms);
}
.tv-gv-row:nth-child(even) { border-radius: var(--cut-2); rotate: .6deg; translate: 6px 0; }
.tv-gv-row:nth-child(3n) { border-radius: var(--cut-3); rotate: -.3deg; }
.tv-gv-row.is-empty { opacity: .62; }
.tv-gv-fill {
    position: absolute; inset: 0 auto 0 0; width: var(--w, 0%);
    background: color-mix(in srgb, var(--accent) 70%, var(--tv-surface)); transition: width .6s cubic-bezier(.3, 1.2, .5, 1);
}
.tv-gv-row.is-leader { border-color: var(--gold); box-shadow: 6px 7px 0 color-mix(in srgb, var(--gold) 70%, #000); }
.tv-gv-row.is-leader .tv-gv-fill { background: color-mix(in srgb, var(--gold) 45%, var(--tv-surface)); }
.tv-gv-icon, .tv-gv-name, .tv-gv-faces, .tv-gv-count { position: relative; }
.tv-gv-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; rotate: -4deg; box-shadow: 2px 3px 0 rgb(0 0 0 / 30%); }
.tv-gv-name { flex: 1; min-width: 0; font-size: 24px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-gv-faces { display: flex; gap: 4px; }
/* «×2» sits beside the face, mid-row: under it (bottom corner) the row's overflow clipped it (owner 2026-10-29). */
.tv-gv-face { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.tv-gv-face .tv-gv-avatar { font-size: 30px; box-shadow: 0 0 0 2px var(--tv-surface); border-radius: 50%; }
.tv-gv-times {
    padding: 2px 9px; border-radius: 999px; box-shadow: 2px 3px 0 rgb(0 0 0 / 30%);
    background: var(--gold); color: #17191f; font-size: 18px; line-height: 1.2; font-weight: 800;
}
.tv-gv-more { width: 34px; height: 34px; border-radius: 50%; background: rgb(255 255 255 / 16%); font-size: 13px; font-weight: 700; }
.tv-gv-count { min-width: 44px; text-align: right; font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--gold); }
.tv-gv-row.is-empty .tv-gv-count { color: var(--text-secondary); }
.tv-gv-count.is-bump { animation: tv-pop .45s cubic-bezier(.2, .8, .2, 1); }
/* The pick: a big card over the ranking, the icon spinning through the leaders on a tie, then landing. */
.tv-gv-result {
    position: absolute; z-index: 2; top: 92px; bottom: 30px; right: 70px; width: 620px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
    background: var(--bg-secondary); border: 2px solid var(--gold);
    border-radius: 30px 18px 34px 20px / 20px 32px 18px 30px; box-shadow: 10px 12px 0 rgb(0 0 0 / 34%); rotate: -1.2deg;
    animation: tv-cut-in .6s cubic-bezier(.3, 1.45, .5, 1) both;
}
.tv-gv.has-result .tv-gv-board { opacity: .25; filter: blur(2px); transition: opacity .4s, filter .4s; }
.tv-gv-result-icon { width: 200px; height: 200px; border-radius: 44px; box-shadow: 6px 8px 0 rgb(0 0 0 / 30%); }
.tv-gv-result.is-spinning .tv-gv-result-icon { animation: tv-gv-spin .16s linear infinite; }
.tv-gv-result.is-landed .tv-gv-result-icon { animation: tv-pop .6s cubic-bezier(.2, .8, .2, 1) both; rotate: -4deg; }
@keyframes tv-gv-spin { 50% { transform: translateY(-6px) scale(.96); } }
.tv-gv-result-name { font-family: var(--font-display); font-weight: 800; font-size: 46px; line-height: 1.1; letter-spacing: -.035em; text-wrap: balance; }
.tv-gv-result-votes { color: var(--gold); font-weight: 700; font-size: 22px; min-height: 1.3em; }
body[data-view="gamevote"] .tv-corner { top: 16px; bottom: auto; padding: 5px 14px 5px 5px; border-radius: 14px; }
body[data-view="gamevote"] .tv-corner img { width: 58px; height: 58px; padding: 4px; border-radius: 9px; }
body[data-view="gamevote"] .tv-corner-code { font-size: 20px; }

/* ── «Смехлыст»: writing and the matchup, on the phones' light «joke card» paper ── */
/* Writing: a stack of notes, the top one says what to do; a caret blinks as if someone is typing. */
.tv-write { flex-direction: column; gap: 18px; }
.tv-write-main { flex: 1; min-height: 0; }
.tv-write-card {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px;
    width: 880px; padding: 52px 72px 56px; text-align: center;
    background: var(--qp-paper); color: var(--qp-ink);
    border-radius: 30px 18px 34px 20px / 20px 32px 18px 30px; box-shadow: 9px 11px 0 rgb(0 0 0 / 30%);
    rotate: -1.6deg; animation: tv-cut-in .7s cubic-bezier(.3, 1.45, .5, 1) both;
}
/* Two more notes under it, in the palette's teal and pink, cut and turned the other way (same cell of the grid). */
.tv-write-main { display: grid; place-items: center; }
.tv-write-main > * { grid-area: 1 / 1; }
.tv-write-note {
    align-self: stretch; justify-self: stretch; margin: auto; width: 880px; height: 330px;
    border-radius: 18px 32px 20px 30px / 30px 20px 32px 18px; box-shadow: 7px 9px 0 rgb(0 0 0 / 26%);
}
.tv-write-note--teal { background: var(--gold); rotate: 4deg; translate: 26px 16px; animation: tv-note-in .7s .15s cubic-bezier(.3, 1.45, .5, 1) both; }
.tv-write-note--pink { background: #f77cb0; rotate: -5deg; translate: -30px 22px; animation: tv-note-in .7s .25s cubic-bezier(.3, 1.45, .5, 1) both; }
@keyframes tv-note-in { from { opacity: 0; translate: 0 0; rotate: 0deg; } }
.tv-write-phone {
    display: grid; place-items: center; width: 104px; height: 104px; margin-top: -6px;
    border-radius: 46% 54% 50% 50% / 54% 46% 54% 46%; background: var(--accent); color: #fff; font-size: 52px;
    box-shadow: 4px 5px 0 rgb(0 0 0 / 28%); animation: tv-scribble 1.6s ease-in-out infinite;
}
@keyframes tv-scribble { 0%, 100% { rotate: -8deg; translate: 0 0; } 25% { rotate: 4deg; translate: 2px -3px; } 50% { rotate: -4deg; translate: -1px 1px; } 75% { rotate: 7deg; translate: 1px -2px; } }
.tv-write-title {
    font-family: var(--font-display); font-weight: 800; font-size: 50px; line-height: 1.12; letter-spacing: -.035em;
    color: var(--qp-ink-accent); text-wrap: balance;
}
.tv-write-hint { display: inline-flex; align-items: center; gap: 4px; font-size: 25px; font-weight: 600; color: rgb(23 25 31 / 72%); }
.tv-write-caret { display: inline-block; width: 3px; height: 1.1em; background: var(--accent); animation: tv-caret 1s steps(1) infinite; }
@keyframes tv-caret { 50% { opacity: 0; } }

/* The matchup: the prompt card on top, the two answers dropping in under it, «VS» stamped between them. */
.tv-vote { flex-direction: column; gap: 18px; }
/* The prompt's card, the answers and «VS» (one look with a PC player's stage): ../quiplash-matchup.css .qpm-root. */

/* Its reveal (the prompt's card, the answers, the «СМЕХЛЫСТ!» stamp, the scores): ../quiplash-matchup.css. */

/* ── «Бредовуха»: the question on cream paper, the gap on an ochre chip ── */
/* The card, the notes, the answers and the reveal's colours (one look with a PC player's stage): ../fibbage-stage.css
   .fbs-root. Here only the screen's own parts: the hint with the phone and the caret, the round leaderboard. */
.tv-lie, .tv-pick { flex-direction: column; gap: 18px; }
.tv-lie .fbs-lie, .tv-pick .fbs-pick { flex: 1; min-height: 0; }
.tv-fb-hint { display: inline-flex; align-items: center; justify-content: center; gap: 12px; margin: 0; font-size: 24px; font-weight: 600; color: var(--fb-ink-muted); }
.tv-fb-phone {
    display: grid; place-items: center; width: 52px; height: 52px; flex: none;
    border-radius: 46% 54% 50% 50% / 54% 46% 54% 46%; background: var(--fb-maroon); color: var(--fb-cream); font-size: 26px;
    box-shadow: 3px 4px 0 rgb(0 0 0 / 25%); animation: tv-scribble 1.6s ease-in-out infinite;
}
.tv-fb-hint .tv-write-caret { background: var(--fb-maroon); }
body[data-tv-game="fibbage"] .tv .rr-lb-row { --tv-lb-bg: var(--fb-cream); --tv-lb-line: transparent; --tv-lb-shadow: 5px 6px 0 var(--fb-panel-deep); }
body[data-tv-game="fibbage"] .tv .rr-lb-row.rr-leading { --tv-lb-line: var(--fb-ochre); --tv-lb-shadow: 6px 7px 0 color-mix(in srgb, var(--fb-ochre) 70%, #000); }

/* ── «Детектор правды»: the yellow page (ink), the dark cards (white) as on the phones' yes/no and number buttons ── */
/* Cards and panels are near-black on the yellow page: their own text is white, the muted line light. */
body[data-tv-game="truth-detector"] :is(.tv-room, .tv-player, .tv-chip, .tv-option, .tv-round, .tv-corner, .tv-code-input,
    .tv-final-board, .tv-gv-row, .tv-gv-result, .rr-option, .rr-lb-row) { color: var(--td-on-surface); --text-secondary: var(--td-on-surface-muted); --text-primary: #fff; }
body[data-tv-game="truth-detector"] .tv-round { color: var(--td-on-surface-muted); }
body[data-tv-game="truth-detector"] :is(.tv-winner-points, .tv-gv-voted) { color: var(--td-ink); }
body[data-tv-game="truth-detector"] .tv-code { text-shadow: 4px 5px 0 rgb(39 39 35 / 22%); }
body[data-tv-game="truth-detector"] .tv-code-input::placeholder { color: rgb(255 255 255 / 30%); }
/* The cube is a transparent picture: its hard shadow follows its outline (drop-shadow), a box-shadow drew a square. */
body[data-tv-game="truth-detector"] .tv-cube { filter: drop-shadow(7px 9px 0 rgb(39 39 35 / 30%)); }
body[data-tv-game="truth-detector"] .tv-qr-card { box-shadow: 7px 9px 0 rgb(39 39 35 / 30%); }
body[data-tv-game="truth-detector"] .tv-chip.is-done { border-color: var(--td-orange); background: color-mix(in srgb, var(--td-orange) 22%, var(--td-surface)); }
body[data-tv-game="truth-detector"] .tv-badge { background: color-mix(in srgb, var(--td-orange) 26%, transparent); color: var(--td-orange); }
body[data-tv-game="truth-detector"] .tv-final-board .leader-row { background: color-mix(in srgb, #fff 7%, var(--td-surface)); }
body[data-tv-game="truth-detector"] .tv-final-board .leader-row:first-child { box-shadow: 6px 7px 0 color-mix(in srgb, var(--td-orange) 70%, #000); }
body[data-tv-game="truth-detector"] .tv :is(.tv-option, .rr-option, .leader-row, .tv-player) { box-shadow: 5px 6px 0 rgb(39 39 35 / 30%); }
.tv-detect { flex-direction: column; gap: 14px; }
/* The step itself (statement, polygraph, «Да» / «Нет», numbers) and its reveal: assets/css/truth-detect.css, shared with
   a PC player's stage (shared/client/truth-detect.ts). */

/* ── Light pages («Что за мем?», «Рисовач»): ink on the page and on white cards; the hard shadows soften, the
   reveal takes the light tokens (reveal-results.css --rr-*), the bits drawn in white on dark pages turn ink ── */
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv {
    --cut-shadow: 5px 6px 0 rgb(23 25 31 / 14%);
    --rr-ink: var(--light-ink); --rr-muted: var(--text-secondary);
    --rr-surface: var(--light-card); --rr-border: var(--tv-line);
    --rr-leading-surface: var(--light-card); --rr-leading-border: var(--gold);
    --rr-wrong-surface: var(--light-card); --rr-correct-surface: var(--light-card);
}
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv-cube { filter: drop-shadow(7px 9px 0 rgb(23 25 31 / 14%)); }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv-qr-card { box-shadow: 7px 9px 0 rgb(23 25 31 / 14%); }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) :is(.tv-room, .tv-final-board.leaderboard-card) { box-shadow: 8px 10px 0 rgb(23 25 31 / 10%); }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv-code { text-shadow: 4px 5px 0 rgb(23 25 31 / 14%); }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv-code-input::placeholder { color: rgb(23 25 31 / 25%); }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv-chip.is-done { background: color-mix(in srgb, var(--gold) 10%, #fff); }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv-chip-mark { color: #fff; }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv-final-board .leader-row { background: var(--light-card); border: 2px solid var(--tv-line); }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv-final-board.leaderboard-card { --on-accent: #fff; }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv .rr-voter { color: var(--light-ink); background: rgb(23 25 31 / 7%); }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv .rr-lb-pos { color: var(--text-secondary); background: rgb(23 25 31 / 7%); }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv .rr-lb-row.rr-leading { --tv-lb-shadow: 6px 7px 0 color-mix(in srgb, var(--gold) 45%, transparent); }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv .rr-lb-score { color: var(--gold); }
body:is([data-tv-game="whatdoyoumeme"], [data-tv-game="drawful"], [data-tv-game="jokinghazard"]) .tv-final-board .leader-row:first-child { box-shadow: 6px 7px 0 color-mix(in srgb, var(--gold) 45%, transparent); }
/* «Рисовач»: the phones' drawing paper, the blue grid over the whole page. */
body[data-tv-game="drawful"] {
    background-color: var(--bg-primary);
    background-image: linear-gradient(var(--df-grid) 1px, transparent 1px), linear-gradient(90deg, var(--df-grid) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* ── «Что за мем?»: the prompt as the phones' card (a situation in ink, or the meme), the table as cut cards ── */
.tv-meme, .tv-draw, .tv-km { flex-direction: column; gap: 14px; }
.tv-meme-hint .tv-fb-phone { background: var(--accent); color: var(--accent-ink); }
.tv-meme.is-voting .tv-meme-hint .tv-fb-phone { width: 40px; height: 40px; font-size: 20px; }
/* The step itself (the prompt, the hint, the cards) and the reveal's memes: ../meme-stage.css .mms-root, shared with a
   PC player's stage (shared/client/meme-stage.ts). Here only the screen's own bits: the hint's phone. */
body[data-tv-game="whatdoyoumeme"] .tv .rr-context { padding: 24px 28px; background: var(--light-card); border: 2px solid var(--tv-line); border-radius: var(--cut-2); rotate: -1deg; }
body[data-tv-game="whatdoyoumeme"] .tv .rr-context-text { color: var(--light-ink); font-weight: 700; }
body[data-tv-game="whatdoyoumeme"] .tv .rr-option.rr-type-correct { border-color: var(--rp-correct); }
body[data-tv-game="whatdoyoumeme"] .tv .rr-author-name { color: var(--gold); font-weight: 700; }

/* ── «Joking Hazard»: the round's comic, then the table; the step itself is ../jh-stage.css .jhs-root (shared with a
   PC player's stage, shared/client/jh-stage.ts). Here only the screen's own bits: the content between the top bar and
   the foot of chips, the hint's phone. ── */
.tv-jh { justify-content: flex-start; gap: 14px; }
.tv-jh .jhs-head, .tv-jh[data-step="table"] .jhs-hint { margin-top: auto; }
.tv-jh .tv-foot { margin-top: auto; align-self: stretch; }
.tv-jh .jhs-hint .tv-fb-phone { background: var(--accent); color: var(--accent-ink); }

/* ── «Рисовач»: the drawing card, the drawing on its sheet with the artist, the titles, the reveal (one look with a PC
   player's stage): ../draw-stage.css .dws-root, shared/client/draw-stage.ts ── */

/* ── «Как хорошо ты меня знаешь?»: who answers, the question, the options (one look with a PC player's stage):
   ../knowme-stage.css .kms-root ── */
/* Reveal as on the phones (km-theme.css): options on cream with ink, the right one on navy with the green edge. */
body[data-tv-game="knowme"] .tv .rr-context-text { font-weight: 700; }
body[data-tv-game="knowme"] .tv .rr-context-subtext { color: var(--km-cream); font-size: 21px; font-weight: 600; }
body[data-tv-game="knowme"] .tv .rr-leaderboard-title { color: var(--km-cream); }
body[data-tv-game="knowme"] .tv :is(.rr-option, .rr-option-image-card) { background: var(--km-cream); border: 2px solid transparent; }
body[data-tv-game="knowme"] .tv .rr-option.rr-type-wrong { border-color: rgb(23 25 31 / 16%); }
body[data-tv-game="knowme"] .tv .rr-option-text { color: var(--km-ink); }
body[data-tv-game="knowme"] .tv :is(.rr-vote-count, .rr-voters-label, .rr-option-image-voters) { color: var(--km-ink-muted); }
body[data-tv-game="knowme"] .tv .rr-voter { color: var(--km-ink); background: rgb(23 25 31 / 8%); }
body[data-tv-game="knowme"] .tv :is(.rr-voter-points, .rr-lb-delta:not(.rr-zero)) { padding: 1px 6px; border-radius: 6px; background: var(--km-navy); }
body[data-tv-game="knowme"] .tv .rr-option.rr-type-correct { background: var(--km-navy); border-color: var(--rp-correct); }
body[data-tv-game="knowme"] .tv .rr-option.rr-type-correct .rr-option-text { color: #fff; }
body[data-tv-game="knowme"] .tv .rr-option.rr-type-correct :is(.rr-vote-count, .rr-voters-label) { color: var(--km-cream); }
body[data-tv-game="knowme"] .tv .rr-option.rr-type-correct .rr-voter { color: #fff; background: rgb(255 255 255 / 12%); }
body[data-tv-game="knowme"] .tv .rr-option.rr-type-correct .rr-voter-points { padding: 0; background: none; }
body[data-tv-game="knowme"] .tv .rr-lb-row { --tv-lb-bg: var(--km-cream); --tv-lb-line: transparent; }
body[data-tv-game="knowme"] .tv .rr-lb-row.rr-leading { --tv-lb-line: var(--km-navy); --tv-lb-shadow: 6px 7px 0 rgb(23 25 31 / 34%); }
body[data-tv-game="knowme"] .tv :is(.rr-lb-name, .rr-lb-score) { color: var(--km-ink); }
body[data-tv-game="knowme"] .tv .rr-lb-pos { color: var(--km-ink-muted); background: rgb(23 25 31 / 8%); }

/* ── «Что бы ты выбрал?»: the two sides as big cut cards (A cyan, B crimson) with «или» between; the role card, the
   impostor vote and reveal take the same place ── */
.tv-wyr, .tv-wml, .tv-geo { flex-direction: column; gap: 14px; }
.tv-wyr-main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 0 12px; }
/* The kicker, the two sides and «или» (one look with a PC player's stage): ../wyr-choice.css .wyc-root. */
.tv-wyr-kicker .tv-fb-phone { background: var(--wyr-b); color: #fff; }
.tv-wyr-teaser { color: var(--wyr-ink); background: #fff; }
.tv-wyr-card, .tv-wyr-imposter { display: none; }
.tv-wyr:not([data-step="pair"]) .wyc-root { display: none; }
.tv-wyr[data-step="role"] .tv-wyr-role, .tv-wyr[data-step="vote"] .tv-wyr-vote { display: flex; }
.tv-wyr[data-step="imposter"] .tv-wyr-imposter { display: flex; }
.tv-wyr[data-step="imposter"] .tv-foot { display: none; }
.tv-wyr-card {
    flex-direction: column; align-items: center; gap: 16px; width: 820px; padding: 48px 60px 44px; text-align: center;
    color: var(--wyr-ink); background: #fff; border-radius: 30px 18px 34px 20px / 20px 32px 18px 30px;
    box-shadow: 9px 11px 0 rgb(0 0 0 / 22%); rotate: -1.2deg; animation: tv-cut-in .7s cubic-bezier(.3, 1.45, .5, 1) both;
}
.tv-wyr-card h1 { font-family: var(--font-display); font-weight: 800; font-size: 44px; letter-spacing: -.03em; }
.tv-wyr-card p { font-size: 25px; font-weight: 600; line-height: 1.35; color: #3a4250; text-wrap: balance; }
.tv-wyr-card-icon { display: grid; place-items: center; width: 84px; height: 84px; font-size: 42px; color: #fff; background: var(--wyr-b); border-radius: 44% 56% 52% 48% / 52% 44% 56% 48%; rotate: -6deg; }
.tv-wyr-imposter { flex-direction: column; align-items: center; gap: 22px; width: 100%; max-width: 1180px; }
.tv-wyr-verdict {
    display: flex; align-items: center; gap: 18px; padding: 20px 30px; color: var(--wyr-ink); background: #fff;
    border-radius: var(--cut-2); box-shadow: 7px 9px 0 rgb(0 0 0 / 22%); rotate: -1deg; animation: tv-cut-in .6s cubic-bezier(.3, 1.45, .5, 1) both;
}
.tv-wyr-verdict .rp-player { font-size: 32px; color: var(--wyr-ink); }
.tv-wyr-verdict-label { font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--wyr-b); padding: 6px 12px; border-radius: 10px; }
.tv-wyr-verdict-result { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--wyr-b); }
.tv-wyr-verdict-result.is-caught { color: #00785a; }
.tv-wyr-votes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; max-width: 1100px; }
.tv-wyr-ballot { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; background: var(--tv-surface); border-radius: 999px; animation: tv-in .45s ease both; }
.tv-wyr-ballot .rp-player { font-size: 19px; color: #fff; }
.tv-wyr-arrow { font-weight: 800; color: var(--wyr-a); }
.tv-wyr-novotes { font-size: 20px; color: var(--text-secondary); }
.tv-wyr-rounds { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; width: 100%; }
.tv-wyr-round {
    display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; color: var(--wyr-ink); background: #fff;
    border-radius: var(--cut-3); box-shadow: var(--cut-shadow); animation: tv-cut-in .55s cubic-bezier(.3, 1.45, .5, 1) both;
}
.tv-wyr-round:nth-child(even) { border-radius: var(--cut-4); rotate: .7deg; }
.tv-wyr-round:nth-child(odd) { rotate: -.6deg; }
.tv-wyr-round-n { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #4a5566; }
.tv-wyr-version { display: grid; gap: 2px; font-size: 18px; line-height: 1.3; }
.tv-wyr-version b { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #4a5566; }
.tv-wyr-version.is-imposter b { color: var(--wyr-b); }
body[data-tv-game="wouldyourather"] .tv .rr-badge.majority { color: var(--wyr-ink); background: var(--wyr-a); }
body[data-tv-game="wouldyourather"] .tv .rr-lb-score { color: var(--wyr-a); }

/* ── «Кто из нас»: the statement, the votes, the punishments (one look with a PC player's stage): ../wml-stage.css
   .wms-root. Here only the screen's own parts: the premium sample's chip, the hint's phone, the foot while voting. ── */
.tv-wml-teaser { color: #fff; background: var(--wm-crimson); }
.tv-wml-hint .tv-fb-phone { background: var(--wm-crimson); color: #fff; }
.tv-wml:not([data-step="vote"]) :is(.tv-foot, .tv-wml-teaser) { display: none; }

/* ── «Имаджинариум»: the «Что за мем?» view with its own bits in assets/css/im-stage.css (shared with a PC player's
   stage); the amber page is light like «Детектор правды»: ink panels with white ── */
body[data-tv-game="imaginarium"] :is(.tv-room, .tv-player, .tv-chip, .tv-round, .tv-corner, .tv-code-input,
    .tv-final-board, .tv-gv-row, .tv-gv-result, .rr-lb-row) { color: var(--im-on-ink); --text-secondary: var(--im-on-ink-muted); --text-primary: #fff; }
body[data-tv-game="imaginarium"] .tv-round { color: var(--im-on-ink-muted); }
body[data-tv-game="imaginarium"] .tv-gv-voted { color: var(--im-ink); }
body[data-tv-game="imaginarium"] .tv-winner-points { color: var(--im-ink); }
body[data-tv-game="imaginarium"] .tv-chip.is-done { border-color: var(--im-cream); background: color-mix(in srgb, var(--gold) 26%, var(--im-ink)); }
body[data-tv-game="imaginarium"] .tv-final-board .leader-row { background: color-mix(in srgb, #fff 7%, var(--im-ink)); }
body[data-tv-game="imaginarium"] .tv {
    --cut-shadow: 5px 6px 0 rgb(66 44 53 / 30%);
    --rr-ink: var(--light-ink); --rr-muted: #5a4636;
    --rr-surface: var(--light-card); --rr-border: transparent;
    --rr-wrong-surface: var(--light-card); --rr-correct-surface: var(--light-card);
}
body[data-tv-game="imaginarium"] .tv .rr-context { padding: 24px 28px; background: var(--light-card); border-radius: var(--cut-2); rotate: -1deg; box-shadow: var(--cut-shadow); }
body[data-tv-game="imaginarium"] .tv .rr-context-text { color: var(--light-ink); font-weight: 700; }
body[data-tv-game="imaginarium"] .tv .rr-context-subtext { color: #5a4636; }
body[data-tv-game="imaginarium"] .tv .rr-voter { color: var(--light-ink); background: rgb(66 44 53 / 10%); }
body[data-tv-game="imaginarium"] .tv .rr-lb-row { --tv-lb-bg: var(--im-ink); --tv-lb-line: transparent; }
body[data-tv-game="imaginarium"] .tv .rr-lb-row.rr-leading { --tv-lb-line: var(--im-cream); }
body[data-tv-game="imaginarium"] .tv .rr-lb-score { color: var(--gold); }
body[data-tv-game="imaginarium"] .tv .rr-lb-pos { color: var(--im-on-ink-muted); background: rgb(255 255 255 / 12%); }

/* ── Game end: the phones' hero (crowned winner) and board, side by side ── */
.tv-final { gap: 56px; align-items: center; padding-bottom: 40px; }
.tv-final-hero { flex: 0 0 440px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.tv-final-figure { margin-bottom: 10px; }
.tv-final-figure .ge-hero-figure { animation: tv-pop .7s .15s cubic-bezier(.2, .8, .2, 1) both; }
.tv-winner-name { font-family: var(--font-display); font-weight: 800; font-size: 42px; line-height: 1.1; letter-spacing: -.035em; text-wrap: balance; animation: tv-in .5s .35s ease both; }
.tv-winner-points { color: var(--gold); font-weight: 700; font-size: 22px; animation: tv-in .5s .45s ease both; }
.tv-final-hero .tv-hint { margin-top: 12px; font-size: 16px; }
.tv-final-board.leaderboard-card {
    flex: 1; min-width: 0; margin: 0; padding: 20px; border-radius: 26px; background: var(--bg-secondary);
    --row-hi: color-mix(in srgb, var(--gold) 16%, transparent); --accent-pink: var(--gold); --on-accent: #17191f;
    --accent-text: var(--gold); --card-accent-2-text: var(--gold); --bg-card: var(--tv-surface);
}
.tv-final-board h2 { font-size: 18px; margin-bottom: 12px; }
.tv-final-board .leaderboard { gap: 10px; }
.tv-final-board .leader-row {
    grid-template-columns: 44px 52px minmax(0, 1fr) auto; gap: 14px; min-height: 68px; padding: 8px 18px;
    border-radius: 16px; background: color-mix(in srgb, #fff 6%, var(--bg-secondary));
    animation: tv-row-in .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(500ms + var(--i, 0) * 120ms);
}
@keyframes tv-row-in { from { opacity: 0; transform: translateX(30px); } }
.tv-final-board .rank { width: 40px; height: 40px; font-size: 15px; }
.tv-final-board .leader-avatar { width: 52px; height: 52px; font-size: 20px; }
.tv-final-board .leader-name { font-size: 24px; }
.tv-final-board .leader-score { font-size: 26px; }
/* More than six players: two columns, 1–6 on the left and the rest on the right, rows sharing the height. */
.tv-final-board { align-self: center; max-height: 100%; overflow: hidden; }
.tv-final[data-crowd] .tv-final-board .leaderboard { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(var(--tv-half, 6), auto); grid-auto-flow: column; gap: 10px 12px; }
.tv-final[data-crowd] .tv-final-board .leader-row {
    grid-template-columns: 34px 42px minmax(0, 1fr) auto; gap: 10px; padding: 0 14px;
    min-height: 0; height: min(68px, calc((490px - (var(--tv-half, 6) - 1) * 10px) / var(--tv-half, 6)));
}
.tv-final[data-crowd] .tv-final-board .rank { width: 34px; height: 34px; font-size: 13px; }
.tv-final[data-crowd] .tv-final-board .leader-avatar { width: 42px; height: 42px; font-size: 17px; }
.tv-final[data-crowd] .tv-final-board .leader-name { font-size: 21px; }
.tv-final[data-crowd] .tv-final-board .leader-score { font-size: 22px; }

/* ── Cut paper: answers and boards (owner 2026-10-27: «скучные… небольшой наклон, сдвиг, неровные края», «менее
   нейрослопово», «дорого, как в Jackbox») ──
   Each card is a hand-cut piece: four uneven corner shapes in turn, a slight tilt and shift that alternate, and a
   hard shadow without blur, as if the card lies on the screen. The tilt and shift use the separate `rotate` and
   `translate` properties, so reveal-results.js can still move the rows with `transform` when places change.
   Only on the shared screen; the phones keep their look. */
.tv {
    --cut-1: 26px 12px 22px 16px / 16px 24px 12px 22px;
    --cut-2: 14px 24px 14px 26px / 24px 14px 22px 12px;
    --cut-3: 22px 16px 28px 12px / 12px 20px 16px 26px;
    --cut-4: 12px 26px 16px 22px / 22px 12px 26px 16px;
    --cut-shadow: 5px 6px 0 rgb(0 0 0 / 34%);
}
.tv :is(.tv-option, .rr-option, .leader-row, .tv-player) {
    border-radius: var(--cut-1); box-shadow: var(--cut-shadow);
    rotate: -.7deg; translate: -4px 0;
}
.tv :is(.tv-option, .rr-option, .leader-row, .tv-player):nth-child(4n + 2) { border-radius: var(--cut-2); rotate: .8deg; translate: 6px 2px; }
.tv :is(.tv-option, .rr-option, .leader-row, .tv-player):nth-child(4n + 3) { border-radius: var(--cut-3); rotate: -.4deg; translate: 3px -1px; }
.tv :is(.tv-option, .rr-option, .leader-row, .tv-player):nth-child(4n + 4) { border-radius: var(--cut-4); rotate: .5deg; translate: -6px 1px; }
/* Leaderboard rows (the final board here, the round board below, cut-paper.css on phones and the PC stage) turn and
   shift half as much: a board reads as a list, a big spread looked messy (owner 2026-10-29: «расброс наклона
   меньше»). */
.tv .leader-row { rotate: -.35deg; translate: -2px 0; }
.tv .leader-row:nth-child(4n + 2) { rotate: .4deg; translate: 3px 1px; }
.tv .leader-row:nth-child(4n + 3) { rotate: -.2deg; translate: 2px 0; }
.tv .leader-row:nth-child(4n + 4) { rotate: .25deg; translate: -3px 1px; }
/* The tilt, the shift and the hard shadow reach up to ~14px past a card's own box. Lists that clip (overflow:
   hidden, for big rooms) keep that much room inside and give it back with a negative margin, so the layout does
   not move and no card loses its edge (owner 2026-10-28: «у всех ТВ проблема с обрезкой контуров игроков»). */
.tv { --cut-room: 14px; }
.tv-players { margin: calc(-1 * var(--cut-room)); padding: var(--cut-room); }
/* The reveal screens fill a clipping container of their own (reveal-results.css), so they keep the room inside. */
.tv .rr-screen1, .tv .rr-screen2 { padding: var(--cut-room) var(--cut-room) 24px; }
/* Two answers side by side lean towards each other; a lone column zig-zags (above). */
.tv-options:not(.is-four) { gap: 20px 22px; padding: 4px 8px; }
.tv-options:not(.is-four) .tv-option:nth-child(odd) { rotate: -1.1deg; }
.tv-options:not(.is-four) .tv-option:nth-child(even) { rotate: 1deg; translate: 0 6px; }
/* (Next to media the answers zig-zag: ../question-stage.css.) */
/* The letter: a stamp, cut too and turned the other way. */
.tv-option-letter {
    border-radius: 46% 54% 50% 50% / 54% 46% 54% 46%; rotate: -6deg;
    box-shadow: 2px 3px 0 rgb(0 0 0 / 30%); font-family: var(--font-display); font-weight: 800;
}
.tv-option:nth-child(even) .tv-option-letter { rotate: 5deg; border-radius: 54% 46% 46% 54% / 46% 54% 50% 50%; }
/* Cards land: dropped from a little above with a turn, then settle with a small bounce. */
.tv-option { animation-name: tv-cut-in; animation-duration: .6s; animation-timing-function: cubic-bezier(.3, 1.45, .5, 1); }
@keyframes tv-cut-in { from { opacity: 0; transform: translateY(-26px) rotate(-5deg) scale(1.06); } }
/* The leader stands out: a bigger tilt (still halved, see above), the gold shadow. */
.tv-final-board .leader-row:first-child {
    rotate: -.7deg; translate: -4px -1px; box-shadow: 6px 7px 0 color-mix(in srgb, var(--gold) 70%, #000);
}
/* Round leaderboard: reveal-results.js measures the rows (getBoundingClientRect) to slide them when places change,
   and a tilted row measures taller, so the rows overshot and jumped at the end. The row box stays straight; its
   cut-paper card is a ::before behind the content, which turns, shifts and changes shape smoothly when the row
   lands in its new place. */
.tv .rr-lb-row {
    --tv-lb-bg: var(--rr-surface, rgb(255 255 255 / 6%)); --tv-lb-line: var(--rr-border, rgb(255 255 255 / 8%));
    --tv-tilt: -.35deg; --tv-shift: -2px 0; --tv-cut: var(--cut-1); --tv-lb-shadow: var(--cut-shadow);
    isolation: isolate; background: none; border-color: transparent; border-radius: 18px;
}
.tv .rr-lb-row:nth-child(4n + 2) { --tv-tilt: .4deg; --tv-shift: 3px 1px; --tv-cut: var(--cut-2); }
.tv .rr-lb-row:nth-child(4n + 3) { --tv-tilt: -.2deg; --tv-shift: 2px 0; --tv-cut: var(--cut-3); }
.tv .rr-lb-row:nth-child(4n + 4) { --tv-tilt: .25deg; --tv-shift: -3px 1px; --tv-cut: var(--cut-4); }
.tv .rr-lb-row.rr-leading {
    --tv-lb-bg: var(--rr-leading-surface, rgb(255 255 255 / 10%)); --tv-lb-line: var(--rr-leading-border, rgb(255 255 255 / 15%));
    --tv-tilt: -.7deg; --tv-shift: -4px -1px; --tv-lb-shadow: 6px 7px 0 color-mix(in srgb, var(--gold) 70%, #000);
}
.tv .rr-lb-row::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    border-radius: var(--tv-cut); background: var(--tv-lb-bg); border: 2px solid var(--tv-lb-line); box-shadow: var(--tv-lb-shadow);
    rotate: var(--tv-tilt); translate: var(--tv-shift);
    transition: rotate .5s cubic-bezier(.3, 1.4, .5, 1), translate .5s ease, border-radius .5s ease, box-shadow .4s ease, background-color .3s ease;
}
.tv .rr-option.rr-type-correct { box-shadow: 6px 7px 0 color-mix(in srgb, var(--rp-correct) 55%, #000); }
/* Cards and panels behind them: cut a little too, so nothing on the screen is a plain rounded box. */
.tv-final-board.leaderboard-card, .tv-room { border-radius: 30px 18px 34px 20px / 20px 32px 18px 30px; box-shadow: 8px 10px 0 rgb(0 0 0 / 28%); }
.tv-final-board.leaderboard-card { rotate: .6deg; }
.tv-qr-card { border-radius: 26px 16px 24px 18px / 18px 26px 16px 24px; rotate: -2deg; box-shadow: 7px 9px 0 rgb(0 0 0 / 32%); }
.tv-code { rotate: -2deg; text-shadow: 4px 5px 0 rgb(0 0 0 / 35%); }

/* ── Corner join card during the game, offline notice ── */
.tv-corner {
    position: absolute; z-index: 4; right: 40px; bottom: 22px; display: flex; align-items: center; gap: 12px;
    padding: 8px 16px 8px 8px; border-radius: 18px; background: var(--bg-secondary); border: 1px solid var(--tv-line);
}
.tv-corner img { width: 70px; height: 70px; padding: 5px; border-radius: 10px; background: #fff; image-rendering: pixelated; }
.tv-corner-text { display: flex; flex-direction: column; gap: 2px; }
.tv-corner-site { color: var(--text-secondary); font-size: 14px; font-weight: 600; }
.tv-corner-code { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: .12em; color: var(--gold); }
/* On the reveal and the final screen it takes the timer's place in the top bar, leaving them the whole height. */
body:is([data-view="reveal"], [data-view="final"]) .tv-corner { top: 16px; bottom: auto; padding: 5px 14px 5px 5px; border-radius: 14px; }
body:is([data-view="reveal"], [data-view="final"]) .tv-corner img { width: 58px; height: 58px; padding: 4px; border-radius: 9px; }
body:is([data-view="reveal"], [data-view="final"]) .tv-corner-code { font-size: 20px; }
.tv-offline {
    position: absolute; z-index: 5; left: 50%; bottom: 24px; transform: translateX(-50%);
    padding: 10px 20px; border-radius: 999px; background: var(--rp-wrong); color: #17191f; font-weight: 700; font-size: 18px;
}

@media (prefers-reduced-motion: reduce) {
    .tv *, .tv *::before, .tv *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── «100 к 1»: the show's board ──
   The question on a navy card with the yellow edge, the answers face down in two columns (number, dots, points);
   a find flips its card over (rotateX) to the yellow side with the red diamond and who found it; a miss stamps the
   big red cross with the guess crossed out. At the round end the answers nobody found flip to the navy side. */
.tv-board { flex-direction: column; gap: 14px; }
/* .tv-hk-main and the board itself: client/assets/css/hundred-board.css (shared with the PC stage). */

/* The scores under the board: every player lit, the leader with the yellow edge, «+N» floating up after a find. */
.tv-hk-scores .tv-chip { opacity: 1; gap: 10px; }
.tv-hk-scores .tv-chip.is-leader { border-color: var(--hk-yellow); }
.tv-hk-score-value { font-family: var(--font-display); font-weight: 800; color: var(--hk-yellow); }
.tv-hk-gain {
    position: absolute; right: 6px; top: -8px; padding: 0 8px; border-radius: 8px; background: var(--hk-yellow); color: var(--hk-ink);
    font-family: var(--font-display); font-weight: 800; font-size: 18px; pointer-events: none;
    animation: tv-hk-gain 1.4s ease-out forwards;
}
@keyframes tv-hk-gain { 0% { opacity: 0; translate: 0 10px; } 15% { opacity: 1; translate: 0 0; } 75% { opacity: 1; } 100% { opacity: 0; translate: 0 -26px; } }

/* The round's leaderboard (reveal-results.js) on the show's navy, as the phones' hk-theme.css. */
body[data-tv-game="100-to-1"] .tv .rr-leaderboard-title { color: var(--text-secondary); }
body[data-tv-game="100-to-1"] .tv .rr-lb-row { --tv-lb-bg: var(--hk-surface, var(--tv-surface)); --tv-lb-line: rgb(255 255 255 / 10%); }
body[data-tv-game="100-to-1"] .tv .rr-lb-row.rr-leading { --tv-lb-line: var(--hk-yellow); }
body[data-tv-game="100-to-1"] .tv .rr-lb-pos { color: var(--text-secondary); background: rgb(255 255 255 / 12%); }
body[data-tv-game="100-to-1"] .tv .rr-lb-pos:is(.rr-gold, .rr-silver, .rr-bronze) { color: #fff; }
body[data-tv-game="100-to-1"] .tv .rr-lb-score { color: var(--hk-yellow); }
body[data-tv-game="100-to-1"] .tv .rr-lb-delta { padding: 1px 6px; border-radius: 6px; background: var(--hk-deep); }

/* ── «На весь экран» (fullscreen.ts): the header's round icon button in the window's bottom-left corner, outside the
   scaled stage (bottom-right is the join card, the top corners hold the round and the timer). Fades out while the
   mouse rests and comes back on any movement, touch or key. ── */
.tv-tools {
    position: fixed; z-index: 990; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 10px; pointer-events: none;
}
.tv-tools > * { pointer-events: auto; }
.tv-fullscreen { color: var(--text-primary, #fff); transition: opacity .4s ease; }
.tv-fullscreen[hidden] { display: none; }
.tv-fullscreen:active { transform: none; } /* game-motion.css gives the springy press */
.tv-fullscreen:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.tv-fullscreen.is-idle { opacity: 0; pointer-events: none; }
.tv-fullscreen .rp-icon { font-size: 22px; }

/* ── «Громкость» (volume.ts): the same round header button with the speaker; a click opens the slider beside it in
   the header's chip (the button then mutes and unmutes). Fades with «На весь экран» while the mouse rests. ── */
.tv-volume { display: flex; align-items: center; gap: 8px; color: var(--text-primary, #fff); transition: opacity .4s ease; }
.tv-volume.is-idle { opacity: 0; pointer-events: none; }
.tv-volume-btn:active { transform: none; }
.tv-volume-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.tv-volume-btn .rp-icon { font-size: 22px; }
.tv-volume-panel {
    display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px;
    border-radius: 999px; border: 1px solid var(--rp-gh-line, rgb(255 255 255 / 24%));
    background: var(--rp-gh-chip, rgb(255 255 255 / 14%));
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    animation: tv-volume-in .2s ease-out;
}
.tv-volume-panel[hidden] { display: none; }
@keyframes tv-volume-in { from { opacity: 0; transform: translateX(-8px); } }
.tv-volume-value { min-width: 4.2ch; font: 700 15px/1 var(--font-body); font-variant-numeric: tabular-nums; text-align: right; }
.tv-volume-range {
    --tv-volume: 100%;
    width: 180px; height: 24px; margin: 0; background: transparent; cursor: pointer;
    -webkit-appearance: none; appearance: none;
}
.tv-volume-range:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 999px; }
.tv-volume-range::-webkit-slider-runnable-track {
    height: 6px; border-radius: 999px;
    background: linear-gradient(90deg, var(--gold, var(--accent)) var(--tv-volume), var(--tv-line, rgb(255 255 255 / 16%)) var(--tv-volume));
}
.tv-volume-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--tv-line, rgb(255 255 255 / 16%)); }
.tv-volume-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--gold, var(--accent)); }
.tv-volume-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%;
    background: var(--text-primary, #fff); border: 0; box-shadow: 0 2px 6px rgb(0 0 0 / 30%);
    transition: transform .15s ease;
}
.tv-volume-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--text-primary, #fff); box-shadow: 0 2px 6px rgb(0 0 0 / 30%); }
.tv-volume-range:active::-webkit-slider-thumb { transform: scale(1.2); }

/* ── «Пауза» / «Ждём хоста…»: the phones' pause screen (shared/client/online-pause.ts) over the whole window (not
      only the 16:9 stage, whose edges showed on a 16:10 screen), its card scaled with the stage (--tv-scale, fitStage)
      and read from across the room; a screen has no «Продолжить» or «Выйти из игры» (it is not the host, never leaves) ── */
#online-pause-overlay.tv-pause { border-radius: 0; }
#online-pause-overlay.tv-pause .rp-pause-card { zoom: 1.6; zoom: calc(1.6 * var(--tv-scale, 1)); }
#online-pause-overlay.tv-pause .rp-pause-resume,
#online-pause-overlay.tv-pause .rp-pause-exit { display: none; }

/* A game the screen can't show: its icon and name, big, over «Играем на телефонах». */
.tv-game-tag--big { gap: 16px; font-size: 28px; color: var(--text-primary); }
.tv-game-tag--big img { width: 72px; height: 72px; border-radius: 16px; }

/* ── Player status under the chip in the room view (owner 2026-11-02: «Готов», «Читает правила»…) ── */
.tv-player-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tv-player-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tv-player-top .rp-player-name { flex: 0 1 auto; }
.tv-player-status {
    font-size: 14px; font-weight: 700; line-height: 1.2;
    color: var(--text-secondary); overflow: hidden;
    /* A long status (Выбирает вопросы next to the host badge, long languages) takes a second line, not «…». */
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere;
}
.tv-player-status.is-ready { color: var(--rp-correct); }
.tv-player-status.is-busy { color: var(--gold); }
/* The yellow page (Детектор правды) sets white cards: gold on white is lost, its orange takes over, as on .tv-badge. */
body[data-tv-game="truth-detector"] .tv-player-status.is-busy { color: var(--td-orange); }

/* ── «Для стрима» (main.ts streamPopup): the connect view's second button, the settings line and the OBS link ── */
.tv-button--ghost {
    background: transparent; color: var(--text-primary); border: 2px solid var(--tv-line); box-shadow: none;
    animation: none; min-height: 48px; padding: 8px 28px; font-size: 17px;
}
.tv-button--ghost::after { content: none; }
.tv-stream-setup { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tv-stream-info { margin: 0; color: var(--gold); font-size: 16px; font-weight: 700; max-width: 760px; }
.tv-stream-hint { margin: 0; color: var(--text-secondary); font-size: 15px; line-height: 1.4; max-width: 720px; text-wrap: balance; }
/* «Войти через Twitch»: the channel chip and «Выйти» in one row, the hint under it. */
.tv-twitch { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tv-twitch-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
/* A stream screen set up: the setup sits next to the code form, so the view still fits the 720 px stage. */
body.tv-stream .tv-connect { gap: 10px; }
body.tv-stream .tv-connect .tv-cube { width: 64px; height: 64px; }
/* OBS browser source: no window tools (nobody clicks inside OBS). */
body.tv-obs .tv-tools { display: none !important; }
/* «Для стрима» once connected: the gear in the corner opens the same settings (on the connect view the big button). */
body[data-view="connect"] .tv-stream-tool { display: none; }
/* «Для стрима» only on the test site: main.ts adds .tv-beta from /api/config betaFeatures (prod has none). */
body:not(.tv-beta) .tv-stream-setup, body:not(.tv-beta) .tv-stream-tool { display: none !important; }

/* ── Stream: the players' code hidden, the audience's code and QR ── */
.tv-lobby.is-code-hidden .tv-qr-card { display: none; }
.tv-lobby.is-code-hidden .tv-code { font-size: 44px; letter-spacing: 0; rotate: 0deg; }
.tv-audience-line { margin-top: 10px; font-size: 16px; color: var(--gold); }
.tv-corner.is-off { display: none !important; }

/* ── «Зрители» in the corner: how many voted, then the split (top three; the winner or the right answer green) ── */
.tv-corner-poll {
    display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 120px; min-height: 70px;
    padding-left: 12px; border-left: 1px solid var(--tv-line);
}
.tv-corner-poll.is-result { width: 250px; }
.tv-corner-poll:not(.is-result) .tv-cp-head { flex-direction: column; align-items: flex-start; gap: 2px; }
/* On the reveal and the final screen the corner sits in the top bar: with the viewers' split there, the split
   alone stays (the QR comes back with the next question), so it never covers the RoomPlay logo. */
body:is([data-view="reveal"], [data-view="final"]) .tv-corner.has-poll > :not(.tv-corner-poll) { display: none; }
body:is([data-view="reveal"], [data-view="final"]) .tv-corner.has-poll .tv-corner-poll { padding-left: 4px; border-left: 0; min-height: 58px; }
.tv-cp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tv-cp-title { font-weight: 800; font-size: 15px; color: var(--gold); }
.tv-cp-count { color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.tv-cp-row { display: grid; grid-template-columns: 1fr 60px 50px; align-items: center; gap: 6px; font-size: 13px; }
.tv-cp-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-primary); }
.tv-cp-bar { height: 8px; border-radius: 999px; background: rgb(255 255 255 / 12%); overflow: hidden; }
.tv-cp-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.tv-cp-row.is-win .tv-cp-bar i { background: var(--rp-correct); }
.tv-cp-row.is-win .tv-cp-text { font-weight: 800; }
.tv-cp-pct { text-align: right; font-family: var(--font-display); font-size: 14px; }

/* ── «Угадай мелодию» «Лента лет» (main.ts timelineBoard): every player's timeline in a cut-paper row, years as white
   chips with ink, the song at its place gold («?»), then green or red with its year. Palette tokens only. ── */
.tv-tl { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.tv-tl-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.tv-tl-title { font: 800 34px/1.1 var(--font-display); letter-spacing: -.02em; }
.tv-tl-sub { color: var(--text-secondary); font-size: 20px; margin-top: 4px; }
.tv-tl-year { font: 800 54px var(--font-display); background: var(--gold); color: var(--accent-ink); padding: 6px 22px;
  border-radius: var(--cut-2, 16px); box-shadow: var(--cut-shadow, 5px 6px 0 rgb(0 0 0 / 34%)); rotate: 2deg; }
.tv-tl-rows { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
.tv-tl-row { display: flex; align-items: center; gap: 16px; background: var(--tv-surface); border-radius: var(--cut-1, 16px);
  box-shadow: var(--cut-shadow, 5px 6px 0 rgb(0 0 0 / 34%)); padding: 10px 18px; rotate: -.3deg; }
.tv-tl-row:nth-child(2n) { border-radius: var(--cut-3, 16px); rotate: .3deg; }
.tv-tl-row.is-lead { box-shadow: 6px 7px 0 color-mix(in srgb, var(--gold) 65%, #000); }
.tv-tl-name { width: 190px; flex: none; overflow: hidden; }
.tv-tl-cards { display: flex; flex: 1; flex-wrap: wrap; gap: 8px; align-items: center; }
.tv-tl-chip { background: #fff; color: var(--accent-ink); font: 800 18px var(--font-display); padding: 7px 10px; border-radius: 8px 12px 8px 10px;
  box-shadow: 2px 3px 0 rgb(0 0 0 / 30%); }
.tv-tl-chip.is-new { background: var(--gold); }
.tv-tl-chip.is-ok { background: var(--rp-correct); color: var(--rp-correct-ink); }
.tv-tl-chip.is-no { background: var(--rp-wrong); color: var(--rp-wrong-ink); text-decoration: line-through; }
.tv-tl-tag { font-weight: 800; font-size: 17px; color: var(--rp-wrong); max-width: 260px; text-align: right; }
.tv-tl-count { font: 800 30px var(--font-display); color: var(--gold); min-width: 80px; text-align: right; }
.tv-tl-count small { font-size: 17px; color: var(--text-secondary); }
.tv-tl-note { align-self: flex-start; background: var(--tv-surface); padding: 10px 16px; border-radius: var(--cut-4, 14px); font-weight: 700; font-size: 19px; }

/* Premium samples (owner 2026-11-09 «это должно быть одинаково во всех местах. Логичнее не показывать»): the big screen
   shows the sample question as any other; the chip «Из премиум-набора…» stays on the players' phones and PCs, where it
   leads to Premium. One rule for every game on /tv/ (Детектор правды, КХТМЗ, ЧБТВ, Кто из нас, Я никогда не, 100 к 1). */
.tv-td-teaser { display: none !important; }
/* The stream's Twitch channel under the logo in the lobby (shared «Аватарка с именем» chip, main.ts renderStreamerChip). */
.tv-streamer { display: flex; justify-content: center; max-width: 100%; margin: -2px 0 2px; }
.tv-streamer-chip { max-width: 100%; font-size: 18px; font-weight: 700; }
