/* Shared chrome for game pages. Tokens mirror assets/css/style.css */
:root {
  --bg: #0b0e12;
  --panel: #131820;
  --panel-2: #1a212b;
  --line: #2a3442;
  --text: #e7ebf0;
  --muted: #9aa6b5;
  --accent: #ffb000;
  --accent-dim: #8a5f00;
  --ok: #3ddc84;
  --err: #ff5c5c;
  --info: #4fc3f7;
  --radius: 10px;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }

.game-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-wrap: wrap;
}

.game-bar .back {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
}
.game-bar .back:hover { color: var(--accent); }

.game-bar h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 600;
  letter-spacing: .02em;
}

.game-bar .spacer { flex: 1; }

.game-main {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 16px;
  min-height: 0;
}

.game-stage {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.game-stage canvas {
  display: block;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #07090c;
  touch-action: none;
  image-rendering: pixelated;
}

.game-side {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.panel h2 {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 500;
}

.panel p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.panel p:last-child { margin-bottom: 0; }

.hud {
  font-family: var(--mono);
  font-size: 13px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
}
.hud dt { color: var(--muted); }
.hud dd { margin: 0; text-align: right; color: var(--text); }

.btn {
  font: 500 13px/1 var(--sans);
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.active, .btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #111;
}
.btn.primary { background: var(--accent); color: #111; border-color: var(--accent); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }

.kbd {
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
  color: var(--text);
}

.led {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #333;
  vertical-align: middle;
}
.led.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.led.warn { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.led.err { background: var(--err); box-shadow: 0 0 8px var(--err); }

.toast-line {
  font-family: var(--mono);
  font-size: 13px;
  min-height: 1.5em;
  color: var(--accent);
}

@media (max-width: 900px) {
  .game-main { flex-direction: column; }
  .game-side { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
