/* ZOMBIE KILLER - Estilos principales */

/* Reset y configuración base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #06101a;
  font-family: Inter, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

canvas {
  display: none; /* Oculto inicialmente */
  width: 100vw;
  height: 100vh;
}

/* HUD y elementos de interfaz - REDISEÑADO */

.panel {
  background: rgba(6, 20, 33, 0.6);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 160, 255, 0.18);
  backdrop-filter: blur(6px);
}

/* ========== PANEL IZQUIERDO: VIDA Y ESTAMINA ========== */
#hud {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 20;
  pointer-events: none;
  display: none;
}

.hud-left-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-player-stats {
  background: linear-gradient(135deg, rgba(10, 20, 35, 0.85), rgba(5, 15, 25, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 220px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hud-health-section,
.hud-stamina-section {
  margin-bottom: 10px;
}

.hud-stamina-section {
  margin-bottom: 0;
}

.hud-bar-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.hud-bar-icon {
  font-size: 12px;
}

.hud-bar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.5);
  flex: 1;
}

.hud-bar-value {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Barra de salud */
.hud-health-bar {
  position: relative;
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 80, 80, 0.2);
}

.hud-health-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff4444, #ff6b6b);
  border-radius: 5px;
  transition: width 200ms ease-out;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.hud-health-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
  border-radius: 5px 5px 0 0;
}

/* Barra de estamina */
.hud-stamina-bar {
  position: relative;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 200, 0, 0.2);
}

.hud-stamina-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffaa00, #ffcc44);
  border-radius: 4px;
  transition: width 100ms linear;
  box-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
}

.hud-stamina-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
  border-radius: 4px 4px 0 0;
}

/* Efecto de brillo en las barras */
.hud-bar-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Efecto soda activa */
.hud-soda-effect {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(0, 200, 255, 0.15), rgba(0, 255, 200, 0.1));
  border: 1px solid rgba(0, 255, 200, 0.3);
  border-radius: 8px;
  animation: sodaPulse 1.5s infinite;
}

@keyframes sodaPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 200, 0.2); }
  50% { box-shadow: 0 0 20px rgba(0, 255, 200, 0.4); }
}

.soda-icon {
  font-size: 14px;
}

.soda-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #00ffc8;
}

.soda-timer {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin-left: auto;
}

/* ========== PANEL SUPERIOR CENTRAL: OLEADA ========== */
#hudTop {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
  display: none;
}

.hud-top-panel {
  display: flex;
}

.hud-wave-container {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(10, 20, 35, 0.9), rgba(5, 15, 25, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  padding: 10px 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.hud-wave-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wave-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.4);
}

.wave-number {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 20px rgba(255, 100, 100, 0.5);
}

.hud-wave-divider {
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.hud-enemies-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.enemies-icon {
  font-size: 20px;
  filter: drop-shadow(0 0 8px rgba(100, 255, 100, 0.5));
}

.enemies-count {
  font-size: 24px;
  font-weight: 900;
  color: #ff6b6b;
  text-shadow: 0 0 15px rgba(255, 100, 100, 0.5);
  min-width: 30px;
}

.enemies-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
}

/* ========== PANEL SUPERIOR DERECHO: DINERO Y KILLS ========== */
#hudTopRight {
  position: fixed;
  top: 20px;
  right: 100px;
  z-index: 20;
  pointer-events: none;
  display: none;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.hud-top-right-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.hud-money-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(255, 200, 0, 0.15), rgba(255, 150, 0, 0.1));
  border: 1px solid rgba(255, 200, 0, 0.3);
  border-radius: 25px;
  padding: 8px 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(255, 200, 0, 0.15);
}

.money-icon {
  font-size: 18px;
}

.money-value {
  font-size: 20px;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
  min-width: 50px;
}

.hud-kills-container {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(10, 20, 35, 0.85), rgba(5, 15, 25, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 6px 14px;
  backdrop-filter: blur(10px);
}

.kills-icon {
  font-size: 14px;
}

.kills-value {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.kills-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
}

/* ========== MUNICIÓN - REDISEÑADO ========== */
.ammo {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: none;
  z-index: 20;
  pointer-events: none;
}

.ammo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(10, 20, 35, 0.9), rgba(5, 15, 25, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ammo-icon {
  font-size: 20px;
  opacity: 0.8;
}

.ammo-current {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  min-width: 40px;
  text-align: right;
}

.ammo-divider {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 300;
}

.ammo-reserve {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  min-width: 30px;
}

.ammo-infinite {
  font-size: 28px;
  font-weight: 400;
  color: #fff;
}

/* Estado de munición baja */
.ammo.low .ammo-current {
  color: #ff6b6b;
  animation: ammoLowPulse 0.5s infinite;
}

@keyframes ammoLowPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Estado sin munición */
.ammo.empty .ammo-current {
  color: #ff4444;
}

/* ========== MIRA - MEJORADA ========== */
#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 15;
  display: none;
}

#crosshair:before,
#crosshair:after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5), 0 0 8px rgba(255, 255, 255, 0.3);
  border-radius: 1px;
}

#crosshair:before {
  width: 12px;
  height: 2px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#crosshair:after {
  width: 2px;
  height: 12px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Punto central de la mira */
#crosshair .dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 3px;
  background: #ff4444;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255, 68, 68, 0.8);
}

/* ========== EFECTOS DE DAÑO - MEJORADO ========== */
.damage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(255, 0, 0, 0.3), transparent 50%),
    radial-gradient(ellipse at 0% 50%, rgba(255, 0, 0, 0.2), transparent 40%),
    radial-gradient(ellipse at 100% 50%, rgba(255, 0, 0, 0.2), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 0, 0, 0.15), transparent 40%);
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.damage.active {
  opacity: 1;
  animation: damageFlash 0.3s ease-out;
}

@keyframes damageFlash {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 0; }
}

/* ========== MIRA TELESCÓPICA - FRANCOTIRADOR ========== */
#scope {
  position: fixed;
  inset: 0;
  display: none;
  pointer-events: none;
  z-index: 16;
}

/* Capa de desenfoque exterior (fuera del círculo de la mira) */
#scope::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.3);
  /* Máscara para dejar el centro sin desenfoque */
  mask: radial-gradient(circle at 50% 50%, transparent 24vh, black 25vh);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 24vh, black 25vh);
}

/* Retícula de la mira */
#scope::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 50vh;
  height: 50vh;
  background:
    /* Cruz horizontal */
    linear-gradient(90deg, transparent 0%, transparent 10%, rgba(0,0,0,0.85) 10%, rgba(0,0,0,0.85) 46%, transparent 46%, transparent 54%, rgba(0,0,0,0.85) 54%, rgba(0,0,0,0.85) 90%, transparent 90%),
    /* Cruz vertical */
    linear-gradient(180deg, transparent 0%, transparent 10%, rgba(0,0,0,0.85) 10%, rgba(0,0,0,0.85) 46%, transparent 46%, transparent 54%, rgba(0,0,0,0.85) 54%, rgba(0,0,0,0.85) 90%, transparent 90%),
    /* Punto central rojo */
    radial-gradient(circle at 50% 50%, #ff0000 3px, transparent 3px),
    /* Borde circular de la mira */
    radial-gradient(circle at 50% 50%, transparent 96%, rgba(30,30,30,0.95) 97%);
  background-size: 100% 2px, 2px 100%, 100% 100%, 100% 100%;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(20,20,20,0.9), 0 0 30px rgba(0,0,0,0.5);
}

/* ========== ARMAS - CONFIGURACIÓN DE TAMAÑO ========== */
/* 
   AJUSTA ESTOS VALORES PARA CAMBIAR EL TAMAÑO DE CADA ARMA:
   - --weapon-scale: Pistola (1 = 100%, 0.5 = 50%, 1.5 = 150%)
   - --sniper-scale: Francotirador
   - --knife-scale: Cuchillo
*/
:root {
  --weapon-scale: 0.7;   /* Pistola - ajustar aquí */
  --sniper-scale: 1.1;   /* Francotirador - ajustar aquí */
  --knife-scale: 0.6;    /* Cuchillo - ajustar aquí */
}

/* Estilos base compartidos */
#weapon, #sniper, #knife {
  position: fixed;
  left: 60%;
  bottom: -5%; /* Un poco más abajo para ocultar el borde inferior */
  transform: translateX(-50%);
  transform-origin: center bottom; /* Escalar desde abajo */
  pointer-events: none;
  z-index: 9;
  height: auto;
  will-change: transform;
  display: none;
}

/* Tamaño individual de cada arma */
#weapon {
  width: calc(40vw * var(--weapon-scale));
  max-width: calc(720px * var(--weapon-scale));
}

#sniper {
  width: calc(40vw * var(--sniper-scale));
  max-width: calc(720px * var(--sniper-scale));
}

#knife {
  width: calc(55vw * var(--knife-scale));
  max-width: calc(720px * var(--knife-scale));
  left: 65%; /* Un poco más a la derecha */
}

/* ========== SLOTS DE ARMAS - REDISEÑADO ========== */
#weaponSlots {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 25;
  pointer-events: none;
}

#weaponSlots .slot {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(10, 20, 35, 0.8), rgba(5, 15, 25, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

#weaponSlots .slot::before {
  content: attr(data-key);
  position: absolute;
  top: -8px;
  left: -8px;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

#weaponSlots .slot.selected {
  border-color: rgba(100, 255, 150, 0.6);
  background: linear-gradient(135deg, rgba(20, 40, 30, 0.9), rgba(10, 30, 20, 0.95));
  box-shadow: 0 0 20px rgba(100, 255, 150, 0.3), 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: scale(1.05);
}

#weaponSlots .slot.selected::before {
  background: rgba(100, 255, 150, 0.2);
  border-color: rgba(100, 255, 150, 0.4);
  color: #64ff96;
}

#weaponSlots .slot img {
  max-width: 44px;
  max-height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: filter 0.2s;
}

#weaponSlots .slot.selected img {
  filter: drop-shadow(0 0 8px rgba(100, 255, 150, 0.4));
}

/* ========== FPS COUNTER ========== */
#fps {
  position: fixed;
  left: 20px;
  top: 20px;
  display: none;
  z-index: 25;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.2);
}

/* ========== PROMPTS Y HINTS ========== */
#shopPrompt, #bottomHint, #vehiclePrompt {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  display: none;
  z-index: 26;
  color: #fff;
  background: linear-gradient(135deg, rgba(10, 20, 35, 0.9), rgba(5, 15, 25, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#shopPrompt kbd, #bottomHint kbd, #vehiclePrompt kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 8px;
  margin: 0 4px;
  font-family: monospace;
  font-size: 12px;
}

#vehiclePrompt {
  border-color: rgba(100, 200, 100, 0.3);
}

#bottomHint {
  z-index: 27;
  border-color: rgba(255, 100, 100, 0.3);
}


/* ========== ANIMACIONES DE VALORES HUD ========== */
.hud-value-change {
  animation: valueChange 0.3s ease-out;
}

@keyframes valueChange {
  0% { transform: scale(1.3); color: #fff; }
  100% { transform: scale(1); }
}

/* Animación para dinero ganado */
.money-gained {
  animation: moneyGain 0.4s ease-out;
}

@keyframes moneyGain {
  0% { transform: scale(1.2); filter: brightness(1.5); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Animación para kills */
.kills-gained {
  animation: killGain 0.3s ease-out;
}

@keyframes killGain {
  0% { transform: scale(1.3); color: #ff6b6b; }
  100% { transform: scale(1); }
}

/* ========== ESTADOS DE SALUD CRÍTICA ========== */
.hud-health-section.critical .hud-health-bar {
  animation: criticalPulse 0.8s infinite;
}

@keyframes criticalPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 0, 0, 0.3); }
  50% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.6); }
}

/* ========== RESPONSIVE PARA PANTALLAS PEQUEÑAS ========== */
@media (max-width: 1200px) {
  .hud-player-stats {
    min-width: 180px;
    padding: 10px 12px;
  }
  
  .hud-wave-container {
    padding: 8px 16px;
    gap: 12px;
  }
  
  .wave-number {
    font-size: 22px;
  }
  
  .enemies-count {
    font-size: 18px;
  }
  
  #weaponSlots .slot {
    width: 50px;
    height: 50px;
  }
  
  #weaponSlots .slot img {
    max-width: 36px;
    max-height: 36px;
  }
}

@media (max-width: 900px) {
  #hud {
    left: 10px;
    bottom: 10px;
  }
  
  .hud-player-stats {
    min-width: 150px;
    padding: 8px 10px;
  }
  
  .hud-bar-label {
    font-size: 9px;
  }
  
  .hud-bar-value {
    font-size: 11px;
  }
  
  #hudTop {
    top: 10px;
  }
  
  .hud-wave-container {
    padding: 6px 12px;
    gap: 8px;
  }
  
  .wave-number {
    font-size: 18px;
  }
  
  .enemies-count {
    font-size: 16px;
  }
  
  #hudTopRight {
    right: 60px;
    top: 10px;
  }
  
  .money-value {
    font-size: 16px;
    min-width: 40px;
  }
  
  .ammo-container {
    padding: 8px 12px;
  }
  
  .ammo-current {
    font-size: 24px;
  }
  
  .ammo-reserve {
    font-size: 14px;
  }
  
  #weaponSlots {
    right: 10px;
  }
  
  #weaponSlots .slot {
    width: 45px;
    height: 45px;
  }
  
  #weaponSlots .slot img {
    max-width: 32px;
    max-height: 32px;
  }
  
  :root {
    --weapon-scale: 0.55;
    --sniper-scale: 0.9;
    --knife-scale: 0.5;
  }
}

@media (max-width: 600px) {
  #hud {
    left: 5px;
    bottom: 5px;
  }
  
  .hud-player-stats {
    min-width: 120px;
    padding: 6px 8px;
  }
  
  .hud-health-bar {
    height: 8px;
  }
  
  .hud-stamina-bar {
    height: 6px;
  }
  
  .hud-bar-icon {
    font-size: 10px;
  }
  
  .hud-bar-label {
    font-size: 8px;
    letter-spacing: 1px;
  }
  
  .hud-bar-value {
    font-size: 10px;
  }
  
  #hudTop {
    top: 5px;
  }
  
  .hud-wave-container {
    padding: 5px 10px;
    gap: 6px;
    border-radius: 30px;
  }
  
  .wave-label, .enemies-label {
    font-size: 7px;
  }
  
  .wave-number {
    font-size: 16px;
  }
  
  .enemies-count {
    font-size: 14px;
  }
  
  .enemies-icon {
    font-size: 14px;
  }
  
  .hud-wave-divider {
    height: 24px;
  }
  
  #hudTopRight {
    right: 50px;
    top: 5px;
  }
  
  .hud-money-container {
    padding: 5px 10px;
  }
  
  .money-icon {
    font-size: 14px;
  }
  
  .money-value {
    font-size: 14px;
    min-width: 35px;
  }
  
  .hud-kills-container {
    padding: 4px 10px;
  }
  
  .kills-icon {
    font-size: 12px;
  }
  
  .kills-value {
    font-size: 14px;
  }
  
  .ammo {
    right: 10px;
    bottom: 10px;
  }
  
  .ammo-container {
    padding: 6px 10px;
    gap: 8px;
  }
  
  .ammo-icon {
    font-size: 16px;
  }
  
  .ammo-current {
    font-size: 20px;
    min-width: 30px;
  }
  
  .ammo-divider {
    font-size: 16px;
  }
  
  .ammo-reserve {
    font-size: 12px;
    min-width: 25px;
  }
  
  #weaponSlots {
    right: 5px;
  }
  
  #weaponSlots .slot {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }
  
  #weaponSlots .slot::before {
    width: 16px;
    height: 16px;
    font-size: 9px;
    top: -6px;
    left: -6px;
  }
  
  #weaponSlots .slot img {
    max-width: 28px;
    max-height: 28px;
  }
  
  :root {
    --weapon-scale: 0.45;
    --sniper-scale: 0.75;
    --knife-scale: 0.4;
  }
  
  #crosshair {
    width: 20px;
    height: 20px;
  }
  
  #crosshair:before {
    width: 10px;
  }
  
  #crosshair:after {
    height: 10px;
  }
  
  #shopPrompt, #bottomHint, #vehiclePrompt {
    bottom: 80px;
    padding: 8px 14px;
    font-size: 12px;
  }
  
  .fists-container {
    bottom: 60px;
    width: 350px;
    height: 25vh;
  }
}

/* Optimización de rendimiento para animaciones */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* GPU acceleration para elementos animados */
#waveBanner,
.hud-health-fill,
.hud-stamina-fill,
#weapon,
#sniper,
#knife,
.fist {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}


/* ========== BRAZOS / PUÑOS (MODO MUNDO ABIERTO) ========== */
.fists-container {
  position: fixed;
  bottom: 80px; /* Por encima de la barra de inventario */
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 35vh;
  pointer-events: none;
  z-index: 8; /* Por debajo del inventario (z-index: 35) */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.fist {
  position: absolute;
  bottom: -15%;
  height: 100%;
  width: auto;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
  transform-origin: center bottom;
  object-fit: contain;
}

.fist-left {
  left: 5%;
  transform: rotate(-10deg);
}

.fist-right {
  right: 5%;
  transform: rotate(10deg);
}

/* Animación de caminar */
.fist-left.walking {
  animation: fistWalkLeft 0.5s ease-in-out infinite;
}

.fist-right.walking {
  animation: fistWalkRight 0.5s ease-in-out infinite;
}

@keyframes fistWalkLeft {
  0%, 100% { transform: translateY(0) rotate(-10deg); }
  50% { transform: translateY(-15px) rotate(-6deg); }
}

@keyframes fistWalkRight {
  0%, 100% { transform: translateY(-15px) rotate(6deg); }
  50% { transform: translateY(0) rotate(10deg); }
}

/* Animación de correr */
.fist-left.running {
  animation: fistRunLeft 0.3s ease-in-out infinite;
}

.fist-right.running {
  animation: fistRunRight 0.3s ease-in-out infinite;
}

@keyframes fistRunLeft {
  0%, 100% { transform: translateY(0) rotate(-12deg); }
  50% { transform: translateY(-25px) rotate(-4deg); }
}

@keyframes fistRunRight {
  0%, 100% { transform: translateY(-25px) rotate(4deg); }
  50% { transform: translateY(0) rotate(12deg); }
}

/* Animación de golpe izquierdo */
.fist-left.punching {
  animation: punchLeft 0.18s ease-out forwards;
}

@keyframes punchLeft {
  0% { transform: translateY(0) translateX(0) rotate(-10deg); }
  50% { transform: translateY(-70px) translateX(40px) rotate(0deg) scale(1.1); }
  100% { transform: translateY(0) translateX(0) rotate(-10deg); }
}

/* Animación de golpe derecho */
.fist-right.punching {
  animation: punchRight 0.18s ease-out forwards;
}

@keyframes punchRight {
  0% { transform: translateY(0) translateX(0) rotate(10deg); }
  50% { transform: translateY(-70px) translateX(-40px) rotate(0deg) scale(1.1); }
  100% { transform: translateY(0) translateX(0) rotate(10deg); }
}

/* Estado idle */
.fist-left.idle {
  animation: fistIdleLeft 2s ease-in-out infinite;
}

.fist-right.idle {
  animation: fistIdleRight 2s ease-in-out infinite;
}

@keyframes fistIdleLeft {
  0%, 100% { transform: translateY(0) rotate(-10deg); }
  50% { transform: translateY(-5px) rotate(-8deg); }
}

@keyframes fistIdleRight {
  0%, 100% { transform: translateY(-5px) rotate(8deg); }
  50% { transform: translateY(0) rotate(10deg); }
}


/* ========== INDICADOR DE DAÑO A ÁRBOLES ========== */
.tree-hit-indicator {
  position: fixed;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 900;
  color: #8B4513;
  text-shadow: 0 0 10px rgba(139, 69, 19, 0.8), 2px 2px 0 #000;
  pointer-events: none;
  z-index: 30;
  animation: treeHitFade 0.6s ease-out forwards;
}

@keyframes treeHitFade {
  0% { 
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1.2); 
  }
  100% { 
    opacity: 0; 
    transform: translate(-50%, -80%) scale(0.8); 
  }
}

/* ========== INDICADOR DE ITEM RECOGIDO ========== */
.pickup-indicator {
  position: fixed;
  left: 50%;
  bottom: 150px;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: 700;
  color: #90EE90;
  text-shadow: 0 0 8px rgba(144, 238, 144, 0.6), 1px 1px 0 #000;
  pointer-events: none;
  z-index: 30;
  animation: pickupFade 1s ease-out forwards;
}

@keyframes pickupFade {
  0% { 
    opacity: 1; 
    transform: translateX(-50%) translateY(0); 
  }
  100% { 
    opacity: 0; 
    transform: translateX(-50%) translateY(-30px); 
  }
}


/* ========== SISTEMA DE CONSTRUCCIÓN ========== */
/* Indicador de modo construcción */
.build-mode-indicator {
  position: fixed;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.8), rgba(101, 67, 33, 0.9));
  border: 2px solid rgba(255, 200, 100, 0.5);
  border-radius: 10px;
  padding: 8px 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  z-index: 25;
  pointer-events: none;
  display: none;
}

.build-mode-indicator.active {
  display: block;
  animation: buildPulse 1.5s infinite;
}

@keyframes buildPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 200, 100, 0.3); }
  50% { box-shadow: 0 0 20px rgba(255, 200, 100, 0.6); }
}

/* Controles de construcción */
.build-controls {
  position: fixed;
  bottom: 190px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 10px;
  z-index: 25;
  pointer-events: none;
}

.build-controls.active {
  display: flex;
}

.build-control-hint {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 10px;
  color: #fff;
  font-size: 12px;
}

.build-control-hint kbd {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  padding: 1px 5px;
  margin: 0 3px;
  font-family: monospace;
}
