/* ==========================================================================
   DEV ADVENTURE — ESTILOS GLOBALES Y TEMÁTICA INDIE RETRO (Ciclo 2: 5 Niveles)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Rajdhani:wght@500;600;700&display=swap');

:root {
  --bg-dark: #0a0b10;
  --bg-panel: #12141e;
  --bg-card: #181b2a;
  --border-gold: #f59e0b;
  --border-dim: #313852;
  --text-main: #e2e8f0;
  --text-dim: #94a3b8;
  --gold-glow: rgba(245, 158, 11, 0.4);
  --gold-light: #fbbf24;
  --crimson: #ef4444;
  --crimson-dark: #991b1b;
  --cyan-accent: #38bdf8;
  --emerald-accent: #10b981;
  --purple-accent: #c084fc;
  --font-retro: 'Press Start 2P', monospace, sans-serif;
  --font-ui: 'Rajdhani', sans-serif, system-ui;
}

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

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-ui);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 50% 30%, rgba(245, 158, 11, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(56, 189, 248, 0.04) 0%, transparent 40%),
    linear-gradient(rgba(10, 11, 16, 0.85) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 11, 16, 0.85) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  background-color: #0d0f17;
  z-index: 0;
}

/* ==========================================================================
   PANTALLA INICIAL (index.php)
   ========================================================================== */

.menu-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 520px;
  padding: 20px;
}

.menu-card {
  background: linear-gradient(180deg, #181b2b 0%, #10121d 100%);
  border: 3px solid #2d334d;
  box-shadow: 
    0 0 0 1px #05060a,
    0 10px 30px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 36px 28px;
  text-align: center;
  position: relative;
}

.menu-card::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 20px;
  right: 20px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

.game-title {
  font-family: var(--font-retro);
  font-size: 26px;
  line-height: 1.3;
  color: #fbbf24;
  text-shadow: 
    0 2px 0 #92400e,
    0 4px 0 #451a03,
    0 0 15px rgba(245, 158, 11, 0.5);
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.game-subtitle {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 28px;
  letter-spacing: 0.5px;
}

.form-group {
  margin-bottom: 24px;
  text-align: left;
}

.form-label {
  display: block;
  font-family: var(--font-retro);
  font-size: 11px;
  color: #cbd5e1;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.input-box {
  width: 100%;
  background-color: #0b0c13;
  border: 2px solid #334155;
  border-radius: 4px;
  padding: 14px 16px;
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  color: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
  letter-spacing: 1px;
}

.input-box:focus {
  border-color: var(--gold-light);
  box-shadow: 0 0 12px var(--gold-glow);
  background-color: #11131f;
}

.input-box::placeholder {
  color: #475569;
  font-weight: 500;
}

.error-message {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--crimson);
  margin-top: 8px;
  min-height: 20px;
  display: flex;
  align-items: center;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
  border: 2px solid #fef3c7;
  border-radius: 4px;
  color: #fff;
  font-family: var(--font-retro);
  font-size: 13px;
  padding: 16px 20px;
  cursor: pointer;
  box-shadow: 
    0 4px 0 #78350f,
    0 6px 15px rgba(0, 0, 0, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: all 0.1s ease;
  margin-top: 6px;
  letter-spacing: 1px;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  transform: translateY(-1px);
  box-shadow: 
    0 5px 0 #78350f,
    0 8px 20px rgba(245, 158, 11, 0.4);
}

.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #78350f;
}

.menu-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

.menu-footer span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================================
   PANTALLA DE JUEGO (game.php)
   ========================================================================== */

.game-viewport {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  padding: 0;
  overflow: hidden;
}

/* Contenedor centralizado para modo pantalla completa */
.game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
  overflow: hidden;
}

/* Escala el canvas manteniendo la nitidez de pixel art */
canvas, #gameCanvas, .game-canvas {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain; /* Evita que la imagen se deforme */
  display: block;
  margin: 0 auto;
  background-color: #0b0d14;
}

/* HUD Superior */
.hud-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(180deg, rgba(12, 14, 22, 0.95) 0%, rgba(12, 14, 22, 0.75) 80%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-family: var(--font-retro);
  font-size: 11px;
  color: #e2e8f0;
  pointer-events: none;
  z-index: 20;
}

.hud-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hud-title {
  color: #fbbf24;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.hud-badge {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid #475569;
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 9px;
  color: #94a3b8;
}

.hud-player {
  color: #38bdf8;
}

.hud-timer-container {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hud-timer-label {
  font-size: 9px;
  color: #94a3b8;
}

.hud-timer-value {
  font-size: 13px;
  color: #f1f5f9;
  letter-spacing: 1.5px;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.hud-timer-value.running {
  color: #38bdf8;
}

.hud-timer-value.stopped {
  color: #fbbf24;
  text-shadow: 0 0 10px var(--gold-glow);
}

.hud-volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 3px 8px;
  margin-left: 6px;
  pointer-events: auto !important;
  user-select: none;
  z-index: 30;
}

.hud-volume-slider-box {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto !important;
}

.hud-volume-slider {
  width: 70px;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  accent-color: #fbbf24;
  pointer-events: auto !important;
  touch-action: none;
}

.hud-volume-slider:hover {
  border-color: #fbbf24;
}

.hud-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fbbf24;
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.9);
  cursor: pointer;
  pointer-events: auto !important;
  transition: transform 0.1s ease;
}

.hud-volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #f59e0b;
}

.hud-volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fbbf24;
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.9);
  cursor: pointer;
  pointer-events: auto !important;
  transition: transform 0.1s ease;
}

.hud-volume-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: #f59e0b;
}

.hud-volume-label {
  font-family: var(--font-retro);
  font-size: 9px;
  color: #fbbf24;
  min-width: 32px;
  text-align: right;
  pointer-events: auto !important;
}

.hud-audio-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid #475569;
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 13px;
  padding: 3px 6px;
  cursor: pointer;
  pointer-events: auto !important;
  transition: all 0.15s ease;
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hud-audio-btn:hover {
  background: #334155;
  border-color: #f59e0b;
  transform: scale(1.1);
}

/* Barra inferior de controles */
.controls-bar {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 960px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  padding: 0 4px;
}

.controls-hint span {
  color: #94a3b8;
  background: #1e2436;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #333d59;
  font-size: 11px;
  font-family: var(--font-retro);
  margin-right: 4px;
}

/* ==========================================================================
   MODALES Y OVERLAYS (Cofres / Resultados)
   ========================================================================== */

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 7, 12, 0.88);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: linear-gradient(180deg, #191d2d 0%, #10131e 100%);
  border: 3px solid #f59e0b;
  border-radius: 8px;
  box-shadow: 
    0 0 0 1px #05060a,
    0 0 35px rgba(245, 158, 11, 0.35),
    0 20px 40px rgba(0, 0, 0, 0.95);
  width: 92%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px 24px;
  text-align: center;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-header-tag {
  display: inline-block;
  font-family: var(--font-retro);
  font-size: 12px;
  color: #fbbf24;
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.modal-level-title {
  font-family: var(--font-retro);
  font-size: 14px;
  color: #f8fafc;
  letter-spacing: 1px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.modal-level-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.modal-separator {
  height: 2px;
  background: linear-gradient(90deg, transparent, #475569, transparent);
  margin: 10px 0 14px 0;
}

.modal-body-text {
  font-size: 14px;
  line-height: 1.55;
  color: #cbd5e1;
  text-align: left;
  background: rgba(10, 12, 18, 0.65);
  padding: 14px 16px;
  border-radius: 6px;
  border: 1px solid #283048;
  margin-bottom: 16px;
  white-space: pre-line;
}

/* Esquema visual de Promoción de Ambientes (Nivel 4) */
.promotion-flow-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #090c14;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 12px 8px;
  margin-bottom: 16px;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-retro);
  font-size: 9px;
  padding: 6px 8px;
  border-radius: 4px;
  background: #1e293b;
  border: 1px solid #475569;
  letter-spacing: 0.5px;
}

.flow-badge {
  font-size: 8px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.flow-step.dev { border-color: #10b981; color: #10b981; }
.flow-step.test { border-color: #38bdf8; color: #38bdf8; }
.flow-step.staging { border-color: #f59e0b; color: #f59e0b; }
.flow-step.prod { border-color: #ef4444; color: #ef4444; }

.flow-arrow {
  color: #64748b;
  font-size: 12px;
}

/* Badge de tiempo */
.modal-time-badge {
  background: #0d101b;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.modal-time-label {
  font-family: var(--font-retro);
  font-size: 9px;
  color: #94a3b8;
  letter-spacing: 1px;
}

.modal-time-value {
  font-family: var(--font-retro);
  font-size: 18px;
  color: #38bdf8;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

/* Tabla de Desglose de 5 Niveles (Resultado Final) */
.result-table-container {
  width: 100%;
  margin-bottom: 16px;
  background: rgba(10, 12, 18, 0.7);
  border: 1px solid #2d3748;
  border-radius: 6px;
  overflow: hidden;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.result-table th {
  background: #1a202c;
  font-family: var(--font-retro);
  font-size: 9px;
  color: #fbbf24;
  padding: 8px 12px;
  letter-spacing: 1px;
  border-bottom: 1px solid #2d3748;
}

.result-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-table tr:last-child td {
  border-bottom: none;
}

.res-lvl {
  font-family: var(--font-retro);
  font-size: 9px;
  color: #94a3b8;
}

.res-name {
  font-weight: 600;
  color: #e2e8f0;
}

.res-time {
  font-family: var(--font-retro);
  font-size: 11px;
  color: #38bdf8;
  text-align: right;
  letter-spacing: 1px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-secondary {
  background: #1e293b;
  border: 2px solid #475569;
  border-radius: 4px;
  color: #cbd5e1;
  font-family: var(--font-retro);
  font-size: 11px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.1s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  background: #334155;
  border-color: #94a3b8;
  color: #fff;
}

.btn-secondary:active {
  transform: translateY(2px);
}

.reset-toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #38bdf8;
  border-radius: 4px;
  padding: 8px 16px;
  font-family: var(--font-retro);
  font-size: 10px;
  color: #38bdf8;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 30;
}

.reset-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   CICLO 3: GUARDADO DE SCORE & SCOREBOARD STYLES
   ========================================================================== */

.save-score-section {
  margin: 14px 0 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.btn-save-score {
  width: 100%;
  background: linear-gradient(180deg, #10b981 0%, #047857 100%);
  border: 2px solid #a7f3d0;
  border-radius: 4px;
  color: #fff;
  font-family: var(--font-retro);
  font-size: 12px;
  padding: 14px 18px;
  cursor: pointer;
  box-shadow: 
    0 4px 0 #064e3b,
    0 6px 15px rgba(16, 185, 129, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: all 0.15s ease;
  letter-spacing: 1px;
}

.btn-save-score:hover:not(:disabled) {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 
    0 5px 0 #064e3b,
    0 8px 20px rgba(16, 185, 129, 0.6);
}

.btn-save-score:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #064e3b;
}

.btn-save-score:disabled {
  opacity: 0.8;
  cursor: not-allowed;
  transform: none;
}

.btn-save-score.saved {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  border-color: #7dd3fc;
  box-shadow: 0 4px 0 #075985;
}

.save-status-msg {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 4px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.save-status-msg.info {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid #0284c7;
  color: #38bdf8;
}

.save-status-msg.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #6ee7b7;
}

.save-status-msg.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

/* Scoreboard View Specifics */
.scoreboard-card {
  padding: 30px 24px;
}

.scoreboard-table th {
  padding: 10px 12px;
}

.scoreboard-table td {
  padding: 10px 12px;
}

.score-row.rank-1 {
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid #f59e0b;
}

.score-row.rank-1 .res-name strong {
  color: #fbbf24;
}

.score-row.rank-2 {
  background: rgba(148, 163, 184, 0.08);
  border-left: 3px solid #cbd5e1;
}

.score-row.rank-2 .res-name strong {
  color: #f1f5f9;
}

.score-row.rank-3 {
  background: rgba(180, 83, 9, 0.08);
  border-left: 3px solid #b45309;
}

.score-row.rank-3 .res-name strong {
  color: #fed7aa;
}

.btn-detail-toggle {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.btn-detail-toggle:hover {
  background: #334155;
  border-color: #38bdf8;
  transform: scale(1.1);
}

.db-error-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fca5a5;
  font-size: 14px;
}

.db-empty-box {
  background: rgba(30, 41, 59, 0.5);
  border: 1px dashed #475569;
  border-radius: 6px;
  padding: 28px 16px;
  margin-bottom: 20px;
  text-align: center;
  color: #cbd5e1;
  font-size: 15px;
}

/* ==========================================================================
   SELECCIÓN DE MODO / DIFICULTAD (MENU_DIFICULTAD.png — Baby Mode vs Dev Mode)
   ========================================================================== */

.difficulty-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(5, 6, 10, 0.96);
  z-index: 95;
  padding: 16px;
  animation: devSelectFadeIn 0.35s ease-out;
}

.difficulty-cabinet {
  width: 96%;
  max-width: 1060px;
  max-height: 94vh;
  background: #090b12;
  border: 3px solid #f59e0b;
  border-radius: 10px;
  box-shadow:
    0 0 0 2px #05060a,
    0 0 40px rgba(245, 158, 11, 0.35),
    0 20px 50px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.difficulty-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: calc(94vh - 52px);
  margin: 0 auto;
  overflow: hidden;
  background: #080912;
  flex-shrink: 0;
}

.difficulty-bg-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  image-rendering: pixelated;
  pointer-events: none;
  transform: none !important;
}

/* Zonas interactivas estáticas sobre MENU_DIFICULTAD.png (Sin transform/scale ni elementos fuera del área) */
.difficulty-hotspot {
  position: absolute;
  left: 34.15%;
  width: 52.45%;
  padding: 0;
  background: rgba(255, 255, 255, 0);
  border: 3px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transform: none !important;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Separación vertical amplia (57.0% a 61.6% = 4.6% de espacio libre) para evitar doble selección */
.difficulty-hotspot.mode-baby {
  top: 42.40%;
  height: 14.60%;
}

.difficulty-hotspot.mode-dev {
  top: 61.60%;
  height: 16.60%;
}

.difficulty-hotspot.active {
  z-index: 10;
  transform: none !important;
}

.difficulty-hotspot.mode-baby.active {
  border-color: #f472b6;
  background: rgba(244, 114, 182, 0.08);
  box-shadow:
    0 0 0 2px #38bdf8,
    0 0 22px rgba(244, 114, 182, 0.8),
    inset 0 0 18px rgba(56, 189, 248, 0.25);
}

.difficulty-hotspot.mode-dev.active {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.08);
  box-shadow:
    0 0 0 2px #ef4444,
    0 0 24px rgba(250, 204, 21, 0.85),
    inset 0 0 18px rgba(245, 158, 11, 0.25);
}

.difficulty-cursor-arrow {
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-retro);
  font-size: 18px;
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.95), 0 2px 4px #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.difficulty-hotspot.active .difficulty-cursor-arrow {
  opacity: 1;
}

.difficulty-tag-pill {
  position: absolute;
  right: 10px;
  top: 8px;
  font-family: var(--font-retro);
  font-size: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.85);
}

.difficulty-hotspot.active .difficulty-tag-pill {
  opacity: 1;
}

.difficulty-tag-pill.baby-pill {
  background: rgba(131, 24, 67, 0.92);
  border: 1px solid #f472b6;
  color: #fce7f3;
}

.difficulty-tag-pill.dev-pill {
  background: rgba(120, 53, 15, 0.92);
  border: 1px solid #fbbf24;
  color: #fef3c7;
}

/* Botones táctiles de modo adicionales para celulares (ocultos en PC) */
.difficulty-mobile-btns {
  display: none;
}

.btn-mobile-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 6px;
  border: 2px solid #334155;
  background: #131826;
  color: #e2e8f0;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-mobile-mode-title {
  font-family: var(--font-retro);
  font-size: 10px;
  letter-spacing: 0.5px;
}

.btn-mobile-mode-sub {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

.btn-mobile-mode.mode-baby-btn {
  border-color: rgba(244, 114, 182, 0.45);
}

.btn-mobile-mode.mode-baby-btn .btn-mobile-mode-title {
  color: #f9a8d4;
}

.btn-mobile-mode.mode-baby-btn.active {
  background: rgba(131, 24, 67, 0.35);
  border-color: #f472b6;
  box-shadow: 0 0 14px rgba(244, 114, 182, 0.55);
}

.btn-mobile-mode.mode-dev-btn {
  border-color: rgba(245, 158, 11, 0.45);
}

.btn-mobile-mode.mode-dev-btn .btn-mobile-mode-title {
  color: #fbbf24;
}

.btn-mobile-mode.mode-dev-btn.active {
  background: rgba(120, 53, 15, 0.38);
  border-color: #fbbf24;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.55);
}

.difficulty-footer-bar {
  background: #0c0f1a;
  border-top: 2px solid #1e293b;
  padding: 0 18px;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.difficulty-mode-desc {
  font-size: 13px;
  color: #e2e8f0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.difficulty-footer-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.difficulty-keys-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-right: 4px;
}

.difficulty-keys-hint kbd {
  background: #1e293b;
  border: 1px solid #475569;
  color: #fbbf24;
  font-family: var(--font-retro);
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 3px;
}

/* Banners de estado de Modo en Paso Nombre, HUD y Modal de Resultados */
.mode-status-banner {
  font-family: var(--font-retro);
  font-size: 9px;
  padding: 8px 12px;
  border-radius: 5px;
  margin-bottom: 16px;
  letter-spacing: 0.8px;
  line-height: 1.4;
}

.mode-status-banner.mode-normal {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid #f59e0b;
  color: #fbbf24;
}

.mode-status-banner.mode-baby {
  background: rgba(244, 114, 182, 0.15);
  border: 1px solid #f472b6;
  color: #f9a8d4;
}

.hud-baby-badge {
  background: rgba(131, 24, 67, 0.85) !important;
  border-color: #f472b6 !important;
  color: #fbcfe8 !important;
  box-shadow: 0 0 10px rgba(244, 114, 182, 0.4);
}

.baby-mode-no-rank-box {
  width: 100%;
  background: rgba(131, 24, 67, 0.22);
  border: 2px dashed #f472b6;
  border-radius: 6px;
  padding: 14px 16px;
  text-align: center;
}

/* ==========================================================================
   DEV SELECT — PANTALLA DE SELECCIÓN DE 7 PERSONAJES (Guía menuFinal.jpg)
   ========================================================================== */

.dev-select-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1420px;
  padding: 12px 18px;
  animation: devSelectFadeIn 0.35s ease-out;
}

@keyframes devSelectFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.dev-select-cabinet {
  background: radial-gradient(circle at 50% 10%, rgba(245, 158, 11, 0.12) 0%, rgba(13, 17, 27, 0.98) 65%),
              linear-gradient(180deg, #0d111c 0%, #090c14 60%, #06080e 100%);
  border: 3px solid #f59e0b;
  border-radius: 12px;
  box-shadow: 
    0 0 0 3px #05060a,
    0 0 35px rgba(245, 158, 11, 0.35),
    inset 0 0 30px rgba(0, 0, 0, 0.85),
    inset 0 2px 0 rgba(255, 255, 255, 0.12);
  padding: 20px 24px 18px;
  position: relative;
  overflow: hidden;
}

.dev-select-cabinet::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 2px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
  z-index: 1;
}

.dev-select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  position: relative;
  z-index: 2;
}

.dev-header-decor {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}

.dev-header-label {
  font-size: 12px;
  font-family: var(--font-retro);
  color: #94a3b8;
  letter-spacing: 1px;
}

.dev-select-title-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  flex: 1;
}

.dev-select-main-title {
  font-family: var(--font-retro);
  font-size: 32px;
  color: #fbbf24;
  letter-spacing: 4px;
  margin: 0;
  text-transform: uppercase;
  text-shadow: 
    0 2px 0 #b45309,
    0 4px 0 #78350f,
    0 6px 0 #451a03,
    0 0 20px rgba(245, 158, 11, 0.8);
  display: inline-block;
  animation: titleGlowPulse 2s infinite alternate ease-in-out;
}

@keyframes titleGlowPulse {
  0% { text-shadow: 0 2px 0 #b45309, 0 4px 0 #78350f, 0 0 15px rgba(245, 158, 11, 0.6); }
  100% { text-shadow: 0 2px 0 #b45309, 0 4px 0 #78350f, 0 0 30px rgba(251, 191, 36, 0.95), 0 0 50px rgba(239, 68, 68, 0.5); }
}

.dev-select-player-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
}

.dev-select-player-badge strong {
  color: #38bdf8;
}

.dev-select-mode-pill {
  font-family: var(--font-retro);
  font-size: 9px;
  padding: 5px 10px;
  border-radius: 14px;
  border: 1px solid #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.dev-select-mode-pill.baby {
  border-color: #f472b6;
  background: rgba(244, 114, 182, 0.18);
  color: #f9a8d4;
}

/* Grilla de 7 personajes (MARTINEZ, ALMADA, BOXER, CEBALLES, MAYO, ZABALA, BARREDA) */
.dev-cards-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
  z-index: 2;
}

.dev-card-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dev-p1-indicator {
  height: 24px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dev-card-wrapper.active .dev-p1-indicator {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  animation: p1Bounce 0.8s infinite alternate ease-in-out;
}

@keyframes p1Bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

.dev-p1-badge-img {
  height: 24px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px #f59e0b);
}

.dev-card {
  width: 100%;
  background: #0b0f19;
  border: 2px solid #263044;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.65);
}

.dev-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: #38bdf8;
  box-shadow:
    0 0 18px rgba(56, 189, 248, 0.55),
    0 12px 24px rgba(0, 0, 0, 0.85);
}

.dev-card-wrapper.active .dev-card {
  border-color: #facc15;
  border-width: 3px;
  box-shadow: 
    0 0 0 2px #ef4444,
    0 0 24px rgba(250, 204, 21, 0.8),
    0 12px 28px rgba(0, 0, 0, 0.9);
  transform: translateY(-6px) scale(1.035);
}

.dev-card-wrapper.launching .dev-card {
  border-color: #ffffff;
  border-width: 3px;
  animation: devCardLaunchFlash 0.15s infinite alternate ease-in-out;
}

@keyframes devCardLaunchFlash {
  0% { 
    transform: translateY(-6px) scale(1.05); 
    box-shadow: 0 0 35px rgba(250, 204, 21, 1), 0 0 0 3px #ffffff; 
  }
  100% { 
    transform: translateY(-8px) scale(1.07); 
    box-shadow: 0 0 50px rgba(239, 68, 68, 1), 0 0 0 4px #fbbf24; 
  }
}

/* Marco y avatar del personaje (Estilo menuFinal.jpg) */
.dev-portrait-frame {
  width: 100%;
  aspect-ratio: 3 / 4.1;
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, #60a5fa 0%, #93c5fd 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.dev-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.dev-card:hover .dev-portrait-img,
.dev-card-wrapper.active .dev-portrait-img {
  transform: scale(1.06);
  filter: contrast(1.05) brightness(1.04);
}

/* Nombre del personaje e información estilo menuFinal.jpg */
.dev-info-box {
  padding: 10px 6px 12px;
  background: #0b0e17;
  border-top: 2px solid #1e293b;
  text-align: center;
}

.dev-name-title {
  font-family: var(--font-retro);
  font-size: 12px;
  color: #f59e0b;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  text-shadow: 
    -1px -1px 0 #000,  
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000,
     0 2px 0 #78350f;
}

.dev-card:hover .dev-name-title,
.dev-card-wrapper.active .dev-name-title {
  color: #fef08a;
  text-shadow: 
    -1px -1px 0 #000,  
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000,
     0 2px 0 #dc2626,
     0 0 10px rgba(250, 204, 21, 0.9);
}

.dev-role-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.dev-card:hover .dev-role-tag,
.dev-card-wrapper.active .dev-role-tag {
  color: #38bdf8;
}

.dev-tech-pills {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Barra inferior de confirmación y acciones (menuFinal.jpg) */
.dev-select-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 30;
  pointer-events: auto;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dev-select-hint {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dev-select-hint kbd {
  background: #1e293b;
  border: 1px solid #475569;
  color: #fbbf24;
  font-family: var(--font-retro);
  font-size: 8px;
  padding: 3px 6px;
  border-radius: 3px;
}

.dev-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 35;
  pointer-events: auto;
}

.btn-change-name {
  font-size: 11px;
  padding: 13px 20px;
  background: #1e2536;
  border-color: #334155;
  position: relative;
  z-index: 40;
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
}

.btn-start-dev {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  border: 2px solid #fbbf24;
  border-radius: 6px;
  color: #090d16;
  font-family: var(--font-retro);
  font-size: 12px;
  font-weight: 700;
  padding: 14px 28px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-start-dev:hover {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.btn-start-dev:active {
  transform: translateY(1px);
}

/* HUD Avatar y badges en juego */
.hud-dev-avatar {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid #f59e0b;
  vertical-align: middle;
  margin-right: 6px;
  object-fit: cover;
  image-rendering: pixelated;
}

.hud-dev-tag {
  color: #f59e0b;
  font-size: 9px;
  margin-left: 4px;
}

/* Modal Avatar de Dev en fin de nivel y victoria */
.modal-dev-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

.modal-dev-img {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  border: 2px solid #f59e0b;
  object-fit: cover;
  image-rendering: pixelated;
}

.modal-dev-info {
  text-align: left;
}

.modal-dev-name {
  font-family: var(--font-retro);
  font-size: 11px;
  color: #fbbf24;
}

.modal-dev-role {
  font-size: 12px;
  color: #94a3b8;
}

/* Responsive para pantallas medianas (Tablets / Laptops chicas) */
@media (max-width: 1180px) and (min-width: 769px) {
  .dev-cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  .dev-card-wrapper {
    width: calc(25% - 8px);
  }
  .dev-select-wrapper {
    max-height: 96vh;
    overflow-y: auto;
  }
}

/* ==========================================================================
   VIDEO INTRODUCTORIO (index.php — Secuencia Intro P2)
   ========================================================================== */

.video-intro-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: rgba(6, 8, 14, 0.96);
  backdrop-filter: blur(8px);
}

.video-intro-card {
  background: linear-gradient(180deg, #181b2b 0%, #0d0f17 100%);
  border: 3px solid #f59e0b;
  border-radius: 8px;
  box-shadow: 
    0 0 0 1px #05060a,
    0 0 40px rgba(245, 158, 11, 0.35),
    0 20px 45px rgba(0, 0, 0, 0.95);
  max-width: 920px;
  width: 96%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 22px;
  position: relative;
}

.video-intro-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
  font-family: var(--font-retro);
  font-size: 11px;
}

.video-badge {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
  letter-spacing: 1px;
}

.video-title-tag {
  color: #94a3b8;
  font-size: 10px;
}

.video-player-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #2d334d;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-player-container video {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
}

.btn-play-trigger {
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
  border: 2px solid #fef3c7;
  color: #fff;
  font-family: var(--font-retro);
  font-size: 13px;
  padding: 14px 28px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.video-intro-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 14px;
}

.video-shortcut-hint {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.video-shortcut-hint kbd {
  color: #94a3b8;
  background: #1e2436;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #333d59;
  font-size: 10px;
  font-family: var(--font-retro);
}

.btn-skip-video {
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
  border: 2px solid #fef3c7;
  border-radius: 4px;
  color: #fff;
  font-family: var(--font-retro);
  font-size: 11px;
  padding: 12px 22px;
  cursor: pointer;
  box-shadow: 0 4px 0 #78350f, 0 6px 15px rgba(0, 0, 0, 0.6);
  transition: all 0.1s ease;
  letter-spacing: 1px;
}

.btn-skip-video:hover {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #78350f, 0 8px 20px rgba(245, 158, 11, 0.4);
}

.btn-skip-video:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #78350f;
}

/* ==========================================================================
   CONTROLES TÁCTILES MÓVILES (TOUCH OVERLAY)
   ========================================================================== */

.mobile-ui {
  display: none;
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  padding: 0 24px;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 40;
  touch-action: none;
}

.dpad {
  display: flex;
  gap: 14px;
  pointer-events: auto;
}

.action-buttons {
  display: flex;
  gap: 14px;
  pointer-events: auto;
}

.touch-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.82);
  border: 2px solid #38bdf8;
  color: #f8fafc;
  font-family: var(--font-retro);
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(4px);
  transition: transform 0.08s ease, background-color 0.08s ease, border-color 0.08s ease;
}

.touch-btn:active,
.touch-btn.pressed {
  background: rgba(56, 189, 248, 0.45);
  border-color: #fbbf24;
  transform: scale(0.92);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

.touch-btn-jump {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.3);
  border: 2px solid #fbbf24;
  color: #fbbf24;
  font-size: 10px;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(245, 158, 11, 0.4);
}

.touch-btn-jump:active,
.touch-btn-jump.pressed {
  background: rgba(245, 158, 11, 0.55);
  border-color: #fef08a;
  color: #fff;
  transform: scale(0.92);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.8);
}

/* Forzar visualización de controles táctiles en pantallas táctiles o teléfonos */
@media (max-width: 1024px) and (pointer: coarse) {
  .mobile-ui {
    display: flex;
  }
}

/* ==========================================================================
   PORTADA / POSTER INICIAL (index.php — Paso 0)
   ========================================================================== */

.poster-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #05060a;
  z-index: 100;
  padding: 12px;
  cursor: pointer;
}

.poster-cabinet {
  position: relative;
  width: 96%;
  max-width: 960px;
  max-height: 92vh;
  aspect-ratio: 16 / 9;
  background: #0a0b10;
  border: 3px solid #f59e0b;
  border-radius: 8px;
  box-shadow: 
    0 0 0 1px #05060a,
    0 0 45px rgba(245, 158, 11, 0.35),
    0 20px 50px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.poster-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  image-rendering: auto;
  z-index: 1;
  transition: transform 0.4s ease;
}

.poster-wrapper:hover .poster-bg-img {
  transform: scale(1.015);
}

.poster-start-bar {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 24px 16px 36px;
  background: linear-gradient(0deg, rgba(6, 8, 14, 0.95) 0%, rgba(6, 8, 14, 0.65) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.poster-press-hint {
  font-family: var(--font-retro);
  font-size: 15px;
  color: #fde047;
  letter-spacing: 2px;
  text-shadow: 
    0 0 12px rgba(253, 224, 71, 0.9),
    0 0 24px rgba(245, 158, 11, 0.75),
    0 2px 4px rgba(0, 0, 0, 0.95);
  animation: arcadeBlink 1.1s infinite ease-in-out;
  text-align: center;
  user-select: none;
  cursor: pointer;
}

@keyframes arcadeBlink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    text-shadow: 0 0 14px rgba(253, 224, 71, 0.95), 0 0 28px rgba(245, 158, 11, 0.8), 0 2px 4px rgba(0, 0, 0, 0.95);
  }
  50% {
    opacity: 0.25;
    transform: scale(0.98);
    text-shadow: 0 0 4px rgba(253, 224, 71, 0.3);
  }
}

/* ==========================================================================
   DISEÑO WEB RESPONSIVE INTEGRAL PARA CELULARES Y DISPOSITIVOS MÓVILES
   (Portada, Video Intro, Menú de Dificultad, Nombre y Selección de Personajes)
   ========================================================================== */

@media (max-width: 768px) {
  html, body {
    height: 100dvh;
    min-height: 100dvh;
    overflow-x: hidden;
  }

  /* 1. PASO 0: PORTADA / MENÚ DE INICIO (POSTER.jpg completo sin recortes laterales) */
  .poster-wrapper {
    height: 100dvh;
    padding: 12px;
  }

  .poster-cabinet {
    width: 100%;
    max-width: 540px;
    height: auto;
    max-height: 92dvh;
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #070910;
  }

  .poster-bg-img {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    transform: none !important;
    display: block;
    background: #05060a;
  }

  .poster-wrapper:hover .poster-bg-img {
    transform: none !important;
  }

  .poster-start-bar {
    position: relative;
    padding: 18px 14px 20px;
    background: linear-gradient(180deg, #101423 0%, #070911 100%);
    border-top: 2px solid rgba(245, 158, 11, 0.55);
  }

  .poster-press-hint {
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: 1px;
    padding: 12px 10px;
    width: 100%;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.5);
    border-radius: 6px;
  }

  /* 2. PASO 1: VIDEO INTRO EN CELULARES */
  .video-intro-wrapper {
    height: 100dvh;
    padding: 10px;
  }

  .video-intro-card {
    width: 100%;
    max-height: 94dvh;
    padding: 14px 12px;
  }

  .video-intro-header {
    font-size: 9px;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
  }

  .video-title-tag {
    font-size: 8px;
  }

  .video-shortcut-hint {
    display: none;
  }

  .video-intro-footer {
    justify-content: center;
    margin-top: 12px;
  }

  .btn-skip-video {
    width: 100%;
    text-align: center;
    padding: 14px 16px;
    font-size: 11px;
  }

  .btn-play-trigger {
    font-size: 11px;
    padding: 12px 18px;
  }

  /* 3. PASO 2: MENÚ DE DIFICULTAD (MENU_DIFICULTAD.png 100% estático + botones táctiles) */
  .difficulty-wrapper {
    height: 100dvh;
    padding: 10px;
  }

  .difficulty-cabinet {
    width: 100%;
    max-height: 96dvh;
  }

  .difficulty-stage {
    width: 100%;
    aspect-ratio: 3 / 2;
    max-height: 50dvh;
  }

  .difficulty-cursor-arrow {
    font-size: 12px;
    left: -16px;
  }

  .difficulty-tag-pill {
    display: none;
  }

  .difficulty-mobile-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 10px;
    background: #090c15;
    border-top: 2px solid #1e293b;
    flex-shrink: 0;
  }

  .difficulty-footer-bar {
    height: 84px;
    min-height: 84px;
    max-height: 84px;
    padding: 8px 10px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }

  .difficulty-mode-desc {
    white-space: normal;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    width: 100%;
    max-height: 30px;
    overflow: hidden;
  }

  .difficulty-keys-hint {
    display: none;
  }

  .difficulty-footer-actions {
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  /* 4. PASO 3: INGRESO DE NOMBRE EN CELULARES */
  .menu-wrapper {
    padding: 10px;
    max-height: 98dvh;
    overflow-y: auto;
  }

  .menu-card {
    padding: 20px 16px;
  }

  .mode-status-banner {
    font-size: 8px;
    padding: 7px 8px;
    margin-bottom: 12px;
  }

  .game-title {
    font-size: 19px;
    margin-bottom: 8px;
  }

  .game-subtitle {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .form-group {
    margin-bottom: 14px;
  }

  .form-label {
    font-size: 10px;
    margin-bottom: 8px;
  }

  .input-box {
    font-size: 16px; /* Evita auto-zoom en iOS */
    padding: 12px 14px;
  }

  .btn-primary {
    font-size: 11px;
    padding: 14px 12px;
  }

  .menu-card .btn-secondary {
    font-size: 10px;
    padding: 11px 12px;
    margin-top: 8px !important;
  }

  .menu-footer {
    margin-top: 14px;
    padding-top: 12px;
    font-size: 11px;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }

  /* 5. PASO 4: SELECCIÓN DE PERSONAJES (DEV SELECT — 7 Personajes adaptados a celular) */
  .dev-select-wrapper {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .dev-select-cabinet {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 12px 10px 12px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .dev-select-header {
    margin-bottom: 8px;
    flex-shrink: 0;
    justify-content: center;
  }

  .dev-header-decor {
    display: none;
  }

  .dev-select-title-box {
    gap: 6px 8px;
  }

  .dev-select-main-title {
    font-size: 18px;
    letter-spacing: 2px;
    width: 100%;
    text-align: center;
  }

  .dev-select-player-badge {
    font-size: 11px;
    padding: 3px 10px;
  }

  .dev-select-mode-pill {
    font-size: 8px;
    padding: 4px 8px;
  }

  /* Grilla 3 + 3 + 1 centrada y compacta para ver los 7 personajes cómodamente */
  .dev-cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    padding: 4px 2px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dev-card-wrapper {
    width: calc(33.333% - 6px);
    position: relative;
  }

  .dev-p1-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 10;
    height: 18px;
    margin-bottom: 0;
    pointer-events: none;
  }

  .dev-p1-badge-img {
    height: 18px;
  }

  .dev-card:hover,
  .dev-card-wrapper.active .dev-card {
    transform: translateY(-2px);
  }

  .dev-portrait-frame {
    aspect-ratio: 3 / 3.25;
  }

  .dev-info-box {
    padding: 6px 4px 7px;
  }

  .dev-name-title {
    font-size: 9px;
    margin-bottom: 2px;
    letter-spacing: 0.2px;
  }

  .dev-role-tag {
    font-size: 8.5px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dev-tech-pills {
    display: none;
  }

  .dev-select-footer {
    flex-shrink: 0;
    margin-top: 0;
    padding-top: 10px;
    flex-direction: column;
    gap: 6px;
  }

  .dev-select-hint {
    display: none;
  }

  .dev-actions-group {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .btn-change-name {
    padding: 12px 10px;
    font-size: 8.5px;
    flex: 0 0 auto;
  }

  .btn-start-dev {
    padding: 12px 10px;
    font-size: 9.5px;
    flex: 1;
    justify-content: center;
    text-align: center;
    letter-spacing: 0.5px;
  }
}

/* Ajustes adicionales para teléfonos muy angostos (<= 360px) */
@media (max-width: 360px) {
  .dev-name-title {
    font-size: 8px;
  }
  .dev-role-tag {
    font-size: 7.5px;
  }
  .btn-mobile-mode-title {
    font-size: 8.5px;
  }
  .btn-change-name {
    padding: 11px 8px;
    font-size: 8px;
  }
  .btn-start-dev {
    padding: 11px 8px;
    font-size: 8.5px;
  }
}

/* Modo Horizontal (Landscape) en Celulares (altura reducida <= 540px) */
@media (max-height: 540px) and (orientation: landscape) {
  .poster-wrapper {
    padding: 6px;
    height: 100dvh;
  }

  .poster-cabinet {
    height: 94dvh;
    width: auto;
    max-width: 96vw;
    aspect-ratio: 16 / 9;
  }

  .poster-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .poster-start-bar {
    position: relative;
    padding: 10px 12px 14px;
    background: linear-gradient(0deg, rgba(6, 8, 14, 0.95) 0%, rgba(6, 8, 14, 0.65) 60%, transparent 100%);
    border-top: none;
  }

  .poster-press-hint {
    font-size: 10px;
    padding: 6px 12px;
    width: auto;
  }

  .difficulty-wrapper {
    padding: 6px;
    height: 100dvh;
  }

  .difficulty-cabinet {
    max-height: 96dvh;
    width: auto;
  }

  .difficulty-stage {
    max-height: calc(96dvh - 44px);
    width: auto;
    aspect-ratio: 3 / 2;
  }

  .difficulty-mobile-btns {
    display: none;
  }

  .difficulty-footer-bar {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    flex-direction: row;
    padding: 0 12px;
  }

  .difficulty-mode-desc {
    white-space: nowrap;
    text-align: left;
    font-size: 11px;
  }

  .difficulty-footer-actions {
    width: auto;
  }

  .menu-wrapper {
    max-height: 98dvh;
    overflow-y: auto;
    padding: 8px;
  }

  .menu-card {
    padding: 14px 18px;
  }

  .game-title {
    font-size: 18px;
    margin-bottom: 4px;
  }

  .game-subtitle {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .dev-select-wrapper {
    height: 100dvh;
    max-height: 100dvh;
    padding: 6px 10px;
  }

  .dev-select-cabinet {
    max-height: calc(100dvh - 12px);
    padding: 8px 12px;
  }

  .dev-select-header {
    margin-bottom: 6px;
  }

  .dev-header-decor {
    display: none;
  }

  .dev-select-main-title {
    font-size: 16px;
    width: auto;
  }

  .dev-cards-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 6px;
    overflow-y: auto;
  }

  .dev-card-wrapper {
    width: 100%;
  }

  .dev-p1-indicator {
    position: absolute;
    top: 3px;
    right: 3px;
    height: 16px;
    margin: 0;
  }

  .dev-p1-badge-img {
    height: 16px;
  }

  .dev-portrait-frame {
    aspect-ratio: 3 / 3.1;
  }

  .dev-info-box {
    padding: 4px 3px 5px;
  }

  .dev-name-title {
    font-size: 8px;
    margin-bottom: 2px;
  }

  .dev-role-tag {
    font-size: 7.5px;
  }

  .dev-tech-pills {
    display: none;
  }

  .dev-select-footer {
    padding-top: 6px;
    flex-direction: row;
  }

  .dev-actions-group {
    width: 100%;
    justify-content: flex-end;
  }

  .btn-change-name,
  .btn-start-dev {
    padding: 8px 14px;
    font-size: 9px;
    flex: 0 1 auto;
  }
}
