/* «Квиз» and «Угадай мелодию»: the question on the big screen, one look on the shared screen (/tv/) and on a PC
   player's stage (owner 2026-10-29: «версии некоторых экранов в ПК и ТВ почти не отличаются» → one code for both,
   after the «100 к 1» pilot, hundred-board.css). The markup and the moving part are shared/client/question-stage.ts;
   the page supplies the palette (--tv-surface, --tv-line, --accent, --accent-ink, --gold, --text-primary,
   --text-secondary, --rp-correct, --rp-wrong).

   The media on the left (the record, a picture, the four photos), the question and the answers A–D as hand-cut cards
   dealt in one by one: two by two, or one column next to media. A PC player's answers are buttons: hover lifts the
   card, the pick turns gold, the result green or red, the others fade. The .tv-option card is also the screen's
   card in its other views (Бредовуха, Каракули, Как хорошо ты меня знаешь?), so its base look lives here unscoped. */
.qs-root {
    --font-display: 'Unbounded', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* The /tv/ hand-cut corners (tv/style.css .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%);
}
.qs-root .hidden { display: none; }
@keyframes qs-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes qs-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes qs-cut-in { from { opacity: 0; transform: translateY(-26px) rotate(-5deg) scale(1.06); } }
@keyframes tv-option-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }

/* ── Question ── */
.tv-q-main { flex: 1; min-height: 0; display: flex; align-items: center; gap: 44px; }
.tv-q-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 26px; }
.tv-q-topic { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; color: var(--text-secondary); animation: qs-in .4s ease both; }
.tv-q-topic-name { color: var(--text-primary); font-weight: 700; overflow-wrap: anywhere; }
.tv-q-text {
    font-weight: 600; font-size: 40px; line-height: 1.25; text-align: center; text-wrap: balance;
    animation: qs-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
.tv-q-text:empty { display: none; }
.qs-root.has-media .tv-q-text { text-align: left; font-size: 34px; }
.tv-q-media { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; animation: qs-pop .55s cubic-bezier(.2, .8, .2, 1) both; }
.tv-q-media img { display: block; max-width: 520px; max-height: 470px; border-radius: 20px; object-fit: contain; box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent); }
/* A picture: its box is there before it loads (520×470, the picture's largest size), so nothing moves when it comes. */
.tv-q-media.is-image { width: 520px; height: 470px; }
.tv-q-media.is-image img { opacity: 0; scale: .96; transition: opacity .35s ease, scale .45s cubic-bezier(.3, 1.4, .5, 1); }
.tv-q-media.is-image img.is-loaded { opacity: 1; scale: 1; }
.tv-q-media.is-four { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 460px; }
.tv-q-media.is-four img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; box-shadow: none; }
/* The record player (music-player.ts): the phones' record, big. */
.tv-q-media.is-record { width: 440px; flex-direction: column; }
.tv-record { width: 100%; }
.qs-root .music-player { width: 100%; }
.qs-root .music-player .vinyl-container { width: 380px; max-width: 380px; margin-bottom: 22px; animation: music-record-drop 420ms cubic-bezier(.2, .9, .25, 1.15) both; }
.qs-root .music-player .vinyl-play-icon { font-size: 54px; }
.qs-root .music-player .audio-player-bar { margin: 0; padding: 14px 20px; border-radius: 18px; }
.qs-root .music-player .audio-hint, .qs-root .music-player .audio-time { font-size: 18px; }
.qs-root .music-player .audio-progress-bar { height: 8px; }

/* Answers: the phones' .quiz-option (card, line, round letter), two by two; one column next to media. */
.tv-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.qs-root.has-media .tv-options { grid-template-columns: 1fr; gap: 14px; }
.tv-option {
    display: flex; align-items: center; gap: 18px; min-height: 84px; padding: 14px 22px;
    border-radius: 20px; background: var(--tv-surface); border: 2px solid var(--tv-line);
    font-size: 26px; font-weight: 500; line-height: 1.25;
    animation: tv-option-in .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(180ms + var(--i, 0) * 110ms);
}
.qs-root.has-media .tv-option { min-height: 74px; font-size: 24px; }
.tv-option-letter {
    flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
    background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 22px;
}
.tv-option-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tv-options.is-two .tv-option { justify-content: center; text-align: center; }
.tv-options.is-two .tv-option-letter { display: none; }
.tv-options.is-four { display: flex; justify-content: center; }
.tv-four-cells { display: flex; gap: 10px; }
.tv-four-cell {
    width: 56px; height: 68px; border-radius: 12px; background: var(--tv-surface); border: 2px solid var(--tv-line);
    animation: tv-option-in .4s ease both; animation-delay: calc(var(--i, 0) * 60ms);
}

/* ── Cut paper (tv/style.css «Cut paper», the same values): each answer a hand-cut card, tilted and shifted in turn,
   with a hard shadow; two side by side lean towards each other, a column next to media zig-zags; the letter a stamp. */
.qs-root .tv-option {
    border-radius: var(--cut-1); box-shadow: var(--cut-shadow); rotate: -.7deg; translate: -4px 0;
    animation-name: qs-cut-in; animation-duration: .6s; animation-timing-function: cubic-bezier(.3, 1.45, .5, 1);
}
.qs-root .tv-option:nth-child(4n + 2) { border-radius: var(--cut-2); rotate: .8deg; translate: 6px 2px; }
.qs-root .tv-option:nth-child(4n + 3) { border-radius: var(--cut-3); rotate: -.4deg; translate: 3px -1px; }
.qs-root .tv-option:nth-child(4n + 4) { border-radius: var(--cut-4); rotate: .5deg; translate: -6px 1px; }
.qs-root .tv-options:not(.is-four) { gap: 20px 22px; padding: 4px 8px; }
.qs-root .tv-options:not(.is-four) .tv-option:nth-child(odd) { rotate: -1.1deg; }
.qs-root .tv-options:not(.is-four) .tv-option:nth-child(even) { rotate: 1deg; translate: 0 6px; }
.qs-root.has-media .tv-options .tv-option:nth-child(odd) { rotate: -.6deg; translate: -4px 0; }
.qs-root.has-media .tv-options .tv-option:nth-child(even) { rotate: .6deg; translate: 8px 0; }
.qs-root .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;
}
.qs-root .tv-option:nth-child(even) .tv-option-letter { rotate: 5deg; border-radius: 54% 46% 46% 54% / 46% 54% 50% 50%; }

/* ── A PC player's answers (buttons): hover lifts the card, the pick is gold, the result green or red. ── */
.qs-root button.tv-option {
    width: 100%; margin: 0; font-family: inherit; color: var(--text-primary); text-align: left; cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, opacity .25s ease, scale .15s ease;
}
.qs-root .tv-options.is-two button.tv-option { text-align: center; }
.qs-root button.tv-option:hover:not(:disabled) { border-color: color-mix(in srgb, var(--gold) 60%, transparent); box-shadow: 7px 9px 0 rgb(0 0 0 / 34%); }
.qs-root button.tv-option:active:not(:disabled) { scale: .97; }
.qs-root button.tv-option:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.qs-root button.tv-option:disabled { cursor: default; }
.qs-root .tv-options.is-locked .tv-option:not(.is-selected, .is-correct, .is-wrong) { opacity: .5; }
.qs-root .tv-option.is-selected { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--tv-surface)); box-shadow: 6px 7px 0 color-mix(in srgb, var(--gold) 55%, #000); animation: qs-stamp .26s cubic-bezier(.3, 1.45, .5, 1); }
.qs-root .tv-option.is-selected .tv-option-letter { background: var(--gold); color: var(--accent-ink); }
.qs-root .tv-option.is-correct { border-color: var(--rp-correct); background: color-mix(in srgb, var(--rp-correct) 14%, var(--tv-surface)); box-shadow: 6px 7px 0 color-mix(in srgb, var(--rp-correct) 55%, #000); animation: qs-stamp .32s cubic-bezier(.3, 1.45, .5, 1); }
.qs-root .tv-option.is-correct .tv-option-letter { background: var(--rp-correct); color: var(--accent-ink); }
.qs-root .tv-option.is-wrong { border-color: var(--rp-wrong); background: color-mix(in srgb, var(--rp-wrong) 12%, var(--tv-surface)); box-shadow: 4px 5px 0 color-mix(in srgb, var(--rp-wrong) 45%, #000); animation: qs-shake .36s ease-out; }
.qs-root .tv-option.is-wrong .tv-option-letter { background: var(--rp-wrong); color: var(--accent-ink); }
@keyframes qs-stamp { 0% { scale: 1; } 45% { scale: 1.04; } 100% { scale: 1; } }
@keyframes qs-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

/* ── Round end (reveal-results.js with `dashboard`), laid out for the wide screen: on /tv/ #r-box (every game), on a
   PC player's stage #reveal-container (main.ts adds .qs-reveal there on the stage only). ── */
.qs-reveal .rr-container { z-index: 1; }
.qs-reveal .rr-screen1, .qs-reveal .rr-screen2 { padding: var(--cut-room, 14px) var(--cut-room, 14px) 24px; overflow: hidden; }
/* Answers: the question (or the record's cover) on the left, the answers one by one on the right. */
.qs-reveal .rr-screen1 {
    display: grid; grid-template-columns: 400px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); column-gap: 44px; align-items: center;
}
.qs-reveal .rr-context { grid-column: 1; margin: 0; align-self: center; }
.qs-reveal .rr-context-text { font-size: 30px; font-weight: 600; line-height: 1.3; text-wrap: balance; }
.qs-reveal .rr-context-subtext { font-size: 18px; line-height: 1.4; margin-top: 14px; }
.qs-reveal .rr-context-image { max-width: 360px; max-height: 360px; width: auto; border-radius: 22px; margin: 0 auto 18px; object-fit: contain; box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent); }
.qs-reveal .rr-context-fourphoto { width: 340px; gap: 6px; border-radius: 16px; }
/* Many answers (a big room) scroll inside their own column: reveal-results.js scrolls the newest answer into view, and
   with the whole screen as the scroller the question on the left went up with it. The cards keep their height, and the
   column's padding leaves room for their tilt and hard shadow (`--cut-room`). */
.qs-reveal .rr-options {
    grid-column: 2; flex: none; gap: 12px; align-self: center; max-height: 100%; overflow-x: hidden; overflow-y: auto; scrollbar-width: none;
    padding: var(--cut-room, 14px); margin: 0 calc(-1 * var(--cut-room, 14px));
}
.qs-reveal .rr-options::-webkit-scrollbar { display: none; }
.qs-reveal .rr-options > * { flex-shrink: 0; }
.qs-reveal .rr-option { border-radius: 20px; padding: 16px 22px; border-width: 2px; }
.qs-reveal .rr-option-text { font-size: 24px; }
.qs-reveal .rr-option.rr-type-correct .rr-option-text::before, .qs-reveal .rr-option.rr-type-wrong .rr-option-text::before { width: 26px; height: 26px; }
.qs-reveal .rr-voters { gap: 10px; margin-top: 12px; }
.qs-reveal .rr-container.rr-dashboard .rr-voter { font-size: 23px; padding: 6px 16px 6px 6px; border-radius: 999px; gap: 9px; }
.qs-reveal .rr-voter-avatar { width: 38px; height: 38px; font-size: 18px; }
.qs-reveal .rr-voter-points { font-size: 21px; }
/* Scores: one wide card in the middle, the rows count up and change places as on the phones. */
/* The board fits the stage for any room: rows share the height (`--tv-rows` from main.ts), never cut at the top. */
.qs-reveal .rr-container.rr-dashboard .rr-screen2 { padding: 0 0 20px; align-items: center; justify-content: safe center; }
.qs-reveal .rr-leaderboard-title { font-size: 20px; margin-bottom: 14px; }
.qs-reveal .rr-leaderboard { width: 760px; gap: 10px; }
.qs-reveal .rr-lb-row {
    padding: 0 22px; gap: 16px; border-radius: 18px;
    height: min(68px, calc((556px - (var(--tv-rows, 1) - 1) * 10px) / var(--tv-rows, 1)));
}
.qs-reveal .rr-lb-pos { width: 40px; height: 40px; font-size: 18px; }
.qs-reveal .rr-lb-avatar { width: 40px; height: 40px; }
.qs-reveal .rr-lb-name { font-size: 24px; }
.qs-reveal .rr-lb-score { font-size: 26px; min-width: 70px; }
.qs-reveal .rr-lb-delta { font-size: 20px; }

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

/* «Микроанимации» 8 (owner 2026-11-10): a question the host reads out falls in word by word (tv/main.ts dealWords). */
.tv-word { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
    .tv-word { animation: tv-word-in .38s cubic-bezier(.3, 1.45, .5, 1) var(--d, 0ms) backwards; }
}
@keyframes tv-word-in { from { opacity: 0; transform: translateY(-14px) rotate(-6deg) scale(1.1); } }
