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

body {
  background: #0a0e17;
  overflow: hidden;
  font-family: 'Share Tech Mono', monospace;
  color: #e2e8f0;
}

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

/* Overlays */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* Start Screen */
#title {
  font-family: 'Press Start 2P', cursive;
  font-size: 48px;
  color: #e0f2fe;
  text-shadow:
    0 0 10px #22d3ee,
    0 0 30px #22d3ee,
    0 0 60px #22d3ee44;
  margin-bottom: 40px;
  letter-spacing: 8px;
}

#highScores {
  margin-bottom: 40px;
  text-align: center;
}

#highScores h2 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  color: #67e8f9;
  margin-bottom: 16px;
  letter-spacing: 4px;
}

#scoreList {
  list-style: none;
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  color: #94a3b8;
  line-height: 2;
}

#scoreList li {
  letter-spacing: 2px;
}

#startPrompt, #restartPrompt {
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
  color: #e2e8f0;
  margin-bottom: 30px;
  letter-spacing: 2px;
}

#controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
  letter-spacing: 2px;
}

/* Pulse animation */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Game Over Screen */
#gameOverScreen {
  background: rgba(10, 14, 23, 0);
  transition: background 1s ease-in;
}

#gameOverScreen.fade-in {
  background: rgba(10, 14, 23, 0.85);
}

#gameOverTitle {
  font-family: 'Press Start 2P', cursive;
  font-size: 40px;
  color: #dc2626;
  text-shadow: 0 0 20px #dc262688;
  margin-bottom: 24px;
  letter-spacing: 6px;
}

#finalScore {
  font-family: 'Share Tech Mono', monospace;
  font-size: 24px;
  color: #e2e8f0;
  margin-bottom: 16px;
  letter-spacing: 3px;
}

#newHighScore {
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
  color: #f59e0b;
  text-shadow: 0 0 15px #f59e0b88;
  margin-bottom: 24px;
  animation: pulse 1s ease-in-out infinite;
}

/* Name Entry */
#nameEntry {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

#nameLabel {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  color: #67e8f9;
  letter-spacing: 3px;
  margin-bottom: 12px;
}

#nameInput {
  font-family: 'Share Tech Mono', monospace;
  font-size: 24px;
  color: #e0f2fe;
  background: transparent;
  border: none;
  border-bottom: 2px solid #67e8f9;
  text-align: center;
  width: 220px;
  padding: 8px 4px;
  letter-spacing: 4px;
  text-transform: uppercase;
  outline: none;
  caret-color: #67e8f9;
  pointer-events: auto;
}

#nameInput::placeholder {
  color: #334155;
  letter-spacing: 2px;
  font-size: 14px;
}

#nameInput:focus {
  border-bottom-color: #22d3ee;
  box-shadow: 0 2px 12px #22d3ee44;
}

#nameSubmitPrompt {
  font-family: 'Press Start 2P', cursive;
  font-size: 10px;
  color: #e2e8f0;
  margin-top: 16px;
  letter-spacing: 2px;
}

#nameSkipPrompt {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #64748b;
  margin-top: 8px;
  letter-spacing: 2px;
}

#submitStatus {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  color: #67e8f9;
  letter-spacing: 3px;
  margin-bottom: 24px;
}

/* Score list formatting */
#scoresPeriod {
  font-size: 12px;
  color: #94a3b8;
}

#scoreList .local-indicator {
  color: #64748b;
  font-size: 11px;
  margin-top: 4px;
}

/* HUD */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  z-index: 5;
  pointer-events: none;
}

#hud-left, #hud-right {
  display: flex;
  flex-direction: column;
}

#score {
  font-family: 'Share Tech Mono', monospace;
  font-size: 28px;
  color: #e2e8f0;
  letter-spacing: 3px;
}

#lives {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

#lives .life-icon {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 14px solid #67e8f9;
}

#level {
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px;
  color: #67e8f9;
  letter-spacing: 3px;
  text-align: right;
}

/* Level Flash */
#levelFlash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  pointer-events: none;
  font-family: 'Press Start 2P', cursive;
  font-size: 36px;
  color: #67e8f9;
  text-shadow: 0 0 20px #22d3ee88;
  letter-spacing: 6px;
  animation: levelFlashAnim 2s ease-in-out forwards;
}

@keyframes levelFlashAnim {
  0% { opacity: 0; transform: scale(0.8); }
  20% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); }
}

/* Responsive */
@media (max-width: 600px) {
  #title {
    font-size: 28px;
    letter-spacing: 4px;
  }
  #score {
    font-size: 20px;
  }
  #level {
    font-size: 14px;
  }
  #gameOverTitle {
    font-size: 24px;
  }
  #levelFlash {
    font-size: 24px;
  }
}
