:root {
  --primary: #00ffcc;
  --secondary: #ff3366;
  --bg-dark: #0a0e17;
  --panel-bg: rgba(16, 24, 40, 0.85);
  --border-color: rgba(0, 255, 204, 0.3);
  --font-family-title: 'Orbitron', sans-serif;
  --font-family-body: 'Rajdhani', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-family-body);
  color: #ffffff;
}

#game-container {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Viñeteado Cinematográfico 4K Película */
#game-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle, transparent 65%, rgba(0, 0, 0, 0.4) 100%);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

/* Pantallas y Superposiciones */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle, rgba(10,14,23,0.85) 0%, rgba(5,8,12,0.98) 100%);
  backdrop-filter: blur(10px);
}

.glass-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 0 30px rgba(0, 255, 204, 0.15), inset 0 0 15px rgba(0, 255, 204, 0.05);
  border-radius: 12px;
  padding: 35px;
  width: 90%;
  max-width: 420px;
  text-align: center;
}

.brand h1 {
  font-family: var(--font-family-title);
  font-size: 2rem;
  letter-spacing: 3px;
}
.brand h1 span {
  color: var(--primary);
  text-shadow: 0 0 12px var(--primary);
}
.brand .subtitle {
  font-size: 0.85rem;
  color: #8a99ad;
  letter-spacing: 2px;
  margin-top: 4px;
  margin-bottom: 24px;
}

.logo-badge {
  display: inline-block;
  background: var(--primary);
  color: #000;
  font-family: var(--font-family-title);
  font-weight: 900;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.input-group {
  text-align: left;
  margin-bottom: 16px;
}
.input-group label {
  display: block;
  font-size: 0.8rem;
  color: #a0aec0;
  margin-bottom: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.input-group input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-family-body);
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.2s;
}
.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.3);
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  padding: 14px;
  border: none;
  border-radius: 6px;
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #00b386 100%);
  color: #000;
  box-shadow: 0 4px 15px rgba(0, 255, 204, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 255, 204, 0.5);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.alert {
  padding: 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-top: 12px;
}
.alert-error {
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid var(--secondary);
  color: #ff99b3;
}
.checkout-hint {
  margin-top: 18px;
  font-size: 0.85rem;
  color: #718096;
}
.checkout-hint a {
  color: var(--primary);
  text-decoration: none;
}

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

/* Mira de Disparo Ultra-Profesional Estilo Call of Duty (CoD Tactical Reticle HUD) */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  transition: transform 0.15s ease-out;
}

/* Anillo Táctico Exterior de Cobertura */
#crosshair::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(0, 255, 204, 0.4);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.3);
}

.ch-line {
  position: absolute;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}
.ch-line.top { top: 2px; left: 23px; width: 2px; height: 10px; }
.ch-line.bottom { bottom: 2px; left: 23px; width: 2px; height: 10px; }
.ch-line.left { top: 23px; left: 2px; width: 10px; height: 2px; }
.ch-line.right { top: 23px; right: 2px; width: 10px; height: 2px; }

.ch-dot {
  position: absolute;
  top: 22px;
  left: 22px;
  width: 4px;
  height: 4px;
  background: #ff3366;
  border-radius: 50%;
  box-shadow: 0 0 8px #ff3366;
}

#hit-marker {
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 28px;
  font-weight: 900;
  color: var(--secondary);
  text-shadow: 0 0 12px var(--secondary);
  animation: hitPulse 0.15s ease-in-out;
}

/* Banner Táctico de Zona */
#zone-banner {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 23, 0.9);
  border: 1px solid var(--primary);
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.25);
  padding: 12px 30px;
  border-radius: 8px;
  text-align: center;
  pointer-events: none;
  animation: fadeInDown 0.4s ease-out;
}
.zone-badge {
  font-family: var(--font-family-title);
  font-size: 0.7rem;
  color: #a0aec0;
  letter-spacing: 2px;
}
#zone-title {
  font-family: var(--font-family-title);
  font-size: 1.1rem;
  color: var(--primary);
  letter-spacing: 1px;
}

/* Barra Superior */
.top-bar {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 10px 24px;
  border-radius: 30px;
  font-family: var(--font-family-title);
  font-size: 0.85rem;
}
.stat .k-label { color: #a0aec0; }
.ping-badge span { color: var(--primary); }

/* Indicador de Sangre / Daño Recibido */
#damage-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  box-shadow: inset 0 0 100px 30px rgba(255, 0, 0, 0.7);
  pointer-events: none;
  z-index: 15;
}

/* Pantalla Game Over */
.game-over-box {
  border-color: var(--secondary) !important;
  box-shadow: 0 0 40px rgba(255, 51, 102, 0.4) !important;
}
.game-over-title {
  font-family: var(--font-family-title);
  color: var(--secondary);
  font-size: 2.2rem;
  letter-spacing: 2px;
  margin: 10px 0;
}
.game-over-sub {
  color: #a0aec0;
  font-size: 0.95rem;
}
.stats-summary {
  background: rgba(0, 0, 0, 0.4);
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
}
.sum-label {
  font-family: var(--font-family-title);
  font-size: 0.8rem;
  color: #a0aec0;
  display: block;
}
.sum-val {
  font-family: var(--font-family-title);
  font-size: 1.8rem;
  color: var(--primary);
  font-weight: bold;
}

/* Kill Feed */
#kill-feed {
  position: absolute;
  top: 95px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
  z-index: 95;
}
.kill-item {
  background: rgba(0, 0, 0, 0.6);
  border-right: 3px solid var(--secondary);
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 4px;
}

/* Indicador de Salud del Soldado (Parte Superior Derecha) */
.health-container {
  position: absolute;
  top: 20px;
  right: 25px;
  width: 240px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.18);
  z-index: 100;
}

/* Barra Inferior (Munición y Equipamiento) */
.bottom-bar {
  position: absolute;
  bottom: 25px;
  left: 30px;
  right: 175px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 100;
}

.bottom-bar > * {
  pointer-events: auto;
}

.hud-label {
  font-family: var(--font-family-title);
  font-size: 0.75rem;
  color: #a0aec0;
  margin-bottom: 4px;
}
.bar-outer {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}
#health-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #00ffcc 0%, #00b386 100%);
  transition: width 0.2s ease-out;
}
#health-text {
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 1rem;
  margin-top: 6px;
}

.weapon-status {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 8px;
  text-align: right;
}
.weapon-name {
  font-family: var(--font-family-title);
  font-size: 0.85rem;
  color: var(--primary);
}
.ammo-count {
  font-family: var(--font-family-title);
  font-size: 1.8rem;
  font-weight: 800;
}

/* Minimapa Radar (Parte Inferior Derecha) */
#minimap-container {
  position: absolute;
  bottom: 25px;
  right: 25px;
  width: 130px;
  height: 130px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  overflow: hidden;
  background: rgba(10, 14, 23, 0.85);
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.25);
  z-index: 100;
}

/* Controles Táctiles (Móvil) */
.touch-only {
  display: none; /* Se activa en móviles mediante JS/Media Query */
}

@media (max-width: 900px), (pointer: coarse) {
  .touch-only {
    display: block;
    pointer-events: auto;
  }
  .click-overlay {
    display: none !important;
  }
}

.touch-zone {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px dashed rgba(0, 255, 204, 0.3);
}
#joystick-move {
  bottom: 40px;
  left: 30px;
}
#joystick-stick {
  position: absolute;
  top: 40px;
  left: 40px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.7;
}

.touch-actions {
  position: absolute;
  bottom: 40px;
  right: 30px;
  display: flex;
  gap: 15px;
}
.touch-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid var(--primary);
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  cursor: pointer;
}
.btn-fire {
  width: 75px;
  height: 75px;
  border-color: var(--secondary);
  background: rgba(255, 51, 102, 0.2);
}

.click-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
}
.click-overlay h2 {
  font-family: var(--font-family-title);
  color: var(--primary);
  margin-bottom: 8px;
}

.hidden {
  display: none !important;
}
