:root {
  --bg: #1b211c;
  --panel: #252c26;
  --text: #e8ece6;
  --muted: #9aa69b;
  --accent: #ffd34d;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
#app { display: flex; height: 100%; }
#stage { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 12px; }
#board { display: block; border-radius: 10px; box-shadow: 0 6px 30px rgba(0,0,0,.5); touch-action: manipulation; }
#side { width: 290px; flex: none; background: var(--panel); padding: 16px; overflow-y: auto; }
h1 { margin: 0 0 12px; font-size: 22px; letter-spacing: .5px; }
h2 { margin: 18px 0 8px; font-size: 14px; text-transform: uppercase; color: var(--muted); letter-spacing: 1px; }
.card { background: rgba(255,255,255,.05); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 10px 14px;
  background: var(--accent); color: #222; font-weight: 600; width: 100%; }
button:disabled { opacity: .4; cursor: default; }
#players { list-style: none; margin: 0; padding: 0; }
#players li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
#players li.me { background: rgba(255,211,77,.08); border-radius: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 3px; flex: none; }
.pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstat { color: var(--muted); font-size: 12px; }
.pscore { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 40px; text-align: right; }
.help { padding-left: 18px; color: var(--muted); margin: 0; }
.help li { margin-bottom: 6px; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; }
.overlay form { background: var(--panel); padding: 24px; border-radius: 12px; width: min(320px, 90vw); display: grid; gap: 12px; }
.overlay p { margin: 0; color: var(--muted); }
.overlay input { font: inherit; padding: 10px; border-radius: 8px; border: 1px solid #444; background: #111; color: var(--text); }
#toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); background: #b3261e; color: #fff;
  padding: 10px 16px; border-radius: 8px; font-weight: 600; }
@media (max-width: 800px) {
  #app { flex-direction: column; height: auto; }
  #side { width: auto; }
}
