:root {
  color-scheme: dark;
  --bg: #050915;
  --panel: rgba(255,255,255,0.08);
  --panel-border: rgba(255,255,255,0.12);
  --text: #eef7ff;
  --muted: rgba(238,247,255,0.78);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #172a52 0%, #08101d 48%, #02050c 100%);
}

.app {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.hud {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.brand {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stat {
  min-width: 90px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  text-align: center;
}

.label {
  display: block;
  font-size: 0.66rem;
  opacity: 0.78;
  text-transform: uppercase;
}

.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.action-btn {
  min-width: 140px;
  height: 42px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  color: white;
  cursor: pointer;
  background: linear-gradient(135deg, #79efff, #7affb9);
}

.action-btn.ghost {
  background: rgba(255,255,255,0.1);
}

.status {
  margin: 0 0 12px;
  color: var(--muted);
}

.game-shell {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  background: #040812;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #03060d;
  touch-action: none;
}

.help {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .app { width: min(100vw - 20px, 1120px); }
  .controls { flex-wrap: wrap; }
  .action-btn { flex: 1 1 140px; }
}
