:root {
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, "Noto Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, #1a2a6c 0%, var(--bg) 55%),
              radial-gradient(1000px 500px at 80% 20%, #b21f1f 0%, transparent 55%),
              radial-gradient(900px 450px at 50% 100%, #fdbb2d 0%, transparent 60%);
  color: var(--text);
  display: grid;
  place-items: center;
}

.wrap {
  width: min(520px, 94vw);
  display: grid;
  gap: 12px;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 6px;
}

.title {
  font-weight: 800;
  letter-spacing: 0.4px;
  opacity: 0.95;
}

.score {
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.score #score, .score #best { color: var(--text); }
.sep { opacity: 0.5; margin: 0 2px; }

.stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
}

.hud {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.55));
  backdrop-filter: blur(2px);
}

.hud[hidden] { display: none; }

.hud-card {
  width: min(320px, 86%);
  padding: 18px 16px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.12);
  text-align: center;
}

.hud-card h1 {
  margin: 2px 0 6px;
  font-size: 22px;
}

.hud-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 600;
}

button {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
  color: #0b1020;
  background: rgba(255,255,255,0.9);
  transition: transform 120ms ease, opacity 120ms ease;
}
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0px); opacity: 0.92; }

.hint {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.82);
  font-weight: 700;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

.dot { opacity: 0.6; }

.footer {
  padding: 6px 8px;
  color: rgba(255,255,255,0.62);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
}
