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

body {
  background: linear-gradient(135deg, #2c1810 0%, #1a0e08 100%);
  font-family: "Orbitron", monospace;
  color: #ff6b35;
  overflow: hidden;
  user-select: none;
  cursor: none;
}

/* Show cursor in menus */
body:not(.game-active) {
  cursor: default !important;
}

#startScreen,
#upgradeMenu,
#gameOver {
  cursor: default !important;
}

#startScreen *,
#upgradeMenu *,
#gameOver * {
  cursor: default !important;
}

#gameContainer {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameTitle {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 10;
}

#gameTitle h1 {
  font-family: "Creepster", cursive;
  font-size: 3.5em;
  color: #ff3333;
  text-shadow: 0 0 20px #ff3333, 0 0 40px #cc0000;
  margin-bottom: 10px;
  letter-spacing: 3px;
}

#gameTitle p {
  font-size: 1.2em;
  color: #cccccc;
  text-shadow: 2px 2px 4px #000;
}

#gameContainer3D {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  background: #0a0a0a;
  cursor: none;
}

#gameContainer3D canvas {
  display: block;
  outline: none;
}

#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1000;
}

.crosshair-dot {
  width: 4px;
  height: 4px;
  background: #ff6b35;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px #ff6b35;
}

.crosshair-lines {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.crosshair-line {
  background: #ff6b35;
  box-shadow: 0 0 4px #ff6b35;
  position: absolute;
}

.crosshair-horizontal {
  width: 20px;
  height: 2px;
  left: -10px;
  top: -1px;
}

.crosshair-vertical {
  width: 2px;
  height: 20px;
  left: -1px;
  top: -10px;
}

#gameHUD {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px;
  z-index: 100;
}

#topHUD {
  position: absolute;
  top: 200px; /* Position below minimap (minimap height ~190px) */
  left: 20px;
  display: flex;
  flex-direction: column; /* Stack vertically instead of horizontally */
  gap: 10px;
  width: 200px; /* Fixed width to align with minimap */
}

#healthBar,
#staminaBar,
#waveInfo,
#credits {
  background: rgba(0, 0, 0, 0.8);
  padding: 10px 15px;
  border-radius: 5px;
  border: 2px solid #ff6b35;
  width: 170px; /* Fixed width to align with minimap */
  box-sizing: border-box; /* Include padding and border in width */
}

.hud-label {
  font-size: 0.8em;
  font-weight: 700;
  margin-bottom: 5px;
  color: #ff6b35;
}

.bar-container {
  width: 100%;
  height: 20px;
  background: #333;
  border-radius: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 10px;
}

.health-bar {
  background: linear-gradient(90deg, #ff3333 0%, #ff6b35 100%);
  width: 100%;
}

.stamina-bar {
  background: linear-gradient(90deg, #44aaff 0%, #0088ff 100%);
  width: 100%;
  box-shadow: 0 0 10px rgba(68, 170, 255, 0.4);
}

.bullet-time-ready {
  color: #00ffff;
  font-size: 0.7em;
  font-weight: bold;
  text-align: center;
  margin-top: 2px;
  text-shadow: 0 0 8px #00ffff;
  animation: bulletTimePulse 1.5s ease-in-out infinite;
}

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

#waveNumber,
#creditCount {
  font-size: 1.5em;
  font-weight: 900;
  color: #fff;
}

#weaponInfo {
  position: absolute;
  top: 510px; /* Position below the topHUD status items */
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  padding: 10px 15px;
  border-radius: 5px;
  border: 2px solid #ff6b35;
  width: 170px; /* Match the width of status items */
}

#ammoCount {
  font-size: 1.2em;
  font-weight: 700;
  color: #fff;
}

/* Minimap Styling */
#minimap {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #ff6b35;
  width: fit-content;
  z-index: 105; /* Ensure it's above other HUD elements */
}

#minimapCanvas {
  border: 1px solid #ff6b35;
  border-radius: 4px;
  background: rgba(20, 20, 20, 0.9);
  display: block;
}

.shop-panel,
.upgrade-panel,
.game-over-panel,
.start-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.95);
  border: 3px solid #ff6b35;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 107, 53, 0.5);
  z-index: 200;
}

.upgrade-panel h2,
.game-over-panel h2,
.start-panel h2 {
  font-family: "Creepster", cursive;
  font-size: 2.5em;
  color: #ff3333;
  text-shadow: 0 0 15px #ff3333;
  margin-bottom: 20px;
}

.upgrade-options {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.upgrade-option {
  background: rgba(51, 51, 51, 0.8);
  border: 2px solid #ff6b35;
  border-radius: 10px;
  padding: 20px;
  min-width: 200px;
}

.upgrade-option h3 {
  color: #ff6b35;
  font-size: 1.5em;
  margin-bottom: 10px;
}

.upgrade-option p {
  color: #ccc;
  margin-bottom: 10px;
  font-size: 1em;
}

button {
  background: linear-gradient(135deg, #ff6b35 0%, #ff3333 100%);
  border: none;
  color: white;
  padding: 12px 25px;
  font-size: 1.1em;
  font-family: "Orbitron", monospace;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
  background: linear-gradient(135deg, #ff8555 0%, #ff5533 100%);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background: #666;
  color: #999;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.controls {
  text-align: left;
  margin: 20px 0;
  background: rgba(51, 51, 51, 0.5);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #ff6b35;
}

.controls p {
  margin-bottom: 8px;
  color: #ccc;
  font-size: 1.1em;
}

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

.hidden {
  display: none !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #ff6b35;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #ff8555;
}

/* Crosshair cursor */
.crosshair {
  cursor: crosshair;
}

/* Animation for damage text */
@keyframes damageText {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px);
  }
}

.damage-text {
  position: absolute;
  color: #ff3333;
  font-weight: bold;
  font-size: 16px;
  animation: damageText 1s ease-out forwards;
  pointer-events: none;
  z-index: 150;
}

/* Muzzle flash effect */
@keyframes muzzleFlash {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

.muzzle-flash {
  position: absolute;
  width: 20px;
  height: 20px;
  background: radial-gradient(
    circle,
    #ffff00 0%,
    #ff6600 50%,
    transparent 100%
  );
  border-radius: 50%;
  animation: muzzleFlash 0.1s ease-out forwards;
  pointer-events: none;
  z-index: 50;
}

/* Shop Menu Styles */
.shop-panel {
  width: 90vw;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ff6b35;
}

.shop-credits {
  font-size: 1.2em;
  color: #ffff00;
  font-weight: bold;
}

.shop-content {
  display: flex;
  gap: 30px;
  height: 100%;
}

.weapons-section {
  flex: 2;
}

.hotbar-section {
  flex: 1;
  min-width: 300px;
}

.weapon-list {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 10px;
}

.weapon-item {
  background: rgba(40, 40, 40, 0.8);
  border: 1px solid #666;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.weapon-item:hover {
  border-color: #ff6b35;
  background: rgba(50, 50, 50, 0.9);
}

.weapon-info h3 {
  color: #ff6b35;
  margin: 0 0 8px 0;
  font-size: 1.3em;
}

.weapon-description {
  color: #ccc;
  margin: 8px 0;
  font-style: italic;
}

.weapon-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
  font-size: 0.9em;
}

.weapon-stats span {
  color: #aaa;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

.weapon-price {
  font-weight: bold;
  color: #ffff00;
  margin: 10px 0;
}

.weapon-actions {
  text-align: right;
}

.weapon-btn {
  background: #ff6b35;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.weapon-btn:hover {
  background: #ff8555;
  transform: translateY(-1px);
}

.weapon-btn.equipped {
  background: #4caf50;
}

.weapon-btn.equipped:hover {
  background: #66bb6a;
}

.weapon-btn.disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.6;
}

.weapon-btn.disabled:hover {
  background: #666;
  transform: none;
}

/* Hotbar Styles */
.hotbar-slots {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.hotbar-slot {
  width: 80px;
  height: 60px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #666;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hotbar-slot:hover {
  border-color: #ff6b35;
}

.hotbar-weapon {
  text-align: center;
  color: white;
}

.hotbar-weapon.active {
  color: #ff6b35;
}

.hotbar-empty {
  text-align: center;
  color: #666;
}

.hotbar-empty.active {
  color: #ff6b35;
}

.hotbar-name {
  font-size: 0.7em;
  margin-bottom: 4px;
}

.hotbar-key {
  font-weight: bold;
  font-size: 0.8em;
}

.hotbar-text {
  font-size: 0.7em;
}

.hotbar-help {
  color: #aaa;
  font-size: 0.9em;
  text-align: center;
  margin: 10px 0;
}

/* In-game Hotbar */
#gameHotbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 200;
}

.hotbar-slot-game {
  width: 60px;
  height: 45px;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #666;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  color: white;
  transition: all 0.3s ease;
}

.hotbar-slot-game.active {
  border-color: #ff6b35;
  background: rgba(255, 107, 53, 0.2);
}

.hotbar-slot-game.empty {
  color: #666;
}

#closeShop {
  background: #ff6b35;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s ease;
}

#closeShop:hover {
  background: #ff8555;
  transform: translateY(-1px);
}

/* Tier Unlock Notification */
.tier-unlock-notification {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeInOut 4s ease-in-out forwards;
}

.tier-unlock-content {
  background: linear-gradient(135deg, #ff6b35, #ff8555);
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  color: white;
  border: 3px solid #ffaa00;
  box-shadow: 0 0 30px rgba(255, 107, 53, 0.8);
}

.tier-unlock-content h2 {
  font-size: 2.5em;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.tier-unlock-content p {
  font-size: 1.2em;
  margin: 8px 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  15% {
    opacity: 1;
    transform: scale(1);
  }
  85% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}
