:root {
  --bg: #07111d;
  --panel: #0d1d2b;
  --panel-2: #10283a;
  --line: #24445a;
  --text: #f4f8fb;
  --muted: #a9bac7;
  --accent: #77e6ff;
  --accent-2: #ffd66e;
  --danger: #ff7d7d;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at 50% -20%, #15354b 0, var(--bg) 52%); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { padding: 14px; }
button, input, select { font: inherit; }
button, select { border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--panel-2); }
button { padding: 8px 13px; cursor: pointer; }
button:hover, button:focus-visible, select:focus-visible { border-color: var(--accent); outline: none; }
select { width: 100%; margin-top: 5px; padding: 6px 8px; }
select:disabled { opacity: .55; }
.shell { width: min(1100px, 100%); margin: 0 auto; }
.game-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 9px; }
.eyebrow { margin: 0 0 2px; font-size: .72rem; letter-spacing: .12em; color: var(--accent); font-weight: 800; }
h1 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.65rem); line-height: 1; letter-spacing: -.035em; }
.tagline { margin: 5px 0 0; color: var(--muted); font-size: .95rem; }
.header-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.hud { display: grid; grid-template-columns: repeat(5, minmax(85px, 1fr)); gap: 7px; margin-bottom: 7px; }
.hud > div { min-height: 46px; border: 1px solid var(--line); background: rgba(13,29,43,.92); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; }
.hud-label { font-size: .62rem; letter-spacing: .11em; color: var(--muted); font-weight: 800; }
.hud strong { font-size: 1rem; letter-spacing: .06em; }
#toolsValue { font-size: .78rem; letter-spacing: .025em; white-space: nowrap; }
.play-wrap { position: relative; overflow: hidden; border: 1px solid #31556c; border-radius: 12px; background: #04101b; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
canvas { width: 100%; height: auto; max-height: 63vh; display: block; background: #04101b; outline: none; touch-action: none; }
canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.status-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(2,8,13,.42); }
.status-overlay[hidden] { display: none; }
.status-card { width: min(520px, 92%); padding: 24px; text-align: center; background: rgba(7,20,31,.94); border: 1px solid #3a6b84; border-radius: 14px; box-shadow: 0 16px 44px rgba(0,0,0,.35); }
.status-kicker { margin: 0 0 7px; color: var(--accent); font-size: .72rem; letter-spacing: .12em; font-weight: 900; }
.status-card h2 { margin: 0 0 8px; font-size: 1.65rem; }
.status-card p { margin: 6px 0; color: #d5e1e8; }
.status-action { color: var(--accent-2) !important; font-weight: 800; }
.micro-help { margin: 7px 4px 11px; color: var(--muted); font-size: .8rem; text-align: center; }
.guide { border: 1px solid var(--line); border-radius: 10px; background: rgba(13,29,43,.88); overflow: hidden; }
.guide summary { cursor: pointer; padding: 11px 14px; font-weight: 800; color: #e8f8ff; background: rgba(16,40,58,.85); }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px; }
.guide-grid section { border-left: 2px solid #24445a; padding: 0 10px; min-width: 0; }
.guide h2 { margin: 0 0 4px; font-size: .88rem; color: var(--accent); }
.guide p, .guide label { margin: 0; color: #c4d3dd; font-size: .78rem; line-height: 1.45; }
.guide label { display: block; margin: 3px 0; }
@media (max-width: 900px) {
  .guide-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  body { padding: 8px; }
  .game-header { align-items: start; }
  .tagline { display: none; }
  .hud { grid-template-columns: repeat(3, 1fr); }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .game-header { display: block; }
  .header-actions { margin-top: 9px; }
  .hud { grid-template-columns: repeat(2, 1fr); }
  .guide-grid { grid-template-columns: 1fr; }
  .status-card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
