/* Mind Games TXC Live: one look for every screen. The event's logo colors start the palette (navy, red, yellow, green,
   blue); the admin page can change them later. Big type and high contrast for iPads at arm's length and a gym projector. */
:root {
  --bg: #0b1730; --panel: #13254a; --panel2: #1b3260; --line: #2a4479; --fg: #f3f6fc; --muted: #a8b6d4;
  --gold: #f4b83a; --on-gold: #0b1730;
  --red: #e5483f; --yellow: #f4c430; --green: #2fae66; --blue: #3d7be0; --violet: #9a7bf0;
  --ok: #2fae66; --bad: #e5483f;
  --hist: #e5483f; --math: #3d7be0; --sci: #2fae66; --rel: #9a7bf0;
  --A: #e5483f; --B: #3d7be0; --C: #d9a514; --D: #2fae66;
  --display: 'Saira Condensed', 'Arial Narrow', Impact, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 400 17px/1.45 var(--body); -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--fg); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
textarea { width: 100%; min-height: 140px; font: 14px/1.4 var(--mono); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; margin: 0; line-height: 1; }
.muted { color: var(--muted); }
.wordmark { font: 800 22px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.wordmark .m { color: var(--red); } .wordmark .g { color: var(--yellow); } .wordmark .t { color: var(--green); }

.bar { display: flex; align-items: center; gap: 14px; padding: 12px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: var(--panel); }
.bar .grow { flex: 1; min-width: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.live { background: var(--ok); } .dot.offline { background: var(--bad); }
.status { font: 600 13px var(--mono); color: var(--muted); display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }

.btn { border: 0; border-radius: 10px; padding: 12px 18px; background: var(--panel2); font-weight: 650; min-height: 46px; }
.btn.gold { background: var(--gold); color: var(--on-gold); }
.btn.big { font: 800 24px/1 var(--display); text-transform: uppercase; padding: 18px 26px; letter-spacing: .02em; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.bad { background: var(--bad); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .choice:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 10px; z-index: 50; max-width: calc(100vw - 32px); }
.toast.bad { background: #5a1714; border-color: var(--bad); }
.info { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; background: none; color: var(--muted);
  font: 700 12px/1 Georgia, serif; font-style: italic; padding: 0; vertical-align: middle; margin-left: 4px; }
.infopop { position: fixed; z-index: 60; background: #fff; color: #0b1730; padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 1.4; box-shadow: 0 6px 24px rgba(0,0,0,.4); }

/* subjects */
.subj { display: inline-block; font: 700 13px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; padding: 6px 9px; border-radius: 5px; background: var(--panel2); }
.subj.hist { background: var(--hist); } .subj.math { background: var(--math); } .subj.sci { background: var(--sci); } .subj.rel { background: var(--rel); }

/* choices */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { display: flex; align-items: center; gap: 14px; text-align: left; border: 3px solid transparent; border-radius: 14px; padding: 16px; min-height: 84px;
  background: var(--panel2); font-size: 22px; font-weight: 600; line-height: 1.2; }
.choice .k { flex: none; width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font: 800 28px/1 var(--display); color: #fff; }
.choice[data-k="0"] .k { background: var(--A); } .choice[data-k="1"] .k { background: var(--B); } .choice[data-k="2"] .k { background: var(--C); } .choice[data-k="3"] .k { background: var(--D); }
.choice.picked { border-color: var(--gold); background: #2a3f6e; }
.choice.right { border-color: var(--ok); background: #164b33; }
.choice.wrong { opacity: .45; }
.choice:disabled { cursor: default; }

/* the board */
.board { display: grid; gap: 8px; }
.board .hd { font: 800 16px/1.1 var(--display); text-transform: uppercase; text-align: center; padding: 10px 4px; border-radius: 6px; color: #fff; }
.board .sq { font: 800 30px/1 var(--display); text-align: center; padding: 16px 0; border-radius: 8px; background: var(--panel2); border: 2px solid var(--line); color: var(--gold); }
.board .sq.used { color: transparent; background: var(--panel); border-color: var(--panel); }
.board button.sq:not(:disabled):hover { border-color: var(--gold); }

.clock { font: 800 34px/1 var(--display); font-variant-numeric: tabular-nums; }
.clock.low { color: var(--bad); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--panel2); font-size: 14px; font-weight: 600; }
.chip.ok { background: #164b33; } .chip.warn { background: #5a4310; } .chip.bad { background: #5a1714; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* a judges' ruling, shown on every screen for a moment */
.noticeband { position: sticky; top: 0; z-index: 40; background: var(--gold); color: var(--on-gold); font: 800 22px/1.2 var(--display); text-transform: uppercase;
  letter-spacing: .02em; padding: 12px max(16px, env(safe-area-inset-left)); text-align: center; }
