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

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

body {
  font-family: "Rajdhani", sans-serif;
  overflow: hidden;
  background: linear-gradient(135deg, #0a0015 0%, #1a0033 50%, #0f001f 100%);
}

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

#ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#hud {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-end;
  padding: 0 40px;
  font-family: "Orbitron", monospace;
}

.hud-item {
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #00ffff;
  border-radius: 10px;
  padding: 15px 25px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

.hud-label {
  font-size: 12px;
  color: #00ffff;
  letter-spacing: 2px;
  margin-bottom: 5px;
}

.hud-value {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 10px #00ffff;
}

#startScreen,
#gameOverScreen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(
    ellipse at center,
    rgba(10, 0, 30, 0.95) 0%,
    rgba(0, 0, 0, 0.98) 100%
  );
  pointer-events: all;
}

#gameOverScreen {
  display: none;
}

h1 {
  font-family: "Orbitron", monospace;
  font-size: 80px;
  font-weight: 900;
  color: #00ffff;
  text-transform: uppercase;
  letter-spacing: 8px;
  margin-bottom: 20px;
  text-shadow:
    0 0 10px #00ffff,
    0 0 20px #00ffff,
    0 0 30px #00ffff,
    0 0 40px #ff00ff,
    0 0 70px #ff00ff;
  animation: glow 2s ease-in-out infinite alternate;
}

.subtitle {
  font-family: "Rajdhani", sans-serif;
  font-size: 24px;
  color: #ff00ff;
  letter-spacing: 4px;
  margin-bottom: 50px;
  text-transform: uppercase;
}

.btn {
  font-family: "Orbitron", monospace;
  font-size: 24px;
  font-weight: 700;
  padding: 20px 50px;
  background: linear-gradient(135deg, #ff00ff 0%, #00ffff 100%);
  color: #000;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 3px;
  pointer-events: all;
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.6);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 50px rgba(255, 0, 255, 1);
}

.btn span {
  position: relative;
  z-index: 1;
}

.controls {
  margin-top: 40px;
  text-align: center;
  color: #00ffff;
  font-size: 18px;
  line-height: 1.8;
}

.controls strong {
  color: #ff00ff;
  font-weight: 700;
}

#finalScore {
  font-size: 48px;
  color: #00ffff;
  margin: 30px 0;
  font-family: "Orbitron", monospace;
}

@keyframes glow {
  from {
    text-shadow:
      0 0 10px #00ffff,
      0 0 20px #00ffff,
      0 0 30px #00ffff,
      0 0 40px #ff00ff,
      0 0 70px #ff00ff;
  }
  to {
    text-shadow:
      0 0 20px #00ffff,
      0 0 30px #ff00ff,
      0 0 40px #ff00ff,
      0 0 50px #ff00ff,
      0 0 80px #ff00ff,
      0 0 100px #ff00ff;
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
  }
}

/* Speedometer Styles */
.speedometer {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 220px;
  height: 160px;
  background: rgba(0, 0, 0, 0.8);
  border: 3px solid #00ffff;
  border-radius: 20px;
  padding: 15px;
  box-shadow:
    0 0 30px rgba(0, 255, 255, 0.5),
    inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.speedometer-svg {
  width: 100%;
  height: 100px;
}

.speedometer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 12;
  stroke-linecap: round;
}

.speedometer-fill {
  fill: none;
  stroke: url(#speedGradient);
  stroke: #00ffff;
  stroke-width: 12;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px #00ffff);
  transition: d 0.1s ease-out;
}

.speedometer-ticks line {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 2;
}

.speed-label {
  fill: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  font-family: "Orbitron", monospace;
}

.speedometer-needle {
  stroke: #ff00ff;
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px #ff00ff);
  transition: transform 0.1s ease-out;
  transform-origin: 100px 100px;
}

.speedometer-center {
  fill: #ff00ff;
  filter: drop-shadow(0 0 8px #ff00ff);
}

.speedometer-value {
  text-align: center;
  margin-top: -10px;
}

.speedometer-value #speed {
  font-family: "Orbitron", monospace;
  font-size: 36px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 15px #00ffff;
}

.speedometer-unit {
  display: block;
  font-family: "Orbitron", monospace;
  font-size: 12px;
  color: #00ffff;
  letter-spacing: 2px;
  margin-top: -5px;
}

/* Speedometer glow animation */
@keyframes needleGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 6px #ff00ff);
  }
  50% {
    filter: drop-shadow(0 0 12px #ff00ff) drop-shadow(0 0 20px #ff00ff);
  }
}

.speedometer-needle {
  animation: needleGlow 1s ease-in-out infinite;
}

/* Flash screen effect */
@keyframes flashFade {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Pedestrian counter styles */
.pedestrian-counter {
  border-color: #ff6b6b;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

.pedestrian-counter .hud-label {
  color: #ff6b6b;
}

.pedestrian-counter .hud-value {
  text-shadow: 0 0 10px #ff6b6b;
}

.pedestrian-counter:hover {
  box-shadow: 0 0 30px rgba(255, 107, 107, 0.8);
}

/* Traffic light counter styles */
.traffic-counter {
  border-color: #ffaa00;
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.5);
}

.traffic-counter .hud-label {
  color: #ffaa00;
}

.traffic-counter .hud-value {
  text-shadow: 0 0 10px #ffaa00;
}

.traffic-counter:hover {
  box-shadow: 0 0 30px rgba(255, 170, 0, 0.8);
}

/* Vehicle overtaken counter styles */
.vehicle-counter {
  border-color: #2ecc71;
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
}

.vehicle-counter .hud-label {
  color: #2ecc71;
}

.vehicle-counter .hud-value {
  text-shadow: 0 0 10px #2ecc71;
}

.vehicle-counter:hover {
  box-shadow: 0 0 30px rgba(46, 204, 113, 0.8);
}

/* Near miss counter styles */
.nearmiss-counter {
  border-color: #e91e63;
  box-shadow: 0 0 20px rgba(233, 30, 99, 0.5);
}

.nearmiss-counter .hud-label {
  color: #e91e63;
}

.nearmiss-counter .hud-value {
  text-shadow: 0 0 10px #e91e63;
}

.nearmiss-counter:hover {
  box-shadow: 0 0 30px rgba(233, 30, 99, 0.8);
}
