:root {
  --primary-font: 'Outfit', sans-serif;
  --retro-font: 'Press Start 2P', monospace;
  --bg-dark: #0d0c1d;
  --neon-cyan: #00f0ff;
  --neon-magenta: #ff007f;
  --neon-yellow: #ffde07;
  --neon-blue: #3a86ff;
  --neon-green: #39ff14;
  --text-white: #ffffff;
}

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

body {
  background-color: #05050a;
  color: var(--text-white);
  font-family: var(--primary-font);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

#game-container {
  width: 1024px;
  height: 576px;
  position: relative;
  background-color: var(--bg-dark);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(58, 134, 255, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

/* Efecto tubo de rayos catódicos (CRT) y scanlines */
.arcade-cabinet-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 6px 100%;
  z-index: 10;
  pointer-events: none;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-dark);
}

.screen.active {
  display: flex;
}

/* Pantalla de Título */
#title-screen {
  background: radial-gradient(circle at center, #1b1b3a 0%, #080811 100%);
}

.logo-container {
  text-align: center;
  margin-bottom: 18px;
}

.retro-title {
  font-family: var(--retro-font);
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -2px;
  color: #fff;
  text-shadow: 
    3px 3px 0px var(--neon-magenta),
    -3px -3px 0px var(--neon-cyan);
  animation: glitch 1.5s infinite alternate;
  position: relative;
}

.subtitle {
  font-family: var(--retro-font);
  font-size: 1rem;
  margin-top: 15px;
  color: var(--neon-yellow);
  text-shadow: 0 0 8px rgba(255, 222, 7, 0.6);
  letter-spacing: 2px;
}

.arcade-btn {
  font-family: var(--retro-font);
  font-size: 1.05rem;
  padding: 11px 34px;
  background: transparent;
  color: #fff;
  border: 4px solid #fff;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  animation: pulse 1.2s infinite;
}

.arcade-btn:hover {
  background-color: #fff;
  color: var(--bg-dark);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
}

.controls-guide-title-screen {
  display: flex;
  gap: 40px;
  margin-top: 22px;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 30px;
  border-radius: 10px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-guide {
  font-size: 0.8rem;
  text-align: left;
}

.player-guide h3 {
  font-family: var(--retro-font);
  color: var(--neon-yellow);
  margin-bottom: 8px;
  font-size: 0.75rem;
}

.player-guide p {
  margin: 3px 0;
  color: #ccc;
}

.player-guide span {
  background: #333;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: bold;
}

/* Pantalla de Selección de Personajes */
#char-select-screen {
  background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
  padding: 20px;
}

.select-title {
  font-family: var(--retro-font);
  font-size: 1.5rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  margin-bottom: 25px;
}

.selection-area {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.player-preview {
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  padding: 15px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#p1-preview {
  box-shadow: 0 0 15px rgba(58, 134, 255, 0.1);
}

#p2-preview {
  box-shadow: 0 0 15px rgba(255, 0, 110, 0.1);
}

.player-tag {
  font-family: var(--retro-font);
  font-size: 0.8rem;
  margin-bottom: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}

.p1-tag {
  background-color: var(--neon-blue);
  color: white;
}

.p2-tag {
  background-color: var(--neon-magenta);
  color: white;
}

.portrait-frame {
  width: 140px;
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #1e293b;
  border: 4px solid #475569;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: border-color 0.2s ease;
}

#p1-preview .portrait-frame {
  border-color: var(--neon-blue);
}

#p2-preview .portrait-frame {
  border-color: var(--neon-magenta);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.char-name-display {
  font-family: var(--retro-font);
  font-size: 1.1rem;
  margin-top: 15px;
  letter-spacing: 1px;
}

.char-special-info {
  margin-top: 10px;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  width: 100%;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

.char-special-info p {
  margin: 4px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-special-info .key {
  background: #334155;
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: bold;
  font-size: 0.65rem;
}

/* Grilla Central */
.selection-grid-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.selection-grid {
  display: flex;
  gap: 12px;
  background: rgba(2, 6, 23, 0.8);
  padding: 15px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.05);
}

.grid-cell {
  width: 75px;
  height: 75px;
  border-radius: 8px;
  overflow: hidden;
  border: 3px solid #334155;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  background-color: #1e293b;
}

.grid-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.grid-cell.active-p1 {
  border-color: var(--neon-blue);
  box-shadow: 0 0 15px var(--neon-blue);
  transform: scale(1.05);
}

.grid-cell.active-p2 {
  border-color: var(--neon-magenta);
  box-shadow: 0 0 15px var(--neon-magenta);
  transform: scale(1.05);
}

.grid-cell.active-both {
  border-color: var(--neon-yellow);
  box-shadow: 0 0 15px var(--neon-yellow);
  transform: scale(1.05);
}

.grid-cell.active-p1 img,
.grid-cell.active-p2 img,
.grid-cell.active-both img {
  opacity: 1;
}

.grid-cell-label {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.55rem;
  font-family: var(--retro-font);
  text-align: center;
  padding: 2px 0;
}

/* Selector Escenario */
.stage-selector-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(30, 41, 59, 0.5);
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 320px;
}

.stage-title {
  font-family: var(--retro-font);
  font-size: 0.65rem;
  color: var(--neon-yellow);
  margin-bottom: 5px;
}

.stage-carousel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.stage-nav-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--retro-font);
  font-size: 1rem;
  cursor: pointer;
  padding: 5px 10px;
  transition: color 0.2s ease;
}

.stage-nav-btn:hover {
  color: var(--neon-yellow);
}

#stage-name-display {
  font-family: var(--retro-font);
  font-size: 0.75rem;
  color: #e2e8f0;
}

.start-fight-prompt {
  font-family: var(--retro-font);
  font-size: 0.65rem;
  color: #94a3b8;
  height: 20px;
  text-align: center;
}

#ready-prompt {
  animation: pulse 1s infinite alternate;
}

/* Pantalla de Combate */
#fight-screen {
  background-color: #000;
  position: relative;
}

#gameCanvas {
  display: block;
}

/* HUD Superior */
#hud {
  position: absolute;
  top: 15px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  z-index: 5;
  pointer-events: none;
}

.hud-player {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 42%;
}

.hud-portrait-circle {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  background-color: #334155;
  flex-shrink: 0;
}

#hud-p1 .hud-portrait-circle {
  border-color: var(--neon-blue);
}

#hud-p2 .hud-portrait-circle {
  border-color: var(--neon-magenta);
}

.hud-portrait-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.hud-meta {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

#hud-p1 .hud-meta {
  align-items: flex-start;
}

#hud-p2 .hud-meta {
  align-items: flex-end;
}

.hud-name {
  font-family: var(--retro-font);
  font-size: 0.8rem;
  margin-bottom: 5px;
  color: #fff;
  text-shadow: 1px 1px 0px #000;
}

.health-bar-container {
  width: 100%;
  height: 16px;
  background-color: #334155;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.health-bar {
  height: 100%;
  background: linear-gradient(to bottom, var(--neon-yellow) 0%, #eab308 100%);
  position: absolute;
  top: 0;
  width: 100%;
  transition: width 0.1s ease;
  z-index: 2;
}

#hud-p1 .health-bar {
  right: 0;
}

#hud-p2 .health-bar {
  left: 0;
}

.health-bar-red-under {
  height: 100%;
  background-color: #ef4444;
  position: absolute;
  top: 0;
  width: 100%;
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 1;
}

#hud-p1 .health-bar-red-under {
  right: 0;
}

#hud-p2 .health-bar-red-under {
  left: 0;
}

/* Indicadores de Rondads */
.rounds-container {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}

.round-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #fff;
  background-color: rgba(0, 0, 0, 0.4);
}

.round-dot.won {
  background-color: var(--neon-yellow);
  box-shadow: 0 0 6px var(--neon-yellow);
}

/* Timer Central */
#timer-container {
  width: 60px;
  height: 50px;
  background: rgba(0, 0, 0, 0.85);
  border: 3px solid var(--neon-yellow);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(255, 222, 7, 0.3);
}

#timer {
  font-family: var(--retro-font);
  font-size: 1.5rem;
  color: #fff;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

/* Alertas de Combate (Round, Fight, KO) */
#fight-alerts {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  pointer-events: none;
  display: none;
}

#fight-alert-text {
  font-family: var(--retro-font);
  font-size: 3rem;
  text-align: center;
  color: var(--neon-yellow);
  text-shadow: 
    3px 3px 0px #000,
    0 0 20px rgba(255, 222, 7, 0.6);
  animation: alert-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Keyframes */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
  }
}

@keyframes glitch {
  0% {
    text-shadow: 3px 3px 0px var(--neon-magenta), -3px -3px 0px var(--neon-cyan);
  }
  92% {
    text-shadow: 3px 3px 0px var(--neon-magenta), -3px -3px 0px var(--neon-cyan);
  }
  95% {
    text-shadow: 5px -2px 0px var(--neon-magenta), -5px 2px 0px var(--neon-cyan);
  }
  98% {
    text-shadow: -2px 5px 0px var(--neon-magenta), 2px -5px 0px var(--neon-cyan);
  }
  100% {
    text-shadow: 3px 3px 0px var(--neon-magenta), -3px -3px 0px var(--neon-cyan);
  }
}

@keyframes alert-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  80% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

/* ============================
   PAUSA / REINICIAR / SALIR
   ============================ */
#timer-container {
  position: relative;
}

#pause-btn {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--retro-font);
  font-size: 0.7rem;
  color: var(--neon-yellow);
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid var(--neon-yellow);
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 222, 7, 0.3);
  transition: all 0.15s ease;
}

#pause-btn:hover {
  background: var(--neon-yellow);
  color: #000;
  box-shadow: 0 0 16px rgba(255, 222, 7, 0.8);
}

#pause-overlay {
  display: none; /* se muestra con flex desde JS */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 5, 0.82);
  z-index: 20;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(3px);
}

#pause-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 40px 60px;
  background: rgba(10, 10, 25, 0.95);
  border: 4px solid var(--neon-yellow);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(255, 222, 7, 0.35), inset 0 0 20px rgba(255, 222, 7, 0.08);
}

#pause-title {
  font-family: var(--retro-font);
  font-size: 2.2rem;
  color: var(--neon-yellow);
  margin: 0 0 10px 0;
  text-shadow: 3px 3px 0 #000, 0 0 18px rgba(255, 222, 7, 0.6);
  letter-spacing: 4px;
}

.pause-menu-btn {
  font-size: 0.9rem;
  padding: 12px 30px;
  width: 260px;
  animation: none; /* sin pulso: el menú debe leerse estático */
}

#pause-hint {
  font-family: var(--retro-font);
  font-size: 0.55rem;
  color: #94a3b8;
  margin-top: 8px;
  letter-spacing: 1px;
}

/* El HUD tiene pointer-events:none; los botones interactivos dentro de él
   deben reactivarlos para poder recibir clics */
#pause-btn,
#sound-btn {
  pointer-events: auto;
}

#sound-btn {
  position: absolute;
  top: calc(100% + 8px);
  left: calc(50% + 34px);
  transform: translateX(-50%);
  font-family: var(--retro-font);
  font-size: 0.7rem;
  color: var(--neon-yellow);
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid var(--neon-yellow);
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 222, 7, 0.3);
  transition: all 0.15s ease;
}

#sound-btn:hover {
  background: var(--neon-yellow);
  color: #000;
}

#sound-btn.muted {
  color: #64748b;
  border-color: #64748b;
  box-shadow: none;
}

#pause-btn {
  left: calc(50% - 16px);
}

/* ============================
   APAGAR EFECTO CRT (opciones)
   ============================ */
body.no-crt .arcade-cabinet-effect {
  display: none;
}

/* ============================
   AVISOS DE PELIGRO EN EL HUD
   ============================ */
/* Vida baja: la barra parpadea en rojo (clásico de los fighters) */
.health-bar.low {
  background: linear-gradient(to bottom, #ff4d4d 0%, #b91c1c 100%);
  animation: low-hp-flash 0.45s steps(2, start) infinite;
}

@keyframes low-hp-flash {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.8); }
  100% { filter: brightness(1); }
}

/* Últimos 10 segundos: el timer pulsa en rojo */
#timer.urgent {
  color: #ff2d2d;
  text-shadow: 0 0 10px rgba(255, 45, 45, 0.9);
  animation: timer-urgent 0.5s infinite alternate;
}

@keyframes timer-urgent {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* ============================
   MENÚ DEL TÍTULO (OPCIONES / RANKING)
   ============================ */
.insert-coin-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.title-menu-row {
  display: flex;
  gap: 16px;
}

.small-btn {
  font-size: 0.7rem;
  padding: 10px 22px;
  border-width: 3px;
  animation: none; /* los botones secundarios no pulsan */
}

.tiny-btn {
  font-size: 0.55rem;
  padding: 8px 14px;
  border-width: 2px;
  animation: none;
}

.arcade-btn:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ============================
   OVERLAYS MODALES (OPCIONES / RANKING / VICTORIA)
   ============================ */
.modal-overlay {
  display: none; /* se muestra con flex desde JS */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 5, 0.85);
  z-index: 40;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(3px);
}

.modal-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 44px;
  max-height: 540px;
  background: rgba(10, 10, 25, 0.97);
  border: 4px solid var(--neon-cyan);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.3), inset 0 0 20px rgba(0, 240, 255, 0.06);
}

.modal-title {
  font-family: var(--retro-font);
  font-size: 1.3rem;
  color: var(--neon-cyan);
  text-shadow: 3px 3px 0 #000, 0 0 14px rgba(0, 240, 255, 0.6);
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.modal-hint {
  font-family: var(--retro-font);
  font-size: 0.5rem;
  color: #64748b;
  letter-spacing: 1px;
}

/* Filas del menú de opciones */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 420px;
  font-family: var(--retro-font);
  font-size: 0.65rem;
  color: #e2e8f0;
}

.setting-row label {
  flex-shrink: 0;
}

.setting-value {
  width: 36px;
  text-align: right;
  color: var(--neon-yellow);
}

.setting-row input[type="range"] {
  flex-grow: 1;
  accent-color: var(--neon-yellow);
  cursor: pointer;
}

.setting-row select {
  font-family: var(--retro-font);
  font-size: 0.65rem;
  background: #0d0c1d;
  color: var(--neon-yellow);
  border: 2px solid var(--neon-yellow);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}

.setting-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--neon-yellow);
  cursor: pointer;
}

/* ============================
   RANKING / HALL DE LA FAMA
   ============================ */
.ranking-list {
  list-style: none;
  width: 460px;
  font-family: var(--retro-font);
  font-size: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ranking-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: #e2e8f0;
  padding: 4px 8px;
  border-radius: 4px;
}

.ranking-list li:first-child {
  color: var(--neon-yellow);
  text-shadow: 0 0 8px rgba(255, 222, 7, 0.5);
}

.ranking-list .rank-pos {
  width: 28px;
  flex-shrink: 0;
}

.ranking-list .rank-name {
  flex-grow: 1;
  overflow: hidden;
  white-space: nowrap;
}

.ranking-list .rank-char {
  color: #64748b;
  font-size: 0.5rem;
}

.ranking-list .rank-score {
  color: var(--neon-cyan);
}

.ranking-list .rank-empty {
  color: #64748b;
  justify-content: center;
}

/* Entrada recién guardada: destaca parpadeando */
.ranking-list .rank-new {
  background: rgba(57, 255, 20, 0.12);
  color: var(--neon-green);
  animation: pulse 0.8s infinite alternate;
}

.ranking-list.compact {
  font-size: 0.55rem;
  gap: 4px;
}

/* ============================
   PANTALLA DE VICTORIA
   ============================ */
.victory-panel {
  border-color: var(--neon-yellow);
  box-shadow: 0 0 30px rgba(255, 222, 7, 0.35), inset 0 0 20px rgba(255, 222, 7, 0.08);
  gap: 10px;
  padding: 22px 44px;
}

.victory-panel .modal-title {
  color: var(--neon-yellow);
  text-shadow: 3px 3px 0 #000, 0 0 18px rgba(255, 222, 7, 0.6);
}

.victory-char-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

#victory-portrait {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  image-rendering: pixelated;
  border: 3px solid var(--neon-yellow);
  box-shadow: 0 0 12px rgba(255, 222, 7, 0.5);
}

#victory-char-name {
  font-family: var(--retro-font);
  font-size: 1rem;
  letter-spacing: 1px;
}

.score-breakdown {
  width: 380px;
  font-family: var(--retro-font);
  font-size: 0.55rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  padding: 8px 0;
}

.score-row {
  display: flex;
  justify-content: space-between;
}

.score-row.total {
  color: var(--neon-yellow);
  font-size: 0.75rem;
  margin-top: 4px;
  text-shadow: 0 0 8px rgba(255, 222, 7, 0.5);
}

.victory-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--retro-font);
  font-size: 0.6rem;
  color: #e2e8f0;
}

#victory-name-input {
  font-family: var(--retro-font);
  font-size: 0.7rem;
  width: 150px;
  text-transform: uppercase;
  background: #0d0c1d;
  color: var(--neon-green);
  border: 2px solid var(--neon-green);
  border-radius: 4px;
  padding: 7px 9px;
  text-align: center;
  user-select: text;
  caret-color: var(--neon-green);
}

#victory-name-input:disabled {
  opacity: 0.5;
  border-color: #64748b;
  color: #94a3b8;
}

.victory-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.victory-actions .small-btn {
  font-size: 0.55rem;
  padding: 9px 14px;
}

/* ============================
   MULTIJUGADOR ONLINE
   ============================ */
.online-main-btn {
  font-size: 0.85rem;
  padding: 12px 30px;
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3), inset 0 0 15px rgba(0, 240, 255, 0.15);
}

.online-main-btn:hover {
  background-color: var(--neon-cyan);
  color: var(--bg-dark);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.8);
}

.online-status {
  font-family: var(--retro-font);
  font-size: 0.6rem;
  color: var(--neon-green);
  min-height: 16px;
  text-align: center;
  letter-spacing: 1px;
}

.online-status.error {
  color: #ff4d4d;
}

#online-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.online-divider {
  font-family: var(--retro-font);
  font-size: 0.55rem;
  color: #64748b;
}

.online-join-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

#room-code-input {
  font-family: var(--retro-font);
  font-size: 1rem;
  width: 120px;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 6px;
  background: #0d0c1d;
  color: var(--neon-cyan);
  border: 2px solid var(--neon-cyan);
  border-radius: 4px;
  padding: 9px 6px;
  user-select: text;
  caret-color: var(--neon-cyan);
}

#room-code-input::placeholder {
  font-size: 0.55rem;
  letter-spacing: 2px;
  color: #475569;
}

#room-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#room-code-display {
  font-family: var(--retro-font);
  font-size: 2.4rem;
  color: var(--neon-yellow);
  letter-spacing: 14px;
  padding-left: 14px; /* compensa el letter-spacing del último carácter */
  text-shadow: 3px 3px 0 #000, 0 0 18px rgba(255, 222, 7, 0.6);
}

.online-blink {
  animation: pulse 1s infinite alternate;
  color: var(--neon-cyan) !important;
}

/* Indicador de latencia durante la pelea online */
#ping-display {
  position: absolute;
  top: calc(100% + 42px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--retro-font);
  font-size: 0.5rem;
  color: #94a3b8;
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
}
