:root {
  --bg: #0b0f1a;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --ink: #e7ecf5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#hud {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding-top: 18px;
}

#score {
  font-size: clamp(40px, 12vw, 88px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: rgba(231, 236, 245, 0.92);
  text-shadow: 0 0 24px rgba(34, 211, 238, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}
#score.live { opacity: 1; }

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(11, 15, 26, 0.55), rgba(11, 15, 26, 0.92));
  backdrop-filter: blur(2px);
  transition: opacity 0.3s ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.overlay h1 {
  font-size: clamp(38px, 11vw, 72px);
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, var(--cyan), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(34, 211, 238, 0.35));
}

.overlay p { font-size: clamp(15px, 4.4vw, 19px); line-height: 1.5; color: rgba(231, 236, 245, 0.78); }
.overlay .best { font-size: 15px; color: var(--cyan); min-height: 20px; font-weight: 600; }

#start-btn {
  margin-top: 6px;
  padding: 16px 34px;
  font-size: 18px;
  font-weight: 700;
  color: #06141a;
  background: linear-gradient(120deg, var(--cyan), #67e8f9);
  border: none;
  border-radius: 999px;
  box-shadow: 0 10px 40px rgba(34, 211, 238, 0.4);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
#start-btn:active { transform: scale(0.95); box-shadow: 0 6px 20px rgba(34, 211, 238, 0.5); }
