/* ============================================
   RANGE CSS - CATCH-A-BULLET!
   ============================================ */

:root {
  --yellow: #f4c025;
  --orange: #d15610;
  --bg-dark: #1a1a1b;
  --bg-darker: #0d0d0d;
  --neon-green: #39ff14;
  --neon-red: #ff073a;
  --neon-blue: #00d4ff;
  --neon-purple: #b026ff;
  --text-main: #e0e0e0;
  --border: 3px solid #000;
  --shadow: 6px 6px 0px #000;
}

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

body {
  background: var(--bg-darker);
  color: var(--text-main);
  font-family: 'Share Tech Mono', monospace;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background-image: 
    radial-gradient(circle at 50% 50%, transparent 10%, rgba(0,0,0,0.7) 100%),
    url('../img/back-gg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  user-select: none;
}

body.alt-bg {
  background-image: 
    radial-gradient(circle at 50% 50%, transparent 10%, rgba(0,0,0,0.7) 100%),
    url('../img/back-g.png');
}

/* CRT scanline overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, 
    rgba(0,0,0,0) 0px, 
    rgba(0,0,0,0) 2px, 
    rgba(0,0,0,0.1) 2px, 
    rgba(0,0,0,0.1) 4px);
  pointer-events: none;
  z-index: 999;
}

h1, h2, h3, h4 {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  text-align: center;
  padding: 1rem;
  position: relative;
  z-index: 10;
}

.marquee-sign {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--orange), -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  border: var(--border);
  padding: 0.5rem 1.5rem;
  background: var(--bg-dark);
  box-shadow: var(--shadow), 0 0 20px rgba(244, 192, 37, 0.4);
  display: inline-block;
  transform: rotate(-1deg);
  letter-spacing: 2px;
  text-decoration: none;
  animation: signFlicker 8s infinite;
}

/* ============================================
   TARGET AREA
   ============================================ */
.range-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 200px); /* leave room for header & footer */
  position: relative;
}

.target-board {
  width: 300px;
  height: 400px;
  background: #d4c4a8; /* Cardboard color */
  border: 4px solid #3a2e1d;
  box-shadow: 10px 10px 0 rgba(0,0,0,0.5), inset 0 0 50px rgba(0,0,0,0.5);
  position: relative;
  transition: transform 0.1s;
  background-image: 
    radial-gradient(circle at center, transparent 40%, rgba(90, 70, 40, 0.4) 100%),
    repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.05) 10px, rgba(0,0,0,0.05) 20px);
  overflow: hidden; /* Keep crosshair inside */
}

/* Moving Crosshair */
.moving-crosshair {
  position: absolute;
  width: 40px;
  height: 40px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--neon-red);
  border-radius: 50%;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 0 10px var(--neon-red), inset 0 0 5px var(--neon-red);
  
  /* Tactical animation for sweeping, holding, snapping, AND breathing sway */
  animation: 
    panScopeX 7s cubic-bezier(0.4, 0, 0.2, 1) infinite, 
    panScopeY 11s cubic-bezier(0.4, 0, 0.2, 1) infinite,
    breathSway 4.3s ease-in-out infinite;
}

/* Crosshair inner lines */
.moving-crosshair::before,
.moving-crosshair::after {
  content: '';
  position: absolute;
  background: var(--neon-red);
  box-shadow: 0 0 5px var(--neon-red);
}

.moving-crosshair::before {
  top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%);
}

.moving-crosshair::after {
  left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%);
}

/* Crosshair center dot */
.moving-crosshair .dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px;
  background: var(--neon-green);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 21;
}

@keyframes panScopeX {
  0%, 15% { left: 50%; }
  20%, 25% { left: 35%; }
  30%, 45% { left: 50%; }
  50%, 55% { left: 65%; }
  60%, 75% { left: 50%; }
  80%, 85% { left: 45%; }
  90%, 95% { left: 55%; }
  100% { left: 50%; }
}

@keyframes panScopeY {
  0%, 15% { top: 50%; }
  20%, 25% { top: 40%; }
  30%, 45% { top: 50%; }
  50%, 55% { top: 35%; }
  60%, 75% { top: 50%; }
  80%, 85% { top: 20%; }
  90%, 95% { top: 18%; }
  100% { top: 50%; }
}

@keyframes breathSway {
  0% { transform: translate(-50%, -50%); }
  25% { transform: translate(calc(-50% + 6px), calc(-50% - 8px)); }
  50% { transform: translate(calc(-50% - 4px), calc(-50% + 5px)); }
  75% { transform: translate(calc(-50% + 7px), calc(-50% + 3px)); }
  100% { transform: translate(-50%, -50%); }
}

/* Target Rings */
.target-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 4px solid #1a1a1a;
  pointer-events: none;
}

.ring-1 { width: 260px; height: 260px; }
.ring-2 { width: 200px; height: 200px; }
.ring-3 { width: 140px; height: 140px; background: rgba(0,0,0,0.05); }
.ring-4 { width: 80px; height: 80px; background: rgba(0,0,0,0.1); }
.ring-bullseye { 
  width: 40px; 
  height: 40px; 
  background: var(--neon-red); 
  border-color: #000;
  box-shadow: 0 0 10px var(--neon-red);
}

.target-hitbox {
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* Bullet Hole Visuals */
.bullet-hole {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #111;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 2px 2px 5px #000, 0 0 2px rgba(0,0,0,0.8);
  pointer-events: none;
  z-index: 6;
}

.bullet-hole::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  background: radial-gradient(circle, rgba(0,0,0,0.8) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  z-index: -1;
  border-radius: 50%;
}

.bullet-hole.featured { box-shadow: inset 2px 2px 5px #000, 0 0 8px var(--neon-green); border: 2px solid var(--neon-green); }
.bullet-hole.sub { width: 14px; height: 14px; box-shadow: inset 2px 2px 5px #000, 0 0 5px var(--neon-blue); }
.bullet-hole.jhp { width: 18px; height: 18px; border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; background: #0a0a0a; }

/* Damage Numbers Popup */
.dmg-popup {
  position: absolute;
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--yellow);
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  pointer-events: none;
  z-index: 10;
  animation: floatUp 1s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

.dmg-popup.crit {
  color: var(--neon-red);
  font-size: 2.2rem;
  text-shadow: 0 0 10px var(--neon-red), 2px 2px 0 #000;
}

.dmg-popup.armor {
  color: var(--neon-blue);
  font-size: 1.2rem;
  margin-top: 20px;
}


.critical-notice {
  position: absolute;
  font-family: 'Oswald', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--neon-purple);
  text-shadow: 0 0 15px var(--neon-purple), 3px 3px 0 #000;
  pointer-events: none;
  z-index: 50;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: critFloat 1.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes critFloat {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.5) rotate(-5deg); filter: brightness(2); }
  20%  { opacity: 1; transform: translate(-50%, -40px) scale(1.2) rotate(2deg); filter: brightness(1.5); }
  80%  { opacity: 1; transform: translate(-50%, -60px) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -100px) scale(0.8); }
}

.target-board.crit-flash {
  box-shadow: 0 0 40px var(--neon-purple), inset 0 0 40px var(--neon-purple);
  border-color: var(--neon-purple);
}

.bullseye-notice {
  position: absolute;
  font-family: 'Oswald', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 0 20px var(--yellow), 3px 3px 0 #000;
  pointer-events: none;
  z-index: 60;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: bullseyeFloat 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes bullseyeFloat {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.3); filter: brightness(3); }
  25%  { opacity: 1; transform: translate(-50%, -60px) scale(1.4); filter: brightness(2); }
  75%  { opacity: 1; transform: translate(-50%, -80px) scale(1.1); filter: brightness(1); }
  100% { opacity: 0; transform: translate(-50%, -120px) scale(1); }
}

.target-board.bullseye-flash {
  box-shadow: 0 0 60px var(--yellow), inset 0 0 60px var(--yellow);
  border-color: var(--yellow);
}

@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.5); }
  20% { transform: translate(-50%, -20px) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(1); }
}

/* Screen shake */
@keyframes shake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(4px, -2px); }
  50% { transform: translate(-4px, 2px); }
  75% { transform: translate(2px, 2px); }
  100% { transform: translate(-2px, -2px); }
}
.screen-shake {
  animation: shake 0.2s cubic-bezier(.36,.07,.19,.97) both;
}

/* ============================================
   HUD / AMMO SELECTOR
   ============================================ */
.hud-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.8);
  border-top: var(--border);
  border-top-color: var(--yellow);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  z-index: 100;
}

.ammo-selector {
  display: flex;
  gap: 10px;
  background: var(--bg-dark);
  padding: 10px;
  border: 2px solid #333;
  box-shadow: var(--shadow);
}

.ammo-type-btn {
  background: #111;
  border: 2px solid #444;
  color: #888;
  padding: 10px;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  text-align: center;
  min-width: 80px;
  transition: all 0.1s;
}

.ammo-type-btn.active {
  border-color: var(--yellow);
  background: #222;
  color: #fff;
  transform: translateY(-5px);
  box-shadow: 0 5px 0 var(--yellow);
}

.ammo-type-btn:hover:not(.active) {
  background: #1a1a1a;
  border-color: #666;
}

.ammo-type-btn.empty {
  opacity: 0.5;
  cursor: not-allowed;
}

.ammo-type-btn .ammo-name {
  display: block;
  font-size: 1.1rem;
  font-weight: bold;
}

.ammo-type-btn .ammo-count {
  display: block;
  font-size: 1.4rem;
  color: var(--neon-green);
  margin-top: 5px;
  text-shadow: 0 0 5px rgba(57, 255, 20, 0.4);
}

.ammo-type-btn.empty .ammo-count {
  color: var(--neon-red);
}

/* Specific ammo colors */
.ammo-type-btn[data-type="featured"].active { border-color: var(--neon-green); box-shadow: 0 5px 0 var(--neon-green); }
.ammo-type-btn[data-type="JHP"].active { border-color: var(--neon-red); box-shadow: 0 5px 0 var(--neon-red); }
.ammo-type-btn[data-type="SUB"].active { border-color: var(--neon-blue); box-shadow: 0 5px 0 var(--neon-blue); }
.ammo-type-btn[data-type="PAK"].active { border-color: var(--neon-purple); box-shadow: 0 5px 0 var(--neon-purple); }

/* Weapon Stats Display */
.weapon-stats {
  background: var(--bg-dark);
  border: 2px solid #333;
  padding: 10px 20px;
  box-shadow: var(--shadow);
  max-width: 300px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.stat-label { color: #888; }
.stat-val.dmg-health { color: var(--neon-red); font-weight: bold; }
.stat-val.dmg-armor { color: var(--neon-blue); font-weight: bold; }

/* Readout panel (Combat Log) */
.readout-panel {
  position: absolute;
  top: 10rem; /* Stacked below XP */
  left: 2rem;
  background: rgba(0,0,0,0.7);
  border: var(--border);
  padding: 0.8rem;
  width: 250px;
}
.readout-panel h3 { color: var(--yellow); margin-bottom: 5px; }
.readout-log {
  height: 150px;
  overflow-y: auto;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.log-line {
  margin-bottom: 4px;
  opacity: 0.8;
}
.log-line.fire { color: #fff; }
.log-line.empty { color: var(--neon-red); }
.log-line.vip { color: var(--neon-purple); font-weight: bold; }
.log-line.reward { color: var(--neon-green); font-weight: bold; }
.log-line.levelup { color: var(--yellow); font-weight: bold; text-shadow: 0 0 8px var(--yellow); }

/* Shoot Button */
.shoot-btn-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0; /* Gap handled by internal margins/padding for tighter integration */
  margin-top: 3rem;
  z-index: 100;
}

.shoot-btn {
  font-family: 'Oswald', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1rem 3rem;
  background: var(--neon-red);
  color: #fff;
  border: var(--border);
  box-shadow: 6px 6px 0 #000;
  cursor: pointer;
  transition: all 0.1s;
  letter-spacing: 2px;
}

.shoot-btn:hover {
  background: #ff3333;
  box-shadow: 4px 4px 0 #000, 0 0 30px rgba(255, 7, 58, 0.5);
  transform: translate(2px, 2px);
}

.shoot-btn:active {
  transform: translate(6px, 6px);
  box-shadow: 0px 0px 0 #000;
}

/* Navigation */
/* ============================================
   TOP NAVIGATION BAR
   ============================================ */
.top-nav-area {
  position: absolute;
  top: 1rem;
  left: 2rem;
  width: 250px;
  display: flex;
  gap: 8px;
  z-index: 1000;
}

.nav-button {
  flex: 1;
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  padding: 6px 2px;
  background: var(--bg-dark);
  color: var(--yellow);
  border: 2px solid var(--yellow);
  box-shadow: 3px 3px 0 #000;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-button:hover {
  background: var(--yellow);
  color: #000;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #000;
}

.nav-button.active {
  background: var(--neon-purple);
  border-color: var(--neon-purple);
  color: #fff;
  box-shadow: 3px 3px 0 #000, 0 0 10px rgba(176, 38, 255, 0.4);
}

/* Reset Button */
.reset-btn {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 10px 40px;
  background: var(--bg-dark);
  color: #666;
  border: 2px solid #333;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 2px;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
  margin-top: 10px;
  width: 220px;
}

.reset-btn:hover {
  background: #222;
  color: var(--neon-red);
  border-color: var(--neon-red);
  box-shadow: 0 0 15px rgba(255, 7, 58, 0.2);
}

/* Target reset flash */
@keyframes resetFlash {
  0%   { filter: brightness(3) saturate(0); }
  100% { filter: brightness(1) saturate(1); }
}

.target-board.reset-flash {
  animation: resetFlash 0.5s ease-out;
}

/* ============================================
   CREDITS DISPLAY (Synced with index.html)
   ============================================ */
.player-credits-wrap {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  z-index: 1001;
  background: var(--bg-dark);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 0.5rem 1rem;
  transform: rotate(1deg);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: auto;
  min-width: 150px;
}

.player-credits-wrap .credits-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  color: #888;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.player-credits-wrap .credits-value {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.4rem; /* match index.html font-size */
  color: var(--yellow);
  text-shadow: 1px 1px 0 #000;
  transition: all 0.1s ease;
}

.credits-ping {
  animation: creditsPing 0.3s ease-out;
}

@keyframes creditsPing {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.2); filter: brightness(1.8); text-shadow: 0 0 15px var(--yellow); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* ============================================
   XP & LEVEL PANEL (Compact sidebar style)
   ============================================ */
.xp-level-panel {
  position: absolute;
  top: 3.5rem; /* Stacked below Menu */
  left: 2rem;
  background: rgba(0,0,0,0.85);
  border: 2px solid var(--neon-blue);
  padding: 0.6rem 1rem;
  width: 250px; /* match log width */
  z-index: 200;
  box-shadow: 4px 4px 0 #000;
}

.xp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.xp-label {
  font-size: 0.75rem;
  color: var(--neon-blue);
  font-weight: bold;
}

.level-tag {
  background: var(--neon-blue);
  color: #000;
  font-weight: bold;
  font-size: 0.7rem;
  padding: 1px 6px;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
}

.xp-bar-wrap {
  width: 100%;
  height: 4px;
  background: #111;
  border: 1px solid #333;
  margin-bottom: 6px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: var(--neon-blue);
  box-shadow: 0 0 10px var(--neon-blue);
  transition: width 0.5s ease;
}

.session-stats-mini {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.session-stats-mini span span {
  color: #aaa;
  font-weight: bold;
}

.reward-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.reward-label {
  color: #888;
}

.reward-val {
  color: var(--yellow);
  font-weight: bold;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
}

.reward-val.xp-val   { color: var(--neon-blue); }
.reward-val.level-val {
  color: var(--neon-green);
  font-size: 1.2rem;
  text-shadow: 0 0 6px rgba(57,255,20,0.5);
}

/* XP progress bar */
.xp-bar-wrap {
  width: 100%;
  height: 6px;
  background: #222;
  border: 1px solid #444;
  margin: 6px 0;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
  transition: width 0.5s ease;
  box-shadow: 0 0 6px var(--neon-blue);
}

/* Session stats */
.session-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-top: 3px;
}

.session-label { color: #666; }
.session-val   { color: #aaa; font-weight: bold; }

/* ============================================
   MOBILE — compact layout
   ============================================ */
/* ============================================
   COMBAT / LIVE ACTION STYLES
   ============================================ */
.btn-sub-row {
  display: flex;
  gap: 15px;
  width: 100%;
  justify-content: center;
}

.additional-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px; /* Increased from 15px to push buttons further down */
}

.live-action-btn {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 12px 30px;
  background: var(--bg-dark);
  color: var(--orange);
  border: 2px solid var(--orange);
  cursor: pointer;
  transition: all 0.2s;
  clip-path: polygon(5% 0, 100% 0, 95% 100%, 0% 100%);
  width: 260px;
  position: relative;
  overflow: hidden;
}

.live-action-btn:hover {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 0 20px rgba(209, 86, 16, 0.4);
}

.live-action-btn.active {
  background: var(--neon-red);
  border-color: var(--neon-red);
  color: #fff;
  box-shadow: 0 0 20px var(--neon-red);
  animation: pulseRed 2s infinite;
}

@keyframes pulseRed {
  0% { box-shadow: 0 0 5px var(--neon-red); }
  50% { box-shadow: 0 0 20px var(--neon-red); }
  100% { box-shadow: 0 0 5px var(--neon-red); }
}

.enemy-status-overlay {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  background: rgba(0,0,0,0.85);
  padding: 10px;
  border: 1px solid var(--neon-red);
  box-shadow: 0 0 20px rgba(255, 7, 58, 0.3);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.enemy-status-overlay.visible { opacity: 1; }

.enemy-name-tag {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--neon-red);
  text-transform: uppercase;
  text-align: center;
  background: rgba(0,0,0,0.8);
  padding: 2px 8px;
  border: 1px solid var(--neon-red);
  margin-bottom: 4px;
  letter-spacing: 1px;
  text-shadow: 0 0 5px var(--neon-red);
}

.enemy-bar-wrap, .player-bar-wrap {
  position: relative;
  height: 14px;
  background: rgba(0,0,0,0.6);
  border: 1px solid #444;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 100%;
  transition: width 0.3s ease-out;
}

.bar-fill.health { background: var(--neon-red); box-shadow: 0 0 8px var(--neon-red); }
.bar-fill.armor { background: var(--neon-blue); box-shadow: 0 0 8px var(--neon-blue); }

.bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
  letter-spacing: 1px;
}

.player-combat-stats {
  position: fixed;
  top: 7.5rem;
  right: 2rem;
  background: var(--bg-dark);
  border: 2px solid #ed1c1c;
  padding: 10px;
  width: 200px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  z-index: 1001;
}

.player-combat-stats.hidden { display: none; }

.player-bar-group { display: flex; flex-direction: column; gap: 8px; }

.enemy-muzzle-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, #fff 0%, var(--orange) 30%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  z-index: 100;
  pointer-events: none;
  opacity: 0;
}

.flash-active { animation: muzzleFlashAnim 0.15s ease-out forwards; }

@keyframes muzzleFlashAnim {
  0% { transform: translate(-50%, -50%) scale(0.1); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.player-hit-flash {
  position: fixed;
  inset: 0;
  background: rgba(255, 0, 0, 0.4);
  z-index: 1000;
  pointer-events: none;
  animation: hitFlashAnim 0.3s ease-out forwards;
}

@keyframes hitFlashAnim {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* ============================================
   MOBILE — compact layout
   ============================================ */
@media (max-width: 600px) {
  .smoke-overlay { opacity: 0.3; } /* less distraction */
  
  .btn-sub-row { flex-direction: column; gap: 5px; }
  .player-combat-stats { 
    width: 100%; 
    position: fixed; 
    bottom: 90px; 
    left: 0; 
    right: 0; 
    z-index: 50; 
    padding: 5px;
    border-left: none;
    border-right: none;
    background: rgba(0,0,0,0.9);
  }

  /* Compact Top Nav Area */
  .top-nav-area {
    top: 0.2rem;
    left: 0;
    width: 100%;
    padding: 0 0.5rem;
    gap: 4px;
    justify-content: center;
  }

  .nav-button {
    font-size: 0.65rem;
    padding: 4px 6px;
    box-shadow: 2px 2px 0 #000;
  }

  .nav-button.active {
    box-shadow: 2px 2px 0 #000;
  }

  /* Header / Marquee */
  .header {
    padding: 0.2rem 0.5rem;
    margin-top: 2rem;
  }

  .marquee-sign {
    font-size: 1.1rem;
    padding: 0.15rem 0.5rem;
    letter-spacing: 0.5px;
    transform: rotate(0deg);
  }

  /* Combat Log & XP - Combined Compact Row */
  .readout-panel {
    position: fixed;
    top: 3.5rem;        
    left: 0;
    width: 55%;
    height: 2rem;
    padding: 0 0.5rem;
    border: none;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    z-index: 60;
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.95);
  }

  .readout-panel h3 {
    font-size: 0.6rem;
    color: var(--yellow);
    margin: 0 5px 0 0;
    white-space: nowrap;
  }

  .readout-log {
    height: 1.2rem;
    font-size: 0.65rem;
    flex-direction: row;
    align-items: center;
    overflow: hidden;
    gap: 0.5rem;
    padding: 0;
  }

  .log-line { margin: 0; white-space: nowrap; }

  .xp-level-panel {
    position: fixed;
    top: 3.5rem;
    right: 0;
    width: 45%; 
    height: 2rem;
    border: none;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    border-left: 1px solid #333;
    padding: 0 0.5rem;
    z-index: 60;
    background: rgba(0,0,0,0.95);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .xp-header { margin-bottom: 0; width: 100%; gap: 5px; }
  .xp-label { font-size: 0.6rem; white-space: nowrap; order: 2; }
  .level-tag { font-size: 0.6rem; padding: 0 4px; clip-path: none; order: 1; }
  .xp-bar-wrap { display: none; }
  .session-stats-mini { display: none; }

  /* Credits strip - make it a pill at the top or floaty */
  .player-credits-wrap {
    top: 5.8rem;
    right: 0.5rem;
    padding: 0.2rem 0.6rem;
    min-width: 100px;
    transform: rotate(0deg);
    border-width: 2px;
  }

  .player-credits-wrap .credits-label { font-size: 0.55rem; }
  .player-credits-wrap .credits-value { font-size: 1.1rem; }

  /* Range Container & Target */
  .range-container {
    height: calc(100vh - 160px);
    margin-top: 5rem;
    justify-content: flex-start;
  }

  .target-board {
    width: 180px;
    height: 240px;
    margin-top: 10px;
  }

  .ring-1 { width: 160px; height: 160px; }
  .ring-2 { width: 110px; height: 110px; }
  .ring-3 { width: 60px;  height: 60px; }
  .ring-bullseye { width: 22px; height: 22px; }

  /* Buttons area */
  .shoot-btn-container {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0 1rem;
  }

  .shoot-btn {
    font-size: 1.8rem;
    padding: 0.5rem 0;
    width: 100%;
    box-shadow: 4px 4px 0 #000;
  }

  .additional-actions {
    margin-top: 0.5rem;
    flex-direction: row;
    gap: 8px;
    width: 100%;
  }

  .live-action-btn, .reset-btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 8px 0;
    width: auto;
    margin-top: 0;
    clip-path: none;
  }

  /* HUD Redesign for Mobile */
  .hud-container {
    padding: 0.3rem 0.4rem;
    gap: 4px;
  }

  .weapon-stats {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    justify-content: space-around;
  }

  .stat-row {
    font-size: 0.7rem;
    background: rgba(0,0,0,0.5);
    padding: 2px 8px;
    border: 1px solid #333;
  }

  .stat-label { display: none; } /* Hide labels to save space, values are color coded */
  .stat-row::before {
    content: attr(data-compact-label);
    margin-right: 4px;
    color: #888;
  }

  .ammo-selector {
    padding: 4px;
    gap: 4px;
  }

  .ammo-type-btn {
    min-width: 45px;
    padding: 4px 2px;
  }

  .ammo-type-btn .ammo-name { font-size: 0.75rem; }
  .ammo-type-btn .ammo-count { font-size: 0.85rem; margin-top: 0; }
  
  /* Modal adjustments */
  .session-modal-content {
    padding: 1.5rem 1rem;
    width: 95%;
  }
  .session-title { font-size: 1.5rem; margin-bottom: 1.5rem; }
  .session-grid { gap: 0.8rem; margin-bottom: 1.5rem; }
  .session-stat-box { padding: 0.8rem; }
  .session-stat-box .value { font-size: 1.6rem; }
  .continue-btn { font-size: 1.2rem; padding: 0.8rem 2rem; }
}

/* ============================================
   SESSION SUMMARY MODAL
   ============================================ */
.session-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none; /* Controlled by JS */
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.session-modal.active {
  display: flex;
  animation: modalFadeIn 0.3s ease-out forwards;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(1.1); }
  to { opacity: 1; transform: scale(1); }
}

.session-modal-content {
  background: rgba(26, 26, 27, 0.85);
  border: 4px solid var(--neon-blue);
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.3);
  padding: 3rem;
  max-width: 600px;
  width: 100%;
  text-align: center;
  position: relative;
  clip-path: polygon(10% 0, 100% 0, 100% 90%, 90% 100%, 0 100%, 0 10%);
}

.session-title {
  font-size: 3rem;
  color: var(--neon-blue);
  letter-spacing: 4px;
  margin-bottom: 2.5rem;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.session-stat-box {
  background: rgba(0,0,0,0.5);
  border: 2px solid #333;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.session-stat-box.accent {
  border-color: var(--yellow);
}

.session-stat-box.reward {
  border-color: var(--neon-green);
  grid-column: span 1;
}

.session-stat-box.reward:nth-last-child(1) {
  grid-column: span 2;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.session-stat-box .label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.session-stat-box .value {
  font-family: 'Oswald', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
}

.session-stat-box.accent .value { color: var(--yellow); }
.session-stat-box.reward .value { color: var(--neon-green); }

.continue-btn {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1rem 3rem;
  background: var(--neon-green);
  color: #000;
  border: none;
  cursor: pointer;
  box-shadow: 6px 6px 0 #000;
  transition: all 0.1s;
  letter-spacing: 2px;
}

.continue-btn:hover {
  background: #2ce610;
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 #000;
}

.continue-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 #000;
}

@media (max-width: 600px) {
  .session-modal-content {
    padding: 2rem 1rem;
  }
  .session-title { font-size: 1.8rem; }
  .session-stat-box .value { font-size: 1.8rem; }
  .session-grid { grid-template-columns: 1fr; }
  .session-stat-box.reward:nth-last-child(1) { grid-column: span 1; }
}

/* ============================================
   EPIC LEVEL UP BANNER
   ============================================ */
.level-up-banner {
  display: none; /* Shown via JS */
  position: relative;
  margin: -1rem 0 2rem 0;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.4);
  border-top: 2px solid var(--yellow);
  border-bottom: 2px solid var(--yellow);
  overflow: hidden;
  animation: bannerSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.level-up-banner.active {
  display: block;
}

.banner-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--yellow) 0%, transparent 70%);
  opacity: 0.2;
  animation: glowPulse 2s ease-in-out infinite;
}

.banner-content {
  position: relative;
  z-index: 2;
}

.banner-subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--yellow);
  letter-spacing: 5px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeInUp 0.5s 0.2s ease-out forwards;
}

.banner-title {
  font-family: 'Oswald', sans-serif;
  font-size: 4.5rem;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 20px var(--yellow), 0 0 40px var(--orange);
  margin-bottom: 1rem;
  font-weight: 800;
  letter-spacing: -2px;
  transform: scale(0.8);
  opacity: 0;
  animation: epicPop 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.banner-levels {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  font-family: 'Oswald', sans-serif;
  font-size: 2.5rem;
  font-weight: bold;
  opacity: 0;
  animation: fadeInUp 0.5s 0.6s ease-out forwards;
}

.old-level {
  color: #666;
}

.level-arrow {
  color: var(--yellow);
  font-size: 1.5rem;
  animation: arrowPulse 1s ease-in-out infinite;
}

.new-level {
  color: var(--neon-green);
  text-shadow: 0 0 15px var(--neon-green);
  font-size: 3.5rem;
}

@keyframes bannerSlideIn {
  from { transform: translateX(-100%) skewX(-15deg); opacity: 0; }
  to { transform: translateX(0) skewX(0); opacity: 1; }
}

@keyframes epicPop {
  0% { transform: scale(0.5); opacity: 0; filter: brightness(3); }
  70% { transform: scale(1.1); opacity: 1; filter: brightness(1.5); }
  100% { transform: scale(1); opacity: 1; filter: brightness(1); }
}

@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.2); }
}

@keyframes arrowPulse {
  0%, 100% { transform: translateX(0); opacity: 0.5; }
  50% { transform: translateX(5px); opacity: 1; }
}

/* ============================================
   LOOT MODAL STYLES (COMPACT)
   ============================================ */
.loot-modal .session-modal-content {
  border-color: var(--neon-green);
  box-shadow: 0 0 50px rgba(57, 255, 20, 0.2);
  padding: 1.5rem;
  max-width: 450px;
}

.loot-title {
  color: var(--neon-green);
  text-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.loot-crate-visual {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 1rem;
}

.crate-icon {
  font-size: 3.5rem;
  z-index: 2;
  animation: crateFloat 3s ease-in-out infinite;
}

.crate-glow {
  position: absolute;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--neon-green) 0%, transparent 70%);
  opacity: 0.3;
  animation: glowPulse 2s infinite;
}

@keyframes crateFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

.loot-ammo-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 5px;
}

.loot-ammo-item {
  background: rgba(255,255,255,0.05);
  padding: 5px 12px;
  border-left: 3px solid var(--neon-green);
  display: flex;
  justify-content: space-between;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
}

.claim-btn {
  background: var(--neon-green);
  border-color: var(--neon-green);
  color: #000;
  margin-top: 1.5rem;
  padding: 0.8rem 2rem;
  font-size: 1.2rem;
}

.claim-btn:hover {
  background: #2ce610;
  box-shadow: 0 0 30px rgba(57, 255, 20, 0.4), 6px 6px 0 #000;
}

/* Specific session stat box overrides for loot */
.loot-grid {
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.loot-grid .session-stat-box.reward {
  border-color: var(--neon-green);
  min-height: 80px;
  padding: 1rem;
}

.loot-grid .session-stat-box .value {
    font-size: 2rem;
}

@media (max-width: 600px) {
  .loot-title { font-size: 1.4rem; }
  .crate-icon { font-size: 2.5rem; }
  .loot-grid { grid-template-columns: 1fr; }
}

/* ============================================
   SYSTEM MENU & SETTINGS
   ============================================ */
/* menu-btn styles removed and integrated into .nav-button */

.settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 3000;
  display: none; /* Controlled by JS */
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}

.settings-modal.active {
  display: flex;
  animation: modalFadeIn 0.3s ease-out forwards;
}

.settings-container {
  background: #0d0d0d;
  border: 4px solid var(--neon-red);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 7, 58, 0.4);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 400px;
  width: 90%;
  position: relative;
}

.settings-modal.active .settings-container {
  transform: scale(1);
}

.menu-action-btn,
.new-game-btn {
  background: var(--neon-red);
  color: #fff;
  border: none;
  padding: 1rem 2rem;
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
  margin-top: 1rem;
  transition: all 0.1s;
  width: 100%;
}

.menu-action-btn {
  background: var(--neon-blue);
  margin-bottom: 0.5rem;
}

.menu-action-btn:hover {
  background: #33e4ff;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000;
}

.new-game-btn:hover {
  background: #ff3333;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000;
}

.menu-action-btn:active,
.new-game-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.close-shop-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--neon-red);
  color: #fff;
  border: 2px solid #000;
  font-family: 'Oswald', sans-serif;
  font-weight: bold;
  padding: 5px 12px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
  z-index: 10;
}

/* ============================================
   GAME OVER MODAL STYLES (INTENSE RED)
   ============================================ */
.game-over-modal {
  background: rgba(20, 0, 0, 0.95);
  backdrop-filter: blur(10px);
}

.game-over-content {
  border-color: var(--neon-red) !important;
  box-shadow: 0 0 60px rgba(255, 7, 58, 0.4) !important;
  background: #000 !important;
  text-align: center;
}

.game-over-title {
  color: var(--neon-red) !important;
  font-size: 3.5rem !important;
  text-shadow: 0 0 20px var(--neon-red);
  margin-bottom: 0.5rem;
  position: relative;
}

.game-over-msg {
  color: #888;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 2px;
  margin-bottom: 2rem;
}

.skull-visual {
  font-size: 5rem;
  margin: 2rem 0;
  animation: pulseSkull 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--neon-red));
}

.restart-btn {
  background: var(--neon-red) !important;
  border-color: var(--neon-red) !important;
  color: #fff !important;
  animation: pulseRestart 1.5s infinite;
  font-size: 1.4rem !important;
  padding: 1rem 3rem !important;
}

/* ============================================
   AMBIENCE & ANIMATIONS
   ============================================ */
.smoke-overlay {
  position: fixed;
  inset: 0;
  background: url('https://www.transparenttextures.com/patterns/asfalt-dark.png'); /* subtle grain */
  opacity: 0.15;
  pointer-events: none;
  z-index: 5; /* Increased to be above main container but below modals */
}

.smoke-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08), transparent 70%);
  filter: blur(60px);
  animation: smokeMove 30s infinite alternate ease-in-out;
}

@keyframes smokeMove {
  0% { transform: translate(-5%, -5%) scale(1); opacity: 0.3; }
  50% { transform: translate(5%, 5%) scale(1.1); opacity: 0.6; }
  100% { transform: translate(-5%, -5%) scale(1); opacity: 0.3; }
}

@keyframes signFlicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; filter: brightness(1) drop-shadow(0 0 20px rgba(244, 192, 37, 0.4)); }
  20%, 24%, 55% { opacity: 0.7; filter: brightness(0.5) drop-shadow(0 0 5px rgba(244, 192, 37, 0.1)); }
}

.restart-btn:hover {
  background: #ff4d6d !important;
  box-shadow: 0 0 40px var(--neon-red), 6px 6px 0 #000;
}

@keyframes pulseSkull {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; filter: brightness(1.5); }
}

@keyframes pulseRestart {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px var(--neon-red); }
  50% { transform: scale(1.05); box-shadow: 0 0 40px var(--neon-red), 0 0 10px #fff; }
}

/* Glitch Effect Shorthand */
.glitch-wrapper {
  position: relative;
}

.game-over-title::before,
.game-over-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0.8;
}

.game-over-title::before {
  color: #0ff;
  z-index: -1;
  animation: glitch 3s infinite;
}

.game-over-title::after {
  color: #f0f;
  z-index: -2;
  animation: glitch 2s infinite reverse;
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}
