* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #10151d; --panel: #1a2330; --panel2: #202c3b; --line: #344356;
  --text: #edf3fa; --muted: #9baabd; --blue: #3989ed; --red: #e45b5b;
}
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:17px 24px; background:#151d28; border-bottom:1px solid var(--line); }
h1 { margin:2px 0 0; font-size:20px; letter-spacing:1.7px; }
.eyebrow,.section-label { color:#8ea3ba; font-size:10px; font-weight:800; letter-spacing:1.5px; }
.turn-box { display:flex; align-items:center; gap:16px; font-weight:800; }
.team-blue { color:#72b2ff; } .team-red { color:#ff8585; }
button { border:1px solid #53677f; color:var(--text); background:#2b3b4e; padding:9px 12px; border-radius:7px; font-weight:700; cursor:pointer; }
button:hover:not(:disabled) { filter:brightness(1.2); }
button:disabled { opacity:.35; cursor:not-allowed; }
button.primary { background:#286fc0; border-color:#438de0; }
button.danger { background:#873e43; border-color:#b85b62; }
button.good { background:#286d58; border-color:#399477; }
button.small { padding:6px 9px; font-size:12px; }
.layout { display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:16px; max-width:1500px; padding:16px; margin:auto; }
.game-panel,.card { background:var(--panel); border:1px solid var(--line); border-radius:11px; overflow:hidden; }
.map-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 15px; }
.map-heading strong { display:block; font-size:14px; }
.map-heading span { color:var(--muted); font-size:12px; }
.legend { display:flex; flex-wrap:wrap; gap:12px; color:#b9c7d7; font-size:11px; }
.dot,.swatch { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:4px; vertical-align:middle; }
.dot.blue { background:var(--blue); } .dot.red { background:var(--red); }
.swatch { border-radius:2px; } .swatch.move { background:#4bd69a; } .swatch.attack { background:#f2bd54; }
#gameView { height:min(72vh,760px); min-height:490px; background:#a9c2d0; position:relative; }
#gameView canvas { display:block; width:100%; height:100%; }
.map-help { padding:9px 14px; color:var(--muted); font-size:11px; border-top:1px solid var(--line); }
.sidebar { display:flex; flex-direction:column; gap:12px; min-width:0; }
.card { padding:14px; }
.card h2 { margin:7px 0 3px; font-size:18px; }
.muted { color:var(--muted); margin:0 0 12px; font-size:12px; }
.stats { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.stat { padding:7px 8px; background:var(--panel2); border-radius:6px; }
.stat b { display:block; font-size:13px; } .stat span { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.7px; }
.actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.log { display:flex; flex-direction:column; gap:7px; max-height:230px; overflow:auto; margin-top:10px; }
.log-entry { padding:7px 8px; background:var(--panel2); border-radius:5px; color:#c5d1df; font-size:11px; }
.rules ul { margin:9px 0 0; padding-left:17px; color:#b6c4d3; font-size:11px; }
.rules li { margin:5px 0; }
footer { text-align:center; color:#75869a; padding:8px 16px 18px; font-size:11px; }
@media (max-width:900px) {
  .layout { grid-template-columns:1fr; }
  #gameView { height:65vh; min-height:420px; }
  .sidebar { display:grid; grid-template-columns:1fr 1fr; }
  .selected-card { grid-column:1/-1; }
}
@media (max-width:560px) {
  .topbar { align-items:flex-start; flex-direction:column; padding:13px 15px; }
  .turn-box { width:100%; justify-content:space-between; }
  .layout { padding:9px; gap:9px; }
  .map-heading { align-items:flex-start; flex-direction:column; }
  .sidebar { display:flex; }
  #gameView { min-height:390px; }
}
