/* Study Game: shared look for the student page and the teacher's board. One dusk-sea theme on purpose. */
:root {
  color-scheme: dark;
  --bg: #141428; --panel: #201f3b; --panel2: #2b2950; --line: #403d6e; --fg: #f3eefb; --mut: #aaa6cf;
  --sea: #14304f; --land: #6d6787; --land2: #7c7696; --sun: #ff9a4d; --good: #4fd6a0; --bad: #ff6470; --warn: #ffc94d;
  --t0: #ff5f57; --t1: #3fa7ff; --t2: #f6c63f; --t3: #5ccf62;
  --display: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; --body: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; --math: "Cambria Math", Cambria, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.45; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel2); border-radius: 8px; padding: 7px 12px; font-weight: 600; touch-action: manipulation; }
button:hover:not(:disabled) { border-color: var(--sun); }
button:disabled { opacity: .42; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, g:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
button.primary { background: var(--sun); border-color: var(--sun); color: #29160a; }
button.good { background: color-mix(in srgb, var(--good) 24%, var(--panel2)); border-color: var(--good); }
button.bad { background: color-mix(in srgb, var(--bad) 24%, var(--panel2)); border-color: var(--bad); }
button.big { font-size: 17px; padding: 11px 22px; }
input, select { background: #15152b; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.tiny { font-size: 12.5px; color: var(--mut); }
.brand { font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--sun); }
.pill { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; font-size: 13px; }
.pill b { font-family: var(--display); color: var(--sun); letter-spacing: .08em; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 13px; min-width: 0; }
.side { display: grid; gap: 9px; min-width: 0; align-content: start; }
.center { min-height: 62vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 14px; }
.formcard { width: min(420px, calc(100vw - 32px)); display: grid; gap: 12px; text-align: left; }
.formcard label { display: grid; gap: 4px; font-weight: 600; }
.formcard input { font-size: 18px; }
.err { color: var(--bad); font-weight: 600; min-height: 1.3em; }
.code { font-family: var(--display); font-size: clamp(34px, 7vw, 54px); font-weight: 700; letter-spacing: .14em; color: var(--sun); }
.tname { color: var(--c); font-family: var(--display); font-weight: 700; }
.yes { color: var(--good); font-weight: 700; } .no { color: var(--bad); font-weight: 700; }
.vote { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12px; color: var(--mut); }
.mapbanner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; padding: 7px 12px; font-family: var(--display); font-size: 24px; }
.mapbanner b { font-weight: 700; color: var(--sun); }
.mapbanner button { font-family: var(--body); font-size: 14px; }
.mapbanner .tiny { font-family: var(--body); }
.clock { font-weight: 700; font-variant-numeric: tabular-nums; }
.mapwrap { background: var(--sea); border: 1px solid var(--line); border-radius: 0 0 10px 10px; overflow: auto; }
.mapwrap.solo { border-radius: 10px; }
.mapwrap svg { display: block; width: 100%; height: auto; max-height: calc(100vh - 190px); min-width: 320px; }
.land path { fill: var(--land); stroke: #23233f; stroke-width: 1.3; transition: fill .35s; }
.land.alt path { fill: var(--land2); }
.land.o0 path { fill: var(--t0); } .land.o1 path { fill: var(--t1); } .land.o2 path { fill: var(--t2); }
.land.dim { opacity: .62; }
.land.click { cursor: pointer; }
.land.click:hover path { filter: brightness(1.15); }
.land.can path { stroke: #fff; stroke-width: 2; }
.land.sel path { stroke: var(--sun); stroke-width: 4; }
.land.cap path { stroke: #fff; stroke-width: 3.5; animation: cap .7s 3 alternate; }
@keyframes cap { to { filter: brightness(1.5); } }
.lab { pointer-events: none; }
.lab text { font-family: var(--body); font-weight: 700; fill: #fff; paint-order: stroke; stroke: #1a1a30; stroke-width: 2.6px; text-anchor: middle; }
.lane { fill: none; stroke: #cfe5ff; stroke-width: 1.8; stroke-dasharray: 2.5 5; stroke-linecap: round; opacity: .85; }
text.tag { font-size: 11px; fill: #14142a; stroke: none; font-family: var(--body); font-weight: 800; text-anchor: middle; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; background: #fff; color: #1b1b2e; font-weight: 600; border-radius: 9px; padding: 8px 15px; z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 6px 22px #0009; }
.down { background: var(--bad); color: #210609; text-align: center; font-weight: 700; padding: 4px 10px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* The four-team map (board.js). Scoped to .sgmap so the Simpler Game's hex map keeps its own look. */
.sgmap .land path { stroke: #1b1b33; stroke-width: 1; stroke-linejoin: round; }
.sgmap .land.can path { stroke: #fff; stroke-width: 1.6; }
.sgmap .land.sel path { stroke: var(--sun); stroke-width: 3; }
.sgmap .land.cap path { stroke: #fff; stroke-width: 2.4; }
.sgmap .lab .dotb { fill: #1a1a30; stroke: #fff; stroke-width: 1; }
.sgmap .lab .starb { fill: #fff1b8; stroke: #1a1a30; stroke-width: 1.2; stroke-linejoin: round; }
.sgmap .lab text.num { font-family: var(--display); font-weight: 700; fill: #fff; stroke: none; text-anchor: middle; }
.sgmap .lab text.num.dark { fill: #1a1a30; }
.sgmap .lab text.nm { font-size: 5.1px; stroke-width: 1.5px; }
.sgmap text.tag { font-size: 7px; }
.sgkey { display: grid; gap: 4px; }
.krow { display: grid; grid-template-columns: 40px 14px 1fr auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: var(--panel2); }
.krow .place { font-family: var(--display); font-weight: 700; color: var(--sun); }
.krow .sw { width: 14px; height: 14px; border-radius: 4px; }
.krow .tn { font-weight: 700; }
.krow .n { font-family: var(--display); font-weight: 700; font-size: 18px; }
.res { border-top: 1px solid var(--line); padding: 6px 0 2px; font-size: 13.5px; }
.res b { font-family: var(--display); }
.namechips { display: flex; flex-wrap: wrap; gap: 5px; }
.namechips span { border: 1px solid var(--c); border-radius: 7px; padding: 3px 9px; font-weight: 700; background: color-mix(in srgb, var(--c) 18%, #15152b); }
