:root {
  --bg: #000;
  --neon: #ffe400;
  --maze: #2121ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: radial-gradient(circle at 50% 0%, #0a0a23 0%, #000 70%);
  color: #fff;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  -webkit-font-smoothing: none;
  user-select: none;
  touch-action: none;
}
.frame {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 12px 28px;
}
.title {
  font-size: clamp(18px, 6vw, 34px);
  letter-spacing: 4px;
  color: var(--neon);
  text-shadow: 0 0 8px rgba(255, 228, 0, 0.55), 0 0 18px rgba(255, 228, 0, 0.25);
}
.stage {
  border: 3px solid var(--maze);
  border-radius: 6px;
  box-shadow: 0 0 18px rgba(33, 33, 255, 0.45), inset 0 0 24px rgba(0, 0, 0, 0.6);
  background: #000;
  line-height: 0;
}
canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: min(92vw, 420px);
  height: auto;
}
.hint {
  font-size: 9px;
  line-height: 1.6;
  color: #9aa;
  text-align: center;
  max-width: 420px;
}

/* On-screen controls — only useful on touch devices. */
.controls {
  display: none;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(2, 56px);
  gap: 6px;
  justify-content: center;
}
.pad {
  font-size: 20px;
  color: var(--neon);
  background: #111;
  border: 2px solid var(--maze);
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.pad:active { background: #1b1b4a; }
.pad.up    { grid-column: 2; grid-row: 1; }
.pad.left  { grid-column: 1; grid-row: 2; }
.pad.right { grid-column: 3; grid-row: 2; }
.pad.down  { grid-column: 2; grid-row: 2; }

@media (pointer: coarse) {
  .controls { display: grid; }
}
