@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Outfit:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  /* PALETA TOTALMENTE LUMINOSA Y CIENTÍFICA (NO NEGRA) */
  --bg-main: #edf2f7;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;

  /* Acentos vibrantes según la imagen del menú */
  --fuchsia-pink: #ec4899;
  --fuchsia-gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --fuchsia-glow: rgba(236, 72, 153, 0.4);

  --neon-cyan: #0284c7;
  --neon-cyan-glow: rgba(2, 132, 199, 0.3);
  --neon-purple: #9333ea;
  --neon-purple-glow: rgba(147, 51, 234, 0.25);
  --neon-green: #059669;
  --neon-green-glow: rgba(5, 150, 105, 0.25);
  --neon-gold: #d97706;
  --neon-red: #e11d48;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --border-subtle: #cbd5e1;
  --border-glass: rgba(168, 85, 247, 0.3);
  --border-glass-cyan: rgba(2, 132, 199, 0.3);

  --font-main: 'Outfit', -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

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

/* FONDO DEFINITIVAMENTE LUMINOSO Y CIENTÍFICO (NO NEGRO) */
body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  background-image: 
    linear-gradient(135deg, #e6eef5 0%, #f7fafc 50%, #e2ebf4 100%),
    radial-gradient(circle at 85% 10%, rgba(168, 85, 247, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 15% 90%, rgba(2, 132, 199, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--fuchsia-pink); }

/* ==========================================================================
   CABECERA SUPERIOR (RÉPLICA EXACTA DEL MENÚ)
   ========================================================================== */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  background: rgba(19, 27, 46, 0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-icon-wrap {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon-svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 8px rgba(236, 72, 153, 0.6));
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-main-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
  display: flex;
  align-items: baseline;
}

.brand-main-name span.pink {
  color: #f43f5e;
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: #94a3b8;
  text-transform: uppercase;
}

/* Enlaces del Menú Central */
.nav-links-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-link-item {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link-item:hover, .nav-link-item.active {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Botones Píldora del Menú Derecho */
.nav-pills-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.nav-pill-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Botón Destacado Magenta: UNIRSE CON PIN */
.nav-pill-pin {
  background: var(--fuchsia-gradient);
  border: none;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 18px var(--fuchsia-glow);
  padding: 9px 18px;
}

.nav-pill-pin:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(236, 72, 153, 0.7);
}

/* Botón Jugar Demo Gratis (Rayo) - Alto contraste y máxima legibilidad */
.nav-pill-demo {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: 1px solid #10b981;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.nav-pill-demo:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  border-color: #34d399;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.55);
  transform: translateY(-2px);
  color: #ffffff !important;
}


/* ==========================================================================
   VISTAS Y SECCIONES
   ========================================================================== */
.main-viewport {
  padding-top: 68px;
  min-height: 100vh;
}

.view-section {
  display: none;
  animation: viewFade 0.3s ease-out forwards;
}

.view-section.active {
  display: block;
}

@keyframes viewFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   HERO / INICIO
   ========================================================================== */
.hero-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 50px 24px 30px;
  text-align: center;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  border-radius: var(--radius-full);
  color: #6d28d9;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 22px;
}

.hero-headline {
  font-family: var(--font-heading);
  font-size: clamp(32px, 4.8vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  color: #0f172a;
  margin-bottom: 18px;
}

.hero-headline span.gradient {
  background: linear-gradient(135deg, #0284c7 0%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subhead {
  max-width: 760px;
  margin: 0 auto 36px;
  font-size: 17px;
  line-height: 1.6;
  color: #475569;
}

/* Selector de Nivel en la Home */
.level-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.level-tab-btn {
  padding: 9px 20px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.level-tab-btn:hover, .level-tab-btn.active {
  background: #6d28d9;
  border-color: #6d28d9;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.25);
}

.level-tab-btn.demo-tab.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

/* ==========================================================================
   CATÁLOGO DE SALAS / EXPERIENCIAS
   ========================================================================== */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 26px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 24px 70px;
}

.exp-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.exp-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0284c7, var(--theme-color, #ec4899));
}

.exp-card:hover {
  transform: translateY(-6px);
  border-color: #cbd5e1;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.exp-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.exp-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: #334155;
}

.exp-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.exp-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.exp-desc {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 22px;
}

.exp-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-play-demo {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border: 1px solid #059669 !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
  cursor: pointer;
}

.btn-play-demo:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.55) !important;
  transform: translateY(-2px);
}


/* ==========================================================================
   VISTA DE JUEGO / ESCENARIO 3D INTERACTIVO
   ========================================================================== */
.game-viewport-wrap {
  display: grid;
  grid-template-columns: 1fr 480px;
  height: calc(100vh - 68px);
  overflow: hidden;
}

@media (max-width: 1024px) {
  .game-viewport-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: 45vh 1fr;
    height: auto;
  }
}

.canvas-wrap-3d {
  position: relative;
  width: 100%;
  height: 100%;
  background: #dce8f4;
  overflow: hidden;
}

#canvas-container {
  width: 100%;
  height: 100%;
}

/* HUD Superior en Escenario 3D */
.game-hud-top {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.hud-group {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.hud-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cbd5e1;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-inventory-bar {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cbd5e1;
  padding: 8px 18px;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.inventory-items {
  display: flex;
  gap: 8px;
}

.inventory-slot {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 2px dashed #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.inventory-slot.filled {
  border-style: solid;
  border-color: #059669;
  background: #d1fae5;
}

/* Panel Lateral del Enigma */
.enigma-panel {
  background: #ffffff;
  border-left: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.enigma-header {
  padding: 22px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.enigma-station-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #0284c7;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.enigma-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex-grow: 1;
}

.enigma-audio-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  border-radius: var(--radius-md);
}

.audio-play-btn {
  background: var(--fuchsia-gradient);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(236, 72, 153, 0.3);
}

.consigna-card {
  background: #f8fafc;
  border-left: 4px solid #0284c7;
  padding: 18px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 15px;
  line-height: 1.6;
  color: #1e293b;
}

/* Botón de Salir de Misión - Alto contraste y máxima visibilidad */
.btn-exit-game {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid #b91c1c !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-full) !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.45) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-exit-game:hover {
  background: #b91c1c !important;
  border-color: #991b1b !important;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.65) !important;
  transform: translateY(-2px) !important;
  color: #ffffff !important;
}

/* Campo de texto de respuesta - Máxima legibilidad y contraste */
#input-user-answer {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 2px solid #0284c7 !important;
  border-radius: 10px !important;
  padding: 14px 18px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.12) !important;
  outline: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}

#input-user-answer::placeholder {
  color: #64748b !important;
  font-weight: 500 !important;
}

#input-user-answer:focus {
  background: #ffffff !important;
  border-color: #0369a1 !important;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.25) !important;
}

/* Opciones de test múltiple */
.test-option-btn {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 2px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-align: center !important;
}

.test-option-btn:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  transform: translateY(-1px) !important;
}

.test-option-btn.selected {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0369a1 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2) !important;
}


/* Pistas con Penalización */
.hints-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hint-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.hint-header-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.hint-penalty-badge {
  font-size: 11px;
  font-weight: 700;
  color: #e11d48;
  background: #ffe4e6;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.hint-revealed-text {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  font-size: 13px;
  color: #0369a1;
  line-height: 1.55;
}

.hint-item.revealed .hint-revealed-text {
  display: block;
}

/* ==========================================================================
   MODALES (LUMINOSOS Y ELEGANTES)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-window {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  padding: 32px;
  position: relative;
  color: #0f172a;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.modal-close-btn:hover { background: #fee2e2; color: #e11d48; }

/* Grid de Selección de Avatar Humano 3D */
.avatar-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.avatar-choice-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-choice-card:hover {
  background: #ede9fe;
  border-color: #a855f7;
}

.avatar-choice-card.selected {
  background: #e0f2fe;
  border-color: #0284c7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.2);
}

.avatar-preview-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

/* Tabla de Precios & Pases */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.pricing-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pricing-card.highlight {
  border-color: #ec4899;
  background: #fdf2f8;
  box-shadow: 0 10px 25px rgba(236, 72, 153, 0.15);
}

.price-number {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 800;
  color: #0f172a;
  margin: 10px 0;
}

/* ==========================================================================
   PANEL ADMINISTRADOR
   ========================================================================== */
.admin-level-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
}

.admin-level-btn {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.admin-level-btn.active {
  background: var(--fuchsia-gradient);
  color: white;
  border: none;
}

.enigma-admin-item {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.enigma-admin-item:hover {
  border-color: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.enigma-admin-item.inactive {
  opacity: 0.6;
  border-style: dashed;
  background: #f8fafc;
}

.diff-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.diff-badge-demo {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.diff-badge-facil {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.diff-badge-media {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.diff-badge-dificil {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
