/* 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; }
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); }
.verdict { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.verdict .pick { min-width: 130px; }
.verdict .award { min-width: 4.5em; text-align: right; font-size: 1.1em; }
.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); }
#err { margin: 4px 0; }

/* ---------- host console ---------- */
ul.games { list-style: none; padding: 0; margin: 0 0 16px; }
.game form { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: center; }
.game .game-title { grid-column: 1; font-family: var(--display); font-size: 1.4rem; text-transform: uppercase; text-shadow: var(--shadow); }
.game .muted { grid-column: 1; }
.game button { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.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); }
.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; }
.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.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); }
.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 .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; }

#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 .bottom { display: flex; align-items: flex-end; gap: 24px; min-height: 10vh; }
#overlay .face.back .judge { flex: 0 1 auto; overflow: auto; font-size: clamp(1rem, 2vw, 1.8rem); }
#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 .you-score { font-family: var(--display); font-size: 1.6rem; color: var(--gold); text-shadow: var(--shadow); }
body.player.locked, body.player.locked main { background: var(--gold); color: #000; }
body.player.locked .card { background: #000; border-color: #000; box-shadow: none; color: var(--fg); }
body.player.locked h1 .title { color: #000; text-shadow: none; }
body.player.locked p.round { color: #000; }
.arrow { display: inline-block; margin-left: .3em; }
@media (max-width: 700px) { .lobby-panel { grid-template-columns: 1fr; } }
