/* «Бредовуха»: the question and the answers 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, quiplash-matchup.css, truth-detect.css and wyr-choice.css). The markup
   and the moving part are shared/client/fibbage-stage.ts; the page supplies the palette (--fb-cream, --fb-ink,
   --fb-ink-muted, --fb-ochre, --fb-sage, --fb-maroon, --fb-panel-deep, --text-secondary, --rp-correct, and for the
   letters --accent / --accent-ink). The answer card's base is question-stage.css .tv-option.

   Writing: the fact on cream paper (fb-theme.css .question-card), the gap on an ochre chip stamped in, two notes
   (ochre, sage) cut and turned under the card; the card's last line is the screen's hint or a PC player's lie field.
   Voting: the fact on a smaller card, the answers under it as cut cream cards, two by two (three across past four).
   A PC player's answers are buttons: hover lifts the card, the pick gets the ochre edge, the others fade, its own lie
   stays dimmed. The round reveal (question-stage.css .qs-reveal) in the phones' colours: the question on cream, the
   lies on cream with ink, the truth on the deep maroon with the green edge, the author in maroon. */
.fbs-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;
}
@keyframes fbs-cut-in { from { opacity: 0; transform: translateY(-26px) rotate(-5deg) scale(1.06); } }
@keyframes fbs-note-in { from { opacity: 0; translate: 0 0; rotate: 0deg; } }
@keyframes fbs-stamp { from { opacity: 0; scale: 1.8; rotate: -14deg; } }

/* ── The cream card ── */
.tv-fb-card {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 26px;
    width: 960px; max-width: 100%; padding: 48px 64px 44px; text-align: center;
    background: var(--fb-cream); color: var(--fb-ink);
    border-radius: 30px 18px 34px 20px / 20px 32px 18px 30px; box-shadow: 9px 11px 0 var(--fb-panel-deep);
    rotate: -1.2deg; animation: fbs-cut-in .7s cubic-bezier(.3, 1.45, .5, 1) both;
}
.tv-fb-question { margin: 0; font-weight: 700; font-size: 40px; line-height: 1.28; text-wrap: balance; overflow-wrap: anywhere; color: var(--fb-ink); }
.tv-fb-blank {
    display: inline-block; padding: 0 .22em; border-radius: 8px 5px 9px 6px / 6px 9px 5px 8px;
    background: var(--fb-ochre); color: var(--fb-ink); rotate: -2deg; box-shadow: 2px 3px 0 rgb(23 25 31 / 22%);
}

/* ── Writing: the card on two notes (one grid cell), the gap stamped in ── */
.fbs-lie { display: grid; place-items: center; }
.fbs-lie > * { grid-area: 1 / 1; }
.fbs-lie .tv-fb-blank { animation: fbs-stamp .45s .4s cubic-bezier(.3, 1.6, .5, 1) both; }
.tv-fb-note {
    align-self: stretch; justify-self: stretch; margin: auto; width: 960px; max-width: 100%; height: 300px;
    border-radius: 18px 32px 20px 30px / 30px 20px 32px 18px; box-shadow: 7px 9px 0 rgb(0 0 0 / 26%);
}
.tv-fb-note--ochre { background: var(--fb-ochre); rotate: 3.5deg; translate: 28px 18px; animation: fbs-note-in .7s .15s cubic-bezier(.3, 1.45, .5, 1) both; }
.tv-fb-note--sage { background: var(--fb-sage); rotate: -4.5deg; translate: -30px 24px; animation: fbs-note-in .7s .25s cubic-bezier(.3, 1.45, .5, 1) both; }
.tv-fb-slot { width: 100%; }
.tv-fb-slot:empty { display: none; }

/* ── Voting: the smaller card, the hint, the answers ── */
.fbs-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 0 12px; }
.tv-fb-card--small { width: auto; max-width: 1080px; padding: 18px 40px; gap: 0; rotate: -.8deg; box-shadow: 7px 8px 0 var(--fb-panel-deep); }
.tv-fb-card--small .tv-fb-question { font-size: 29px; }
.tv-fb-pick-hint { margin: 0; color: var(--text-secondary); font-size: 19px; font-weight: 600; }
.tv-fb-options { width: 100%; grid-auto-rows: minmax(0, 1fr); gap: 20px 22px; padding: 4px 8px; max-height: calc(var(--tv-fb-rows, 2) * 104px + (var(--tv-fb-rows, 2) - 1) * 20px + 8px); }
.tv-fb-options.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fbs-root .tv-fb-options .tv-option {
    min-height: 0; max-height: 104px; color: var(--fb-ink); background: var(--fb-cream); border-color: transparent;
    font-weight: 600; box-shadow: 5px 6px 0 var(--fb-panel-deep);
    border-radius: var(--cut-1); rotate: -1.1deg;
    animation-name: fbs-cut-in; animation-duration: .6s; animation-timing-function: cubic-bezier(.3, 1.45, .5, 1);
}
.fbs-root .tv-fb-options .tv-option:nth-child(4n + 2) { border-radius: var(--cut-2); }
.fbs-root .tv-fb-options .tv-option:nth-child(4n + 3) { border-radius: var(--cut-3); }
.fbs-root .tv-fb-options .tv-option:nth-child(4n + 4) { border-radius: var(--cut-4); }
.fbs-root .tv-fb-options .tv-option:nth-child(even) { rotate: 1deg; translate: 0 6px; }
.fbs-root .tv-fb-options .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;
}
.fbs-root .tv-fb-options .tv-option:nth-child(even) .tv-option-letter { rotate: 5deg; border-radius: 54% 46% 46% 54% / 46% 54% 50% 50%; }
.tv-fb-options .tv-option-text { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tv-fb-options.is-three .tv-option { font-size: 23px; gap: 14px; padding: 12px 18px; }
.tv-fb-options.is-three .tv-option-letter { width: 44px; height: 44px; font-size: 19px; }
/* Three across: the cards zig-zag by column instead of by pairs. */
.fbs-root .tv-fb-options.is-three .tv-option:nth-child(3n + 1) { rotate: -1deg; translate: -4px 0; }
.fbs-root .tv-fb-options.is-three .tv-option:nth-child(3n + 2) { rotate: .8deg; translate: 0 6px; }
.fbs-root .tv-fb-options.is-three .tv-option:nth-child(3n + 3) { rotate: -.5deg; translate: 4px -2px; }

/* ── A PC player's answers (buttons) ── */
.fbs-root button.tv-option {
    width: 100%; margin: 0; border: 3px solid transparent; font-family: inherit; text-align: left; cursor: default;
    transition: border-color .2s ease, box-shadow .2s ease, opacity .25s ease, scale .15s ease;
}
.fbs-root.is-votable:not(.is-locked) button.tv-option:not(:disabled) { cursor: pointer; }
.fbs-root.is-votable:not(.is-locked) button.tv-option:hover:not(:disabled) { border-color: var(--fb-ochre); box-shadow: 7px 9px 0 var(--fb-panel-deep); }
.fbs-root button.tv-option:active:not(:disabled) { scale: .97; }
.fbs-root button.tv-option:focus-visible { outline: 3px solid var(--fb-ochre); outline-offset: 3px; }
.fbs-root .tv-option.is-own { opacity: .45; }
.fbs-root.is-locked .tv-option:not(.is-selected) { opacity: .45; }
.fbs-root .tv-fb-options .tv-option.is-selected { border-color: var(--fb-ochre); box-shadow: 6px 7px 0 color-mix(in srgb, var(--fb-ochre) 60%, #000); }
.fbs-root .tv-option.is-selected .tv-option-letter { color: var(--fb-ochre); background: var(--fb-maroon); }

/* ── The reveal (reveal-results.js `dashboard` in question-stage.css .qs-reveal: /tv/ #r-box, a PC player's
   #reveal-container) in the phones' colours ── */
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-context {
    padding: 26px 32px; background: var(--fb-cream); border-radius: 14px 24px 14px 26px / 24px 14px 22px 12px;
    box-shadow: 8px 10px 0 var(--fb-panel-deep); rotate: -1.2deg;
}
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-context-text { color: var(--fb-ink); font-weight: 700; }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-leaderboard-title { color: var(--text-secondary); }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-option { background: var(--fb-cream); border: 2px solid transparent; }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-option.rr-type-wrong { border-color: rgb(23 25 31 / 18%); }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-option-text { color: var(--fb-ink); }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal :is(.rr-vote-count, .rr-voters-label, .rr-author, .rr-author-label) { color: var(--fb-ink-muted); }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-author { font-size: 21px; margin-top: 10px; }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-author-name { color: var(--fb-maroon); font-weight: 700; }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-voter { color: var(--fb-ink); background: rgb(23 25 31 / 8%); }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal :is(.rr-voter-points, .rr-author-points, .rr-lb-delta:not(.rr-zero)) { padding: 1px 6px; border-radius: 6px; background: var(--fb-panel-deep); }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-option.rr-type-correct { background: var(--fb-panel-deep); border-color: var(--rp-correct); }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-option.rr-type-correct .rr-option-text { color: #fff; }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-option.rr-type-correct :is(.rr-vote-count, .rr-voters-label) { color: var(--text-secondary); }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-option.rr-type-correct .rr-voter { color: #fff; background: rgb(255 255 255 / 12%); }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-option.rr-type-correct .rr-voter-points { padding: 0; background: none; }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal :is(.rr-lb-name, .rr-lb-score) { color: var(--fb-ink); }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-lb-pos { color: var(--fb-ink-muted); background: rgb(23 25 31 / 8%); }
:is(body[data-tv-game="fibbage"], body[data-rp-game="fibbage"]) .qs-reveal .rr-lb-delta.rr-zero { color: var(--fb-ink-muted); }

@media (prefers-reduced-motion: reduce) {
    .fbs-root :is(.tv-fb-card, .tv-fb-note, .tv-fb-blank, .tv-option) { animation: none; }
}
