@import url("theme.css");
:root { font: 20px/1.55 var(--theme-font); color: var(--theme-ink); background: var(--theme-background); color-scheme: var(--theme-scheme); }
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 64rem; margin: auto; padding: clamp(1rem,4vw,3rem); }
h1,h2,h3,p { margin: 0 0 1rem; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem,6vw,3.2rem); letter-spacing: -.04em; line-height: 1.15; }
h2 { font-size: 1.5rem; line-height: 1.35; }
.eyebrow { color: var(--theme-muted); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--theme-muted); }
header { margin-bottom: 2rem; }
.in-room header { margin-bottom: .4rem; }
.in-room header h1 { font-size: 1.25rem; margin: 0; }
.in-room header p { display: none; }
.in-room #status,.in-room #connection { margin: .4rem 0; font-size: .85rem; }
/* One line for where and who you are (issue #85); the connection speaks only when lost. */
.in-room .room-bar { margin: .3rem 0 .8rem; font-weight: 650; color: var(--theme-muted); }
#status:empty,#connection:empty { min-height: 0; margin: 0; }
button.link { background: none; border: 0; color: var(--theme-muted); text-decoration: underline; font-weight: 500; padding: .65rem .25rem; }
.leave-row { margin-top: 2rem; text-align: center; }
.pill.me { border-width: 2px; border-color: var(--theme-ink); font-weight: 650; }
.team-blue::before,.team-gold::before,.team-dot::before { content: ''; display: inline-block; width: .9rem; height: .9rem; border-radius: 50%; margin-right: .5rem; vertical-align: -.05rem; border: 2px solid var(--theme-focus-ink); }
.team-blue::before { background: var(--theme-team-blue); }
.team-gold::before { background: var(--theme-team-gold); }
/* Teams after Blue and Gold (issue #296) carry their colour in --team-colour. */
.team-dot::before { background: var(--team-colour); }
p:empty { display: none; }
.card { background: var(--theme-panel); border: 1px solid var(--theme-line); border-radius: 1rem; padding: clamp(1rem,3vw,2rem); margin-bottom: 1.25rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,18rem),1fr)); gap: 1rem; }
button,input,textarea,select { font: inherit; max-width: 100%; border-radius: .6rem; }
button { min-height: 3rem; padding: .65rem 1rem; border: 2px solid transparent; background: var(--theme-accent); color: var(--theme-focus-ink); font-weight: 650; cursor: pointer; overflow-wrap: anywhere; }
.option-hint { display: block; margin-top: .2rem; font-size: .9em; font-weight: 500; }
button.secondary { background: var(--theme-secondary); border-color: var(--theme-line); color: var(--theme-ink); }
button:disabled { cursor: default; opacity: 1; background: var(--theme-panel); border-color: var(--theme-line); color: var(--theme-muted); }
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible { outline: 4px solid var(--theme-accent); outline-offset: 4px; }
input,textarea,select { display: block; width: 100%; background: var(--theme-background); border: 2px solid var(--theme-line); color: var(--theme-ink); padding: .65rem; margin: .4rem 0 1rem; min-height: 3rem; }
input[type=checkbox] { display: inline-block; width: 1.4rem; min-height: 1.4rem; margin: 0 .5rem 0 0; vertical-align: middle; }
label { display: block; }
textarea { min-height: 5rem; resize: vertical; }
.buzzer { width: 100%; min-height: 8rem; font-size: 2rem; margin-top: 1rem; }
.buzz-mic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; }
.mic-icon { width: 2.4rem; height: 2.4rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.choice { text-align: left; min-height: 4rem; width: 100%; }
/* The answer pad (issue #127 part 2): the TV's four boxes in the same places, each with the TV's
 * big letter (no shape, issue #185). Larger text or a long word turns it into one list; nothing shrinks. */
.pad { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pad.stacked { grid-template-columns: 1fr; }
.choice.tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: .4rem;
  min-height: min(6.5rem, 20vh); padding: .7rem .8rem; line-height: 1.2; overflow-wrap: break-word; }
.pad.stacked .choice.tile { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; column-gap: .8rem; min-height: 4rem; padding: .45rem .6rem; }
.tile .mark { display: flex; align-items: center; flex: none; font-size: 2.1rem; line-height: 1; font-weight: 800; }
/* A word breaks only when it cannot fit a line on its own, at the very largest text. */
.tile .words { font-size: 1.1rem; font-weight: 650; min-width: 0; flex: 1 1 8rem; overflow-wrap: anywhere; }
.pad.stacked .tile .mark { min-width: 2.4rem; }
.message { min-height: 1.6rem; margin: 1rem 0; color: var(--theme-accent); overflow-wrap: anywhere; }
.roster { list-style: none; padding: 0; margin: 0 0 1rem; }
.roster li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem 0; border-top: 1px solid var(--theme-line); overflow-wrap: anywhere; }
.roster li > span:first-child { min-width: 0; flex: 1 1 10rem; }
button.danger { border-color: var(--theme-wrong); }
.pill { display: inline-block; border: 1px solid var(--theme-line); border-radius: 2rem; padding: .2rem .8rem; font-size: .85rem; margin: .2rem .4rem .2rem 0; }
details { margin: 1rem 0; border-top: 1px solid var(--theme-line); padding-top: 1rem; }
summary { cursor: pointer; padding: .4rem 0; min-height: 3rem; font-weight: 650; }
fieldset { min-width: 0; border: 0; padding: 1rem 0; }
/* The host's review is a skim (David, 26 Oct): one line per question, Edit opens it. */
.draft-row { border-top: 1px solid var(--theme-line); padding: .6rem 0; }
.draft-keep { display: flex; gap: .6rem; align-items: flex-start; font-weight: 650; }
.draft-keep input { width: 1.4rem; height: 1.4rem; flex: none; margin-top: .15rem; }
.draft-answer { margin: .2rem 0 0 2rem; color: var(--theme-correct); overflow-wrap: anywhere; }
.draft-row details { margin: .2rem 0 0 2rem; border-top: 0; padding-top: 0; }
.draft-row summary { min-height: 2.75rem; font-weight: 600; color: var(--theme-accent); }
/* Your own choice stays visible while you wait, and the reveal reads first (issue #85). Until the
 * reveal the others stay open, quieter, so a change of mind is one tap (issue #127 part 6). */
.choice.chosen { outline: 4px solid var(--theme-ink); outline-offset: 3px; }
.pad.answered .choice:not(.chosen):not(:disabled) { background: var(--theme-secondary); color: var(--theme-ink); border-color: var(--theme-line); }
.choice.chosen:disabled { background: var(--theme-accent); color: var(--theme-focus-ink); opacity: 1; outline: 4px solid var(--theme-ink); outline-offset: 3px; }
/* What the TV says, and "That bit again?" (issue #127 part 3). */
.said { color: var(--theme-muted); font-style: italic; }
.again { margin: 0 0 .8rem; min-height: 2.75rem; padding: .4rem min(.9rem, 3vw); }
/* Side padding follows the screen, not the text size, so 200% text keeps its words whole (codex15, review 5690982424). */
.again-panel { margin: 0 0 .8rem; padding: .8rem min(1rem, 3.5vw); border: 2px solid var(--theme-line); border-radius: 1rem; background: var(--theme-background); }
.again-question { font-size: 1.35rem; font-weight: 700; line-height: 1.35; }
.again-choices { list-style: none; padding: 0; margin: 0; font-size: 1.2rem; line-height: 1.4; }
.again-choices li { padding: .35rem 0; border-top: 1px solid var(--theme-line); overflow-wrap: anywhere; white-space: pre-wrap; }
/* The host's one big button names the next step; a guest reader's card holds the public script
 * (issue #127 part 7). */
.next-step { width: 100%; min-height: 4.5rem; font-size: 1.4rem; margin: 0 0 1rem; }
.reader { border: 3px solid var(--theme-accent); }
.reader-question { font-size: 1.4rem; font-weight: 700; line-height: 1.35; }
.reader-choices { font-size: 1.2rem; line-height: 1.5; }
/* #316: each box needs 9rem for its heading, answer and padding. The 320px
 * compact content fits one; 390px fits two at default text. Enlarging text
 * naturally stacks them, without shrinking the words. */
.answer-boxes { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,9rem),1fr)); gap: .6rem; margin-bottom: 1rem; }
.answer-box,.own { min-width: 0; color: var(--theme-ink); border: 2px solid var(--theme-line);
  border-radius: .6rem; padding: .6rem; overflow-wrap: anywhere; }
.answer-boxes h3 { font-size: .85rem; line-height: 1.3; margin: 0 0 .5rem; }
.answer-value { font-size: 1.25rem; line-height: 1.35; font-weight: 750; margin: 0; }
.own.right { color: var(--theme-correct); border-color: currentColor; }
.own.wrong { color: var(--theme-wrong); }
/* Round answers: one line each, the fact folded away (issue #85). */
.answer-row { margin: 0; padding: .3rem 0; border-top: 1px solid var(--theme-line); }
.answer-row summary { font-weight: 500; min-height: 2.75rem; }
.answer-row strong { color: var(--theme-correct); }
.answer-row .mark { color: var(--theme-correct); font-weight: 700; }
.answer-row p { margin: 0 0 .6rem 1.4rem; }
.score { font-size: 2rem; color: var(--theme-accent); }
.result { font-size: 1.35rem; font-weight: 700; color: var(--theme-correct); overflow-wrap: anywhere; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion:no-preference) { button { transition: background-color .12s; } }
@media (max-width:400px) {
  :root { font-size: 18px; } .row > button { flex: 1 1 100%; }
  .room-bar > button { flex: 0 1 auto; }
  /* Fixed compact gutters leave enlarged headings and panel words room (issue #139). */
  main,.card { padding-inline: 8px; }
}

input::placeholder,textarea::placeholder { color: var(--theme-muted); opacity: 1; }
button.link:disabled { background: transparent; }
/* The owner's admin page (issue #200). */
.warning { border-left: 4px solid var(--theme-wrong); padding: .2rem 0 .2rem .8rem; }
.account { margin-top: 1.5rem; }
/* The owner's page (issue #215): a row's buttons stay together, and the email form sits apart. */
.roster .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.divided { border-top: 1px solid var(--theme-line); margin-top: 1.25rem; padding-top: .5rem; }
.warning-text { color: var(--theme-wrong); }

/* Holding this one control owns its touch gesture; the page still scrolls elsewhere. */
#talk, #buzz-talk, .topic-mic { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#talk[aria-pressed=true], #buzz-talk[aria-pressed=true] { border-color: var(--theme-accent); }

.judgement-label { color: var(--theme-muted); margin: .5rem 0 .2rem; font-size: .85rem; }
.judgement-answer { font-size: 1.15rem; font-weight: 650; margin-bottom: .8rem; }
.judgement-actions button { flex: 1 1 6rem; min-height: 3.5rem; }
.topic-mic { min-height: 5rem; width: 100%; margin-block: .5rem; font-size: 1.4rem; }
/* "Ready to play" checklist (issue #337): a state word, the check and its one-line fix. The words
 * sit beside the state word while 6em fits and wrap below it on large text (codex12, #348). */
.ready-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.ready-line { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; }
.ready-text { flex: 1 1 6em; min-width: 0; overflow-wrap: anywhere; }
.ready-text strong { display: block; }
.ready-fix { display: block; color: var(--theme-muted); font-size: .85rem; }
.ready-state { flex: none; max-width: 100%; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .1rem .45rem; min-width: 7.6em; box-sizing: border-box; text-align: center; border-radius: .4rem; border: 1px solid var(--theme-line); color: var(--theme-muted); white-space: nowrap; }
.ready-line.ready .ready-state { color: var(--theme-correct); border-color: var(--theme-correct); }
.ready-line.not-ready .ready-state { color: var(--theme-wrong); border-color: var(--theme-wrong); }
