/* Plain looks for now (step 5 brings the packs' art, fonts and sounds). */
:root {
  --blue: #0b1c8c;
  --blue-deep: #060f52;
  --gold: #f2c14e;
  --text: #ffffff;
  --muted: #b8c0ff;
  --card: #13248f;
  --line: #2a3bb5;
  --right: #2fb26a;
  --wrong: #d6455d;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--blue-deep); color: var(--text); font-family: var(--font); }
a { color: var(--gold); }
button {
  font: inherit; font-weight: 600; color: var(--blue-deep); background: var(--gold); border: 0; border-radius: 10px;
  padding: 10px 16px; cursor: pointer; touch-action: manipulation;
}
button.secondary { background: transparent; color: var(--text); border: 2px solid var(--line); }
button.on { background: var(--gold); }
button.small { padding: 4px 10px; font-size: 0.85em; }
button.big { display: block; width: 100%; padding: 16px; font-size: 1.2em; margin-top: 10px; }
button.right { background: var(--right); color: white; }
button.wrong { background: var(--wrong); color: white; }
input, select, textarea {
  font: inherit; width: 100%; padding: 10px; margin-top: 4px; border-radius: 8px; border: 2px solid var(--line);
  background: var(--blue-deep); color: var(--text);
}
label { display: block; margin: 10px 0; }
label.check { display: flex; gap: 8px; align-items: center; }
label.check input { width: auto; margin: 0; }
.hint { color: var(--muted); font-size: 0.9em; }
.error { color: #ff9aa9; min-height: 1.2em; }
.center { text-align: center; }
.label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85em; }
.row { display: flex; gap: 8px; margin: 8px 0; }
.row > button { flex: 1; }
.row.wrap { flex-wrap: wrap; }
.row.wrap > button { flex: 0 1 auto; }
.card { background: var(--card); border-radius: 14px; padding: 14px 16px; margin: 12px 0; }
.card h2 { margin: 0 0 8px; font-size: 1.1em; }
.neg { color: #ff9aa9; }
.logo { font-weight: 900; letter-spacing: 0.06em; color: var(--gold); text-shadow: 3px 3px 0 #000; text-align: center; }
.logo.small { font-size: 1.4em; margin: 8px 0; }
.countdown { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 6px; background: var(--blue-deep); color: var(--gold); font-variant-numeric: tabular-nums; }
.verdict { font-size: 1.6em; font-weight: 800; text-align: center; }
.verdict.right { color: var(--right); }
.verdict.wrong { color: var(--wrong); }

/* ---- front page ---- */
.home-main { max-width: 440px; margin: 0 auto; padding: 16px; }
.home .logo { font-size: 2.6em; margin: 24px 0 8px; }

/* ---- the board (TV and phones) ---- */
.board { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 6px; background: #000; padding: 6px; border-radius: 8px; }
.board .cat, .board .cell {
  background: var(--blue); display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 4px;
}
.board .cat { font-weight: 800; text-transform: uppercase; padding: 6px; min-height: 3.2em; font-size: 0.9em; }
.board .cell { color: var(--gold); font-weight: 900; padding: 0; border: 0; }
.board .cell.used { color: transparent; background: #0a1567; }
.board .cell.lit { outline: 4px solid white; }
.board.mini .cat { font-size: 0.55em; min-height: 3.5em; padding: 2px; }
.board.mini .cell { font-size: 0.8em; min-height: 2.6em; border-radius: 4px; }

/* ---- TV ---- */
.tv { overflow: hidden; display: flex; flex-direction: column; height: 100vh; }
.tv #stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 2vh 3vw; min-height: 0; }
.tv .board { height: 100%; }
.tv .board .cat { font-size: 1.6vw; }
.tv .board .cell { font-size: 3.4vw; }
.tv .status { text-align: center; font-size: 2vw; margin: 1vh 0 0; }
.tv .banner { text-align: center; }
.tv .banner h1 { font-size: 6vw; margin: 0 0 2vh; color: var(--gold); text-shadow: 4px 4px 0 #000; }
.tv .banner p { font-size: 2.2vw; }
.tv .banner.showcase h1 { color: white; text-transform: uppercase; }
.tv .banner .label { font-size: 1.5vw; }
.tv .clue-screen { background: var(--blue); flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3vh 5vw; border-radius: 12px; }
.tv .clue-head { font-size: 2vw; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2vh; }
.tv .clue-text { font-size: 4.2vw; font-weight: 700; text-transform: uppercase; text-shadow: 3px 3px 0 #000; line-height: 1.2; }
.tv .clue-screen.answer .clue-text { color: var(--gold); }
.tv .clue-img { max-height: 40vh; max-width: 80%; margin-bottom: 2vh; border-radius: 8px; }
.tv .clue-screen .label { font-size: 1.6vw; margin-top: 3vh; }
.tv .clue-screen .label.buzz-now { color: var(--gold); font-size: 2.4vw; }
.tv .typed { font-size: 3vw; background: var(--blue-deep); padding: 1vh 2vw; border-radius: 8px; min-width: 40%; margin-top: 2vh; }
.tv .verdict { font-size: 3.5vw; margin-top: 2vh; }
.tv h1.dd { font-size: 9vw; color: var(--gold); text-shadow: 6px 6px 0 #000; margin: 0; }
.tv .clue-screen.special p { font-size: 2.4vw; }
.tv .misses { list-style: none; padding: 0; font-size: 1.8vw; color: var(--muted); }
.tv .vote { font-size: 2vw; margin-top: 2vh; color: var(--gold); }
.tv .results { margin: 3vh auto 0; font-size: 1.8vw; border-collapse: collapse; }
.tv .results td { padding: 0.6vh 1.5vw; text-align: left; }
.timer-bar { width: 60%; height: 2vh; background: var(--blue-deep); border-radius: 1vh; overflow: hidden; margin-top: 3vh; }
.timer-bar > div { height: 100%; background: var(--gold); transition: width 0.2s linear; }

#podiums { display: flex; justify-content: center; gap: 1.5vw; padding: 1.5vh 2vw 2vh; }
.podium { background: var(--blue); border: 3px solid var(--line); border-radius: 10px; min-width: 12vw; text-align: center; padding: 1vh 1vw; transition: transform 0.15s; }
.podium .score { font-size: 2.6vw; font-weight: 900; color: white; font-variant-numeric: tabular-nums; }
.podium .name { font-size: 1.6vw; color: var(--muted); }
.podium.control { border-color: var(--gold); }
.podium.buzzed { background: white; transform: translateY(-1vh); }
.podium.buzzed .score, .podium.buzzed .name { color: var(--blue-deep); }
.podium.out { opacity: 0.5; }
.podium.away { opacity: 0.35; border-style: dashed; }
.podium.early { border-color: var(--wrong); }

.tv-lobby { display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: center; }
.join-box { display: flex; gap: 3vw; align-items: center; background: var(--card); border-radius: 16px; padding: 3vh 3vw; }
.qr { width: 22vw; max-width: 340px; background: white; padding: 12px; border-radius: 10px; }
.qr svg { display: block; width: 100%; height: auto; }
.join-url { font-size: 1.8vw; margin-bottom: 3vh; word-break: break-all; }
.room-code { font-size: 7vw; font-weight: 900; color: var(--gold); letter-spacing: 0.1em; }
.lobby-info h2 { font-size: 2.6vw; margin: 0; }
.lobby-info p { font-size: 1.6vw; }
.lobby-players { font-size: 2.2vw; padding-left: 1.2em; }
.sound-on { position: fixed; right: 16px; bottom: 16px; opacity: 0.85; }

/* ---- phone ---- */
.phone { max-width: 560px; margin: 0 auto; padding: 0 12px 24px; user-select: none; -webkit-user-select: none; }
.phone input, .phone textarea { user-select: text; -webkit-user-select: text; }
.phone .bar { display: flex; gap: 8px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.phone .bar .code { margin-left: auto; color: var(--muted); letter-spacing: 0.1em; }
.phone .bar .money { font-weight: 800; color: var(--gold); }
.tag { font-size: 0.7em; background: var(--gold); color: var(--blue-deep); padding: 2px 6px; border-radius: 6px; font-weight: 800; }
.status { text-align: center; font-size: 1.15em; margin: 18px 0; }
.status.big { font-size: 1.6em; font-weight: 800; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li span { flex: 1; }
.list li.mine span { color: var(--gold); font-weight: 700; }
.clue-card .clue-q { font-size: 1.2em; font-weight: 700; margin: 8px 0 0; }
.clue-card .clue-a { font-size: 1.2em; font-weight: 800; color: var(--gold); margin: 8px 0 0; }
.buzzer {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 38vh; margin-top: 12px; border-radius: 50%;
  font-size: 2.6em; font-weight: 900; letter-spacing: 0.08em; border: 8px solid rgba(0,0,0,0.3);
}
.buzzer.waiting { background: #3b3f6b; color: #c7cbe8; }
.buzzer.live { background: var(--wrong); color: white; box-shadow: 0 0 40px rgba(214,69,93,0.6); }
.buzzer.done { background: var(--right); color: white; border-radius: 20px; height: 20vh; }
.buzzer.off { background: transparent; color: var(--muted); border: 2px dashed var(--line); border-radius: 20px; height: 12vh; font-size: 1.2em; }
.buzzer.early { background: #000; color: var(--wrong); }
.skip { display: block; margin: 16px auto; }
.scores { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.scores li { background: var(--card); border-radius: 8px; padding: 6px 10px; display: flex; justify-content: space-between; border: 2px solid transparent; }
.scores li.mine { border-color: var(--gold); }
.scores li.control span::after { content: ' ★'; color: var(--gold); }
.scores li.away { opacity: 0.4; }
#undo { width: 100%; margin-top: 10px; }
details summary { cursor: pointer; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #000; color: white; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: opacity 0.2s; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 0.92; }
