/**
 * AMBERDRIVE - Game Styles
 * Separated from main site styles for maintainability
 */

/* =============================================
   GAME CONTAINER & LAYOUT
   ============================================= */

#race-game {
  padding: 0;
}

.game-container {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 20px;
  background: var(--bg-box);
  border: 1px solid var(--border);
}

.game-canvas-wrapper {
  position: relative;
  display: inline-block;
}

#raceCanvas {
  display: block;
  background: var(--bg);
  border: 2px solid var(--border);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* =============================================
   OVERLAY (Start / Game Over / Pause)
   ============================================= */

.game-overlay {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 13, 13, 0.9);
  cursor: pointer;
  transition: opacity 0.3s ease;
}

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

.game-start,
.game-over,
.game-pause {
  text-align: center;
  animation: flicker 3s infinite;
}

.game-start.hidden,
.game-over.hidden,
.game-pause.hidden {
  display: none;
}

.game-start h2,
.game-over h2,
.game-pause h2 {
  font-family: 'VT323', monospace;
  font-size: 64px;
  color: var(--accent);
  text-shadow: 0 0 20px var(--glow);
  margin-bottom: 30px;
  letter-spacing: 8px;
}

/* =============================================
   UI ELEMENTS
   ============================================= */

.game-instructions {
  font-family: 'Handjet', monospace;
  font-size: 20px;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 30px;
}

.game-instructions .key {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: var(--accent);
  margin: 0 2px;
}

.game-action {
  font-family: 'VT323', monospace;
  font-size: 28px;
  color: var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
}

.final-stats {
  margin: 20px 0;
}

.final-stats p {
  font-family: 'VT323', monospace;
  font-size: 24px;
  color: var(--text);
  margin: 10px 0;
}

.final-stats span {
  color: var(--accent);
  font-size: 32px;
}

/* =============================================
   HUD (Heads Up Display)
   ============================================= */

.game-hud {
  position: absolute;
  top: 30px;
  left: 30px;
  display: flex;
  gap: 24px;
  white-space: nowrap;
  pointer-events: none;
}

.hud-item {
  text-align: left;
  min-width: 60px;
}

.hud-label {
  display: block;
  font-family: 'VT323', monospace;
  font-size: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.hud-value {
  display: block;
  font-family: 'VT323', monospace;
  font-size: 32px;
  color: var(--accent);
  text-shadow: 0 0 10px var(--glow);
  line-height: 1;
}

.hud-value span {
  color: inherit;
  text-shadow: inherit;
}

/* =============================================
   ANIMATIONS
   ============================================= */

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

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  93% {
    opacity: 0.8;
  }
  94% {
    opacity: 1;
  }
  96% {
    opacity: 0.9;
  }
  97% {
    opacity: 1;
  }
}
