:root {
  color-scheme: dark;
  --page-bg: #0f172a;
  --panel-bg: #142033;
  --panel-raised: #1b2a40;
  --panel-border: #35465d;
  --text: #f1f5f9;
  --muted: #b5c2d3;
  --accent: #e11d48;
  --accent-hover: #c9163e;
  --success: #5fe0b1;
  --focus: #83c2ff;
  --choice-a: #ffb6c5;
  --choice-b: #ffe28b;
  --choice-c: #9ae6cd;
  --choice-d: #9acaff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--text); background: var(--page-bg); font: 400 1rem/1.4 "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button, .nav-link { min-height: 42px; padding: 0.55rem 0.85rem; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-raised); color: var(--text); font-weight: 700; cursor: pointer; text-align: center; }
button:hover:not(:disabled), .nav-link:hover { background: #263951; border-color: #627991; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { color: #fff; background: var(--accent); border-color: transparent; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.danger-quiet { color: #ffb6c5; }
a { color: var(--focus); text-underline-offset: 3px; }
.nav-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button, a, input, select, textarea, [tabindex] { -webkit-tap-highlight-color: transparent; }
:is(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button { touch-action: manipulation; }
input, select, textarea { min-width: 0; width: 100%; min-height: 44px; padding: 0.55rem 0.7rem; border: 1px solid #60758f; border-radius: 7px; background: #0e192a; color: var(--text); }
input::placeholder, textarea::placeholder { color: #98a9bd; opacity: 1; }
textarea { resize: vertical; }
input[readonly] { color: var(--muted); }
label { display: grid; gap: 0.3rem; font-size: 0.86rem; font-weight: 700; }
h1, h2, h3, p { margin: 0; }
h1, h2 { line-height: 1.1; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.hidden, [hidden] { display: none !important; }
html[data-trivia-mode="guest"] .auth-gate, html[data-trivia-mode="display"] .auth-gate,
html[data-trivia-mode="guest"] .host-shell, html[data-trivia-mode="display"] .host-shell { display: none !important; }
html[data-trivia-mode="guest"] #triviaGuest { display: block !important; }
html[data-trivia-mode="display"] #triviaDisplay { display: flex !important; }
.eyebrow { color: var(--muted); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.helper-copy, .empty-state { color: var(--muted); font-size: 0.86rem; line-height: 1.4; }
.empty-state { padding: 0.75rem 0; }
.status-message:empty, #triviaStatus:empty { display: none; }
.status-message { min-height: 1.4em; color: #ffe28b; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; flex-shrink: 0; padding: 0.25rem 0.55rem; border: 1px solid #476080; border-radius: 6px; color: #d4e7ff; background: #1a2c45; font-size: 0.78rem; font-weight: 700; }
.room-code { display: block; color: #fff; font-family: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif; font-size: clamp(3rem, 5.5vw, 6.5rem); font-weight: 700; line-height: 1.1; letter-spacing: 0.09em; overflow-wrap: anywhere; }
.room-code.small { font-size: 1.3rem; letter-spacing: 0.07em; white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: 0.5rem; left: 0.5rem; padding: 0.7rem; transform: translateY(-180%); color: #071321; background: var(--focus); border-radius: 6px; }
.skip-link:focus { transform: translateY(0); }
.shared-status { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 32px; padding: 0.25rem 1rem; border-bottom: 1px solid #30455f; color: var(--muted); background: #111e30; font-size: 0.76rem; overflow-wrap: anywhere; }
.shared-status[data-tone="error"], .shared-status[data-tone="warning"] { color: #ffe28b; }
#triviaStatus[data-kind="error"] { color: #ffe28b; }
body.auth-pending[data-mode="host"] .host-shell, body.auth-pending[data-mode="host"] .shared-status { display: none; }
body.auth-ready .auth-gate, body[data-mode="display"] .auth-gate, body[data-mode="guest"] .auth-gate { display: none; }
body[data-mode="display"] .host-shell, body[data-mode="guest"] .host-shell { display: none; }
body[data-mode="host"] .display-shell, body[data-mode="host"] .guest-shell { display: none; }
body[data-mode="display"] .guest-shell, body[data-mode="guest"] .display-shell { display: none; }

.trivia-brand-mark { display: flex; gap: 0.35rem; }
.trivia-brand-mark span { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 50%; color: #071321; background: var(--choice-a); font-family: "Fredoka", "Segoe UI", Arial, sans-serif; font-size: 1.7rem; font-weight: 700; }
.trivia-brand-mark span:nth-child(2) { background: var(--choice-b); }
.trivia-brand-mark span:nth-child(3) { background: var(--choice-d); }
.trivia-brand-mark.compact span { width: 1.75rem; height: 1.75rem; font-size: 1.1rem; }
.auth-gate { display: grid; place-items: center; min-height: 100dvh; padding: 1rem; background: radial-gradient(ellipse at 50% 25%, #21354e, transparent 65%), var(--page-bg); }
.auth-card { display: grid; gap: 0.8rem; width: min(100%, 420px); padding: 1.8rem; border: 1px solid var(--panel-border); border-radius: 14px; background: var(--panel-bg); box-shadow: 0 20px 60px #02061755; }
.auth-card h1 { font-family: "Fredoka", "Segoe UI", Arial, sans-serif; font-size: 2.45rem; }
.auth-card > p:not(.eyebrow) { color: var(--muted); }
.back-link { justify-self: start; margin-bottom: 0.4rem; }
.auth-form { display: grid; gap: 0.85rem; margin-top: 0.2rem; }
.auth-form .primary { min-height: 46px; }

.host-shell { width: min(100%, 1600px); margin: auto; }
.host-header { display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1rem; border-bottom: 1px solid #30455f; }
.host-brand { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.host-brand h1 { font-family: "Fredoka", "Segoe UI", Arial, sans-serif; }
.host-brand p { margin-top: 0.2rem; color: var(--muted); font-size: 0.82rem; }
.host-account { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; margin-left: auto; min-width: 0; font-size: 0.8rem; }
.host-account span { max-width: 18rem; overflow-wrap: anywhere; }
.host-main { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 0.85rem; align-items: start; padding: 0.85rem 1rem 1rem; }
.host-primary-column, .host-side-column { display: grid; gap: 0.85rem; min-width: 0; }
.venue-note > p { margin-top: 0.5rem; color: var(--muted); font-size: 0.8rem; }
.wake-control { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.8rem; }
.wake-control input { width: 19px; height: 19px; min-height: 0; margin: 0; accent-color: var(--accent); }
.panel { min-width: 0; padding: 1rem; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--panel-bg); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.85rem; }
.panel-heading .eyebrow { margin-bottom: 0.2rem; }
.panel-heading h2 { overflow-wrap: anywhere; }
.setup-panel { display: flex; flex-direction: column; gap: 0.65rem; max-height: calc(100dvh - 141px - var(--bingo-environment-banner-height, 0px)); }
.setup-panel .panel-heading { margin-bottom: 0; }
.room-title-field { max-width: 40rem; }
.setup-tools, .button-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.question-editor-list { display: grid; gap: 0.8rem; min-height: 0; overflow-y: auto; padding: 0.15rem 0.25rem 0.2rem 0.15rem; scrollbar-gutter: stable; }
.question-editor { display: grid; gap: 0.65rem; padding: 0.8rem; border: 1px solid #425672; border-radius: 8px; background: #101c2e; }
.question-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.question-order-actions { display: flex; gap: 0.35rem; }
.question-order-actions button { min-width: 36px; min-height: 36px; padding: 0.25rem 0.55rem; font-size: 0.8rem; }
.question-editor-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.question-editor-choices label { display: flex; align-items: center; gap: 0.45rem; }
.choice-letter { display: grid; place-items: center; width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 5px; color: #071321; background: var(--choice-a); font-weight: 700; }
[data-choice="1"] .choice-letter, .choice-letter[data-choice="1"] { background: var(--choice-b); }
[data-choice="2"] .choice-letter, .choice-letter[data-choice="2"] { background: var(--choice-c); }
[data-choice="3"] .choice-letter, .choice-letter[data-choice="3"] { background: var(--choice-d); }
.question-editor-options { display: grid; grid-template-columns: minmax(6rem, 0.55fr) minmax(8rem, 0.7fr) minmax(0, 1fr); align-items: end; gap: 0.6rem; }
.question-editor-options p { padding-bottom: 0.35rem; color: var(--muted); font-size: 0.76rem; }
.setup-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.2rem; padding-top: 0.7rem; border-top: 1px solid var(--panel-border); }
.setup-footer p { color: var(--muted); font-size: 0.8rem; }
.setup-footer button { flex-shrink: 0; }
.host-control-notice { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; min-height: 32px; margin: -0.2rem 0 0.8rem; color: var(--muted); font-size: 0.84rem; }
.host-control-notice:has(button:not(.hidden)) { padding: 0.65rem; border: 1px solid #8c7440; border-radius: 8px; color: #ffe28b; background: #382d19; }
.host-lobby { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 1rem; align-items: center; padding: 0.8rem; border: 1px solid var(--panel-border); border-radius: 8px; background: #0f1c2f; }
.host-lobby canvas { display: block; width: 170px; height: 170px; max-width: 100%; background: #fff; border: 8px solid #fff; border-radius: 6px; }
.host-lobby-copy { display: grid; gap: 0.55rem; min-width: 0; }
.host-lobby-copy > p { color: var(--muted); font-size: 0.88rem; }
.host-lobby-copy .button-row button { font-size: 0.8rem; }
.host-question { display: grid; gap: 0.75rem; padding: 0.8rem; border: 1px solid var(--panel-border); border-radius: 8px; background: #0f1c2f; }
.question-meta, .guest-question-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; }
.host-question h3 { font-size: 1.55rem; line-height: 1.25; overflow-wrap: anywhere; }
.countdown { display: inline-block; flex-shrink: 0; color: #ffe28b; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.countdown[data-manual="true"] { color: var(--muted); font-size: 0.82rem; font-weight: 400; }
.host-choice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.host-choice-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; border: 1px solid #405772; border-radius: 7px; font-size: 0.94rem; overflow-wrap: anywhere; }
.host-choice-list li.is-correct { border-color: var(--success); background: #183e36; }
.answered-count { color: var(--muted); font-size: 0.86rem; }
.host-game-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.host-game-actions button.primary { min-height: 46px; min-width: 145px; }
.host-standings { margin-top: 1rem; }
.host-standings h3 { margin-bottom: 0.5rem; }
.team-list { display: grid; gap: 0.55rem; max-height: min(42vh, 330px); overflow-y: auto; padding: 0.1rem; }
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 0.55rem; padding: 0.65rem; border: 1px solid #3e536e; border-radius: 7px; background: #101c2e; }
.team-row > div { min-width: 0; }
.team-row .team-name { display: block; font-weight: 700; overflow-wrap: anywhere; }
.team-row .team-status { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.76rem; }
.team-row button { flex-shrink: 0; min-height: 36px; padding: 0.3rem 0.5rem; color: #ffb6c5; font-size: 0.74rem; }
.past-results-list { display: grid; gap: 0.5rem; max-height: 220px; overflow-y: auto; }
.past-results-list li { padding: 0.6rem 0; border-bottom: 1px solid #30455f; overflow-wrap: anywhere; }
.past-results-list li strong { display: block; font-size: 0.85rem; }
.past-results-list li p { margin-top: 0.2rem; color: var(--muted); font-size: 0.75rem; }
.export-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.export-actions button { min-height: 38px; padding: 0.4rem 0.55rem; font-size: 0.76rem; }
.leaderboard { display: grid; gap: 0.5rem; }
.leaderboard-row { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; padding: 0.65rem; border: 1px solid #405772; border-radius: 7px; background: #142439; }
.leaderboard-rank { color: #d1e6ff; font-weight: 700; font-variant-numeric: tabular-nums; }
.leaderboard-name { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.leaderboard-score { color: #ffe28b; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.leaderboard-row:first-child { border-color: #8f7844; background: #2d2a22; }

body[data-mode="display"] { max-height: 100dvh; overflow: hidden; background: radial-gradient(ellipse at 50% 0%, #253b56, transparent 65%), #0a1424; }
body[data-mode="display"] .shared-status { position: fixed; bottom: 0; right: 0; left: 0; z-index: 2; min-height: 24px; padding: 0.1rem 1rem; border-top: 1px solid #30455f; border-bottom: 0; background: #0b1728; font-size: 0.7rem; }
body[data-mode="display"] .skip-link { display: none; }
.display-shell { display: flex; flex-direction: column; gap: 2vh; height: calc(100dvh - 24px - var(--bingo-environment-banner-height, 0px)); padding: 2.6vh 3vw; overflow: clip; overflow-anchor: none; }
.display-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-shrink: 0; min-height: 7vh; padding-bottom: 1.4vh; border-bottom: 1px solid #4c6684; }
.display-header h1 { font-family: "Fredoka", "Segoe UI", Arial, sans-serif; font-size: clamp(1.5rem, 3.1vw, 4.5rem); overflow-wrap: anywhere; }
.display-header .eyebrow { margin-bottom: 0.35vh; font-size: clamp(0.7rem, 1vw, 1.5rem); }
.display-fullscreen { opacity: 0.45; padding: 0.4rem 0.6rem; font-size: 0.8rem; }
.display-fullscreen:hover, .display-fullscreen:focus-visible { opacity: 1; }
.display-lobby { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.8fr); gap: 4vw; align-items: center; min-height: 0; flex: 1; }
.display-lobby-copy h2 { margin: 1.5vh 0 2vh; font-family: "Fredoka", "Segoe UI", Arial, sans-serif; font-size: clamp(2.8rem, 6.6vw, 9rem); line-height: 1.04; }
.display-lobby-copy > .eyebrow { color: var(--choice-b); font-size: clamp(0.8rem, 1.5vw, 2.2rem); }
.display-lobby-copy > p:not(.eyebrow) { color: #d3deea; font-size: clamp(1rem, 2vw, 3rem); line-height: 1.4; }
.display-lobby-teams { margin-top: 3vh; color: var(--choice-c); font-size: clamp(1rem, 1.7vw, 2.5rem); }
#displayLobbyTeamCount { font-weight: 700; }
#displayLobbyTeamList { display: flex; flex-wrap: wrap; gap: 0.35em 0.7em; margin-top: 1vh; max-height: 15vh; overflow: hidden; color: #d3deea; font-size: 0.78em; }
.display-join-card { display: grid; justify-items: center; gap: 1vh; min-width: 0; padding: 2vh 1.7vw; border: 1px solid #536d8b; border-radius: 14px; background: #15253b; text-align: center; }
.display-join-card canvas { display: block; width: min(100%, 27vw, 41vh); height: auto; aspect-ratio: 1; padding: 0.45vw; border: 0.45vw solid #fff; border-radius: 8px; background: #fff; }
.display-join-card .eyebrow { margin-top: 0.5vh; font-size: clamp(0.8rem, 1.2vw, 1.8rem); }
.display-join-url { max-width: 100%; color: #d3deea; font-size: clamp(0.85rem, 1.15vw, 1.7rem); overflow-wrap: anywhere; }
.display-question-panel { display: flex; flex-direction: column; gap: 2vh; flex: 1; min-height: 0; }
.display-question-meta { display: flex; align-items: center; gap: 1.5vw; flex-shrink: 0; color: #c6d8ed; font-size: clamp(1rem, 1.5vw, 2.2rem); }
.display-question-number { color: var(--choice-b); font-weight: 700; }
.display-countdown { margin-left: auto; color: #ffe28b; font-size: clamp(1.4rem, 3.3vw, 4.8rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.display-countdown[data-manual="true"] { color: var(--muted); font-size: clamp(1rem, 1.35vw, 1.9rem); font-weight: 400; }
#displayQuestionText { display: flex; align-items: center; flex: 0 1 auto; min-height: 8vh; max-height: 26vh; font-family: "Fredoka", "Segoe UI", Arial, sans-serif; font-size: clamp(1.8rem, 3.2vw, 4.8rem); line-height: 1.14; overflow-wrap: anywhere; }
.display-choice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 1.7vh 1.2vw; flex: 1; min-height: 0; }
.choice-card { display: flex; align-items: center; gap: 1.15vw; min-width: 0; min-height: 0; padding: 1.25vh 1.4vw; border: 2px solid #5d7391; border-radius: 11px; background: #14243a; font-size: clamp(1.4rem, 2.45vw, 3.5rem); font-weight: 700; line-height: 1.18; overflow-wrap: anywhere; }
.choice-card .choice-letter { width: 3.1vw; height: 3.1vw; min-width: 1.9rem; min-height: 1.9rem; border-radius: 7px; font-size: 1em; }
.choice-text { min-width: 0; }
.choice-card.is-correct { border-color: var(--success); background: #1a443b; box-shadow: inset 0 0 0 2px #5fe0b140; }
.choice-card.is-muted { opacity: 0.5; }
.display-question-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-shrink: 0; min-height: 3.5vh; color: #c7d7e8; font-size: clamp(0.9rem, 1.5vw, 2.1rem); }
#displayRevealMessage { color: var(--success); font-weight: 700; }
.display-leaderboard-panel { display: flex; flex-direction: column; align-items: center; gap: 1.3vh; flex: 1; min-height: 0; text-align: center; }
.display-leaderboard-panel > .eyebrow { font-size: clamp(0.8rem, 1.2vw, 1.8rem); }
.display-leaderboard-panel > h2 { font-family: "Fredoka", "Segoe UI", Arial, sans-serif; font-size: clamp(2.4rem, 4.1vw, 6rem); }
.display-winner { color: var(--choice-b); font-family: "Fredoka", "Segoe UI", Arial, sans-serif; font-size: clamp(2rem, 3.4vw, 5rem); line-height: 1.1; overflow-wrap: anywhere; }
.display-leaderboard { width: min(100%, 70vw); gap: 0.8vh; min-height: 0; overflow: hidden; font-size: clamp(1.2rem, 2.1vw, 3rem); text-align: left; }
.display-leaderboard .leaderboard-row { grid-template-columns: 4vw minmax(0, 1fr) auto; padding: 0.9vh 1.3vw; }
.display-leaderboard:has(.leaderboard-row:nth-child(6)) { width: min(100%, 86vw); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8vh 1vw; font-size: clamp(1.1rem, 1.7vw, 2.5rem); }
.display-leaderboard:has(.leaderboard-row:nth-child(6)) .leaderboard-row { grid-template-columns: 2.5vw minmax(0, 1fr) auto; gap: 0.65vw; padding: 0.6vh 0.8vw; }
.display-final-message { margin-top: auto; color: var(--muted); font-size: clamp(1rem, 1.5vw, 2.3rem); }

body[data-mode="guest"] { background: radial-gradient(ellipse at 50% 0%, #213854, transparent 35rem), var(--page-bg); }
body[data-mode="guest"] .shared-status { flex-direction: column; align-items: stretch; gap: 0.15rem; min-height: 32px; padding: 0.35rem 0.85rem; font-size: 0.76rem; }
body[data-mode="guest"] .skip-link { display: none; }
.guest-shell { width: min(100%, 520px); margin: 0 auto; padding: 0.85rem; }
.guest-header { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.2rem 0 0.9rem; border-bottom: 1px solid #48617e; }
.guest-header h1 { margin-top: 0.2rem; font-family: "Fredoka", "Segoe UI", Arial, sans-serif; font-size: 1.5rem; }
.guest-header .eyebrow { font-size: 0.65rem; }
.guest-header .room-code.small { padding: 0.3rem 0.45rem; border: 1px solid #526f90; border-radius: 6px; color: #ffe28b; font-size: 1rem; }
.guest-panel { display: grid; gap: 0.85rem; margin-top: 1rem; }
.guest-join-intro { display: grid; gap: 0.75rem; margin: 0.6rem 0; }
.guest-join-intro h2 { font-family: "Fredoka", "Segoe UI", Arial, sans-serif; font-size: 2rem; line-height: 1.12; }
.guest-join-intro p { color: #c7d7e8; font-size: 0.95rem; }
.guest-join-form { display: grid; gap: 0.85rem; padding: 1rem; border: 1px solid #49617e; border-radius: 10px; background: #14243a; }
.guest-join-form input { min-height: 48px; font-size: 1rem; }
#guestJoinRoomInput { text-transform: uppercase; letter-spacing: 0.06em; }
.guest-join-form .primary { min-height: 52px; margin-top: 0.15rem; font-size: 1.05rem; }
.guest-reassurance { color: var(--muted); font-size: 0.78rem; text-align: center; }
.guest-team { padding-bottom: 0.7rem; border-bottom: 1px solid #354e6b; }
.guest-team h2 { margin-top: 0.2rem; font-size: 1.3rem; overflow-wrap: anywhere; }
.guest-question-meta { color: var(--choice-b); font-size: 0.84rem; font-weight: 700; }
.guest-waiting { padding: 1.1rem; border: 1px solid #46617f; border-radius: 10px; background: #14243a; color: #d3e2f1; font-size: 1.06rem; text-align: center; }
.guest-waiting:empty { display: none; }
#guestQuestionPanel { display: grid; gap: 0.6rem; }
#guestQuestionText { font-size: 1.35rem; line-height: 1.23; overflow-wrap: anywhere; }
.guest-choice-list { display: grid; gap: 0.6rem; margin-top: 0.3rem; }
.guest-choice { display: flex; align-items: center; gap: 0.7rem; width: 100%; min-height: 66px; padding: 0.75rem; border: 2px solid #60799a; border-radius: 10px; background: #1a2d46; font-size: 1.1rem; font-weight: 700; line-height: 1.22; text-align: left; overflow-wrap: anywhere; }
.guest-choice .choice-letter { width: 2.25rem; height: 2.25rem; font-size: 1.1rem; }
.guest-choice.is-selected, .guest-choice[aria-pressed="true"] { border-color: var(--focus); background: #203f60; }
.guest-choice.is-correct { border-color: var(--success); background: #19433b; }
.guest-choice:disabled { opacity: 0.65; }
.guest-choice.is-selected:disabled { opacity: 1; }
.guest-confirm-answer { width: 100%; min-height: 54px; margin-top: .4rem; font-size: 1.1rem; }
.guest-answer-status:not(:empty) { padding: 0.8rem; border: 1px solid #367a68; border-radius: 8px; background: #163a32; color: #a7f1d9; font-size: 0.97rem; font-weight: 700; text-align: center; }
.guest-answer-status[data-tone="error"] { border-color: #996743; background: #392718; color: #ffe0b6; }
#guestFinalSummary { color: var(--muted); }
.guest-footer { margin-top: 1.6rem; padding-bottom: 0.4rem; color: #a7b8cc; font-size: 0.74rem; text-align: center; }

@media (max-width: 1000px) {
  .host-brand .trivia-brand-mark { display: none; }
  .host-main { grid-template-columns: minmax(0, 1fr) 250px; }
  .host-account span { max-width: 11rem; }
  .host-lobby { grid-template-columns: 130px minmax(0, 1fr); gap: 0.75rem; }
  .host-lobby canvas { width: 130px; height: 130px; }
  .host-lobby .button-row button { flex-grow: 1; }
}

@media (max-width: 760px) {
  .host-header { flex-wrap: wrap; gap: 0.65rem; padding: 0.75rem; }
  .host-header > .nav-link { min-height: 38px; padding: 0.35rem 0.6rem; font-size: 0.8rem; }
  .host-brand h1 { font-size: 1.45rem; }
  .host-brand p { font-size: 0.73rem; }
  .host-account { width: 100%; justify-content: space-between; margin-left: 0; padding-top: 0.5rem; border-top: 1px solid #30455f; }
  .host-account span { max-width: none; }
  .host-main { grid-template-columns: minmax(0, 1fr); padding: 0.75rem; }
  .panel { padding: 0.85rem; }
  .setup-panel { max-height: none; }
  .question-editor-list { max-height: none; overflow: visible; scrollbar-gutter: auto; }
  .question-editor { padding: 0.65rem; }
  .question-editor-heading { gap: 0.3rem; }
  .question-editor-title { font-size: 0.9rem; }
  .question-order-actions { gap: 0.2rem; }
  .question-order-actions button { min-width: 32px; min-height: 36px; padding: 0.25rem 0.4rem; }
  .question-editor-choices { grid-template-columns: minmax(0, 1fr); }
  .question-editor-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-editor-options p { grid-column: 1 / -1; padding-bottom: 0; }
  .setup-tools button { flex: 1 1 auto; }
  .setup-footer { align-items: stretch; flex-direction: column; }
  .setup-footer .primary { min-height: 48px; }
  .host-lobby { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .host-lobby canvas { width: 170px; height: 170px; }
  .host-lobby-copy { width: 100%; }
  .host-choice-list { grid-template-columns: minmax(0, 1fr); }
  .host-question h3 { font-size: 1.3rem; }
  .host-game-actions button { flex: 1 1 auto; }
  .team-list { max-height: 330px; }
}

@media (prefers-reduced-motion: no-preference) {
  button, .nav-link { transition: background-color 140ms ease, border-color 140ms ease; }
  .choice-card.is-correct { animation: correct-answer-reveal 320ms ease-out both; }
  .display-winner:not(.hidden) { animation: winner-reveal 450ms cubic-bezier(0.16, 1, 0.3, 1) both; }
}
@keyframes correct-answer-reveal { from { background-color: #14243a; } to { background-color: #1a443b; } }
@keyframes winner-reveal { from { opacity: 0; transform: translateY(0.3rem); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
