:root {
  --neon: #36e0ff;
  --neon-2: #ff3df0;
  --gold: #ffd23b;
  --bg: #0a0520;
}

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

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

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  gap: 28px;
  padding: 16px 22px;
  pointer-events: none;
  z-index: 5;
  text-shadow: 0 0 14px rgba(54, 224, 255, 0.7);
}
.stat { display: flex; flex-direction: column; line-height: 1.1; }
.stat .label { font-size: 11px; letter-spacing: 2px; opacity: 0.65; }
.stat span:last-child {
  font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums;
}

.combo {
  margin-left: auto;
  align-self: center;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 210, 59, 0.9);
  transition: transform 0.12s ease;
}
.combo.bump { transform: scale(1.35); }

/* ---------- score popups ---------- */
#popups { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
.pop {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 22px;
  text-shadow: 0 0 10px currentColor;
  animation: popFloat 0.85s ease-out forwards;
}
@keyframes popFloat {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  20%  { opacity: 1; transform: translate(-50%, -70%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}

/* ---------- overlay ---------- */
#overlay {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(20, 6, 50, 0.45), rgba(3, 0, 12, 0.88));
  backdrop-filter: blur(3px);
  z-index: 10;
}
#overlay.show { display: flex; }

.panel {
  text-align: center;
  padding: 38px 44px;
  border: 1px solid rgba(54, 224, 255, 0.35);
  border-radius: 18px;
  background: rgba(10, 5, 30, 0.6);
  box-shadow: 0 0 60px rgba(54, 224, 255, 0.22), inset 0 0 40px rgba(124, 92, 255, 0.1);
  max-width: 90vw;
}
h1 {
  font-size: clamp(24px, 5.5vw, 42px);
  letter-spacing: 3px;
  font-weight: 900;
  white-space: nowrap;
  background: linear-gradient(90deg, var(--neon), var(--neon-2), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.16em;
  filter: drop-shadow(0 0 18px rgba(54, 224, 255, 0.5));
}
.tag { margin-top: 10px; opacity: 0.7; font-size: 13px; letter-spacing: 1px; }
.how {
  margin: 24px 0;
  display: flex; flex-direction: column; gap: 9px;
  font-size: 14px; opacity: 0.9;
}
.how b { color: var(--neon); }

button#startBtn {
  margin-top: 6px;
  padding: 14px 50px;
  font-size: 17px; font-weight: 800; letter-spacing: 3px;
  color: #06121a;
  background: linear-gradient(90deg, var(--neon), var(--neon-2));
  border: none; border-radius: 40px; cursor: pointer;
  box-shadow: 0 0 30px rgba(54, 224, 255, 0.6);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
button#startBtn:hover { transform: scale(1.05); box-shadow: 0 0 44px rgba(255, 61, 240, 0.7); }
button#startBtn:active { transform: scale(0.98); }

#overMsg { margin-top: 20px; font-size: 15px; line-height: 1.6; color: var(--gold); }
.hidden { display: none !important; }

#homeLink {
  position: fixed;
  bottom: 12px; left: 16px;
  z-index: 7;
  font-size: 13px;
  letter-spacing: 1px;
  color: rgba(234, 246, 255, 0.6);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(54, 224, 255, 0.3);
  border-radius: 20px;
  background: rgba(10, 5, 30, 0.5);
  transition: color 0.15s ease, border-color 0.15s ease;
}
#homeLink:hover { color: var(--neon); border-color: var(--neon); }

/* help button (?) */
#helpBtn {
  position: fixed;
  bottom: 12px; right: 16px;
  z-index: 8;
  width: 40px; height: 40px;
  font-size: 20px; font-weight: 800;
  color: rgba(234, 246, 255, 0.7);
  background: rgba(10, 5, 30, 0.5);
  border: 1px solid rgba(54, 224, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
#helpBtn:hover { color: var(--neon); border-color: var(--neon); transform: scale(1.1); }

/* help panel */
#help {
  position: fixed; inset: 0;
  z-index: 12;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(3, 0, 12, 0.75);
  backdrop-filter: blur(3px);
  padding: 20px;
}
#help.open { display: flex; }
.help-card {
  text-align: left;
  max-width: 460px;
  padding: 28px 30px;
  border: 1px solid rgba(54, 224, 255, 0.35);
  border-radius: 16px;
  background: rgba(10, 5, 30, 0.9);
  box-shadow: 0 0 50px rgba(54, 224, 255, 0.2);
}
.help-card h3 {
  font-size: 16px; letter-spacing: 3px; font-weight: 800;
  color: var(--neon); margin-bottom: 16px; text-align: center;
}
.help-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.help-list li { font-size: 13.5px; line-height: 1.5; opacity: 0.9; }
.help-list b { color: var(--neon); }
#helpClose {
  display: block;
  margin: 22px auto 0;
  padding: 10px 34px;
  font-size: 14px; font-weight: 800; letter-spacing: 2px;
  color: #06121a;
  background: linear-gradient(90deg, var(--neon), var(--neon-2));
  border: none; border-radius: 30px; cursor: pointer;
}
