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

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

body {
  background: #06080f;
  color: #e8ecf4;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-wrapper {
  position: relative;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  max-height: 800px;
  overflow: hidden;
  border-left: 2px solid rgba(0, 230, 180, 0.15);
  border-right: 2px solid rgba(0, 230, 180, 0.15);
  box-shadow: 0 0 80px rgba(0, 230, 180, 0.06), inset 0 0 80px rgba(0, 0, 0, 0.4);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── HUD ── */
#hud {
  position: absolute;
  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;
  background: linear-gradient(to bottom, rgba(6, 8, 15, 0.85) 0%, transparent 100%);
}

.hud-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-block.center {
  align-items: center;
}

.hud-block.right {
  align-items: flex-end;
}

.hud-label {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(0, 230, 180, 0.5);
}

.hud-value {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 800;
  color: #e8ecf4;
  text-shadow: 0 0 12px rgba(0, 230, 180, 0.3);
}

.hud-value.score {
  color: #00e6b4;
}

.hud-value.speed {
  color: #ff6b3d;
}

#lives-container {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.life-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00e6b4;
  box-shadow: 0 0 8px rgba(0, 230, 180, 0.6);
  transition: all 0.3s ease;
}

.life-dot.lost {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

/* ── COMBO ── */
#combo-display {
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#combo-display.visible {
  opacity: 1;
}

#combo-text {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #ff6b3d;
  text-shadow: 0 0 20px rgba(255, 107, 61, 0.5);
  letter-spacing: 4px;
}

/* ── SCREENS ── */
.overlay-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(6, 8, 15, 0.92);
  backdrop-filter: blur(12px);
  transition: opacity 0.5s ease;
}

.overlay-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.start-logo {
  width: 120px;
  height: auto;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 20px rgba(0, 230, 180, 0.4));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.game-title {
  font-family: 'Orbitron', monospace;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #00e6b4, #00c9a7, #00e6b4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 30px rgba(0, 230, 180, 0.3));
  margin-bottom: 8px;
}

.game-subtitle {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 8px;
  color: rgba(0, 230, 180, 0.4);
  text-transform: uppercase;
  margin-bottom: 60px;
}

.start-btn {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: transparent;
  border: 2px solid rgba(0, 230, 180, 0.4);
  color: #00e6b4;
  padding: 16px 48px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.start-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 230, 180, 0.08);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.start-btn:hover::before {
  transform: scaleX(1);
}

.start-btn:hover {
  border-color: #00e6b4;
  box-shadow: 0 0 30px rgba(0, 230, 180, 0.2);
}

.controls-hint {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.controls-hint-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
}

.keys-row {
  display: flex;
  gap: 8px;
}

.key-cap {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.03);
}

/* Game Over */
.gameover-title {
  font-family: 'Orbitron', monospace;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #ff6b3d;
  text-shadow: 0 0 40px rgba(255, 107, 61, 0.3);
  margin-bottom: 8px;
}

.gameover-subtitle {
  font-size: 12px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  margin-bottom: 40px;
}

.final-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.final-score-label {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 4px;
  color: rgba(0, 230, 180, 0.4);
  text-transform: uppercase;
}

.final-score-value {
  font-family: 'Orbitron', monospace;
  font-size: 52px;
  font-weight: 900;
  color: #00e6b4;
  text-shadow: 0 0 30px rgba(0, 230, 180, 0.4);
}

.final-highscore {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: rgba(255, 107, 61, 0.6);
  margin-bottom: 40px;
}

.final-highscore.new-record {
  color: #ff6b3d;
}

.stats-row {
  display: flex;
  gap: 32px;
  margin-bottom: 48px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
}

.stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #e8ecf4;
}

/* Pulse animation for start button */
@keyframes pulse-border {
  0%, 100% { border-color: rgba(0, 230, 180, 0.3); }
  50% { border-color: rgba(0, 230, 180, 0.6); }
}

.start-btn {
  animation: pulse-border 2s ease infinite;
}

.start-btn:hover {
  animation: none;
}

/* Screen shake */
@keyframes shake {
  0%, 100% { transform: translate(0); }
  10% { transform: translate(-4px, 2px); }
  20% { transform: translate(4px, -2px); }
  30% { transform: translate(-2px, 4px); }
  40% { transform: translate(2px, -4px); }
  50% { transform: translate(-4px, 2px); }
  60% { transform: translate(4px, -2px); }
  70% { transform: translate(-2px, 2px); }
  80% { transform: translate(2px, -2px); }
  90% { transform: translate(-2px, 0); }
}

.shake {
  animation: shake 0.4s ease;
}

/* Mobile controls */
#mobile-controls {
  display: none;
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 50;
  pointer-events: none;
}

.mobile-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  pointer-events: auto;
}

.mobile-btn {
  width: 60px;
  height: 60px;
  border: 1px solid rgba(0, 230, 180, 0.2);
  border-radius: 12px;
  background: rgba(0, 230, 180, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 230, 180, 0.5);
  font-size: 22px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.mobile-btn:active {
  background: rgba(0, 230, 180, 0.15);
  border-color: rgba(0, 230, 180, 0.5);
}

@media (max-width: 600px) {
  #mobile-controls {
    display: block;
  }
}

@media (max-width: 480px) {
  #game-wrapper {
    max-height: 100vh;
    border: none;
  }

  .game-title {
    font-size: 28px;
    letter-spacing: 3px;
  }

  .game-subtitle {
    font-size: 9px;
    letter-spacing: 5px;
  }
}
