/* IM Jeopardy — classic blue/gold board, big-screen projector + phone friendly. */
:root {
  --jeop-blue: #060ce9;
  --jeop-blue-dark: #0a1196;
  --jeop-bg: #07071f;
  --jeop-tile: #0b1fb8;
  --jeop-tile-used: #050a3a;
  --gold: #d4af37;
  --gold-bright: #ffcc00;
  --clue-value: #e8b22a;
  --white: #ffffff;
  --grey: #9aa0b5;
  --red: #e03131;
  --green: #2f9e44;
  --panel: #12132e;
  --panel-2: #1b1d3f;
  --shadow: 0 4px 14px rgba(0,0,0,.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: var(--jeop-bg);
  color: var(--white);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
#root { min-height: 100vh; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0 0 .4em; }
.muted { color: var(--grey); }
.center { text-align: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.hide { display: none !important; }

/* ----- generic buttons / inputs ----- */
.btn {
  background: var(--jeop-blue); color: #fff; border: 2px solid var(--gold);
  border-radius: 8px; padding: 10px 16px; font-size: 16px; font-weight: 700;
  box-shadow: var(--shadow);
}
.btn:hover { background: var(--jeop-blue-dark); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.gold { background: var(--gold); color: #1a1a00; border-color: var(--gold-bright); }
.btn.green { background: var(--green); border-color: #74c98a; }
.btn.red { background: var(--red); border-color: #ffb3b3; }
.btn.ghost { background: transparent; border-color: var(--grey); }
.btn.sm { padding: 6px 10px; font-size: 14px; }
input, select {
  background: #fff; color: #111; border: 2px solid var(--gold); border-radius: 8px;
  padding: 10px 12px; font-size: 16px; width: 100%;
}
label { font-weight: 700; font-size: 14px; color: var(--gold); display: block; margin-bottom: 4px; }
.card { background: var(--panel); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--panel-2); }
.pill.live { background: var(--green); }
.pill.warn { background: #b54708; }
.banner { padding: 18px; text-align: center; }
.err { color: #ffb3b3; white-space: pre-wrap; }
.ok { color: #b2f2bb; }

/* ----- app shell ----- */
.app { max-width: 1400px; margin: 0 auto; padding: 16px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.logo { font-family: 'Georgia', serif; font-weight: 900; letter-spacing: .5px;
  color: var(--gold-bright); text-shadow: 2px 2px 0 #00000080; }

/* ===== BOARD VIEW ===== */
.board-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; flex: 1;
}
.cat-head {
  background: var(--jeop-blue); color: var(--white); text-transform: uppercase;
  font-family: 'Georgia', serif; font-weight: 800; text-align: center;
  display: flex; align-items: center; justify-content: center; padding: 8px;
  border-radius: 6px; min-height: 70px; font-size: clamp(13px, 1.4vw, 22px);
  text-shadow: 1px 1px 0 #00000080; line-height: 1.1;
}
.tile {
  background: var(--jeop-tile); border: none; color: var(--clue-value);
  font-family: 'Georgia', serif; font-weight: 900; border-radius: 6px;
  font-size: clamp(22px, 3.4vw, 52px); text-shadow: 2px 2px 0 #00000080;
  display: flex; align-items: center; justify-content: center; min-height: 64px;
  transition: background .15s; cursor: default;
}
.tile.click { cursor: pointer; }
.tile.click:hover { background: #1530ff; }
.tile.used { background: var(--jeop-tile-used); color: transparent; }

.scoreboard { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 14px 0 4px; }
.team-score {
  background: var(--panel); border-radius: 10px; padding: 10px 16px; min-width: 130px;
  text-align: center; border: 2px solid transparent;
}
.team-score.control { border-color: var(--gold-bright); box-shadow: 0 0 14px #ffcc0055; }
.team-score .tn { font-weight: 800; font-size: clamp(14px, 1.4vw, 20px); }
.team-score .sc { font-family: 'Georgia', serif; font-weight: 900; font-size: clamp(20px, 2.6vw, 40px); }
.team-score .sc.neg { color: var(--red); }
.control-tag { font-size: 12px; color: var(--gold-bright); font-weight: 800; }

/* clue overlay */
.clue-overlay {
  position: fixed; inset: 0; background: var(--jeop-blue);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4vw; z-index: 50; text-align: center;
}
.clue-cat { font-size: clamp(16px, 2vw, 30px); color: var(--gold-bright); text-transform: uppercase; font-weight: 800; }
.clue-val { font-family: 'Georgia', serif; font-weight: 900; font-size: clamp(28px, 4vw, 64px); color: var(--clue-value); }
.clue-text { font-family: 'Georgia', serif; font-size: clamp(24px, 4.2vw, 60px); line-height: 1.25; max-width: 1100px; margin: 3vh 0; text-shadow: 2px 2px 0 #00000060; }
.clue-state { font-size: clamp(20px, 2.6vw, 40px); font-weight: 900; letter-spacing: 1px; }
.clue-state.open { color: var(--gold-bright); animation: pulse 1s infinite; }
.clue-state.locked { color: #fff; }
.clue-answer { font-family: 'Georgia', serif; font-size: clamp(22px, 3.4vw, 48px); color: var(--gold-bright); margin-top: 2vh; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.shotclock {
  font-family: 'Georgia', serif; font-weight: 900; font-size: clamp(40px, 8vw, 120px);
  line-height: 1;
}
.shotclock.low { color: var(--red); }
.buzzed-name { font-family: 'Georgia', serif; font-weight: 900; font-size: clamp(40px, 7vw, 110px); color: var(--gold-bright); }
.buzzed-team { font-size: clamp(20px, 2.6vw, 40px); }

/* lobby / join */
.join-big { display: flex; gap: 30px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 30px; }
.code-box { font-family: 'Georgia', serif; font-weight: 900; font-size: clamp(50px, 9vw, 140px); color: var(--gold-bright); letter-spacing: 8px; }
.qr-box { background: #fff; padding: 14px; border-radius: 12px; }
.qr-box img { display: block; width: clamp(160px, 24vw, 320px); height: auto; image-rendering: pixelated; }
/* Compact study-deck QR on the final scoreboard (no white frame, smaller). */
.deck-qr img { display: block; width: 150px; height: auto; image-rendering: pixelated; }

/* ===== PLAYER VIEW ===== */
.player-wrap { min-height: 100vh; display: flex; flex-direction: column; padding: 14px; max-width: 560px; margin: 0 auto; }
.buzz-btn {
  flex: 1; min-height: 46vh; border-radius: 24px; border: 6px solid #00000040;
  font-size: clamp(28px, 9vw, 60px); font-weight: 900; color: #fff; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  box-shadow: 0 10px 0 #00000040; transition: transform .05s, background .1s;
}
.buzz-btn:active { transform: translateY(4px); box-shadow: 0 6px 0 #00000040; }
.buzz-btn.armed { background: var(--red); }
.buzz-btn.armed.buzzed { background: #ffcc00; color: #1a1a00; }
.buzz-btn.idle { background: #555a72; color: #c8cce0; }
.buzz-btn.locked { background: #3a2020; color: #ff9b9b; border-color: #00000060; }
.buzz-btn.mine { background: var(--green); }
.team-chip {
  border: 2px solid var(--gold); background: var(--panel); border-radius: 10px; padding: 14px;
  font-weight: 800; font-size: 18px; text-align: center;
}
.team-chip.active { background: var(--gold); color: #1a1a00; }
.clue-mirror { background: var(--panel); border-radius: 12px; padding: 16px; font-size: 18px; line-height: 1.35; }

/* ===== HOST VIEW ===== */
.host-wrap { max-width: 1200px; margin: 0 auto; padding: 14px; }
.host-grid { display: grid; grid-template-columns: 1fr 360px; gap: 14px; align-items: start; }
@media (max-width: 900px) { .host-grid { grid-template-columns: 1fr; } }
.mini-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.mini-cat { font-size: 11px; font-weight: 800; text-align: center; padding: 4px; background: var(--jeop-blue); border-radius: 4px; min-height: 38px; display: flex; align-items: center; justify-content: center; line-height: 1.05; }
.mini-tile { background: var(--jeop-tile); color: var(--clue-value); font-weight: 800; border: none; border-radius: 4px; padding: 10px 0; font-size: 16px; }
.mini-tile:hover { background: #1530ff; }
.mini-tile.used { background: var(--jeop-tile-used); color: #3a3f66; }
.answer-box { background: #1a1300; border: 2px solid var(--gold); border-radius: 10px; padding: 14px; }
.answer-box .resp { font-size: 22px; font-weight: 800; color: var(--gold-bright); }
.alts { color: #ffe08a; font-size: 15px; margin-top: 6px; }
.adjudicate .btn { font-size: 18px; padding: 14px; flex: 1; }
.host-clue { background: var(--jeop-blue); border-radius: 12px; padding: 16px; }
.attempted-tag { font-size: 12px; color: #ff9b9b; }
.player-row { display: flex; align-items: center; gap: 8px; padding: 6px; border-bottom: 1px solid #ffffff14; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grey); display: inline-block; }
.dot.on { background: var(--green); }
.dot.off { background: var(--red); }

/* ===== leaderboard ===== */
table.lb { width: 100%; border-collapse: collapse; }
table.lb th, table.lb td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #ffffff20; }
table.lb th { color: var(--gold); }
table.lb td.num, table.lb th.num { text-align: right; font-variant-numeric: tabular-nums; }
.super { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; }
.super .card .t { color: var(--gold-bright); font-weight: 800; }
.super .card .n { font-size: 22px; font-weight: 900; }
.standings .team-score { min-width: 0; }

.sound-enable { position: fixed; bottom: 12px; right: 12px; z-index: 60; }
.toast { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 70; font-weight: 700; }
