/* Seminary Jeopardy. Game-show look: deep navy, blue board, gold amounts, red buzzer. */
:root {
  --bg: #060a2b;
  --bg2: #0d1658;
  --blue-hi: #2c4ae6;
  --blue: #1a33c4;
  --blue-lo: #0f1f8a;
  --used: #0a1460;
  --gold: #ffcc33;
  --text: #fff;
  --muted: rgba(225, 230, 255, 0.7);
  --card: rgba(255, 255, 255, 0.06);
  --card-hi: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.15);
  --good: #22c55e;
  --bad: #ef4444;
  --buzz: #e11d48;
  --menu: #111a5c;
  --display: "Oswald", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(ellipse at top, var(--bg2), var(--bg) 70%) fixed var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--gold); }
h1 { margin: 4px 0; font-size: clamp(24px, 6vw, 34px); line-height: 1.15; }
code { background: rgba(0, 0, 0, 0.3); padding: 1px 5px; border-radius: 5px; font-size: 0.92em; }
kbd {
  font: 600 11px/1 system-ui, sans-serif;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.2);
  opacity: 0.85;
}
@media (hover: none) { kbd { display: none; } }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.center-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0; }
.lead { font-size: 19px; margin: 0; }
.error { color: #fca5a5; margin: 0; }
.danger-text { color: #fca5a5 !important; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body.host .wrap { max-width: 900px; }
body.host .wrap.wide { max-width: 1320px; }

/* ---------- top bar ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(6, 10, 43, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.player-bar { grid-template-columns: auto minmax(0, 1fr) auto; }
.bar-left { justify-self: start; min-width: 0; }
.bar-mid { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.bar-mid b { overflow: hidden; text-overflow: ellipsis; }
.bar-right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.link { background: none; border: 0; color: var(--muted); padding: 6px 0; text-decoration: none; font-size: 15px; }
.link:hover { color: var(--text); }
.myscore { font-family: var(--display); color: var(--gold); font-size: 20px; font-weight: 700; }
.code-pill { font-size: 13px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: baseline; gap: 8px; }
.code-pill b { font-family: var(--display); color: var(--gold); font-size: 24px; letter-spacing: 0.12em; }

.conn { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.conn.bad::before { background: var(--bad); }
.conn.wait::before { background: var(--gold); animation: blink 1s infinite; }
@media (max-width: 480px) { .player-bar .conn span { display: none; } }
@media (max-width: 760px) { .host-bar .bar-mid { display: none; } .host-bar { grid-template-columns: auto 1fr; } }
@keyframes blink { 50% { opacity: 0.3; } }

.notice { margin: 0; text-align: center; font-size: 14px; color: #fde68a; background: rgba(234, 179, 8, 0.12); padding: 6px; border-radius: 8px; }

/* ---------- logo ---------- */
.logo { display: flex; flex-direction: column; align-items: center; line-height: 1; font-family: var(--display); text-transform: uppercase; }
.logo span { font-size: 18px; letter-spacing: 0.4em; margin-right: -0.4em; color: var(--muted); font-weight: 500; }
.logo b { font-size: clamp(48px, 13vw, 68px); color: var(--gold); letter-spacing: 0.02em; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.6), 0 0 28px rgba(255, 204, 51, 0.25); }
.logo.small { flex-direction: row; align-items: baseline; gap: 6px; }
.logo.small span { font-size: 12px; letter-spacing: 0.2em; margin: 0; }
.logo.small b { font-size: 20px; text-shadow: none; }

/* ---------- cards and buttons ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.card h2 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.count { background: var(--card-hi); color: var(--text); border-radius: 999px; padding: 1px 9px; letter-spacing: 0; font-size: 13px; }
.note { background: rgba(255, 204, 51, 0.1); border-color: rgba(255, 204, 51, 0.35); }
.note ul { margin: 6px 0 0; padding-left: 20px; color: #fde68a; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-hi);
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s, transform 0.06s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.17); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--gold); color: #1d1500; border-color: transparent; }
.btn.primary:hover:not(:disabled) { background: #ffd966; }
.btn.good { background: var(--good); color: #03210e; border-color: transparent; }
.btn.good:hover:not(:disabled) { background: #3ddc76; }
.btn.bad { background: var(--bad); border-color: transparent; }
.btn.bad:hover:not(:disabled) { background: #f56565; }
.btn.big { min-height: 58px; font-size: 19px; padding: 14px 26px; border-radius: 14px; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.tiny { min-height: 32px; min-width: 32px; padding: 4px 8px; font-size: 15px; border-radius: 8px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.row-btns.end { justify-content: flex-end; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
input, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  font-size: 16px;
}
input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 204, 51, 0.2); }
input::placeholder, textarea::placeholder { color: rgba(225, 230, 255, 0.35); }
textarea { resize: vertical; line-height: 1.35; }

.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--gold); flex: none; margin: 1px 0 0; }
.toggle small { display: block; color: var(--muted); }
.toggle.slim { padding: 0; align-items: center; }
.toggle.slim input { width: 18px; height: 18px; }

/* ---------- student home ---------- */
.home { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px 16px; max-width: 440px; margin: 0 auto; }
.home > .card { width: 100%; }
.join { display: flex; flex-direction: column; gap: 16px; }
.code-input { font-family: var(--display); font-weight: 700; font-size: 40px; letter-spacing: 0.35em; text-align: center; text-transform: uppercase; padding: 6px 0 6px 0.35em; color: var(--gold); }
.quiet-link { color: var(--muted); text-decoration: none; font-size: 15px; }
.quiet-link:hover { color: var(--text); }

/* ---------- the board ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 6px;
  background: #000;
  padding: 6px;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: calc(var(--cols) * 240px);
  margin: 0 auto;
}
.board .cat, .board .cell {
  background: linear-gradient(var(--blue-hi), var(--blue) 55%, var(--blue-lo));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.board .cat {
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 700;
  font-size: clamp(11px, 1.7vw, 24px);
  line-height: 1.1;
  padding: 10px 4px;
  min-height: 56px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
  overflow-wrap: anywhere;
  margin-bottom: 4px;
}
.board .cell {
  border: 0;
  color: var(--gold);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(17px, 3.6vw, 50px);
  aspect-ratio: 16 / 10;
  padding: 0;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.65);
}
button.cell:hover { background: linear-gradient(#4462f5, #2643dc); }
button.cell:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.board .cell.used, .board .cell.blank { background: var(--used); }
button.cell.used:hover { background: #121f80; }
body.player .board { padding: 4px; gap: 4px; border-radius: 10px; }
body.player .board .cat { min-height: 44px; font-size: clamp(10px, 2.8vw, 15px); }
body.player .board .cell { font-size: clamp(15px, 4.6vw, 26px); }

.banner { text-align: center; padding: 12px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 8px 12px; flex-wrap: wrap; }
.banner.gold { background: rgba(255, 204, 51, 0.12); border-color: rgba(255, 204, 51, 0.45); }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35); margin-right: 2px; vertical-align: 1px; }

/* ---------- clue ---------- */
.clue-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-family: var(--display); text-transform: uppercase; font-size: 18px; letter-spacing: 0.04em; color: var(--muted); font-weight: 500; }
.clue-head b { color: var(--gold); font-size: 28px; }
.clue-card {
  background: linear-gradient(var(--blue-hi), var(--blue) 50%, var(--blue-lo));
  border-radius: 16px;
  padding: clamp(20px, 4vw, 52px);
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.clue-card p { margin: 0; font-family: var(--serif); font-size: clamp(20px, 5.4vw, 28px); line-height: 1.38; text-align: center; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55); }
.clue-card.big { min-height: 280px; }
.clue-card.big p { font-size: clamp(22px, 2.7vw, 40px); }

.answer-box {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px 16px;
}
.answer-box.shown { border-style: solid; border-color: rgba(255, 204, 51, 0.5); }
.answer-box:disabled { cursor: default; }
.answer-text { font-size: 21px; font-weight: 700; color: var(--gold); }

.answer-reveal { text-align: center; background: rgba(255, 204, 51, 0.1); border: 1px solid rgba(255, 204, 51, 0.4); border-radius: 14px; padding: 14px; }
.answer-reveal p:last-child { margin: 4px 0 0; font-size: 22px; font-weight: 700; color: var(--gold); }
.result { text-align: center; font-size: 19px; font-weight: 600; margin: 0; width: 100%; }
.result.good { color: #86efac; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.judge { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }
.judge .btn { flex: 1 1 220px; }
.answering { width: 100%; text-align: center; font-size: 22px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.answering b { font-size: 32px; font-family: var(--display); letter-spacing: 0.02em; }
.waiting { width: 100%; text-align: center; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--good); animation: blink 1s infinite; }

.line { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.line li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card-hi); font-weight: 600; }
.line li.now { background: var(--good); color: #03210e; }
.line li.wrong { background: rgba(239, 68, 68, 0.16); color: #fecaca; }
.line .pos { font-size: 12px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, 0.25); display: inline-flex; align-items: center; justify-content: center; }
.line .ms { font-weight: 400; font-size: 13px; opacity: 0.75; }

/* ---------- buzzer ---------- */
.buzz-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 0 4px; }
.buzz {
  width: min(66vw, 240px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 0;
  font-family: var(--display);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  background: radial-gradient(circle at 35% 30%, #ff7a96, var(--buzz) 55%, #9f1239);
  box-shadow: 0 10px 0 #7f1d3a, 0 18px 34px rgba(0, 0, 0, 0.5);
  transition: transform 0.06s, box-shadow 0.06s;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1.05;
  padding: 0 16px;
}
.buzz:disabled { cursor: default; }
.buzz.can { animation: ready 1.1s ease-in-out infinite; }
.buzz.can:active, .buzz.pressed { transform: translateY(8px); box-shadow: 0 2px 0 #7f1d3a, 0 6px 12px rgba(0, 0, 0, 0.5); animation: none; }
@keyframes ready { 50% { filter: brightness(1.18); } }
.buzz.wait { background: radial-gradient(circle at 35% 30%, #6b7280, #3f4654 60%, #1f2937); box-shadow: 0 10px 0 #111827, 0 18px 34px rgba(0, 0, 0, 0.5); color: rgba(255, 255, 255, 0.72); font-size: 34px; }
.buzz.me { background: radial-gradient(circle at 35% 30%, #86efac, var(--good) 55%, #15803d); box-shadow: 0 10px 0 #14532d, 0 0 0 12px rgba(34, 197, 94, 0.25), 0 18px 34px rgba(0, 0, 0, 0.5); font-size: 36px; }
.buzz.queued { background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 55%, #b45309); box-shadow: 0 10px 0 #78350f, 0 18px 34px rgba(0, 0, 0, 0.5); color: #2a1a00; text-shadow: none; font-size: 30px; }
.buzz.out { background: radial-gradient(circle at 35% 30%, #4b5563, #2b313c 60%, #161b24); box-shadow: 0 10px 0 #0b0f17, 0 18px 34px rgba(0, 0, 0, 0.5); color: rgba(255, 255, 255, 0.5); font-size: 28px; }
.buzz-note { margin: 0; text-align: center; color: var(--muted); min-height: 1.4em; max-width: 360px; }

/* ---------- scores ---------- */
.score-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.score-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
.score-list .sub { flex-basis: 100%; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.score-list li.mine { background: rgba(255, 204, 51, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 204, 51, 0.45); }
.score-list li.offline .who { opacity: 0.5; }
.rank { width: 20px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; flex: none; font-size: 14px; }
.who { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-num { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--gold); min-width: 66px; text-align: right; font-variant-numeric: tabular-nums; background: none; border: 0; padding: 0; }
button.score-num { border-radius: 6px; padding: 0 4px; }
button.score-num:hover { background: var(--card-hi); }
.score-edit { display: flex; gap: 6px; }
.score-edit input { width: 110px; padding: 6px 8px; }
.scores .small { margin: 10px 0 0; }

/* ---------- lobby ---------- */
.join-banner {
  text-align: center;
  padding: 26px 16px 20px;
  border-radius: 20px;
  background: linear-gradient(var(--blue-hi), var(--blue) 55%, var(--blue-lo));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.join-banner p { margin: 0; font-size: clamp(18px, 2.6vw, 28px); }
.join-banner p.muted { font-size: 15px; margin-top: 6px; }
.bigcode { font-family: var(--display); font-weight: 700; font-size: clamp(80px, 15vw, 170px); line-height: 1; letter-spacing: 0.14em; margin: 10px 0 4px 0.14em; color: var(--gold); text-shadow: 0 6px 0 rgba(0, 0, 0, 0.6); }
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card-hi); border: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.chip.offline { opacity: 0.5; }
.chip.me { border-color: var(--gold); }
.chip-x { background: none; border: 0; color: var(--muted); padding: 0 0 0 2px; font-size: 12px; line-height: 1; }
.chip-x:hover { color: #fca5a5; }
.seg { display: flex; background: rgba(0, 0, 0, 0.28); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 0; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--gold); color: #1d1500; }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.team-col { border-radius: 12px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.team-name { font-weight: 700; padding: 6px 8px; font-size: 15px; }
.team-members { display: flex; flex-wrap: wrap; gap: 6px; }
.team-members .chip { font-size: 14px; padding: 4px 10px; }
.team-members .chip:hover { border-color: var(--text); }
.team-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.team-btn { padding: 14px 10px; border-radius: 14px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); font-weight: 700; font-size: 17px; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.team-btn.on { background: var(--c); color: #0b0b0b; }
.team-btn small { font-weight: 400; font-size: 13px; opacity: 0.85; }

/* ---------- host layout ---------- */
.play-grid { display: grid; gap: 16px; }
@media (min-width: 1050px) {
  .play-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .play-grid aside { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
}
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--menu);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 20;
}
.menu button { background: none; border: 0; text-align: left; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.menu button:hover { background: var(--card-hi); }

/* ---------- board list and editor ---------- */
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.board-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); }
.board-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.board-info b { font-size: 17px; }
.board-info small { color: var(--muted); }
.help summary { cursor: pointer; color: var(--gold); margin-top: 16px; font-weight: 600; }
.help p { color: var(--muted); }
.prompt { white-space: pre-wrap; background: rgba(0, 0, 0, 0.3); border-radius: 10px; padding: 12px; font-size: 13px; max-height: 260px; overflow: auto; margin: 0 0 10px; }

.cat-edit { display: flex; flex-direction: column; gap: 10px; }
.cat-edit-head { display: flex; gap: 10px; align-items: center; }
.cat-edit > .btn, .editor > .btn { align-self: flex-start; }
.cat-name { font-family: var(--display); text-transform: uppercase; font-size: 20px; letter-spacing: 0.03em; font-weight: 700; }
.clue-edit { display: grid; grid-template-columns: 90px minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.clue-edit .val { text-align: center; color: var(--gold); font-weight: 700; padding-left: 6px; padding-right: 6px; }
.clue-edit textarea { min-height: 48px; }
@media (max-width: 720px) {
  .clue-edit { grid-template-columns: 76px minmax(0, 1fr) auto; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .clue-edit textarea, .clue-edit input:not(.val) { grid-column: 2 / 3; }
  .clue-edit .btn { grid-row: 1; grid-column: 3; }
}
.paste { min-height: 340px; font: 14px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- final scores ---------- */
.final { text-align: center; padding: 8px 0; }
.final h1 { font-family: var(--display); font-size: clamp(38px, 8vw, 68px); color: var(--gold); margin: 4px 0 18px; text-transform: uppercase; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.6); }
.podium { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; align-items: end; max-width: 640px; }
.podium li { background: linear-gradient(var(--blue-hi), var(--blue-lo)); border-radius: 14px 14px 6px 6px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.podium b { font-size: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pts { font-family: var(--display); color: var(--gold); font-size: 26px; font-weight: 700; }
.podium .medal { font-size: 30px; }
.podium .p1 { order: 2; min-height: 190px; box-shadow: inset 0 0 0 2px var(--gold); }
.podium .p2 { order: 1; min-height: 150px; }
.podium .p3 { order: 3; min-height: 120px; }

/* ---------- final jeopardy ---------- */
.fj-head { text-align: center; }
.fj-head h1 { font-family: var(--display); text-transform: uppercase; color: var(--gold); font-size: clamp(32px, 6vw, 58px); margin: 2px 0 0; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.6); }
.chip.done { border-color: rgba(34, 197, 94, 0.6); background: rgba(34, 197, 94, 0.15); }
.fj-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fj-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) auto auto; gap: 8px 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.fj-row.right { border-color: rgba(34, 197, 94, 0.6); background: rgba(34, 197, 94, 0.1); }
.fj-row.wrong { border-color: rgba(239, 68, 68, 0.55); background: rgba(239, 68, 68, 0.08); }
.fj-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.fj-who small { color: var(--muted); width: 100%; }
.fj-answer { font-size: 18px; overflow-wrap: anywhere; }
.fj-wager { font-family: var(--display); color: var(--gold); font-size: 20px; font-weight: 700; text-align: right; }
.fj-btns { display: flex; gap: 6px; }
.fj-btns .btn:not(.on) { background: var(--card-hi); color: var(--text); border-color: var(--line); }
body.player .fj-row { grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: dense; }
body.player .fj-answer { grid-column: 1 / -1; grid-row: 2; }
@media (max-width: 700px) {
  .fj-row { grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: dense; }
  .fj-answer, .fj-btns { grid-column: 1 / -1; }
}
.ok-note { margin: 0; color: #86efac; }
.result.bad { color: #fca5a5; }
.gold { color: var(--gold); }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--menu);
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 12px;
  z-index: 50;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  max-width: calc(100vw - 32px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
