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

body {
  overflow: hidden;
  background: #000;
  font-family: 'Rajdhani', 'Segoe UI', Arial, sans-serif;
}

canvas {
  display: block;
  cursor: none;
}

/* --- Crosshair --- */

#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
}

#crosshair::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

#crosshair::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* --- Radar --- */

#radar {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid rgba(0, 255, 80, 0.4);
  box-shadow: 0 0 15px rgba(0, 255, 80, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 10;
  background: rgba(0, 10, 0, 0.6);
}

/* --- HUD --- */

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

#hud-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#score {
  font-family: 'Orbitron', sans-serif;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

#kills {
  font-family: 'Orbitron', sans-serif;
  color: #ff8844;
  font-size: 14px;
  font-weight: 500;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

#level {
  font-family: 'Orbitron', sans-serif;
  color: #ffc832;
  font-size: 16px;
  font-weight: 500;
  text-shadow: 0 0 12px rgba(255, 200, 50, 0.4), 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 3px;
}

#hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#city-damage-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.city-damage-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #ff6644;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(255, 60, 30, 0.5);
  white-space: nowrap;
}
.city-damage-track {
  width: 200px;
  height: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 100, 60, 0.4);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.city-damage-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, #ff8800, #ff4400, #cc0000);
  box-shadow: 0 0 8px rgba(255, 60, 0, 0.6);
  transition: width 0.4s ease-out;
}
.city-damage-fill.critical {
  animation: cityPulse 0.6s ease-in-out infinite alternate;
}
@keyframes cityPulse {
  from { box-shadow: 0 0 8px rgba(255, 60, 0, 0.6); }
  to   { box-shadow: 0 0 20px rgba(255, 0, 0, 1), 0 0 40px rgba(255, 0, 0, 0.5); }
}
.city-damage-pct {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #ff6644;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(255, 60, 30, 0.5);
  min-width: 36px;
}

#lives {
  display: flex;
  gap: 6px;
  align-items: center;
}

.life-pip {
  transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

.life-pip svg {
  display: block;
  fill: rgba(60, 60, 80, 0.35);
  stroke: rgba(120, 120, 140, 0.3);
  stroke-width: 1;
  transition: fill 0.3s ease, stroke 0.3s ease, filter 0.3s ease;
}

.life-pip.active svg {
  fill: #22cc55;
  stroke: #66ffaa;
  stroke-width: 0.8;
  filter: drop-shadow(0 0 6px rgba(34, 204, 85, 0.5));
}

.life-pip.warning svg {
  fill: #ff9900;
  stroke: #ffcc44;
  filter: drop-shadow(0 0 8px rgba(255, 153, 0, 0.6));
  animation: pipWarn 0.8s ease-in-out infinite;
}

.life-pip.critical svg {
  fill: #ff2222;
  stroke: #ff6644;
  filter: drop-shadow(0 0 10px rgba(255, 34, 34, 0.7));
  animation: pipCritical 0.45s ease-in-out infinite;
}

.life-pip.lost {
  transform: scale(0.7);
  opacity: 0.25;
}

.life-pip.lost svg {
  fill: rgba(60, 60, 80, 0.2);
  stroke: rgba(120, 120, 140, 0.15);
  filter: none;
}

.life-pip.pop {
  animation: pipPop 0.5s ease-out;
}

@keyframes pipWarn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes pipCritical {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.7; }
}

@keyframes pipPop {
  0% { transform: scale(1); }
  20% { transform: scale(1.4); }
  50% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(0.7); opacity: 0.25; }
}

/* --- Damage Overlay --- */

#damage-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  opacity: 0;
  transition: opacity 0.1s ease;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(180, 0, 0, 0.7) 100%);
}

#damage-overlay.flash {
  opacity: 1;
  animation: damageFlash 0.5s ease-out forwards;
}

#damage-overlay.low-health {
  opacity: 1;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(180, 0, 0, 0.35) 100%);
  animation: lowHealthPulse 1.5s ease-in-out infinite;
}

@keyframes damageFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes lowHealthPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* --- Pickup Toast --- */

#pickup-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 20;
}

.pickup-toast-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  border-left: 3px solid currentColor;
  backdrop-filter: blur(4px);
  animation: toastIn 0.3s ease-out, toastOut 0.4s ease-in 1.6s forwards;
  white-space: nowrap;
}

.pickup-toast-item .toast-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pickup-toast-item .toast-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}

.pickup-toast-item .toast-desc {
  font-family: 'Rajdhani', sans-serif;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 500;
  margin-left: 2px;
}

@keyframes toastIn {
  0% { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  0% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-8px); }
}

/* --- Weapon Bar --- */

#weapon-bar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  pointer-events: none;
  z-index: 10;
}

.weapon-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  min-width: 70px;
  transition: all 0.15s ease;
}

.weapon-slot.active {
  background: rgba(255, 200, 50, 0.2);
  border-color: rgba(255, 200, 50, 0.8);
  box-shadow: 0 0 12px rgba(255, 200, 50, 0.3);
}

.weapon-slot.locked {
  opacity: 0.3;
}

.weapon-key {
  font-family: 'Orbitron', sans-serif;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 500;
}

.weapon-name {
  font-family: 'Rajdhani', sans-serif;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 2px 0;
}

.weapon-ammo {
  font-family: 'Orbitron', sans-serif;
  color: #ffc832;
  font-size: 11px;
  font-weight: 500;
  min-height: 14px;
}

/* --- Boosters --- */

#active-boosters {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  pointer-events: none;
  z-index: 10;
}

.booster-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.booster-icon .booster-label {
  font-family: 'Rajdhani', sans-serif;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.booster-icon .booster-timer {
  font-family: 'Orbitron', sans-serif;
  color: #ffc832;
  font-size: 10px;
}

/* --- Level Banner --- */

#level-banner {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Black Ops One', cursive;
  color: #fff;
  font-size: 48px;
  font-weight: 400;
  letter-spacing: 6px;
  text-shadow: 0 0 30px rgba(255, 200, 50, 0.6), 0 0 60px rgba(255, 200, 50, 0.3), 0 4px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.5s ease;
  text-align: center;
  line-height: 1.4;
  white-space: nowrap;
}

#level-banner.visible {
  opacity: 1;
}

/* --- Start Screen --- */

#start-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  cursor: default;
}

#start-screen h1 {
  font-family: 'Black Ops One', cursive;
  color: #fff;
  font-size: 60px;
  font-weight: 400;
  letter-spacing: 6px;
  margin-bottom: 16px;
  text-shadow: 0 0 40px rgba(255, 200, 50, 0.5), 0 0 80px rgba(255, 150, 30, 0.2);
}

#start-screen .subtitle {
  font-family: 'Rajdhani', sans-serif;
  color: rgba(255, 255, 255, 0.45);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 40px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

#play-btn {
  font-family: 'Orbitron', sans-serif;
  padding: 16px 70px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 8px;
  color: #000;
  background: linear-gradient(135deg, #ffd54f, #ffb300);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 40px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: btnPulse 2.5s ease-in-out infinite;
}

#play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 30px rgba(255, 200, 50, 0.6), 0 0 60px rgba(255, 180, 30, 0.2);
}

.start-columns {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.controls-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 34px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.controls-info .info-heading {
  font-family: 'Orbitron', sans-serif;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 2px;
}

.controls-info p {
  font-family: 'Rajdhani', sans-serif;
  color: rgba(255, 255, 255, 0.4);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 2px;
}

.pickups-legend {
  gap: 8px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Rajdhani', sans-serif;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

@keyframes btnPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* --- Game Over / Victory --- */

#game-over, #victory {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  cursor: default;
}

#game-over.visible, #victory.visible {
  display: flex;
}

#game-over h1 {
  font-family: 'Black Ops One', cursive;
  color: #ff4444;
  font-size: 60px;
  font-weight: 400;
  letter-spacing: 6px;
  margin-bottom: 20px;
  text-shadow: 0 0 30px rgba(255, 50, 50, 0.4);
}

#victory h1 {
  font-family: 'Black Ops One', cursive;
  color: #ffc832;
  font-size: 60px;
  font-weight: 400;
  letter-spacing: 6px;
  margin-bottom: 10px;
  text-shadow: 0 0 40px rgba(255, 200, 50, 0.5), 0 0 80px rgba(255, 180, 30, 0.2);
}

#game-over p, #victory p {
  font-family: 'Orbitron', sans-serif;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

#restart-btn, #victory-restart-btn {
  font-family: 'Orbitron', sans-serif;
  margin-top: 30px;
  padding: 14px 44px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #000;
  background: linear-gradient(135deg, #ffd54f, #ffb300);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#restart-btn:hover, #victory-restart-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 200, 50, 0.5);
}
