@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@500;600;700&display=swap');

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05010a;
  font-family: 'Rajdhani', sans-serif;
  color: #eafcff;
}

#game-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at center, rgba(20,0,40,0.75) 0%, rgba(2,0,8,0.95) 75%);
  z-index: 10;
  text-align: center;
  padding: 20px;
}

.hidden { display: none !important; }

.title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: 6px;
  color: #ff2fd6;
  text-shadow:
    0 0 8px #ff2fd6,
    0 0 22px #ff2fd6,
    0 0 46px #7a00ff,
    0 0 2px #fff;
}

.glitch {
  animation: flicker 3.5s infinite;
}

@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.4; }
  94% { opacity: 1; }
  95% { opacity: 0.55; }
  96% { opacity: 1; }
}

.subtitle {
  font-size: 1.1rem;
  letter-spacing: 3px;
  color: #4dfcff;
  text-shadow: 0 0 8px #4dfcff;
  text-transform: uppercase;
}

.progress-bar {
  width: min(420px, 80vw);
  height: 14px;
  border: 2px solid #4dfcff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 10px #4dfcff;
  background: rgba(0,0,0,0.4);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff2fd6, #4dfcff);
  transition: width 0.15s ease-out;
}

#progress-text {
  font-family: 'Orbitron', sans-serif;
  color: #4dfcff;
  letter-spacing: 2px;
}

.instructions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 1.1rem;
  letter-spacing: 1px;
  margin: 6px 0;
}

.key {
  display: inline-block;
  min-width: 34px;
  padding: 4px 10px;
  margin: 0 4px;
  border: 2px solid #ff2fd6;
  border-radius: 6px;
  color: #ff2fd6;
  text-shadow: 0 0 6px #ff2fd6;
  box-shadow: 0 0 8px rgba(255,47,214,0.5);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
}

.neon-btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 3px;
  padding: 14px 42px;
  background: transparent;
  border: 3px solid #4dfcff;
  border-radius: 10px;
  color: #4dfcff;
  text-shadow: 0 0 8px #4dfcff;
  box-shadow: 0 0 16px rgba(77,252,255,0.6), inset 0 0 16px rgba(77,252,255,0.15);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.neon-btn:hover {
  background: rgba(77,252,255,0.15);
  transform: scale(1.06);
}

.neon-btn:active {
  transform: scale(0.97);
}

.hint {
  font-size: 0.85rem;
  color: #7a7a9a;
  letter-spacing: 1px;
}

#hud {
  position: fixed;
  top: 18px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 26px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(0.9rem, 2.4vw, 1.3rem);
  letter-spacing: 2px;
  z-index: 5;
  pointer-events: none;
}

#hud div {
  color: #4dfcff;
  text-shadow: 0 0 8px #4dfcff, 0 0 2px #fff;
}

#score { color: #ff2fd6; text-shadow: 0 0 8px #ff2fd6, 0 0 2px #fff; }

.final-stats {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#new-record {
  color: #ffe14d;
  text-shadow: 0 0 10px #ffe14d;
  margin-top: 6px;
}
