@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  color-scheme: dark;
  --ink: #eaf3f0;
  --muted: #8da39d;
  --panel: #15211f;
  --line: #2b3b37;
  --accent: #d8fa6d;
  --orange: #ff9067;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: #0b1110;
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  overscroll-behavior: none;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: radial-gradient(#55706a 1px, transparent 1px);
  background-size: 22px 22px;
}
.game-shell { width: min(100% - 32px, 900px); margin: 0 auto; padding: 46px 0 28px; }
.topbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { color: var(--accent); font: 500 11px/1 'DM Mono', monospace; letter-spacing: .16em; margin: 0 0 10px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(32px, 6vw, 52px); letter-spacing: -.06em; line-height: .9; }
.stats { display: flex; gap: clamp(12px, 4vw, 34px); }
.stats div { display: grid; gap: 4px; }
.stats span { color: var(--muted); font: 10px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .1em; }
.stats strong { font: 500 18px 'DM Mono', monospace; }
.game-card { border: 1px solid var(--line); background: var(--panel); border-radius: 16px; overflow: hidden; box-shadow: 0 22px 60px #0005; }
.canvas-wrap { position: relative; height: min(70vh, 680px); min-height: 420px; background: #183329; }
canvas { display: block; width: 100%; height: 100%; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 22px; background: #09110fc9; backdrop-filter: blur(3px); }
.overlay.hidden { display: none; }
.overlay-panel { max-width: 360px; text-align: center; }
h2 { font-size: clamp(29px, 5vw, 43px); letter-spacing: -.06em; line-height: .95; margin-bottom: 13px; }
.overlay-panel > p:not(.eyebrow) { color: var(--muted); line-height: 1.5; margin-bottom: 24px; }
.start-hint {
  margin-top: 12px;
  font: 500 11px 'DM Mono', monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
}
button { border: 0; border-radius: 6px; padding: 14px 21px; background: var(--accent); color: #122018; cursor: pointer; font: 700 14px 'Space Grotesk', sans-serif; transition: transform .15s, background .15s; -webkit-tap-highlight-color: transparent; }
button:hover { background: #ecffac; transform: translateY(-2px); }
button:active, .touch-button.active { transform: scale(.98); filter: brightness(1.04); }
.controls { min-height: 64px; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 5vw, 40px); color: var(--muted); font: 11px 'DM Mono', monospace; }
.mobile-controls { display: none; padding: 12px; gap: 10px; background: rgba(13, 22, 20, 0.9); border-top: 1px solid var(--line); }
.touch-button { display: grid; place-items: center; width: 64px; height: 58px; font-size: 24px; background: rgba(216, 250, 109, 0.12); color: var(--ink); border: 1px solid rgba(216, 250, 109, 0.22); border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03); touch-action: manipulation; }
.pause-button { width: auto; min-width: 70px; font-size: 20px; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; margin-right: 3px; border: 1px solid #51645e; border-radius: 4px; color: var(--ink); font-size: 10px; }
.tip { text-align: center; color: #58706a; font: 11px 'DM Mono', monospace; margin: 20px 0 0; }
@media (max-width: 700px) {
  .game-shell { width: min(100% - 18px, 900px); padding-top: 18px; }
  .topbar { align-items: start; flex-direction: column; gap: 14px; margin-bottom: 16px; }
  .stats { width: 100%; justify-content: space-between; }
  .stats strong { font-size: 16px; }
  .game-card { border-radius: 14px; }
  .canvas-wrap { min-height: 380px; height: 62vh; }
  .controls { gap: 10px; flex-wrap: wrap; padding: 12px 8px; }
  .mobile-controls { display: flex; align-items: center; justify-content: center; }
}
@media (max-width: 380px) {
  .controls { font-size: 10px; }
  .stats { gap: 10px; }
  .touch-button { width: 58px; }
}
