/* Jeopardy-style theme. Board blue, gold values, condensed display type. */
:root {
  --blue: #060ce9; --blue-dark: #03067a; --blue-deep: #020442; --bg: #000;
  --gold: #ffcc00; --gold-dark: #d69f4c; --fg: #fff; --muted: #b8bce6;
  --ok: #3ddc84; --bad: #ff5a5a;
  --display: 'Anton', Impact, 'Arial Narrow Bold', 'Helvetica Neue', sans-serif;
  --clue: 'Oswald', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --shadow: 0.06em 0.06em 0 #000, 0.1em 0.1em 0.2em rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--clue); background: var(--bg); color: var(--fg); }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--shadow); }
h1 { margin: .2em 0 .5em; font-size: 2.2rem; }
h1 .title { color: var(--gold); letter-spacing: .08em; }
#timebar { position: fixed; top: 0; left: 0; height: 8px; width: 0; background: var(--gold); box-shadow: 0 0 10px var(--gold); z-index: 30; pointer-events: none; }
.big { font-size: 1.4rem; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.money { font-family: var(--display); color: var(--gold); text-shadow: var(--shadow); letter-spacing: .02em; }
.money.neg, .you-score.neg, body.player .you-score.neg, .podium .score.neg, .podium.leader .score.neg, .podium.dim .score.neg { color: var(--bad); }  /* negative amounts are red everywhere */
label { display: block; margin-bottom: 12px; }
input[type=text], input[type=password] { width: 100%; font-size: 1.3rem; padding: 12px; border-radius: 6px; border: 2px solid var(--blue-dark); background: #0b0f4a; color: var(--fg); font-family: var(--clue); }
button, .button { display: inline-block; font-family: var(--display); font-size: 1.15rem; letter-spacing: .04em; text-transform: uppercase; padding: 10px 20px; border-radius: 6px; border: 2px solid var(--blue-dark); background: var(--blue); color: var(--fg); cursor: pointer; text-decoration: none; margin: 4px 4px 4px 0; text-shadow: var(--shadow); }
button.primary { background: var(--gold); color: #000; border-color: var(--gold-dark); text-shadow: none; }
button.danger { background: var(--bad); color: #000; border-color: #a00; text-shadow: none; }
button.link { background: none; border: 0; color: var(--muted); padding: 4px 0; text-shadow: none; }
button:disabled { opacity: .45; cursor: default; }
.card { background: var(--blue); border: 3px solid var(--blue-dark); border-radius: 4px; padding: 16px; margin: 12px 0; box-shadow: inset 0 0 0 2px #000; }
.clue-text { font-family: var(--clue); font-weight: 600; text-transform: uppercase; text-shadow: var(--shadow); font-size: 1.5rem; line-height: 1.25; }
.response { font-style: italic; color: var(--gold); }
ol.buzz, ul.plain { padding-left: 1.4em; margin: .4em 0; }
ol.buzz li { font-size: 1.3rem; margin: 4px 0; }
table { border-collapse: collapse; width: 100%; }
td, th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--blue-dark); }
td.num { text-align: right; }
tr.winner td { color: var(--gold); }
/* The scoring table: name, answer, award in aligned columns, buttons at the right. */
.judge { display: grid; grid-template-columns: max-content max-content max-content 1fr auto auto; column-gap: 24px; align-items: center; }
.judge.no-answers { grid-template-columns: max-content max-content 1fr auto auto; }  /* a minigame: no answer column */
.verdict { display: contents; }
.verdict > * { padding: 6px 0; }
.verdict .who { font-weight: 600; }
.verdict .award { min-width: 4.5em; text-align: left; }
.verdict .award[contenteditable=true] { outline: none; }
.verdict button.pick { min-width: 64px; font-size: 1.5rem; line-height: 1; padding: 6px 14px; margin: 0; }
.verdict .pick.fixed { min-width: 64px; text-align: center; font-size: 1.5rem; color: var(--bad); }  /* no answer on a daily double: wrong, not up for debate */
.verdict .pick.on-true { background: var(--ok); color: #000; text-shadow: none; }
.verdict .pick.on-false { background: var(--bad); color: #000; text-shadow: none; }
.toolbar { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.join-url { font-size: 2rem; word-break: break-all; color: var(--gold); font-family: var(--display); }
.card.join { display: flex; gap: 28px; align-items: center; }
.join-qr svg { display: block; width: min(52vh, 480px); height: auto; background: #fff; padding: 10px; border-radius: 8px; }  /* white quiet zone so phones can read it */
.join-text { flex: 1; min-width: 0; }
#err { margin: 4px 0; }

/* ---------- host console ---------- */
ul.games { list-style: none; padding: 0; margin: 0 0 16px; }
.game form, .game .row { display: flex; gap: 12px; align-items: center; }
.game .info { flex: 1; min-width: 0; }
.game .game-title { font-family: var(--display); font-size: 1.4rem; text-transform: uppercase; text-shadow: var(--shadow); }
.game button, .game .button { margin: 0; white-space: nowrap; }
.links { display: flex; gap: 16px; align-items: center; }
.links form { display: inline; }
.links a { color: var(--muted); }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 3px dashed var(--blue); border-radius: 8px; background: var(--blue-deep); cursor: pointer; text-align: center; margin: 0 0 16px; }
.dropzone.over { border-color: var(--gold); background: var(--blue-dark); }
.dropzone input { display: none; }

/* ---------- host screen ---------- */
body.host { overflow: hidden; }
body.host main { max-width: none; height: 100vh; padding: 0; display: flex; flex-direction: column; }
body.host .topbar { display: flex; align-items: baseline; gap: 16px; padding: 6px 56px 6px 16px; font-family: var(--display); text-transform: uppercase; }
body.host .topbar .title { font-size: 1.6rem; color: var(--gold); text-shadow: var(--shadow); letter-spacing: .05em; }
body.host .topbar .round { color: var(--muted); font-size: 1.2rem; letter-spacing: .06em; }
body.host .topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
body.player p.round { font-family: var(--display); text-transform: uppercase; color: var(--muted); letter-spacing: .06em; margin: -8px 0 12px; }
body.host .topbar button { font-size: .95rem; padding: 4px 12px; margin: 0; }
#menu { position: fixed; top: 6px; right: 12px; z-index: 50; }
.menu { position: relative; display: inline-block; }
.menu .gear { background: none; border: 0; padding: 4px; margin: 0; color: var(--muted); cursor: pointer; line-height: 0; text-shadow: none; }
.menu .gear:hover, .menu.open .gear { color: var(--gold); }
.menu .menu-items { display: none; position: absolute; right: 0; top: 100%; z-index: 40; min-width: 220px; background: var(--blue-deep); border: 2px solid var(--blue); border-radius: 6px; padding: 6px; flex-direction: column; gap: 4px; }
.menu.open .menu-items { display: flex; }
.menu .menu-items button { margin: 0; text-align: left; font-size: 1rem; padding: 8px 12px; }
.board { flex: 1; display: grid; gap: 6px; padding: 6px; background: var(--bg); min-height: 0; }
.cell { background: var(--blue); border: 2px solid #000; box-shadow: inset 0 0 0 2px var(--blue-dark); display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px 8px; user-select: none; overflow: hidden; }
.cell.category { font-family: var(--display); text-transform: uppercase; color: var(--fg); font-size: clamp(0.9rem, 1.8vw, 2rem); line-height: 1.05; text-shadow: var(--shadow); position: relative; }
.cell.category .bouncer { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }
.cell.value { font-family: var(--display); color: var(--gold); font-size: clamp(1.6rem, 5vw, 5.5rem); text-shadow: var(--shadow); cursor: pointer; transition: transform .1s; }
.cell.value:hover { transform: scale(1.04); }
.cell.value.played { cursor: default; }
.cell.value.played:hover { transform: none; }
.cell.value.locked { opacity: .3; cursor: default; }  /* the Minigames column is played from the top */
.cell.value.locked:hover { transform: none; }
.podiums { display: flex; gap: 8px; padding: 8px 10px; background: #000; overflow-x: auto; min-height: 78px; }
.podium { position: relative; flex: 1 1 0; min-width: 120px; background: var(--blue-dark); border: 3px solid #000; box-shadow: inset 0 0 0 2px var(--blue); border-radius: 4px; padding: 6px 10px; text-align: center; transition: background .3s, opacity .3s; }
.podium .score { font-family: var(--display); font-size: 1.8rem; color: var(--gold); text-shadow: var(--shadow); line-height: 1.1; }
.podium .name { font-family: var(--clue); font-weight: 600; text-transform: uppercase; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium.leader .score { color: #fff; }
.podium.control { border-color: var(--gold); }  /* has control of the board */
.podium.dim { background: #05072a; box-shadow: inset 0 0 0 2px var(--blue-deep); opacity: .55; }
.podium.flash { animation: buzz .8s ease-out forwards; }
@keyframes buzz { 0% { background: var(--gold); } 100% { background: var(--blue-dark); } }
.podium .badge { position: absolute; top: 4px; left: 6px; font-family: var(--display); font-size: 1rem; color: var(--gold); text-shadow: var(--shadow); }
.podium .badge.pass { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }  /* skipped the clue: in, but not buzzing */
.lobby-panel { flex: 1; padding: 16px; }
.lobby-panel h2 { margin: 0 0 8px; font-size: 1.6rem; }
.lobby-panel .players li { font-size: 1.5rem; }
.finish-panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.finish-panel h2 { font-size: 3.2rem; margin: 0; color: var(--gold); }
.finish-panel table { max-width: 700px; font-size: 1.4rem; }

/* ---------- clue overlay (host) ---------- */
#overlay { position: fixed; inset: 0; z-index: 10; perspective: 1400px; pointer-events: none; }
#overlay .tile { position: absolute; transform-style: preserve-3d; pointer-events: auto; will-change: transform, left, top, width, height; }
#overlay .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--blue); border: 3px solid #000; box-shadow: inset 0 0 0 3px var(--blue-dark); overflow: hidden; }
#overlay .face.front { display: flex; align-items: center; justify-content: center; font-family: var(--display); color: var(--gold); font-size: clamp(1.6rem, 5vw, 5.5rem); text-shadow: var(--shadow); }
#overlay .face.back { transform: rotateX(180deg); display: flex; flex-direction: column; padding: 2vh 3vw; }
#overlay .face.back .toolbar { margin-top: 2vh; }

#overlay .face.back.centered { justify-content: center; }
#overlay .face.back .dd-title { flex: 1; display: flex; align-items: center; justify-content: center; font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: clamp(2.5rem, 9vw, 9rem); color: var(--gold); text-shadow: var(--shadow); }
.dd-banner { font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; text-align: center; color: var(--gold); text-shadow: var(--shadow); font-size: clamp(1rem, 2vw, 1.8rem); }
#overlay .face.back .dd-banner { margin-bottom: 1vh; }
#overlay .face.back .wagers { flex: 1; display: grid; grid-template-columns: max-content max-content; column-gap: 32px; justify-content: center; align-content: center; font-size: clamp(1.4rem, 3.2vw, 3.2rem); }  /* fills the tile so the list sits centred above the buttons */
#overlay .face.back .wagers .wager-row { display: contents; }
#overlay .face.back .wagers .who { font-family: var(--clue); font-weight: 600; padding: 4px 0; }
body.player .dd-banner { font-size: 1.2rem; margin: 0 0 12px; }
body.player .dd-banner .money { font-size: inherit; }
input[type=number] { width: 100%; font-size: 1.3rem; padding: 12px; border-radius: 6px; border: 2px solid var(--blue-dark); background: #0b0f4a; color: var(--fg); font-family: var(--clue); }
#overlay .face.back.buzz { animation: screenbuzz .8s ease-out; }
@keyframes screenbuzz { 0% { background: var(--gold); } 100% { background: var(--blue); } }
#overlay .face.back .meta { text-align: center; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: clamp(1rem, 1.8vw, 1.6rem); color: var(--muted); text-shadow: var(--shadow); margin-bottom: 1vh; }  /* the amount here matches the category, so it does not compete with the gold awards below */

#overlay .face.back .clue-text { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: clamp(1.4rem, 4.2vw, 4.6rem); padding: 0 3vw; }
#overlay .face.back .clue-text.small { flex: 0 0 auto; font-size: clamp(1.1rem, 2.4vw, 2.4rem); padding: 1vh 0; }
#overlay .face.back .clue-image { flex: 1 1 0; min-height: 0; width: 100%; object-fit: contain; margin: 1vh 0; }  /* the picture takes the height the text leaves */
#overlay .face.back .clue-text.with-image { flex: 0 0 auto; font-size: clamp(1.2rem, 3vw, 3.2rem); padding: 1vh 3vw; }
#overlay .face.back .clue-image.small { flex: 0 0 auto; max-height: 22vh; }
#overlay .face.back .bottom { display: flex; align-items: flex-end; gap: 24px; min-height: 10vh; margin-top: auto; }  /* stays in the corner even when the content above is centred */
#overlay .face.back .judge { flex: 0 1 auto; overflow: auto; font-size: clamp(1.2rem, 2.7vw, 2.7rem); }  /* answers a touch larger than the clue line above */
#overlay .face.back .judge .verdict { padding: 4px 0; border-bottom: 1px solid var(--blue-dark); }
#overlay .face.back .response { font-size: clamp(1.1rem, 2.4vw, 2.4rem); text-align: center; margin: .4em 0; }
#overlay .face.back .toolbar { justify-content: center; }

/* ---------- phones ---------- */
body.player main, body.visitor main { background: var(--blue-deep); min-height: 100%; }
body.player .card .head { display: flex; justify-content: space-between; font-family: var(--display); text-transform: uppercase; font-size: 1.1rem; margin-bottom: 8px; }
body.player .card .head .val { color: var(--gold); }
body.player .score-card .head { align-items: baseline; margin-bottom: 0; }
body.player .you-score { font-family: var(--display); font-size: 1.6rem; color: var(--gold); text-shadow: var(--shadow); }
body.player .control-note { margin: 0 0 12px; }
body.player .answer-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }  /* Buzz in left, Skip right, apart enough not to mistake */
body.player .answer-actions button { margin: 4px 0; }
body.player .clue-image { display: block; width: 100%; max-height: 50vh; object-fit: contain; margin-top: 10px; border-radius: 4px; }
body.player .clue-image[hidden] { display: none; }  /* display: block above would otherwise beat the hidden attribute: phones must wait for the host's flip */
.arrow { display: inline-block; margin-left: .3em; }
.arrow.back { margin: 0 .3em 0 0; }
@media (max-width: 700px) { .lobby-panel { grid-template-columns: 1fr; } }

/* ---------- game editor (host) ---------- */
body.editor .topbar { flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-right: 16px; }
body.editor .topbar input { font: inherit; letter-spacing: inherit; text-transform: inherit; text-shadow: inherit; color: inherit; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 2px 4px; min-width: 0; }
body.editor .topbar input:hover, body.editor .topbar input:focus { border-bottom-color: var(--gold); outline: none; background: var(--blue-deep); }
body.editor .topbar input.problem { border-bottom-color: var(--bad); }
body.editor .topbar input.title { color: var(--gold); font-size: 1.6rem; letter-spacing: .05em; max-width: 40vw; }
body.editor .tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
body.editor .tab { margin: 0; font-size: 1rem; padding: 4px 10px; color: var(--muted); background: var(--blue-deep); }
body.editor .tab.active { display: inline-flex; align-items: center; background: var(--blue); border: 2px solid var(--blue-dark); border-radius: 6px; padding: 0 2px 0 6px; }
body.editor .tab.active input { color: var(--fg); font-size: 1rem; width: 10em; }
body.editor .tab.add { color: var(--gold); border-style: dashed; }
body.editor .topbar .right { font-family: var(--clue); text-transform: none; flex-wrap: wrap; }
body.editor .file { display: inline-flex; align-items: baseline; color: var(--muted); }
body.editor .file input { font-family: var(--clue); color: var(--fg); text-align: right; }
body.editor .statuses { display: inline-flex; gap: 12px; align-items: center; }
body.editor .status { color: var(--muted); max-width: 30em; font-size: .95rem; }
body.editor .status.ok { color: var(--ok); }
body.editor .status.bad { color: var(--bad); }
body.editor .x { background: none; border: 0; padding: 0 4px; margin: 0; color: var(--muted); font-family: var(--clue); font-size: 1.2rem; line-height: 1; text-shadow: none; }
body.editor .x:hover { color: var(--bad); }
body.editor .empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.board.edit { overflow: auto; }  /* rows fill the screen; a board with more rows than fit scrolls instead of squashing */
.board.edit .cell { user-select: text; }
.board.edit .cell.corner, .board.edit .cell.blank { background: var(--bg); border-color: transparent; box-shadow: none; }
.board.edit .cell.category { padding: 4px 2px 4px 6px; gap: 2px; font-size: clamp(0.9rem, 1.4vw, 1.6rem); }
.board.edit .cell.category textarea, .board.edit .cell.rowvalue input { display: block; width: 100%; min-width: 0; text-align: center; font: inherit; line-height: inherit; letter-spacing: inherit; text-transform: inherit; text-shadow: inherit; color: inherit; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 2px; margin: 0; }
.board.edit .cell.category textarea { resize: none; overflow: hidden; height: 2.3em; }  /* two lines, like a long name on the host board */
.board.edit .cell textarea:focus, .board.edit .cell input:focus { outline: none; border-bottom-color: var(--gold); background: var(--blue-deep); }
.board.edit .cell textarea.problem, .board.edit .cell input.problem { border-bottom-color: var(--bad); }
.board.edit .cell.rowvalue { font-family: var(--display); color: var(--gold); font-size: clamp(1rem, 2vw, 1.8rem); gap: 2px; padding: 4px; }
.board.edit .cell.rowvalue input { -moz-appearance: textfield; }
.board.edit .cell.rowvalue input::-webkit-outer-spin-button, .board.edit .cell.rowvalue input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.board.edit .cell.add { background: var(--blue-deep); border: 2px dashed var(--blue); box-shadow: none; border-radius: 0; margin: 0; padding: 0; color: var(--gold); font-family: var(--display); font-size: 1.4rem; text-shadow: none; cursor: pointer; }
.board.edit .cell.add:hover { background: var(--blue-dark); }
.board.edit .cell.clue { flex-direction: column; align-items: stretch; justify-content: flex-start; text-align: left; padding: 6px 9px; cursor: pointer; font-size: clamp(.7rem, .95vw, 1rem); line-height: 1.25; transition: transform .1s; }
.board.edit .cell.clue:hover, .board.edit .cell.clue:focus { transform: scale(1.03); z-index: 1; outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
.board.edit .cell.clue.problem { box-shadow: inset 0 0 0 2px var(--bad); }
.board.edit .cell.clue.over { background: var(--blue-dark); box-shadow: inset 0 0 0 2px var(--gold); }
.board.edit .cell.clue .q { font-family: var(--clue); font-weight: 600; flex: 0 1 auto; min-height: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }  /* the clue gives way first when the cell is short */
.board.edit .cell.clue .a { color: var(--gold); font-style: italic; flex: 0 0 auto; margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.board.edit .cell.clue .hint { color: var(--muted); font-weight: 400; opacity: .75; }
.board.edit .cell.clue .marks { flex: 0 0 auto; margin-top: auto; padding-top: 3px; display: flex; align-items: center; gap: 8px; min-height: 22px; }
.board.edit .cell.clue .badge { font-family: var(--display); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gold); text-shadow: var(--shadow); }
.board.edit .cell.clue .badge.val { color: var(--fg); }
.board.edit .cell.clue .thumb { width: 26px; height: 26px; object-fit: cover; border: 1px solid #000; border-radius: 3px; margin-left: auto; }
#editbox { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
#editbox .panel { width: min(860px, 100%); max-height: 100%; overflow: auto; background: var(--blue); border: 3px solid #000; box-shadow: inset 0 0 0 3px var(--blue-dark); padding: 20px 24px; }
#editbox .meta { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-shadow: var(--shadow); margin-bottom: 12px; }
#editbox label { font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-size: .95rem; }
#editbox .note { font-family: var(--clue); text-transform: none; letter-spacing: 0; }
#editbox textarea, #editbox input[type=text], #editbox input[type=url], #editbox input[type=number] { display: block; width: 100%; margin-top: 4px; font-family: var(--clue); font-size: 1.2rem; padding: 10px; border-radius: 6px; border: 2px solid var(--blue-dark); background: #0b0f4a; color: var(--fg); text-transform: none; letter-spacing: 0; }
#editbox textarea { resize: vertical; min-height: 5em; }
#editbox .pic { border: 3px dashed var(--blue-dark); border-radius: 8px; padding: 12px; margin: 0 0 12px; background: var(--blue-deep); text-align: center; }
#editbox .pic.over { border-color: var(--gold); }
#editbox .pic img { display: block; max-width: 100%; max-height: 32vh; margin: 0 auto 8px; }
#editbox .pic-empty { display: flex; flex-direction: column; gap: 4px; padding: 12px; }
#editbox .pic label.link { display: inline; color: var(--gold); cursor: pointer; text-transform: none; letter-spacing: 0; font-family: inherit; font-size: inherit; text-decoration: underline; }
#editbox .pic-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
#editbox .pic-actions button { margin: 0; font-size: .95rem; padding: 6px 12px; }
#editbox .pic .path { font-size: .9rem; word-break: break-all; }
#editbox label.url { display: block; margin: 8px 0 0; text-align: left; }
#editbox .row { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
#editbox label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
#editbox label.inline input[type=number] { display: inline-block; width: 8em; margin: 0; }
#editbox label.inline input[type=checkbox] { width: 1.3em; height: 1.3em; accent-color: var(--gold); margin: 0; }
#editbox label.inline select { font-family: var(--clue); font-size: 1rem; padding: 6px 8px; border-radius: 6px; border: 2px solid var(--blue-dark); background: #0b0f4a; color: var(--fg); text-transform: none; letter-spacing: 0; }
#editbox label.response[hidden] { display: none; }
#editbox button.link { color: var(--gold); text-transform: none; letter-spacing: 0; font-family: var(--clue); font-size: 1rem; }

/* ---------- minigames (static/minigames/*.js paint into #minigame) ---------- */
.minigame { display: flex; flex-direction: column; min-height: 0; }
.minigame[hidden] { display: none !important; }  /* mounted behind the instructions page, fetching ahead; the kinds set their own display (body.host .vegas) */
#overlay .face.back .minigame { flex: 1; }
/* The instructions page: the name like a clue, the rules under it, Back at the left and Start in the middle of the bottom bar */
#overlay .face.back .mg-intro { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 3vh; text-align: center; padding: 1vh 3vw; overflow: auto; }
#overlay .face.back .mg-title { font-family: var(--clue); font-weight: 600; text-transform: uppercase; color: var(--gold); text-shadow: var(--shadow); font-size: clamp(1.6rem, 4.2vw, 4.6rem); line-height: 1.2; }
#overlay .face.back .mg-rules { display: flex; flex-direction: column; gap: 1.5vh; max-width: 36em; }
#overlay .face.back .mg-rules p { margin: 0; font-family: var(--clue); font-weight: 500; font-size: clamp(1.1rem, 2.1vw, 2.2rem); line-height: 1.35; text-shadow: var(--shadow); overflow-wrap: anywhere; }
#overlay .face.back .mg-rules p:first-child { font-weight: 600; font-size: clamp(1.3rem, 2.6vw, 2.8rem); }
#overlay .face.back .bottom.intro { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; }
#overlay .face.back .bottom.intro button[data-act=abandon] { justify-self: start; }
.tetrish .tetrish-top { display: flex; gap: 12px; justify-content: center; align-items: flex-start; }
.tetrish-board { position: relative; }
.tetrish-board canvas { display: block; border: 2px solid var(--blue-dark); background: #000; }
.tetrish .tetrish-side { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 68px; }
.tetrish .tetrish-side .label { font-family: var(--display); text-transform: uppercase; font-size: .8rem; color: var(--muted); letter-spacing: .06em; }
.tetrish .tetrish-side canvas.next { display: block; }
.tetrish .tetrish-side .lines { font-size: 1.6rem; }
.tetrish-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; touch-action: none; }  /* holding a button must not scroll the page */
.tetrish-pad button { margin: 0; min-height: 56px; padding: 0; font-size: 1.6rem; line-height: 1; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
.tetrish-pad button.down { grid-column: 1 / -1; }
.tetrish-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--gold); text-shadow: var(--shadow); font-size: 1.6rem; }
.tetrish-overlay.out { background: rgba(0, 0, 0, .55); }  /* a crashed board goes dark under its place; a survivor's stays lit */
.tetrish-overlay[hidden] { display: none; }
.tetrish-standings { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; color: var(--muted); font-size: .95rem; }
.tetrish-standings b { color: var(--fg); }
.tetrish-standings .out { text-decoration: line-through; }
body.host .tetrish { display: grid; gap: 14px 18px; justify-content: center; align-content: center; }  /* the wall of boards */
.tetrish-player .who { display: flex; justify-content: space-between; gap: 12px; font-family: var(--display); text-transform: uppercase; font-size: 1.1rem; padding: 0 2px 4px; text-shadow: var(--shadow); }
.tetrish-player .who .lines { color: var(--gold); }
.tetrish-player.winner canvas { border-color: var(--gold); box-shadow: 0 0 14px var(--gold); }
.tetrish-player .tetrish-overlay { font-size: clamp(1.4rem, 3vw, 3rem); }
/* Vegas: playing cards, hands, and the host's table of seats */
.pcard { display: inline-flex; flex-direction: column; justify-content: space-between; width: 2.4em; height: 3.4em; padding: .15em .25em; border-radius: .3em; background: #fff; color: #111; font-family: var(--clue); font-weight: 600; line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, .6); font-size: 1.2rem; vertical-align: middle; }
.pcard.red { color: #c81e1e; }
.pcard .suit { align-self: flex-end; font-size: 1.3em; }
.pcard.back { background: repeating-linear-gradient(45deg, #8b0000 0 6px, #b22222 6px 12px); border: .2em solid #fff; }
.pcard.hidden { box-shadow: 0 0 0 2px var(--gold); }  /* the phone's own face-down card */
.vegas-hand { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; min-height: 3.4em; }
.vegas-line { display: flex; align-items: baseline; gap: 14px; min-height: 1.6em; }
.vegas-total { font-family: var(--display); font-size: 1.6rem; color: var(--gold); text-shadow: var(--shadow); }
.vegas-total.bad { color: var(--bad); }
.vegas .tag { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.vegas .tag.bust { color: var(--bad); }
.vegas .tag.winner { color: var(--gold); }
.vegas-actions { display: flex; gap: 12px; margin-top: 12px; }
.vegas-actions button { flex: 1; margin: 0; min-height: 56px; font-size: 1.4rem; }
/* The seats share the width evenly: vegas.js sets --cols (at most 4 a row, the rows as even as they come, so 5 seats sit 3 + 2 and 7 sit 4 + 3), and a short last row centers. */
body.host .vegas { --cols: 4; --seat-gap: 22px; display: flex; flex-direction: row; flex-wrap: wrap; gap: 16px var(--seat-gap); align-content: center; justify-content: center; padding: 1vh 0; overflow: auto; }
.vegas-turn { flex-basis: 100%; text-align: center; font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-shadow: var(--shadow); font-size: clamp(1rem, 2vw, 1.8rem); }
.vegas-seat { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--seat-gap)) / var(--cols)); box-sizing: border-box; min-width: 0; text-align: center; padding: 10px 16px; border: 3px solid var(--blue); border-radius: 6px; background: var(--blue-dark); transition: opacity .3s, border-color .3s; }
.vegas-seat.waiting { opacity: .55; }
.vegas-seat.bust { border-color: var(--bad); }
.vegas-seat.winner { border-color: var(--gold); box-shadow: 0 0 14px var(--gold); }
.vegas-seat .name { font-family: var(--display); text-transform: uppercase; font-size: clamp(1rem, 1.8vw, 1.6rem); text-shadow: var(--shadow); }
.vegas-seat .vegas-hand { justify-content: center; }
.vegas-seat .pcard { font-size: clamp(1rem, 1.9vw, 1.7rem); }
.vegas-seat .vegas-line { justify-content: center; }
.vegas-seat .vegas-total { font-size: clamp(1.3rem, 2.4vw, 2.2rem); }
/* Baby SuperRes: the child's picture resolving beside the grown-ups on the host; the names on a phone */
body.host .babies { gap: 1vh; }
.babies-stage { flex: 1; min-height: 0; display: flex; gap: 2vw; align-items: stretch; }
.babies-baby { flex: 1 1 55%; min-width: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 6px; background: #000; }
.babies-baby canvas { display: block; width: 100%; height: 100%; }  /* the picture in blocks, drawn to fit by babies.js */
.babies-mark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: clamp(6rem, 30vh, 18rem); line-height: 1; text-shadow: var(--shadow); animation: babies-pop .25s ease-out; }
.babies-mark[hidden] { display: none; }
.babies-mark.right { color: var(--ok); }
.babies-mark.wrong { color: var(--bad); }
@keyframes babies-pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.babies-adults { flex: 0 0 42%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-content: safe center; overflow: auto; }  /* the round's grown-ups, eight as a rule: two rows of four; more scroll rather than slip off the top */
.babies-adult { position: relative; border: 3px solid var(--blue-dark); border-radius: 6px; background: var(--blue-dark); overflow: hidden; transition: opacity .3s, border-color .3s, visibility .3s; }
.babies-adult img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.babies-adult .name { font-family: var(--display); text-transform: uppercase; font-size: clamp(.7rem, 1.1vw, 1rem); line-height: 1.1; text-align: center; padding: 3px 4px; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: var(--shadow); }  /* a long name takes two lines */
.babies-adult .who { position: absolute; top: 4px; left: 4px; right: 4px; font-family: var(--display); text-transform: uppercase; font-size: clamp(.7rem, 1.1vw, 1rem); color: #000; background: var(--gold); border-radius: 4px; padding: 2px 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.babies-adult.pending { border-color: var(--gold); box-shadow: 0 0 14px var(--gold); animation: babies-pulse 1s ease-in-out infinite alternate; }
@keyframes babies-pulse { from { box-shadow: 0 0 6px var(--gold); } to { box-shadow: 0 0 18px var(--gold); } }
.babies-adult.wrong { border-color: var(--bad); animation: babies-red .3s ease-in-out 3 alternate; }
@keyframes babies-red { from { background: var(--blue-dark); } to { background: var(--bad); } }
.babies-adult.wrong img { opacity: .5; }
.babies-adult.removed { visibility: hidden; }  /* gone for the round, its place kept so the others stay put */
.babies-adult.answer { border-color: var(--ok); box-shadow: 0 0 14px var(--ok); opacity: 1; }
.babies-bar { display: flex; align-items: center; gap: 16px; min-height: 48px; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.6rem); text-shadow: var(--shadow); }
.babies-bar button { margin: 0; }
.babies-bar button[hidden] { display: none; }
body.player .babies-head { font-family: var(--display); text-transform: uppercase; margin: 0 0 8px; }
.babies-names { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.babies-names button { margin: 0; min-height: 52px; padding: 8px 10px; font-size: 1.05rem; white-space: normal; line-height: 1.1; }
.babies-names button.removed { opacity: .25; text-decoration: line-through; }
/* the scoring page's table: the grown-ups across the head, each round's child in a player's row, marked with how they did */
.babies-table { display: inline-flex; gap: 6px; vertical-align: middle; }
.babies-table .cell { position: relative; flex: none; width: 2em; height: 2em; border-radius: 4px; overflow: hidden; background: var(--blue-dark); }
.babies-table .cell img { display: block; width: 100%; height: 100%; object-fit: cover; }
.babies-table .cell b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.5em; line-height: 1; text-shadow: 0 0 8px #000, 0 0 3px #000; }
.babies-table .cell.right b { color: var(--ok); }
.babies-table .cell.wrong b { color: var(--bad); }
.babies-table .cell.right img, .babies-table .cell.wrong img { opacity: .7; }
.verdict.head > * { padding-bottom: 0; }
/* Human Autorater: the pair side by side on the host, each pick under the picture picked once the round is up; Left and Right on a phone */
body.host .autorater { gap: 1vh; }
.autorater-stage { flex: 1; min-height: 0; display: flex; gap: 1.5vw; align-items: stretch; }
.autorater-stage[hidden] { display: none; }
.autorater-side { flex: 1 1 0; min-width: 0; margin: 0; display: flex; flex-direction: column; align-items: center; overflow: hidden; border-radius: 6px; background: #000; border: 4px solid #000; transition: border-color .3s, box-shadow .3s; }
.autorater-side img { flex: 1 1 0; min-height: 0; width: 100%; object-fit: contain; }
.autorater-side figcaption { font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: clamp(1rem, 2vw, 1.8rem); line-height: 1.3; min-height: 1.3em; text-shadow: var(--shadow); }
.autorater-side.fake { border-color: var(--bad); box-shadow: 0 0 18px var(--bad); }
.autorater-side.fake figcaption { color: var(--bad); }
.autorater-side.real { border-color: var(--ok); }
.autorater-side.real figcaption { color: var(--ok); }
.autorater-names { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; min-height: 1.8em; padding: 0 8px 4px; }
.autorater-name, .autorater-chip { font-family: var(--clue); font-weight: 600; font-size: clamp(1rem, 1.7vw, 1.5rem); }
.autorater-name.right { color: var(--ok); }
.autorater-name.wrong { color: var(--bad); }
.autorater-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; min-height: 1.8em; }
.autorater-chip { transition: opacity .3s; }
.autorater-chip.waiting { opacity: .45; }  /* still to pick, like a dark podium */
.autorater-bar { display: flex; align-items: center; gap: 16px; min-height: 48px; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.6rem); text-shadow: var(--shadow); }
.autorater-bar button { margin: 0; }
.autorater-bar button[hidden] { display: none; }
body.player .autorater-head { font-family: var(--display); text-transform: uppercase; margin: 0 0 8px; }
.autorater-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.autorater-pick button { margin: 0; min-height: 96px; font-size: 1.6rem; }
.autorater-pick button.chosen { background: var(--gold); color: #000; border-color: var(--gold-dark); text-shadow: none; opacity: 1; }
/* The Price is Right: the question, then the guesses against the answer on the host; a number to lock in on a phone */
body.host .price { gap: 1vh; }
.price-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 2vh; text-align: center; overflow: auto; }  /* a crowded reveal scrolls from the top rather than losing it */
.price-rule { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-size: clamp(1rem, 2vw, 1.8rem); text-shadow: var(--shadow); margin: 0; }
.price-question { font-family: var(--clue); font-weight: 600; text-transform: uppercase; font-size: clamp(1.2rem, 3.2vw, 3rem); line-height: 1.25; text-shadow: var(--shadow); margin: 0; max-width: 90%; overflow-wrap: anywhere; }
.price-answer { font-family: var(--display); font-size: clamp(2.4rem, 8vw, 7rem); line-height: 1; color: var(--gold); text-shadow: var(--shadow); margin: 0; animation: price-pop .3s ease-out; }
@keyframes price-pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.price-players, .price-guesses { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
.price-chip { font-family: var(--clue); font-weight: 600; font-size: clamp(1rem, 1.8vw, 1.6rem); transition: opacity .3s; overflow-wrap: anywhere; }
.price-chip.waiting { opacity: .45; }  /* still to lock in, like a dark podium */
.price-guess { display: flex; flex-direction: column; align-items: center; min-width: 7em; padding: 8px 14px; border: 3px solid var(--blue); border-radius: 6px; background: var(--blue-dark); }
.price-guess .name { font-family: var(--display); text-transform: uppercase; font-size: clamp(.9rem, 1.5vw, 1.4rem); text-shadow: var(--shadow); max-width: 12em; overflow-wrap: anywhere; }
.price-guess .amount { font-family: var(--display); font-size: clamp(1.3rem, 2.6vw, 2.4rem); line-height: 1.1; text-shadow: var(--shadow); }
.price-guess.won, .price-guess.exact { border-color: var(--gold); box-shadow: 0 0 14px var(--gold); }
.price-guess.won .amount, .price-guess.exact .amount { color: var(--gold); }
.price-guess.over { border-color: var(--bad); }
.price-guess.over .amount { color: var(--bad); text-decoration: line-through; }
.price-guess.none, .price-guess.under { opacity: .6; }
.price-verdict { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: clamp(1.1rem, 2.4vw, 2.2rem); color: var(--gold); text-shadow: var(--shadow); margin: 0; }
.price-standings { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; color: var(--muted); font-size: clamp(.9rem, 1.5vw, 1.3rem); }
.price-standings b { color: var(--fg); }
.price-bar { display: flex; align-items: center; gap: 16px; min-height: 48px; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.6rem); text-shadow: var(--shadow); }
.price-bar button { margin: 0; }
.price-bar button[hidden] { display: none; }
body.player .price-head { font-family: var(--display); text-transform: uppercase; margin: 0 0 8px; }
body.player .price-q { font-family: var(--clue); font-weight: 600; font-size: 1.15rem; line-height: 1.3; margin: 0 0 10px; overflow-wrap: anywhere; }
.price-reveal b { color: var(--gold); font-family: var(--display); font-size: 1.4rem; }
.price-form { display: flex; gap: 10px; margin-top: 10px; }
.price-form[hidden] { display: none; }
.price-form input { flex: 1; min-width: 0; font-size: 1.6rem; text-align: right; }
.price-form button { margin: 0; flex: none; }
/* the scoring page's table: the answers across the head, each round's guess in a player's row, marked with how it did */
.price-table { display: inline-flex; gap: 6px; vertical-align: middle; }
.price-table .cell { flex: none; box-sizing: border-box; padding: 2px 6px; border-radius: 4px; background: var(--blue-dark); text-align: right; font-variant-numeric: tabular-nums; }  /* its width is set per column, from the widest number in it */
.price-table .cell.won, .price-table .cell.exact { color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }
.price-table .cell.exact::after { content: " ★"; }
.price-table .cell.over { color: var(--bad); text-decoration: line-through; }
.price-table .cell.under, .price-table .cell.none { opacity: .6; }

/* ---------- Final Jeopardy! ---------- */
/* The host's title card in place of a one-clue board; a click opens the clue */
.final-splash { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; margin: 6px; padding: 0; border-radius: 0; font: inherit; letter-spacing: 0; text-transform: none; background: var(--blue); border: 2px solid #000; box-shadow: inset 0 0 0 2px var(--blue-dark); user-select: none; }  /* a button when it opens the clue: it has the board's look, not a button's */
.final-splash[data-act] { cursor: pointer; }
.final-splash[data-act]:focus-visible { outline: 3px solid var(--gold); outline-offset: -8px; }
.final-answer .delta[contenteditable=true], .final-wager .delta[contenteditable=true] { outline: none; border-bottom: 2px solid var(--gold); }
.final-logo { display: flex; flex-direction: column; align-items: center; font-family: var(--display); text-transform: uppercase; text-shadow: var(--shadow); line-height: .95; letter-spacing: .06em; }
.final-logo span:first-child { font-size: clamp(2.5rem, 8vw, 8rem); color: var(--fg); }
.final-logo span:last-child { font-size: clamp(3.5rem, 12vw, 12rem); color: var(--gold); font-style: italic; letter-spacing: .02em; }
.final-hint { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-size: clamp(.9rem, 1.6vw, 1.4rem); }
/* The tile: it fades in rather than tumbling out of a cell */
#overlay.final .face.back { animation: final-in .7s ease-out; }
@keyframes final-in { from { opacity: 0; } to { opacity: 1; } }
#overlay .face.back .final-tag { text-align: center; font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; color: var(--gold); text-shadow: var(--shadow); font-size: clamp(1rem, 2.2vw, 2rem); }
#overlay .face.back .final-category { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; line-height: 1.05; font-size: clamp(2rem, 6vw, 6.5rem); color: var(--fg); text-shadow: var(--shadow); padding: 0 6vw; overflow-wrap: anywhere; }
#overlay .face.back .final-status { text-align: center; font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-shadow: var(--shadow); font-size: clamp(1rem, 2vw, 1.8rem); }
#overlay .face.back .final-head { display: flex; justify-content: center; align-items: baseline; gap: 2vw; margin-bottom: 1vh; }
#overlay .face.back .final-head .final-head-cat { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--fg); text-shadow: var(--shadow); font-size: clamp(1rem, 2.2vw, 2rem); }
#overlay .face.back .final-clock { font-family: var(--display); font-size: clamp(1.6rem, 4vw, 4rem); line-height: 1; color: var(--gold); text-shadow: var(--shadow); min-width: 2.2ch; }
/* The reveal: one player on stage, their answer behind a veil, then the ruling and the wager */
#overlay .face.back .final-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; }
.final-who { display: flex; align-items: baseline; gap: 1.5vw; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: clamp(1.4rem, 3.2vw, 3.2rem); text-shadow: var(--shadow); }
.final-who .final-before { font-size: .75em; color: var(--muted); }
.final-answer { width: min(84%, 1400px); min-height: 18vh; display: flex; align-items: center; justify-content: center; gap: 2vw; text-align: center; padding: 2vh 3vw; background: var(--blue-deep); border: 3px solid var(--blue-dark); border-radius: 6px; font-family: var(--clue); font-weight: 600; text-transform: uppercase; font-size: clamp(1.4rem, 4vw, 4.4rem); line-height: 1.2; text-shadow: var(--shadow); overflow-wrap: anywhere; }
.final-answer.veiled { background: repeating-linear-gradient(135deg, var(--blue-deep) 0 14px, #03056a 14px 28px); }  /* something is written here; not yet */
.final-answer .mark { font-size: 1.2em; }
.final-wager { min-height: 1.4em; display: flex; align-items: baseline; gap: 1.5vw; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: clamp(1.3rem, 3vw, 3rem); text-shadow: var(--shadow); }
.final-wager .label { color: var(--muted); }
.final-wager .delta { padding-left: 1vw; animation: price-pop .3s ease-out; }
.final-done { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; min-height: 1.6em; color: var(--muted); font-size: clamp(.9rem, 1.6vw, 1.5rem); }
.final-done b { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .04em; color: var(--fg); }
#overlay .face.back .bottom .pick { font-size: clamp(1.1rem, 2vw, 1.8rem); min-width: min(8em, 40vw); }
#overlay.final .face.back .bottom { flex-wrap: wrap; }  /* a narrow host window: the ruling buttons drop to a line of their own rather than clip */
#overlay .face.back .bottom .pick.on-true { background: var(--ok); color: #000; text-shadow: none; }
#overlay .face.back .bottom .pick.on-false { background: var(--bad); color: #000; text-shadow: none; }
.podium.stage { border-color: var(--gold); box-shadow: 0 0 14px var(--gold), inset 0 0 0 2px var(--blue); }  /* the player being revealed */
body.player .final-card h2 { margin: 0 0 6px; color: var(--gold); font-size: 1.6rem; }
/* the editor: a board's Final flag in its tab, and the note above a Final board */
body.editor .tab.active .final-flag { display: inline-flex; align-items: center; gap: 4px; margin: 0 4px 0 8px; font-family: var(--clue); text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--muted); cursor: pointer; }
body.editor .tab.active .final-flag input { width: 1em; height: 1em; accent-color: var(--gold); margin: 0; }
body.editor .final-note { margin: 6px 16px 0; color: var(--muted); font-size: .95rem; }
body.editor .final-note.bad { color: var(--bad); }
/* Latent Sprint: on the host the picture to describe over the players, the wait, the reveal one picture at a time beside the
   original, then the gallery of every picture with its team; on a phone the picture with a prompt to type, then its own picture */
body.host .latent { gap: 1vh; }
.latent-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5vh; text-align: center; }
.latent-stage > .latent-source { flex: 1 1 0; min-height: 0; max-width: 100%; object-fit: contain; border-radius: 6px; }
.latent-wait { font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--gold); font-size: clamp(1.4rem, 3.5vw, 3.2rem); text-shadow: var(--shadow); margin: 0; animation: latent-pulse 1.2s ease-in-out infinite alternate; }
.latent-wait[hidden] { display: none; }
@keyframes latent-pulse { from { opacity: .5; } to { opacity: 1; } }
.latent-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; min-height: 1.8em; }
.latent-chip { font-family: var(--clue); font-weight: 600; font-size: clamp(1rem, 1.7vw, 1.5rem); transition: opacity .3s; overflow-wrap: anywhere; }
.latent-chip.waiting { opacity: .45; }  /* still to lock in, or a picture still on its way, like a dark podium */
.latent-chip.out { opacity: .45; text-decoration: line-through; }  /* no prompt, or no picture for it */
.latent-compare { flex: 1; min-height: 0; width: 100%; display: flex; gap: 1.5vw; align-items: stretch; }
.latent-compare .latent-source.small { flex: 0 0 26%; min-width: 0; min-height: 0; object-fit: contain; border-radius: 6px; }
.latent-gallery { flex: 1; min-height: 0; width: 100%; display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); grid-auto-rows: 1fr; gap: 1vh 1vw; }
.latent-pic { position: relative; margin: 0; min-width: 0; min-height: 0; overflow: hidden; border-radius: 6px; background: #000; }
.latent-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.latent-pic figcaption { position: absolute; top: 6px; left: 6px; min-width: 1.6em; padding: 0 .35em; border-radius: .8em; background: var(--gold); color: #000; font-family: var(--display); font-size: clamp(1.1rem, 2.2vw, 2rem); line-height: 1.6; text-align: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.latent-pic.big { flex: 1; }
.latent-pic.named figcaption { top: auto; bottom: 0; left: 0; right: 0; min-width: 0; padding: .15em .5em; border-radius: 0; background: rgba(0, 0, 0, .65); color: var(--fg); text-transform: uppercase; letter-spacing: .06em; font-size: clamp(1rem, 2vw, 1.8rem); line-height: 1.4; box-shadow: none; overflow-wrap: anywhere; }  /* the team's name over the foot of its picture */
.latent-caption { display: flex; flex-direction: column; align-items: center; gap: .3em; max-width: 90%; }
.latent-team { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: clamp(1.2rem, 2.6vw, 2.4rem); text-shadow: var(--shadow); }
.latent-prompt { font-family: var(--clue); font-weight: 600; font-size: clamp(1rem, 1.9vw, 1.7rem); line-height: 1.25; overflow-wrap: anywhere; }
.latent-prompt::before { content: "“"; }
.latent-prompt::after { content: "”"; }
.latent-bar { display: flex; align-items: center; gap: 16px; min-height: 48px; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.6rem); text-shadow: var(--shadow); }
.latent-bar button { margin: 0; }
.latent-bar button[hidden] { display: none; }
body.player .latent-head { font-family: var(--display); text-transform: uppercase; margin: 0 0 8px; }
body.player .latent-source { display: block; width: 100%; max-height: 42vh; object-fit: contain; border-radius: 4px; background: #000; }
.latent-locked { font-family: var(--clue); font-weight: 600; font-size: 1.15rem; line-height: 1.3; margin: 10px 0 2px; overflow-wrap: anywhere; }
.latent-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.latent-form[hidden] { display: none; }
.latent-form textarea { width: 100%; font-size: 1.15rem; padding: 10px; border-radius: 6px; border: 2px solid var(--blue-dark); background: #0b0f4a; color: var(--fg); font-family: var(--clue); resize: vertical; }
.latent-form button { margin: 0; align-self: flex-end; }
/* the scoring page's table: the original in the head, in a player's row their picture with its prompt; and the medals in place of the check and the cross */
.latent-table { display: inline-flex; align-items: center; gap: 10px; vertical-align: middle; max-width: 38vw; }
.latent-table img { flex: none; width: 4.8em; height: 3.2em; object-fit: cover; border-radius: 4px; background: var(--blue-dark); }
.latent-table .prompt { flex: 1 1 auto; min-width: 0; font-size: .8em; line-height: 1.2; overflow-wrap: anywhere; }
.verdict .picks { display: inline-flex; gap: 6px; }
.verdict .pick.mark { min-width: 56px; padding: 6px 10px; opacity: .4; }
.verdict .pick.mark.on { opacity: 1; background: var(--gold); border-color: var(--gold-dark); }

/* Eigenfaces: the target face on the host screen with the players lit as they lock in, then the round's faces ranked; a face over sliders on a phone */
body.host .eigenfaces { gap: 1vh; }
.eigen-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 2vh; text-align: center; overflow: auto; }
.eigen-rule { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-size: clamp(1rem, 2vw, 1.8rem); text-shadow: var(--shadow); margin: 0; max-width: 90%; }
.eigen-faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5vh 1.5vw; }
.eigen-face { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .4vh; }
.eigen-face canvas { display: block; width: clamp(96px, 14vw, 26vh); height: auto; border-radius: 6px; background: #000; border: 3px solid var(--blue-dark); image-rendering: auto; }
.eigen-face.big canvas { width: min(44vh, 36vw); }  /* leaves room for the names under it */
.eigen-face.target canvas { border-color: var(--gold); }
.eigen-face figcaption { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.eigen-face .name { font-family: var(--display); text-transform: uppercase; font-size: clamp(.9rem, 1.5vw, 1.4rem); text-shadow: var(--shadow); max-width: 14em; overflow-wrap: anywhere; }
.eigen-face.big .name { font-size: clamp(1.2rem, 2.4vw, 2.2rem); }
.eigen-face .credit { font-family: var(--clue); color: var(--muted); font-size: clamp(.7rem, 1vw, .95rem); max-width: 22em; }
.eigen-face .score { font-family: var(--display); font-size: clamp(1.1rem, 2vw, 1.9rem); color: var(--gold); text-shadow: var(--shadow); }
.eigen-face.ideal canvas { border-color: var(--muted); }
.eigen-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
.eigen-chip { font-family: var(--clue); font-weight: 600; font-size: clamp(1rem, 1.8vw, 1.6rem); transition: opacity .3s; overflow-wrap: anywhere; }
.eigen-chip.waiting { opacity: .45; }  /* still to lock in, like a dark podium */
.eigen-standings { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.5rem); }
.eigen-standings b { color: var(--fg); }
.eigen-bar { display: flex; align-items: center; gap: 16px; min-height: 48px; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.6rem); text-shadow: var(--shadow); }
.eigen-bar button { margin: 0; }
.eigen-bar button[hidden] { display: none; }
body.player .eigen-head { font-family: var(--display); text-transform: uppercase; margin: 0 0 8px; }
.eigen-you { position: sticky; top: 8px; z-index: 1; display: flex; justify-content: center; padding: 4px 0 8px; background: var(--blue); }  /* stays in view while the sliders below scroll */
.eigen-you canvas { display: block; width: min(60vw, 240px); height: auto; border-radius: 4px; background: #000; }
.eigen-sliders { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.eigen-sliders[hidden] { display: none; }
.eigen-sliders input[type=range] { display: block; width: 100%; height: 40px; margin: 0; accent-color: var(--gold); }
.eigen-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.eigen-actions[hidden] { display: none; }
.eigen-actions button { margin: 4px 0; }
.eigen-status p { margin: 8px 0 0; }
.eigen-table { display: inline-flex; gap: 6px; align-items: center; vertical-align: middle; }
.eigen-table .cell { flex: none; width: 3.4em; min-width: 0; justify-content: center; text-align: center; }  /* one width for the targets, the scores and the average, so the head lines up with the rows */
.eigen-table .cell.portrait { padding: 2px; }  /* a target, cut from the sprite (not .face or .tile, which the overlay uses) */
.eigen-table .cell.portrait span { display: block; width: 2em; height: 2em; border-radius: 4px; background-color: var(--blue-dark); background-repeat: no-repeat; }
.eigen-table .cell.label { color: var(--muted); }
.eigen-table .cell.total { color: var(--gold); font-family: var(--display); }
