:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #071019;
  color: #e9f3fb;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #071019; }
body { overflow-x: hidden; }
button, select, input { font: inherit; }
button { color: #eef9ff; background: #163246; border: 1px solid #35627b; border-radius: 8px; padding: .55rem .8rem; cursor: pointer; }
button:hover, button:focus-visible { background: #20465f; outline: 2px solid #82d9ff; outline-offset: 2px; }
.shell { width: min(1100px, 100%); margin: 0 auto; padding: 12px 18px 28px; }
.game-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.game-header h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.5rem); letter-spacing: .02em; }
.eyebrow { margin: 0 0 2px; font-size: .72rem; font-weight: 800; letter-spacing: .16em; color: #8fc7df; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.game-card { border: 1px solid #23485f; border-radius: 14px; overflow: hidden; background: #0b1721; box-shadow: 0 14px 40px rgba(0,0,0,.35); }
.hud { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; align-items: center; padding: 8px 12px; background: #0d2130; border-bottom: 1px solid #23485f; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.hud span { white-space: nowrap; }
.hud span:last-child { text-align: right; font-weight: 800; color: #88e5ff; }
.canvas-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 66vh; background: #050b11; outline: none; }
canvas { display: block; width: 100%; height: 100%; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(2,8,13,.42); pointer-events: none; }
.overlay[hidden] { display: none; }
.overlay-panel { width: min(620px, 86%); padding: 18px 22px; text-align: center; background: rgba(6,18,27,.9); border: 1px solid #3c7896; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.42); }
.overlay-panel h2 { margin: 0 0 7px; }
.overlay-panel p { margin: 0; line-height: 1.45; color: #c5dce8; }
.guide { margin-top: 12px; border: 1px solid #274b60; border-radius: 12px; background: #0d1c27; }
.guide summary { cursor: pointer; padding: 11px 14px; font-weight: 800; }
.guide > p { margin: 8px 14px 14px; line-height: 1.48; color: #c4d4de; }
.guide-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; padding: 2px 14px 8px; }
.guide-grid > div { min-height: 56px; padding: 9px; background: #102634; border: 1px solid #244c63; border-radius: 8px; }
.touch-controls { display: none; padding: 8px 12px 12px; justify-content: space-between; align-items: center; gap: 18px; }
.touch-pad { width: 116px; height: 116px; border: 2px solid #376b86; border-radius: 50%; display: grid; place-items: center; touch-action: none; user-select: none; background: radial-gradient(circle, #17394c 0 20%, #102533 22% 65%, #0b1923 67%); }
.touch-pad-label { font-size: .7rem; letter-spacing: .12em; color: #94cce3; pointer-events: none; }
.touch-fire { width: 100px; height: 100px; border-radius: 50%; touch-action: none; font-weight: 900; letter-spacing: .08em; background: #5c2630; border-color: #b65b68; }
@media (pointer: coarse) { .touch-controls { display: flex; } .canvas-wrap { max-height: none; } }
@media (max-width: 760px) {
  .shell { padding: 8px; }
  .game-header { align-items: flex-end; }
  .eyebrow { font-size: .6rem; }
  .hud { grid-template-columns: repeat(2, 1fr); font-size: .67rem; }
  .hud span:last-child { text-align: left; }
  .guide-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
