/* Shared styles (src/kit). Each game sets its colors in src/game/style.css, which comes after this. */
:root {
  --bg: #1f2937;
  --bg2: #374151;
  --panel: rgba(0, 0, 0, 0.22);
  --text: #fff;
  --muted: #d1d5db;
  --accent: #facc15;
  --good: #4ade80;
  --bad: #f87171;
  --results-bg: rgba(250, 204, 21, 0.15);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at center, var(--bg2), var(--bg) 70%) fixed;
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 980px; margin: 0 auto; padding: 12px 12px 48px; }
h1 { font-size: 2.1rem; margin: 20px 0 8px; text-align: center; }
h2 { margin: 6px 0; font-size: 1.2rem; }
h4 { margin: 12px 0 2px; color: var(--accent); }
.center { text-align: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.banner { position: fixed; top: 0; left: 0; right: 0; z-index: 10; background: var(--bad); text-align: center; padding: 8px; font-weight: 600; }
.error { background: rgba(248, 113, 113, 0.25); border: 1px solid var(--bad); border-radius: 10px; padding: 8px 12px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111827; padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: 90vw; }
.panel { background: var(--panel); border-radius: 16px; padding: 14px 16px; margin: 12px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; max-width: 380px; margin: 0 auto; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

button {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 11px 18px; cursor: pointer;
  background: var(--accent); color: #1f2937; box-shadow: 0 3px 0 #a16207;
}
button:active { transform: translateY(2px); box-shadow: 0 1px 0 #a16207; }
button.secondary { background: #dcfce7; box-shadow: 0 3px 0 #15803d; }
button.danger { background: var(--bad); box-shadow: 0 3px 0 #991b1b; }
button.small { padding: 6px 10px; font-size: 0.9rem; }
button:disabled { opacity: 0.5; cursor: default; }
input[type='text'], input[type='number'] { font: inherit; padding: 11px; border-radius: 12px; border: 2px solid transparent; width: 100%; }
input[type='number'] { width: 110px; padding: 6px 8px; }
input:focus { outline: none; border-color: var(--accent); }
.code { font-size: 2.4rem; font-weight: 900; letter-spacing: 0.3em; }
label.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; }
ul.players { list-style: none; padding: 0; margin: 0; }
ul.players li { padding: 4px 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--good); margin-right: 6px; }
.dot.off { background: #9ca3af; }
details summary { cursor: pointer; font-weight: 700; }
details ul, details ol { padding-left: 20px; margin: 4px 0; }


/* ---------- shared game screen ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.95rem; }
.timer { display: inline-block; margin-left: 8px; font-weight: 800; color: var(--accent); }
.timer.urgent { color: var(--bad); }
.seatctl { justify-content: flex-end; margin-top: 10px; }
.results { background: var(--results-bg); border: 2px solid var(--accent); border-radius: 16px; padding: 12px; margin: 10px 0; text-align: center; }
.results .msg { font-size: 1.1rem; font-weight: 800; margin: 4px 0; }
.results table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.results td, .results th { padding: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.15); text-align: left; }
.results tr.win { color: var(--accent); font-weight: 800; }
.results button { margin-top: 8px; }
.log { font-size: 0.9rem; color: var(--muted); margin-top: 12px; }
.log div:first-child { color: var(--text); font-weight: 600; }
.madeby { position: fixed; bottom: 4px; left: 8px; font-size: 0.75rem; color: var(--muted); opacity: 0.7; }
.madeby a { color: inherit; }
.version { position: fixed; bottom: 4px; right: 8px; font-size: 0.75rem; color: var(--muted); opacity: 0.7; pointer-events: none; }
.updatebar { position: fixed; top: 0; left: 0; right: 0; z-index: 11; background: var(--accent); color: #1f2937; display: flex; gap: 12px; justify-content: center; align-items: center; padding: 6px; font-weight: 700; }
.updatebar button { background: #1f2937; color: #fff; box-shadow: none; }
.timerpick { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; }
select { font: inherit; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--muted); background: transparent; color: inherit; }
option { color: #000; }
.lobbybtns { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 16px 0; }
.lobbybtns p { margin: 0; }
/* Players around the table (games may use these). */
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.seat { background: var(--panel); border-radius: 14px; padding: 8px 10px; border: 3px solid transparent; }
.seat.turn { border-color: var(--accent); box-shadow: 0 0 16px rgba(250, 204, 21, 0.4); }
.seat.dim { opacity: 0.55; }
.who { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-weight: 700; }
.sub { font-size: 0.85rem; color: var(--muted); min-height: 1.2em; }
.controls { background: rgba(0, 0, 0, 0.3); border-radius: 16px; padding: 12px; margin: 10px 0; }
.controls .msg { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }

/* Word Race: slate with teal and amber tiles. */
:root {
  --bg: #0f172a;
  --bg2: #1e293b;
  --muted: #cbd5e1;
  --hit: #0d9488;
  --near: #d97706;
  --miss: #475569;
}
.status { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; font-weight: 700; margin: 10px 0; }
.mine { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.grid { display: flex; flex-direction: column; gap: 5px; }
.gridrow { display: flex; gap: 5px; }
.tile {
  width: 52px; height: 52px; border: 2px solid #334155; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 900; text-transform: uppercase;
}
.tile.typed { border-color: #94a3b8; }
.tile.hit, .key.hit, .chip.hit { background: var(--hit); border-color: var(--hit); }
.tile.near, .key.near, .chip.near { background: var(--near); border-color: var(--near); }
.tile.miss, .key.miss, .chip.miss { background: var(--miss); border-color: var(--miss); }
.grid.small { gap: 2px; margin: 6px 0; }
.grid.small .gridrow { gap: 2px; }
.grid.small .tile { width: 14px; height: 14px; border-width: 1px; border-radius: 3px; }
.reveals { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 8px 0; }
.revealcol .tile { width: 26px; height: 26px; font-size: 0.9rem; border-radius: 5px; }
.answer { font-size: 1.6rem; letter-spacing: 0.2em; color: var(--accent); }
.chip { padding: 0 6px; border-radius: 4px; color: #fff; }
.keyboard { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 520px; user-select: none; }
.krow { display: flex; gap: 5px; justify-content: center; }
.key { flex: 1; padding: 14px 0; min-width: 0; background: #64748b; color: #fff; box-shadow: none; font-size: 1rem; border-radius: 6px; }
.key.wide { flex: 1.6; font-size: 0.85rem; }
@media (max-width: 400px) { .tile { width: 46px; height: 46px; } .key { padding: 12px 0; } }
