* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0016; font-family: 'Orbitron', sans-serif; }
#scene-container { position: fixed; inset: 0; touch-action: none; }
canvas { display: block; }

/* ===== HUD ===== */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

#progress-track {
  position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: rgba(255,255,255,0.06);
}
#progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #00f0ff, #ff00cc);
  box-shadow: 0 0 12px #00f0ff, 0 0 20px #ff00cc;
  transition: width 0.15s linear;
}

#attempt {
  position: absolute; top: 18px; left: 18px;
  font-size: 13px; font-weight: 500; letter-spacing: 2px;
  color: #9a7dff; text-shadow: 0 0 8px #6a3dff;
}
#distance {
  position: absolute; top: 34px; left: 50%; transform: translateX(-50%);
  font-size: clamp(28px, 7vw, 52px); font-weight: 900;
  color: #fff; letter-spacing: 3px;
  text-shadow: 0 0 12px #00f0ff, 0 0 28px #00f0ff, 0 0 40px #0088ff;
}
#best {
  position: absolute; top: 20px; right: 18px;
  font-size: 14px; font-weight: 700; letter-spacing: 2px;
  color: #ff00cc; text-shadow: 0 0 10px #ff00cc;
}

/* ===== Overlay ===== */
#overlay {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(20,0,40,0.55), rgba(5,0,15,0.9));
  backdrop-filter: blur(3px);
  transition: opacity 0.4s ease;
}
#overlay.gone { opacity: 0; pointer-events: none; }

.panel {
  text-align: center; padding: 32px 28px; max-width: 90vw;
  animation: rise 0.5s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes rise { from { transform: translateY(28px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

#title {
  font-size: clamp(38px, 12vw, 92px); font-weight: 900; line-height: 0.95;
  letter-spacing: 4px;
  background: linear-gradient(90deg, #00f0ff, #ff00cc, #ffcc00, #00f0ff);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: flow 4s linear infinite, throb 2s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(255,0,204,0.6));
  margin-bottom: 8px;
}
#title span { display: inline-block; margin: 0 6px; -webkit-text-fill-color: #fff; }
@keyframes flow { to { background-position: 300% 0; } }
@keyframes throb { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }

#subtitle {
  color: #b39dff; letter-spacing: 5px; font-size: 13px; font-weight: 500;
  margin-bottom: 26px; text-transform: uppercase;
}

#death-msg {
  color: #ff5588; font-size: clamp(16px, 4vw, 22px); font-weight: 700;
  letter-spacing: 1px; margin-bottom: 22px;
  text-shadow: 0 0 10px #ff2266;
}

#stats {
  display: flex; gap: 40px; justify-content: center; margin-bottom: 28px;
}
#stats > div { display: flex; flex-direction: column; gap: 6px; }
#stats .lbl { font-size: 11px; letter-spacing: 3px; color: #7a6dbb; }
#stats .val { font-size: clamp(24px, 6vw, 38px); font-weight: 900; color: #fff;
  text-shadow: 0 0 14px #00f0ff; }

#play-btn {
  font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 22px;
  letter-spacing: 4px; color: #0a0016;
  background: linear-gradient(135deg, #00f0ff, #00b3ff);
  border: none; padding: 16px 54px; border-radius: 4px; cursor: pointer;
  box-shadow: 0 0 24px #00f0ff, inset 0 0 0 2px rgba(255,255,255,0.4);
  transition: transform 0.15s, box-shadow 0.2s;
  text-transform: uppercase;
}
#play-btn:hover { transform: scale(1.06) translateY(-2px);
  box-shadow: 0 0 40px #00f0ff, 0 0 60px #ff00cc, inset 0 0 0 2px #fff; }
#play-btn:active { transform: scale(0.98); }

.hint {
  margin-top: 22px; color: #6a5da0; font-size: 12px; letter-spacing: 2px;
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

#remix {
  display: inline-block; margin-top: 28px; font-size: 11px; letter-spacing: 2px;
  color: #4a3d7a; text-decoration: none; border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
#remix:hover { color: #b39dff; border-color: #b39dff; }

.hidden { display: none !important; }

@media (max-width: 600px) {
  #stats { gap: 26px; }
  #attempt { font-size: 11px; top: 14px; left: 12px; }
  #best { font-size: 12px; top: 16px; right: 12px; }
}