/* «Детектор правды»: a step of a round 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
   hundred-board.css, question-stage.css and quiplash-matchup.css). The markup and the moving part are
   shared/client/truth-detect.ts; the page supplies the palette (--td-ink, --td-surface, --td-on-surface,
   --td-on-surface-muted, --td-orange, --text-secondary, --rp-wrong).

   The statement in ink on the yellow page, the polygraph as a dark cut strip with the orange line running under the
   pen (it jumps with each answer), «Да» / «Нет» as the phones' two big dark buttons, cut and leaning towards each
   other, the numbers as a row of dark tiles. A PC player's picks are buttons: hover lifts the card, the pick gets the
   orange edge, the others fade. */
.tdd-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;
}
@keyframes tdd-cut-in { from { opacity: 0; transform: translateY(-26px) rotate(-5deg) scale(1.06); } }
@keyframes tdd-in { from { opacity: 0; transform: translateY(14px); } }

.tv-td-main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
/* The premium sample's chip (also «Кто из нас», ЧБТВ and КХТМЗ on /tv/). */
.tv-td-teaser {
    display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 14px;
    color: var(--td-orange); background: var(--td-surface); font-size: 19px; font-weight: 700;
    border-radius: var(--cut-2); box-shadow: 4px 5px 0 rgb(39 39 35 / 26%); rotate: -1.5deg;
    animation: tdd-cut-in .55s cubic-bezier(.3, 1.45, .5, 1) both;
}
.tdd-root .tv-td-teaser.hidden { display: none; }
.tv-td-text {
    max-width: 1080px; margin: 0; color: var(--td-ink); font-weight: 700; font-size: 44px; line-height: 1.22;
    text-align: center; text-wrap: balance; overflow-wrap: anywhere;
    animation: tdd-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
.tdd-root.is-guessing .tv-td-text { font-size: 32px; color: var(--text-secondary); }
/* The polygraph: a dark cut strip, the orange line running under the pen; the pen jumps with each answer. */
.tv-td-meter {
    position: relative; display: flex; align-items: center; gap: 14px; width: 640px; height: 70px; padding: 0 18px;
    background: var(--td-surface); border-radius: var(--cut-3); box-shadow: 6px 7px 0 rgb(39 39 35 / 28%); rotate: .8deg;
    animation: tdd-cut-in .6s .1s cubic-bezier(.3, 1.45, .5, 1) both;
}
.tv-td-meter-lamp {
    flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--rp-wrong);
    box-shadow: 0 0 0 4px rgb(253 130 106 / 22%); animation: tv-td-lamp 1.2s steps(1) infinite;
}
@keyframes tv-td-lamp { 50% { opacity: .35; } }
.tv-td-meter-strip { position: relative; flex: 1; height: 50px; overflow: hidden; border-radius: 8px; background: rgb(255 255 255 / 6%); }
.tv-td-meter-line { position: absolute; top: 0; left: 0; width: 200%; height: 100%; animation: tv-td-run 3.6s linear infinite; }
.tv-td-meter-line path { fill: none; stroke: var(--td-orange); stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
@keyframes tv-td-run { to { transform: translateX(-50%); } }
.tv-td-meter-pen {
    position: absolute; top: 50%; right: 56px; width: 4px; height: 44px; margin-top: -22px; border-radius: 2px;
    background: #fff; transform-origin: 50% 100%;
}
.tv-td-meter.is-twitch .tv-td-meter-pen { animation: tv-td-pen .6s cubic-bezier(.3, 1.6, .5, 1); }
.tv-td-meter.is-twitch .tv-td-meter-strip { animation: tv-td-jolt .5s ease; }
@keyframes tv-td-pen { 20% { transform: scaleY(1.45) rotate(-14deg); } 45% { transform: scaleY(.6) rotate(12deg); } 70% { transform: rotate(-5deg); } }
@keyframes tv-td-jolt { 30% { transform: scaleY(1.35); } }
.tv-td-hint { margin: 0; color: var(--td-ink); font-size: 26px; font-weight: 700; }
/* «Да» / «Нет»: the phones' two big dark buttons as cut cards leaning towards each other; the numbers in a row. */
.tv-td-picks { display: flex; justify-content: center; gap: 30px; }
.tv-td-pick {
    display: grid; place-items: center; min-width: 260px; height: 120px; padding: 0 30px;
    color: var(--td-on-surface); background: var(--td-surface);
    font-family: var(--font-display); font-weight: 800; font-size: 46px; letter-spacing: -.02em;
    border-radius: var(--cut-1); box-shadow: 6px 7px 0 rgb(39 39 35 / 30%); rotate: -1.6deg;
    animation: tdd-cut-in .6s cubic-bezier(.3, 1.45, .5, 1) both; animation-delay: calc(200ms + var(--i, 0) * 110ms);
}
.tv-td-pick:nth-child(even) { border-radius: var(--cut-2); rotate: 1.4deg; translate: 0 8px; }
.tv-td-picks.is-numbers { flex-wrap: wrap; gap: 16px; max-width: 1100px; }
.tv-td-picks.is-numbers .tv-td-pick { min-width: 0; width: 92px; height: 92px; padding: 0; font-size: 40px; color: var(--td-orange); }
.tv-td-picks.is-numbers .tv-td-pick:nth-child(3n) { border-radius: var(--cut-3); rotate: -.6deg; translate: 0 -4px; }

/* ── A PC player's picks (buttons): hover lifts the card, the pick gets the orange edge, the others fade. ── */
.tdd-root button.tv-td-pick {
    margin: 0; border: 3px solid transparent; cursor: default;
    transition: opacity .25s ease, border-color .2s ease, box-shadow .2s ease, scale .15s ease;
}
.tdd-root .is-votable button.tv-td-pick:not(:disabled) { cursor: pointer; }
.tdd-root .is-votable button.tv-td-pick:hover:not(:disabled) { border-color: color-mix(in srgb, var(--td-orange) 70%, transparent); box-shadow: 8px 10px 0 rgb(39 39 35 / 34%); }
.tdd-root button.tv-td-pick:active:not(:disabled) { scale: .97; }
.tdd-root button.tv-td-pick:focus-visible { outline: 3px solid var(--td-ink); outline-offset: 3px; }
.tdd-root .is-locked .tv-td-pick:not(.is-selected) { opacity: .45; }
.tdd-root .tv-td-pick.is-selected { color: var(--td-ink); background: var(--td-orange); border-color: var(--td-surface); box-shadow: 6px 7px 0 var(--td-surface); }

/* ── The reveal (reveal-results.js `dashboard` in question-stage.css .qs-reveal: /tv/ #r-box, a PC player's
   #reveal-container on the stage) as on the phones (td-theme.css): the statement in ink on the page, the yes count as a
   dark stamp with the orange number, the guesses and the scores on dark cards with white text. */
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal :is(.rr-option, .rr-lb-row) { color: var(--td-on-surface); --text-secondary: var(--td-on-surface-muted); --text-primary: #fff; }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-context-text { color: var(--td-ink); font-weight: 700; }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-context-subtext { color: var(--text-secondary); font-size: 22px; font-weight: 600; margin-top: 22px; }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .td-yes-count {
    display: inline-block; margin-right: 8px; padding: 6px 16px; color: var(--td-orange); background: var(--td-surface);
    font-family: var(--font-display, 'Unbounded', sans-serif); font-weight: 800; font-size: 34px; border-radius: 14px 24px 14px 26px / 24px 14px 22px 12px; rotate: -3deg;
    box-shadow: 4px 5px 0 rgb(39 39 35 / 28%);
}
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-option { background: var(--td-surface); border-color: var(--td-surface); box-shadow: 5px 6px 0 rgb(39 39 35 / 30%); }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-option-text { color: var(--td-on-surface); }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal :is(.rr-voters-label, .rr-vote-count) { color: var(--td-on-surface-muted); }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-voter { color: var(--td-on-surface); background: rgb(255 255 255 / 12%); }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-option.rr-type-correct { border-color: var(--rp-correct); }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-leaderboard-title { color: var(--text-secondary); }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-lb-row { --tv-lb-bg: var(--td-surface); --tv-lb-line: var(--td-surface); --tv-lb-shadow: 5px 6px 0 rgb(39 39 35 / 30%); }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-lb-row.rr-leading { --tv-lb-line: var(--td-orange); --tv-lb-shadow: 6px 7px 0 color-mix(in srgb, var(--td-orange) 70%, #000); }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal :is(.rr-lb-name, .rr-lb-score) { color: var(--td-on-surface); }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-lb-score { color: var(--td-orange); }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-lb-pos { color: var(--td-on-surface-muted); background: rgb(255 255 255 / 12%); }
:is(body[data-tv-game="truth-detector"], body[data-rp-game="truth-detector"]) .qs-reveal .rr-lb-pos:is(.rr-gold, .rr-silver, .rr-bronze) { color: #fff; }

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