@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

:root {
  --bg-dark: #050705;
  --text-white: #f5f5f5;
  --text-muted: #6a736a;
  --neon-green: #00ff66;
  --neon-red: #ff0055;
  --neon-cyan: #00e5ff;
  --neon-yellow: #ffcc00;
  --vhs-flicker-speed: 0.15s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-drag: none;
}

body,
html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-white);
}

/* FILTRO VHS */
#vhs-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  pointer-events: none;
}

.vhs-scanlines {
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
}

.vhs-flicker {
  animation: vhs-flicker-anim var(--vhs-flicker-speed) infinite;
}

@keyframes vhs-flicker-anim {
  0% {
    opacity: 0.98;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.99;
  }
}

body::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    transparent 55%,
    rgba(0, 0, 0, 0.85) 100%
  );
  z-index: 998;
  pointer-events: none;
}

/* ESTRUCTURA DE PANTALLAS */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-dark);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* PANTALLA DE CARGA */
.logo-container {
  text-align: center;
  margin-bottom: 40px;
}

.logo-glitch {
  font-size: 4.5rem;
  font-weight: bold;
  letter-spacing: 12px;
  color: var(--text-white);
  text-shadow: 2px 0 var(--neon-cyan), -2px 0 var(--neon-red);
}

.logo-sub {
  font-size: 2.5rem;
  letter-spacing: 20px;
  color: var(--text-white);
  margin-top: -10px;
  opacity: 0.9;
}

.brand-tag {
  font-size: 0.9rem;
  letter-spacing: 4px;
  color: var(--text-muted);
  margin-top: 15px;
}

.loading-bar-container {
  width: 250px;
  height: 3px;
  background-color: #1a1f1a;
  position: relative;
  overflow: hidden;
}

#loading-bar {
  width: 0%;
  height: 100%;
  background-color: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  transition: width 0.1s linear;
}

.btn {
  background: transparent;
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
  padding: 12px 24px;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 2px;
  cursor: pointer;
  margin-top: 20px;
}

/* MENÚ TERMINAL */
.menu-header {
  position: absolute;
  top: 20px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.system-status {
  color: var(--neon-green);
  text-shadow: 0 0 5px var(--neon-green);
}

.menu-content {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.game-title h1 {
  font-size: 3rem;
  letter-spacing: 4px;
  text-shadow: 1px 1px 0 var(--neon-red), -1px -1px 0 var(--neon-cyan);
}

.game-title p {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 5px;
  margin-top: 5px;
  text-align: center;
}

.menu-options {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 12px;
}

.menu-btn,
.action-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-white);
  padding: 12px 20px;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 3px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  outline: none;
}

.menu-btn:hover,
.action-btn:hover {
  border-color: var(--text-white);
  background-color: rgba(255, 255, 255, 0.05);
  padding-left: 28px;
}

/* MODALES */
.modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 7, 5, 0.96);
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  width: 90%;
  max-width: 650px;
  background-color: #0b0e0b;
  border: 1px solid var(--text-muted);
  padding: 30px;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--neon-red);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: 1px;
}

.modal-body h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--text-muted);
  padding-bottom: 10px;
  letter-spacing: 2px;
}

.lore-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #b0b5b0;
  margin-bottom: 20px;
}

.modal-body h4 {
  color: var(--neon-yellow);
  margin: 15px 0 8px 0;
  font-size: 1rem;
}

.modal-body ul {
  list-style: none;
  padding-left: 10px;
}

.modal-body li {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 8px;
  color: #e0e5e0;
}

.req-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* DESCARGAS */
.download-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 25px;
}

.download-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
  padding: 15px;
  font-size: 1.1rem;
  letter-spacing: 2px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.download-btn:hover {
  background-color: var(--neon-green);
  color: var(--bg-dark);
  box-shadow: 0 0 15px var(--neon-green);
}

/* MULTIJUGADOR COOP */
.net-setup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-top: 20px;
}

.net-box {
  border: 1px dashed var(--text-muted);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
}

.net-box h4 {
  margin-bottom: 10px;
}

.net-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 15px;
}

.net-input {
  background-color: #121612;
  border: 1px solid var(--text-muted);
  color: var(--text-white);
  padding: 10px;
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 15px;
  outline: none;
  text-align: center;
}

.action-btn {
  text-align: center;
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.action-btn:hover {
  background-color: rgba(0, 229, 255, 0.05);
}

/* INTERFAZ DE JUEGO (HUD) */
#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

#game-canvas-holder {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

#game-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 25px;
  z-index: 6;
}

.hud-header,
.hud-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

.hud-phase-info,
.hud-round-info,
.hud-ammo {
  background-color: rgba(5, 7, 5, 0.85);
  border: 1px solid var(--text-muted);
  padding: 10px 20px;
  letter-spacing: 2px;
}

.hud-phase-info {
  display: flex;
  gap: 30px;
}

#hud-timer {
  color: var(--neon-green);
}

.hud-stat {
  background-color: rgba(5, 7, 5, 0.85);
  border: 1px solid var(--text-muted);
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 250px;
}

.hud-stat .label {
  font-size: 0.8rem;
}

.bar-container {
  flex-grow: 1;
  height: 8px;
  background-color: #1a1f1a;
}

#hp-bar {
  height: 100%;
  background-color: var(--neon-red);
}

#stability-bar {
  height: 100%;
  background-color: var(--neon-cyan);
}

.hud-ammo {
  font-size: 1.2rem;
  display: flex;
  gap: 15px;
}

#hud-weapon-name {
  color: var(--text-muted);
}

/* CONTROLES MÓVILES */
#mobile-controls {
  position: absolute;
  bottom: 120px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
  pointer-events: auto;
}

#joystick-move-zone,
#joystick-look-zone {
  width: 120px;
  height: 120px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--text-muted);
}

.mobile-action-btn {
  width: 80px;
  height: 80px;
  background-color: rgba(5, 7, 5, 0.9);
  border: 1px solid var(--text-muted);
  color: var(--text-white);
  font-family: inherit;
  font-weight: bold;
  font-size: 0.8rem;
  border-radius: 50%;
}

.hidden {
  display: none !important;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .logo-glitch {
    font-size: 2.8rem;
    letter-spacing: 6px;
  }
  .logo-sub {
    font-size: 1.6rem;
    letter-spacing: 12px;
  }
  .req-grid,
  .net-setup {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .modal-content {
    padding: 20px;
    width: 95%;
  }
  .hud-stat {
    min-width: 140px;
    padding: 8px;
  }
  .hud-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .hud-ammo {
    width: 100%;
    justify-content: space-between;
  }
}
