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

body {
  background: #050510;
  color: #e0e0ff;
  font-family: 'Courier New', 'Consolas', monospace;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* --- HUD --- */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 10;
}

#timer {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

#score {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ff00ff;
  text-shadow: 0 0 15px rgba(255, 0, 255, 0.7), 0 0 30px rgba(255, 0, 255, 0.3);
}

#hud-right {
  text-align: right;
}

#round {
  font-size: 18px;
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

#lives {
  margin-top: 4px;
  letter-spacing: 4px;
}

.heart {
  color: #ff2255;
  font-size: 20px;
  filter: drop-shadow(0 0 6px rgba(255, 34, 85, 0.8));
}

/* --- Countdown timer --- */
#countdown {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 64px;
  font-weight: 800;
  color: #00ffff;
  text-shadow: 0 0 15px rgba(0, 255, 255, 0.7), 0 0 30px rgba(0, 255, 255, 0.3);
  pointer-events: none;
  z-index: 10;
  letter-spacing: 4px;
}

#countdown.urgent {
  color: #ff3333;
  text-shadow: 0 0 20px rgba(255, 50, 50, 0.9), 0 0 40px rgba(255, 50, 50, 0.4);
  animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.15); }
}

/* --- Level announcement --- */
#level-announce {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
}

#level-announce-text {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 8px;
  color: #00ffff;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 40px rgba(0, 255, 255, 0.4);
  animation: announceIn 1.2s ease-out forwards;
}

#level-announce-sub {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #ff00ff;
  text-shadow: 0 0 15px rgba(255, 0, 255, 0.7);
  margin-top: 8px;
  animation: announceIn 1.2s ease-out 0.2s forwards;
  opacity: 0;
}

@keyframes announceIn {
  0% { opacity: 0; transform: scale(1.5); }
  30% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.95); }
}

/* --- Cut line overlay --- */
#cut-svg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 12;
}

#cut-line {
  stroke: #ff00ff;
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 0, 255, 0.9))
          drop-shadow(0 0 15px rgba(255, 0, 255, 0.5))
          drop-shadow(0 0 30px rgba(255, 0, 255, 0.3));
}

/* --- Volume labels --- */
.vol-label {
  position: fixed;
  font-size: 20px;
  font-weight: 700;
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.8), 0 0 20px rgba(0, 255, 255, 0.4);
  pointer-events: none;
  z-index: 15;
  transform: translate(-50%, -100%);
}

.round-score {
  position: fixed;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  font-size: 56px;
  font-weight: 700;
  color: #ff00ff;
  text-shadow: 0 0 20px rgba(255, 0, 255, 0.8), 0 0 40px rgba(255, 0, 255, 0.4), 0 0 60px rgba(255, 0, 255, 0.2);
  pointer-events: none;
  z-index: 15;
}

/* --- Screens --- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(5, 5, 16, 0.95);
}

.screen h1 {
  font-size: 72px;
  font-weight: 800;
  letter-spacing: 16px;
  margin-bottom: 8px;
  color: #ff00ff;
  text-shadow: 0 0 20px rgba(255, 0, 255, 0.8), 0 0 40px rgba(255, 0, 255, 0.4), 0 0 80px rgba(255, 0, 255, 0.2);
  -webkit-text-fill-color: unset;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.screen h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 8px;
  margin-bottom: 24px;
  color: #00ffff;
  text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

.subtitle {
  font-size: 14px;
  color: #8080ff;
  margin-bottom: 48px;
  letter-spacing: 3px;
  text-shadow: 0 0 8px rgba(128, 128, 255, 0.4);
}

.btn {
  display: block;
  width: 220px;
  padding: 14px 0;
  margin: 8px 0;
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(0, 255, 255, 0.05);
  color: #00ffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
  transition: all 0.2s;
}

.btn:hover, .btn:active {
  background: rgba(0, 255, 255, 0.15);
  border-color: rgba(0, 255, 255, 0.6);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3), inset 0 0 15px rgba(0, 255, 255, 0.1);
}

.btn-secondary {
  border-color: rgba(255, 0, 255, 0.2);
  color: #ff00ff;
  background: rgba(255, 0, 255, 0.05);
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.4);
}

.btn-secondary:hover, .btn-secondary:active {
  background: rgba(255, 0, 255, 0.12);
  border-color: rgba(255, 0, 255, 0.5);
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.3), inset 0 0 15px rgba(255, 0, 255, 0.1);
}

#final-score-display {
  font-size: 72px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ff00ff;
  text-shadow: 0 0 20px rgba(255, 0, 255, 0.8), 0 0 40px rgba(255, 0, 255, 0.4);
}

#final-time-display {
  font-size: 18px;
  color: #8080ff;
  margin-bottom: 32px;
  text-shadow: 0 0 8px rgba(128, 128, 255, 0.4);
}

.name-entry {
  margin-bottom: 24px;
  text-align: center;
}

.name-entry label {
  display: block;
  font-size: 12px;
  color: #8080ff;
  margin-bottom: 8px;
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(128, 128, 255, 0.4);
}

#name-input {
  width: 140px;
  padding: 12px;
  text-align: center;
  font-family: inherit;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 10px;
  text-transform: uppercase;
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 4px;
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
  outline: none;
}

#name-input:focus {
  border-color: rgba(0, 255, 255, 0.6);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* --- Leaderboard --- */
#leaderboard-list {
  width: min(90vw, 400px);
  max-height: 60vh;
  overflow-y: auto;
  margin-bottom: 24px;
}

.lb-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
}

.lb-row:first-child {
  font-weight: 700;
  color: #ff00ff;
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
}

.lb-rank { width: 40px; color: #8080ff; }
.lb-name { width: 60px; font-weight: 600; color: #00ffff; }
.lb-score { width: 60px; text-align: right; color: #ff00ff; }
.lb-time { width: 80px; text-align: right; color: #8080ff; }

/* --- Utility --- */
.hidden {
  display: none !important;
}
