@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap");

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

body {
  overflow: hidden;
  background: #000;
  font-family: "Share Tech Mono", monospace;
  cursor: crosshair;
}

#game-container {
  width: 100vw;
  height: 100vh;
  position: relative;
}

canvas {
  display: block;
}

/* HUD Overlay */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Crosshair */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
}

#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 100, 50, 0.9);
  box-shadow: 0 0 10px rgba(255, 100, 50, 0.8);
}

#crosshair::before {
  width: 2px;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}

#crosshair::after {
  width: 100%;
  height: 2px;
  top: 50%;
  transform: translateY(-50%);
}

#crosshair .dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 100, 50, 0.9);
  box-shadow: 0 0 15px rgba(255, 100, 50, 1);
}

/* Top Stats Bar */
#top-bar {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 40px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.4) 100%
  );
  padding: 15px 30px;
  border: 1px solid rgba(255, 100, 50, 0.3);
  border-radius: 5px;
}

.stat {
  text-align: center;
}

.stat-label {
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  color: rgba(255, 100, 50, 0.7);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.stat-value {
  font-family: "Orbitron", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 100, 50, 0.5);
}

/* Power Meter */
#power-container {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#power-label {
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  color: rgba(255, 100, 50, 0.8);
  text-transform: uppercase;
  letter-spacing: 2px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

#power-bar-bg {
  width: 20px;
  height: 200px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 100, 50, 0.4);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

#power-bar {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: linear-gradient(180deg, #ff6432 0%, #ff3200 50%, #cc2800 100%);
  box-shadow: 0 0 20px rgba(255, 100, 50, 0.8);
  transition: height 0.05s;
}

#power-value {
  font-family: "Orbitron", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #ff6432;
}

/* Angle Display */
#angle-container {
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
}

#angle-label {
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  color: rgba(255, 100, 50, 0.8);
  text-transform: uppercase;
  letter-spacing: 2px;
}

#angle-value {
  font-family: "Orbitron", sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 100, 50, 0.5);
}

#angle-unit {
  font-size: 16px;
  color: rgba(255, 100, 50, 0.8);
}

/* Wind Indicator */
#wind-container {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 15px 25px;
  border: 1px solid rgba(100, 200, 255, 0.3);
  border-radius: 5px;
}

#wind-label {
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  color: rgba(100, 200, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 2px;
}

#wind-arrow {
  font-size: 24px;
  margin: 5px 0;
  transition: transform 0.3s;
}

#wind-value {
  font-family: "Orbitron", sans-serif;
  font-size: 18px;
  color: #64c8ff;
}

/* Weapon Selection */
#weapon-container {
  position: absolute;
  bottom: 30px;
  right: 30px;
  text-align: right;
}

#weapon-label {
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  color: rgba(255, 200, 50, 0.8);
  text-transform: uppercase;
  letter-spacing: 2px;
}

#weapon-name {
  font-family: "Orbitron", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #ffc832;
  text-shadow: 0 0 15px rgba(255, 200, 50, 0.5);
}

#weapon-ammo {
  font-size: 14px;
  color: rgba(255, 200, 50, 0.7);
}

/* Messages */
#message {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Orbitron", sans-serif;
  font-size: 48px;
  font-weight: 900;
  color: #ff6432;
  text-shadow: 0 0 30px rgba(255, 100, 50, 0.8),
    0 0 60px rgba(255, 100, 50, 0.4);
  opacity: 0;
  transition: opacity 0.3s;
  text-align: center;
}

#message.show {
  opacity: 1;
}

/* Controls Help */
#controls {
  position: absolute;
  bottom: 30px;
  left: 30px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.8;
}

#controls span {
  color: rgba(255, 100, 50, 0.8);
  font-weight: bold;
}

/* Start Screen */
#start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0a05 50%, #0a0a0a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

#start-screen h1 {
  font-family: "Orbitron", sans-serif;
  font-size: 72px;
  font-weight: 900;
  color: #ff6432;
  text-shadow: 0 0 50px rgba(255, 100, 50, 0.8),
    0 0 100px rgba(255, 100, 50, 0.4);
  margin-bottom: 20px;
  letter-spacing: 10px;
}

#start-screen h2 {
  font-family: "Share Tech Mono", monospace;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 60px;
  letter-spacing: 5px;
}

#start-button {
  font-family: "Orbitron", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #ff6432 0%, #cc2800 100%);
  border: none;
  padding: 20px 60px;
  cursor: pointer;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 5px;
  box-shadow: 0 0 30px rgba(255, 100, 50, 0.5);
  transition: all 0.3s;
  pointer-events: auto;
}

#start-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(255, 100, 50, 0.8);
}

#start-controls {
  margin-top: 50px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  line-height: 2;
}

#start-controls span {
  color: rgba(255, 100, 50, 0.7);
}

/* Game Over Screen */
#game-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

#game-over.show {
  display: flex;
}

#game-over h1 {
  font-family: "Orbitron", sans-serif;
  font-size: 64px;
  font-weight: 900;
  color: #ff3232;
  text-shadow: 0 0 50px rgba(255, 50, 50, 0.8);
  margin-bottom: 20px;
}

#final-score {
  font-family: "Orbitron", sans-serif;
  font-size: 32px;
  color: #fff;
  margin-bottom: 40px;
}

/* Health Bar */
#health-container {
  position: absolute;
  top: 100px;
  left: 30px;
}

#health-label {
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  color: rgba(50, 255, 100, 0.8);
  text-transform: uppercase;
  letter-spacing: 2px;
}

#health-bar-bg {
  width: 200px;
  height: 15px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(50, 255, 100, 0.4);
  border-radius: 3px;
  overflow: hidden;
}

#health-bar {
  height: 100%;
  background: linear-gradient(90deg, #32ff64 0%, #20cc50 100%);
  box-shadow: 0 0 15px rgba(50, 255, 100, 0.6);
  transition: width 0.3s;
}

/* Damage Flash */
#damage-flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(255, 0, 0, 0.4) 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}

#damage-flash.show {
  opacity: 1;
}

/* Minimap */
#minimap {
  position: absolute;
  top: 100px;
  right: 30px;
  width: 150px;
  height: 150px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 100, 50, 0.4);
  border-radius: 5px;
  overflow: hidden;
}

#minimap-canvas {
  width: 100%;
  height: 100%;
}

/* Mobile Controls */
#mobile-controls {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.mobile-active #mobile-controls {
  display: block;
}

/* Virtual Joystick */
#joystick-zone {
  position: absolute;
  bottom: 30px;
  left: 30px;
  width: 150px;
  height: 150px;
  pointer-events: auto;
  touch-action: none;
}

#joystick-base {
  position: absolute;
  width: 140px;
  height: 140px;
  background: radial-gradient(
    circle,
    rgba(255, 100, 50, 0.1) 0%,
    rgba(255, 100, 50, 0.3) 100%
  );
  border: 2px solid rgba(255, 100, 50, 0.5);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#joystick-stick {
  position: absolute;
  width: 60px;
  height: 60px;
  background: radial-gradient(
    circle,
    rgba(255, 100, 50, 0.8) 0%,
    rgba(255, 100, 50, 0.4) 100%
  );
  border: 2px solid rgba(255, 100, 50, 0.9);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px rgba(255, 100, 50, 0.5);
  transition: transform 0.05s;
}

/* Fire Button */
#fire-zone {
  position: absolute;
  bottom: 30px;
  right: 30px;
  width: 120px;
  height: 120px;
  pointer-events: auto;
  touch-action: none;
}

#fire-button {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(255, 50, 50, 0.3) 0%,
    rgba(255, 50, 50, 0.6) 100%
  );
  border: 3px solid rgba(255, 50, 50, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(255, 50, 50, 0.4);
  transition: all 0.1s;
}

#fire-button.charging {
  background: radial-gradient(
    circle,
    rgba(255, 100, 50, 0.5) 0%,
    rgba(255, 50, 50, 0.8) 100%
  );
  box-shadow: 0 0 50px rgba(255, 50, 50, 0.8);
  transform: scale(1.1);
}

#fire-button span {
  font-family: "Orbitron", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 50, 50, 1);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Aim Zone (right side of screen for touch aiming) */
#aim-zone {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 60%;
  pointer-events: auto;
  touch-action: none;
}

/* Weapon Buttons Mobile */
#weapon-buttons {
  position: absolute;
  bottom: 180px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.weapon-btn {
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 200, 50, 0.5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Orbitron", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 200, 50, 0.8);
  touch-action: manipulation;
}

.weapon-btn.active {
  background: rgba(255, 200, 50, 0.3);
  border-color: rgba(255, 200, 50, 1);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 200, 50, 0.5);
}

/* Mobile Adjustments */
@media (max-width: 768px), (pointer: coarse) {
  #controls {
    display: none;
  }

  #top-bar {
    padding: 10px 20px;
    gap: 20px;
  }

  .stat-value {
    font-size: 18px;
  }

  #angle-container {
    left: 15px;
    top: 45%;
  }

  #angle-value {
    font-size: 24px;
  }

  #power-container {
    right: 15px;
    top: 45%;
  }

  #power-bar-bg {
    height: 150px;
  }

  #wind-container {
    bottom: 170px;
    left: 50%;
    padding: 10px 15px;
  }

  #weapon-container {
    display: none;
  }

  #health-container {
    top: 80px;
    left: 15px;
  }

  #health-bar-bg {
    width: 120px;
    height: 12px;
  }

  #minimap {
    top: 80px;
    right: 15px;
    width: 100px;
    height: 100px;
  }

  #start-screen h1 {
    font-size: 36px;
    letter-spacing: 3px;
  }

  #start-screen h2 {
    font-size: 12px;
  }

  #start-button {
    font-size: 18px;
    padding: 15px 40px;
  }

  #start-controls {
    font-size: 11px;
    padding: 0 20px;
  }

  #crosshair {
    width: 30px;
    height: 30px;
  }
}

/* Touch feedback */
.touch-active {
  opacity: 0.8;
}

/* ========================================
   NEW STYLES FOR SCORCHED EARTH FEATURES
   ======================================== */

/* Shop Overlay */
#shop-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

#shop-overlay.show {
  display: flex;
}

#shop-container {
  width: 90%;
  max-width: 900px;
  max-height: 85%;
  background: linear-gradient(135deg, #1a0a05 0%, #0a0505 100%);
  border: 2px solid rgba(255, 200, 50, 0.5);
  border-radius: 10px;
  padding: 30px;
  overflow-y: auto;
}

#shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 200, 50, 0.3);
}

#shop-header h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 28px;
  color: #ffc832;
  text-shadow: 0 0 20px rgba(255, 200, 50, 0.5);
  margin: 0;
}

#shop-credits {
  font-family: "Orbitron", sans-serif;
  font-size: 24px;
  color: #32ff64;
  text-shadow: 0 0 15px rgba(50, 255, 100, 0.5);
}

#shop-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.shop-item {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 100, 50, 0.3);
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-item:hover:not(.disabled) {
  border-color: rgba(255, 200, 50, 0.8);
  background: rgba(255, 200, 50, 0.1);
  transform: translateY(-2px);
}

.shop-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shop-item-name {
  font-family: "Orbitron", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #ffc832;
  margin-bottom: 5px;
}

.shop-item-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 10px;
  line-height: 1.4;
}

.shop-item-stats {
  display: flex;
  gap: 15px;
  font-size: 10px;
  color: rgba(255, 100, 50, 0.8);
  margin-bottom: 10px;
}

.shop-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 100, 50, 0.2);
}

.shop-item-owned {
  font-size: 11px;
  color: rgba(50, 255, 100, 0.7);
}

.shop-item-price {
  font-family: "Orbitron", sans-serif;
  font-size: 14px;
  color: #32ff64;
}

#shop-close {
  width: 100%;
  font-family: "Orbitron", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #ff6432 0%, #cc2800 100%);
  border: none;
  padding: 15px 30px;
  cursor: pointer;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 3px;
  box-shadow: 0 0 20px rgba(255, 100, 50, 0.4);
  transition: all 0.2s;
  pointer-events: auto;
}

#shop-close:hover {
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(255, 100, 50, 0.7);
}

/* Turn Indicator */
#turn-indicator {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Orbitron", sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#turn-indicator.player-turn {
  background: rgba(50, 255, 100, 0.2);
  border: 1px solid rgba(50, 255, 100, 0.5);
  color: #32ff64;
  text-shadow: 0 0 10px rgba(50, 255, 100, 0.5);
}

#turn-indicator.enemy-turn {
  background: rgba(255, 50, 50, 0.2);
  border: 1px solid rgba(255, 50, 50, 0.5);
  color: #ff5050;
  text-shadow: 0 0 10px rgba(255, 50, 50, 0.5);
}

#turn-indicator.waiting {
  background: rgba(255, 200, 50, 0.2);
  border: 1px solid rgba(255, 200, 50, 0.5);
  color: #ffc832;
  text-shadow: 0 0 10px rgba(255, 200, 50, 0.5);
}

#turn-indicator.shop {
  background: rgba(100, 200, 255, 0.2);
  border: 1px solid rgba(100, 200, 255, 0.5);
  color: #64c8ff;
  text-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
}

/* Credits Display */
#credits-display {
  position: absolute;
  top: 20px;
  right: 30px;
  text-align: right;
}

#credits-label {
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  color: rgba(50, 255, 100, 0.7);
  text-transform: uppercase;
  letter-spacing: 2px;
}

#credits {
  font-family: "Orbitron", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #32ff64;
  text-shadow: 0 0 15px rgba(50, 255, 100, 0.5);
}

/* Laser Pointer for Air Strike */
#laser-pointer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.laser-ring {
  width: 100px;
  height: 100px;
  border: 3px solid rgba(255, 50, 50, 0.8);
  border-radius: 50%;
  margin: 0 auto 15px;
  animation: laser-pulse 1s infinite;
  box-shadow: 0 0 30px rgba(255, 50, 50, 0.5),
    inset 0 0 20px rgba(255, 50, 50, 0.3);
}

@keyframes laser-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
}

.laser-text {
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  color: #ff5050;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 50, 50, 0.8);
}

/* Camera Mode Indicator */
#camera-indicator {
  position: absolute;
  top: 20px;
  left: 30px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

#camera-indicator span {
  color: rgba(255, 100, 50, 0.8);
  font-weight: bold;
}

/* Weapon button disabled state */
.weapon-btn.disabled {
  opacity: 0.3;
  border-color: rgba(100, 100, 100, 0.3);
  color: rgba(100, 100, 100, 0.5);
}

/* Final Credits in Game Over */
#final-credits {
  font-family: "Orbitron", sans-serif;
  font-size: 22px;
  color: #32ff64;
  margin-bottom: 40px;
}

/* Retry button */
#retry-button {
  font-family: "Orbitron", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #ff6432 0%, #cc2800 100%);
  border: none;
  padding: 15px 50px;
  cursor: pointer;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 4px;
  box-shadow: 0 0 30px rgba(255, 100, 50, 0.5);
  transition: all 0.3s;
}

#retry-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(255, 100, 50, 0.8);
}

/* Mobile shop adjustments */
@media (max-width: 768px) {
  #shop-container {
    width: 95%;
    padding: 15px;
  }

  #shop-header h2 {
    font-size: 18px;
  }

  #shop-credits {
    font-size: 16px;
  }

  #shop-items {
    grid-template-columns: 1fr;
  }

  #turn-indicator {
    top: 55px;
    font-size: 11px;
    padding: 5px 12px;
  }

  #credits-display {
    top: 10px;
    right: 15px;
  }

  #credits {
    font-size: 14px;
  }

  #camera-indicator {
    display: none;
  }
}
