:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090d0b;
  color: #e7eee7;
  --line: rgba(180, 206, 183, .14);
  --panel: #111713;
  --muted: #8e9d91;
  --blue: #4ab3f0;
  --red: #ef6166;
  --gold: #e7c86c;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1100px; background: radial-gradient(circle at 50% -20%, #243028 0, #0c110e 45%, #080b09 100%); }
button { font: inherit; }
.shell { min-height: 100vh; padding: 24px; }
.topbar { height: 84px; max-width: 1540px; margin: 0 auto 14px; padding: 0 18px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border: 1px solid var(--line); background: rgba(15, 21, 17, .9); }
.topbar h1 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.eyebrow { margin: 0; color: #90a292; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.scoreboard { display: flex; align-items: stretch; min-width: 360px; height: 58px; border: 1px solid var(--line); }
.score, .clock { display: grid; place-items: center; padding: 5px 20px; }
.score { min-width: 105px; }
.score span, .clock span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.score strong { font-size: 25px; }
.score.blue strong { color: var(--blue); }
.score.red strong { color: var(--red); }
.clock { min-width: 130px; border-inline: 1px solid var(--line); }
.clock strong { font-size: 19px; letter-spacing: .08em; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.actions button { padding: 10px 15px; color: #d9e3da; border: 1px solid var(--line); background: #171f19; cursor: pointer; }
.actions button.primary { color: #11150f; border-color: var(--gold); background: var(--gold); font-weight: 750; }
.content { max-width: 1540px; margin: auto; display: grid; grid-template-columns: minmax(750px, 1fr) 340px; gap: 14px; }
.battlefield-wrap { position: relative; overflow: hidden; min-height: 620px; border: 1px solid var(--line); background: #111814; }
canvas { display: block; width: 100%; height: auto; max-height: calc(100vh - 145px); aspect-ratio: 1120 / 700; cursor: crosshair; touch-action: none; user-select: none; }
.hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); padding: 7px 12px; white-space: nowrap; color: #aebbaf; border: 1px solid rgba(255,255,255,.09); background: rgba(7, 11, 8, .76); font-size: 11px; }
.sidepanel { max-height: calc(100vh - 122px); overflow: auto; padding: 16px; border: 1px solid var(--line); background: rgba(15, 21, 17, .94); }
.sidepanel section + section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.roster { display: grid; gap: 6px; margin-top: 10px; }
.soldier-card { position: relative; width: 100%; min-height: 52px; display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; padding: 7px 9px; overflow: hidden; color: #e5ede6; text-align: left; border: 1px solid transparent; background: #171e19; cursor: pointer; }
.soldier-card:hover { background: #1c261f; }
.soldier-card.selected { border-color: var(--gold); background: #24281d; }
.soldier-card.dead { opacity: .42; filter: grayscale(1); }
.portrait { width: 34px; height: 34px; display: grid; place-items: center; color: #d6eefb; border: 1px solid rgba(74,179,240,.45); background: rgba(74,179,240,.12); font-family: Georgia, serif; font-size: 18px; }
.soldier-copy { display: grid; gap: 2px; }
.soldier-copy strong { font-size: 12px; }
.soldier-copy small { color: var(--muted); font-size: 10px; }
.vitals { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #2b332d; }
.vitals i { display: block; height: 100%; background: #68c47a; }
.inspector h2 { margin: 5px 0 12px; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.trait { display: grid; gap: 2px; padding: 9px 10px; border-left: 2px solid var(--gold); background: rgba(231,200,108,.07); }
.trait strong { color: var(--gold); font-size: 12px; }
.trait span, .muted, .empty-state { color: var(--muted); font-size: 11px; line-height: 1.45; }
.movement-mode { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-left: 2px solid var(--mode-color, var(--gold)); background: rgba(255,255,255,.025); }
.movement-mode span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.movement-mode strong { color: var(--mode-color, #dce5dc); font-size: 11px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.stat { display: grid; gap: 2px; padding: 7px 8px; background: #171e19; }
.stat span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.stat strong { font-size: 13px; }
.section-title { display: flex; justify-content: space-between; align-items: center; }
.section-title > span { color: #667368; font-size: 9px; }
.combat-log { margin-top: 8px; }
.combat-log > div { display: grid; grid-template-columns: 34px 1fr; gap: 7px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.combat-log time { color: #69776c; font: 10px monospace; }
.combat-log p { margin: 0; color: #b7c2b8; font-size: 10px; line-height: 1.35; }

@media (max-width: 1250px) {
  .shell { padding: 12px; }
  .topbar { margin-bottom: 8px; }
  .content { gap: 8px; grid-template-columns: minmax(720px, 1fr) 310px; }
}
