:root {
  --bg-1: #0b0f1a;
  --bg-2: #1b1433;
  --panel: rgba(10, 14, 24, 0.8);
  --ink: #f3f6ff;
  --muted: #9aa7c7;
  --accent: #ffbe0b;
  --accent-2: #3a86ff;
  --danger: #ff006e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 10% 15%, #2a1f5f 0%, transparent 65%),
    radial-gradient(700px 420px at 85% 20%, #1f4a7a 0%, transparent 60%),
    radial-gradient(900px 600px at 60% 90%, #101626 0%, #080a12 70%);
  color: var(--ink);
  font-family: "Futura", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

.shell {
  width: min(980px, 92vw);
  display: grid;
  gap: 12px;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}

.hud-left {
  display: grid;
  gap: 6px;
}

#gameTitle {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

#prompt {
  color: var(--accent);
  font-weight: 700;
}

.hud-right {
  display: grid;
  gap: 4px;
  text-align: right;
  font-weight: 700;
  color: var(--muted);
}

#timer {
  color: var(--accent-2);
  font-size: 1.1rem;
}

#lives {
  color: var(--danger);
}

.stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #05070d;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: linear-gradient(160deg, #10162a, #0b0f1a 60%);
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 8px 20px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.overlay.show {
  opacity: 1;
}

.controls {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
  touch-action: none;
}

.control-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pad {
  min-width: 56px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(30, 40, 60, 0.9);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1rem;
  transition: transform 0.05s ease, background 0.2s ease;
}

.pad.action {
  min-width: 70px;
}

.pad:active,
.pad.is-active {
  transform: translateY(2px) scale(0.98);
  background: rgba(58, 134, 255, 0.9);
}

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

@media (max-width: 720px) {
  .hud { flex-direction: column; align-items: flex-start; }
  .hud-right { text-align: left; }
  .pad { min-width: 52px; min-height: 46px; font-size: 0.95rem; }
}
