/* Test version control */

/* Global font setting for HUD elements */
body, .ammo-counter, .grenade-counter, .weapon-info, .weapon-pickup-message, .score-counter, .enemy-counter, .health-text, .controls-hint, .game-overlay, .game-over, .restart-button {
  font-family: 'Play', 'Orbitron', sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Halo-themed background element */
.halo-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0,0,0,1) 0%, rgba(20,20,20,1) 70%, rgba(0,0,0,1) 100%);
  z-index: -1;
}

/* Crosshair styles */
.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 100;
  display: none;
}

.crosshair-inner {
  width: 6px;
  height: 6px;
  background-color: rgba(0, 255, 150, 0.8);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.crosshair-line {
  position: absolute;
  background-color: rgba(0, 255, 150, 0.8);
}

.crosshair-horizontal {
  width: 20px;
  height: 2px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.crosshair-vertical {
  width: 2px;
  height: 20px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* HUD elements */
.ammo-counter, .grenade-counter, .weapon-info, .score-counter, .enemy-counter {
  color: #e0e0e0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  font-weight: bold;
  display: none;
  z-index: 100;
}

/* HUD container for left-side elements */
.hud-container-left {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px; /* Reduced from 15px */
  z-index: 100;
  padding: 12px 15px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 100, 50, 0.2), rgba(0, 50, 25, 0.2));
  border-left: 2px solid rgba(0, 255, 150, 0.3);
  backdrop-filter: blur(1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Set consistent font sizes within container */
.hud-container-left .score-counter {
  font-size: 20px;
}

.hud-container-left .enemy-counter {
  font-size: 20px;
}

.hud-container-left .ammo-counter {
  font-size: 20px;
}

.hud-container-left .grenade-counter {
  font-size: 20px;
}

.hud-container-left .weapon-info {
  font-size: 20px;
}

/* Maintain backward compatibility for elements outside container */
.score-counter:not(.hud-container-left .score-counter) {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 24px;
}

.enemy-counter:not(.hud-container-left .enemy-counter) {
  position: absolute;
  top: 60px;
  left: 20px;
  font-size: 18px;
}

.ammo-counter:not(.hud-container-left .ammo-counter) {
  position: absolute;
  top: 100px;
  left: 20px;
  font-size: 24px;
}

.grenade-counter:not(.hud-container-left .grenade-counter) {
  position: absolute;
  top: 140px;
  left: 20px;
  font-size: 24px;
}

.weapon-info:not(.hud-container-left .weapon-info) {
  position: absolute;
  top: 180px;
  left: 20px;
  font-size: 20px;
}

.weapon-pickup-message {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  color: #e0e0e0;
  font-size: 20px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  z-index: 100;
  display: none;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 10px 20px;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Health bar */
.health-container {
  position: absolute;
  bottom: 35px;
  right: 20px;
  width: 200px;
  height: 25px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 5px;
  overflow: hidden;
  display: none;
  z-index: 100;
}

.health-bar {
  width: 100%;
  height: 100%;
  background-color: #00cc00;
  transition: width 0.2s;
}

.health-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #e0e0e0;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Damage overlay */
.damage-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 0, 0, 0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 99;
}

/* Controls hint */
.controls-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #e0e0e0;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  text-align: center;
  z-index: 100;
  display: none;
  opacity: 0.6;
}

/* Grenade throw animation container */
.grenade-throw-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
  display: none;
}

/* Sniper scope overlay styling */
#sniperScope {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
    z-index: 100;
    background: transparent;
}
  
#sniperScopeBackground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    display: none;
    z-index: 99;
    
    /* Create a circular cutout */
    -webkit-mask-image: radial-gradient(
      circle at center, 
      transparent 300px, 
      black 301px
    );
    mask-image: radial-gradient(
      circle at center, 
      transparent 300px, 
      black 301px
    );
}
  
/* Scope Details Container */
#sniperScope::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border: 4px solid #00ff00;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    pointer-events: none;
    z-index: 101;
}
  
/* Distance Markers */
#sniperScope .distance-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    color: #00ff00;
    opacity: 0.7;
    font-family: 'Arial', sans-serif;
    z-index: 102;
}
  
#sniperScope .distance-100m {
    transform: translate(-50%, -250px);
}
  
#sniperScope .distance-50m {
    transform: translate(-50%, -150px);
}
  
/* Crosshair */
#sniperScope::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: #00ff00;
    z-index: 102;
}
  
/* Distance Ring Markers */
#sniperScope .ring-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 101;
}
  
#sniperScope .ring-100m {
    width: 200px;
    height: 200px;
}
  
#sniperScope .ring-200m {
    width: 400px;
    height: 400px;
}
  
/* Distance Counter */
#distanceCounter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #00ff00;
    font-family: 'Arial', sans-serif;
    font-size: 24px;
    z-index: 103;
    opacity: 0.8;
}

/* Hide crosshair only for sniper in non-zoomed state */
body.sniper-active:not(.sniper-zoomed) .crosshair {
  display: none !important;
}

/* Ensure crosshair is visible when zoomed (overrides your current rule) */
body.sniper-zoomed .crosshair {
  display: block !important;
}

/* When zoomed with sniper rifle, adjust other HUD elements */
#sniperScope[style*="display: block"] ~ .hud-container-left,
#sniperScope[style*="display: block"] ~ .health-container {
  opacity: 0.5;
}

/* Hide regular crosshair when scope is active */
#sniperScope[style*="display: block"] ~ .crosshair {
  display: none;
}

#start-button p {
    margin: 10px 0;
    line-height: 1.4;
}

.start-click-text {
    font-size: 24px;
    font-weight: bold;
}

.start-instructions {
    font-size: 16px;
    opacity: 0.8;
}

/* Halo-themed Game Overlay */
.game-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #1a1a1a, #333333);
  border: 2px solid #00ff99;
  padding: 20px 40px;
  font-size: 28px;
  color: #00ff99;
  text-align: center;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 200;
}

.game-overlay:hover {
  box-shadow: 0 0 20px 5px rgba(0, 255, 153, 0.7);
  transform: translate(-50%, -50%) scale(1.05);
}

/* Halo-themed Game Over Screen */
/* Halo-themed Restart Button - Centered */
.game-over {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.game-over .overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    max-width: 500px;
    width: 90%;
}

.restart-button {
    display: inline-block;
    padding: 15px 30px;
    font-size: 20px;
    color: #fff;
    background: linear-gradient(135deg, #0077ff, #0057cc);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
}

.restart-button:hover {
    background: linear-gradient(135deg, #0057cc, #003399);
    transform: scale(1.05);
}

/* Ensure text and button are centered */
.game-over h1,
.game-over p,
.game-over .restart-button {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* Radar Container: circular, lower-left corner, Halo glow */
.radar-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid #00ff00;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Subtle ring lines, rotating background pattern */
.radar-background {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) rotate(45deg);
    background: repeating-radial-gradient(
      circle at center,
      transparent 0,
      transparent 10px,
      rgba(0, 255, 0, 0.07) 10px,
      rgba(0, 255, 0, 0.07) 20px
    );
}

/* Player orientation indicator (optional) */
.radar-triangle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid #00ff00;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: transform 0.1s;
}

/* Container for enemy blips */
.radar-enemies {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Enemy blip: small red dot, scaled from center */
.radar-enemy-blip {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #ff0000;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Label to show "25m" or your detection range */
.radar-range-label {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    color: #00ff00;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Media query for mobile devices */
@media (max-width: 768px) {
  .hud-container-left {
      gap: 8px; /* Reduced from 10px */
      padding: 10px;
      background: linear-gradient(135deg, rgba(0, 100, 50, 0.15), rgba(0, 50, 25, 0.15));
  }
  
  .hud-container-left .score-counter,
  .hud-container-left .enemy-counter,
  .hud-container-left .ammo-counter,
  .hud-container-left .grenade-counter,
  .hud-container-left .weapon-info {
      font-size: 16px; /* Consistent size for all elements */
  }

  /* Legacy support for non-container elements */
  .score-counter:not(.hud-container-left .score-counter) {
      font-size: 18px;
      top: 35px;
      left: 10px;
  }
  
  .enemy-counter:not(.hud-container-left .enemy-counter) {
      font-size: 16px;
      top: 55px;
      left: 10px;
  }
  
  .ammo-counter:not(.hud-container-left .ammo-counter) {
      font-size: 18px;
      top: 75px;
      left: 10px;
  }
  
  .grenade-counter:not(.hud-container-left .grenade-counter) {
      font-size: 18px;
      top: 95px;
      left: 10px;
  }
  
  .weapon-info:not(.hud-container-left .weapon-info) {
      font-size: 16px;
      top: 115px;
      left: 10px;
  }
  
  .weapon-pickup-message {
      font-size: 16px;
      display: inline-block;
      width: auto !important;
      max-width: 300px !important;
      text-align: center;
      top: 135px;
      left: 50%;
      transform: translateX(-50%);
      box-sizing: border-box;
  }
  
  .health-text {
      font-size: 12px;
  }
  
  /* Game overlay adjustments */
  .game-overlay {
      font-size: 22px;
      padding: 15px 30px;
  }
  
  .start-click-text {
      font-size: 20px;
  }
  
  .start-instructions {
      font-size: 14px;
  }
  
  /* Radar adjustments */
  .radar-container {
      width: 100px;
      height: 100px;
  }
  
  .radar-range-label {
      font-size: 12px;
  }
}
