@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700;800&family=Nunito:wght@700;900&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #60A5FA;
  font-family: 'Fredoka', 'Nunito', 'Segoe UI', cursive, sans-serif;
  touch-action: none;
}

#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* =========================================
   PANTALLA DE INICIO (SPLASH & LOGO)
   ========================================= */
.splash-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background: radial-gradient(circle at center, #7DD3FC 0%, #38BDF8 60%, #0284C7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
}

/* Contenedor vertical estilo arcade móvil */
.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  width: 100%;
  max-width: 400px;
  height: 100%;
  max-height: 640px;
  margin: auto;
  position: relative;
  z-index: 102;
}

/* REGLA UNIVERSAL PARA OCULTAR PANTALLAS */
.hide,
.map-screen.hide,
.shop-screen.hide,
.splash-screen.hide,
.game-hud.hide,
.modal-overlay.hide,
.orientation-overlay.hide {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Logotipo libre de Serberus Core (sin marco) en la esquina inferior derecha */
.company-signature {
  position: absolute;
  bottom: 14px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  z-index: 105;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.company-signature:hover {
  transform: scale(1.08) translateY(-2px);
}

.company-signature:active {
  transform: scale(0.95);
}

.signature-logo {
  height: clamp(52px, 7.5vh, 68px);
  width: auto;
  max-width: 190px;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
  transition: filter 0.25s ease;
}

.company-signature:hover .signature-logo {
  filter: drop-shadow(0 8px 18px rgba(56, 189, 248, 0.7));
}

.game-intro-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
}

.intro-illustration.intro-mascot {
  width: clamp(105px, 20vh, 135px);
  height: clamp(105px, 20vh, 135px);
  margin-bottom: 2px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
  animation: gentleFloat 2.2s ease-in-out infinite alternate;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.intro-illustration.intro-mascot:hover,
.intro-illustration.intro-mascot:active {
  transform: scale(1.15) rotate(6deg);
}

.game-tagline {
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-top: 4px;
}

.game-title {
  font-size: clamp(32px, 8vw, 44px);
  font-weight: 900;
  color: #FACC15;
  text-align: center;
  line-height: 1.0;
  margin: 0;
  text-shadow: 
    3px 3px 0 #1E293B,
    -2px -2px 0 #1E293B,
    2px -2px 0 #1E293B,
    -2px 2px 0 #1E293B,
    0 7px 0 #CA8A04,
    0 10px 16px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-top: 0;
}

.menu-secondary-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

/* BOTONES CARTOON */
.btn-cartoon {
  border: 4px solid #1E293B;
  border-radius: 50px;
  font-family: inherit;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-play {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(180deg, #4ADE80 0%, #22C55E 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 0 #15803D, 0 12px 20px rgba(0, 0, 0, 0.2);
  text-shadow: 0 2px 0 #15803D;
  animation: pulseScale 1.8s ease-in-out infinite;
}

.btn-play:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #15803D, 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFFFFF 0%, #F1F5F9 100%);
  color: #1E293B;
  font-size: 24px;
  border: 3.5px solid #1E293B;
  box-shadow: 0 5px 0 #64748B, 0 8px 15px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #64748B, 0 10px 18px rgba(0, 0, 0, 0.25);
}

.btn-icon:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #64748B;
}

.splash-footer {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  text-align: center;
  margin-top: 8px;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.3px;
  pointer-events: none;
  width: auto;
}

/* =========================================
   HUD DEL JUEGO (SUPERIOR E INFERIOR)
   ========================================= */
.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  transition: opacity 0.3s;
}

.game-hud.hide {
  opacity: 0;
  visibility: hidden;
}

.hud-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
  gap: 8px;
  flex-wrap: wrap;
}

.hud-sub-bar {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
  pointer-events: auto;
}

.hud-badge {
  background: #FFFFFF;
  border: 3px solid #1E293B;
  border-radius: 30px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 0 #CBD5E1;
  font-size: 16px;
  font-weight: 800;
  color: #1E293B;
}

.hud-level {
  background: linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 100%);
  color: #0369A1;
  box-shadow: 0 4px 0 #0284C7;
}

.hud-progress-pill {
  background: #0284C7;
  color: #FFFFFF;
  border-radius: 14px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 800;
}

.hud-score {
  background: linear-gradient(180deg, #FEF08A 0%, #FACC15 100%);
  color: #713F12;
  box-shadow: 0 4px 0 #CA8A04;
}

.hud-lives-card {
  background: #FFF1F2;
  border-color: #BE123C;
  box-shadow: 0 4px 0 #9F1239;
  padding: 6px 10px;
}

.hearts-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.heart-icon {
  font-size: 18px;
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.25s, opacity 0.25s;
}

.heart-icon.lost {
  filter: grayscale(1);
  opacity: 0.25;
  transform: scale(0.75);
}

.heart-icon.shake {
  animation: heartShake 0.4s ease-in-out;
}

@keyframes heartShake {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3) rotate(-15deg); }
  75% { transform: scale(0.8) rotate(15deg); }
}

.hud-streak-badge {
  font-size: 13px;
  padding: 4px 10px;
  background: #F8FAFC;
}

.hud-combo-pill {
  background: linear-gradient(180deg, #FF6B6B 0%, #EE5253 100%);
  color: #FFFFFF;
  border: 2px solid #1E293B;
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 800;
  margin-left: 4px;
  box-shadow: 0 2px 0 #B71540;
  display: none;
  animation: pulseScale 1.2s infinite;
}

/* BANNER DINÁMICO DE RACHAS */
.streak-banner {
  align-self: center;
  max-width: 90%;
  background: #FFFFFF;
  border: 4px solid #1E293B;
  border-radius: 25px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
  transform: translateY(-80px) scale(0.85);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s;
  pointer-events: none;
}

.streak-banner.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.streak-banner.hit {
  background: linear-gradient(180deg, #FFFBEB 0%, #FEF08A 100%);
  border-color: #D97706;
  box-shadow: 0 6px 0 #B45309;
}

.streak-banner.miss {
  background: linear-gradient(180deg, #F0FDF4 0%, #DCFCE7 100%);
  border-color: #15803D;
  box-shadow: 0 6px 0 #166534;
}

.streak-text {
  font-size: clamp(16px, 4.5vw, 22px);
  font-weight: 800;
  color: #1E293B;
  text-align: center;
}

.streak-mult-badge {
  background: #EA580C;
  color: #FFFFFF;
  border: 2px solid #1E293B;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 14px;
  font-weight: 900;
  display: none;
}

/* MASCOTA ANCLADA EN LA ESQUINA INFERIOR */
.hud-bottom-bar {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: auto !important;
}

.mascot-assistant {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto !important;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.mascot-bubble {
  background: #FFFFFF;
  border: 3px solid #1E293B;
  border-radius: 18px 18px 4px 18px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #1E293B;
  max-width: 185px;
  box-shadow: 0 4px 0 #94A3B8;
  position: relative;
  pointer-events: auto !important;
  cursor: pointer;
}

.mascot-avatar {
  width: 66px;
  height: 66px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  animation: gentleFloat 3s ease-in-out infinite alternate;
  pointer-events: auto !important;
  cursor: pointer;
  touch-action: manipulation;
  display: block;
}

/* Animación de giro de 360° al tocar la mascota (Easter Egg) */
@keyframes mascotSpin {
  0% { transform: rotate(0deg) scale(1); }
  35% { transform: rotate(180deg) scale(1.35); }
  75% { transform: rotate(360deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

.mascot-avatar.spinning {
  animation: mascotSpin 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Animación cuando la flecha le cae al pollito (Molesto / Enfadado) */
@keyframes angryShake {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  20% { transform: translate(-5px, 2px) rotate(-10deg) scale(1.15); filter: drop-shadow(0 0 12px #EF4444); }
  40% { transform: translate(5px, -3px) rotate(10deg) scale(1.15); filter: drop-shadow(0 0 14px #DC2626); }
  60% { transform: translate(-4px, -2px) rotate(-8deg) scale(1.1); }
  80% { transform: translate(4px, 1px) rotate(8deg) scale(1.05); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); filter: none; }
}

.mascot-avatar.angry {
  animation: angryShake 0.65s ease-in-out !important;
}

.mascot-bubble.angry {
  border-color: #EF4444 !important;
  background: #FEF2F2 !important;
  color: #991B1B !important;
  box-shadow: 0 4px 0 #DC2626, 0 0 14px rgba(239, 68, 68, 0.45) !important;
}

/* Animación de pulso cuando el pollito te da una vida extra */
@keyframes heartHealAnim {
  0% { transform: scale(1); filter: none; }
  50% { transform: scale(1.6); filter: drop-shadow(0 0 14px #22C55E); }
  100% { transform: scale(1); filter: none; }
}

.heart-icon.heart-heal {
  animation: heartHealAnim 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* =========================================
   MODAL DE FIN DE JUEGO (GAME OVER)
   ========================================= */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s;
}

.modal-overlay.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-card {
  background: #FFFFFF;
  border: 5px solid #1E293B;
  border-radius: 32px;
  width: 100%;
  max-width: 360px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 12px 0 #0F172A, 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.modal-title {
  font-size: 26px;
  font-weight: 900;
  color: #1E293B;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 15px;
  font-weight: 700;
  color: #64748B;
  margin-bottom: 16px;
}

/* ESTRELLAS DE RECOMPENSA */
.stars-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.star-icon {
  font-size: 42px;
  filter: grayscale(1) opacity(0.3);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.star-icon.active {
  filter: grayscale(0) opacity(1);
  transform: scale(1.15);
  animation: starPop 0.5s ease-out;
}

.stats-grid {
  background: #F1F5F9;
  border: 3px solid #CBD5E1;
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 13px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
}

.stat-value {
  font-size: 28px;
  font-weight: 900;
  color: #1E293B;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: #E2E8F0;
  color: #334155;
  box-shadow: 0 5px 0 #94A3B8;
  font-size: 18px;
}

.btn-secondary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #94A3B8;
}

/* =========================================
   ANIMACIONES
   ========================================= */
@keyframes logoEntrance {
  0% { transform: scale(0.6) translateY(-40px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes gentleFloat {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(3deg); }
}

@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes modalPop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes starPop {
  0% { transform: scale(0.4) rotate(-30deg); }
  70% { transform: scale(1.3) rotate(15deg); }
  100% { transform: scale(1.15) rotate(0deg); }
}

.bounce-in {
  animation: bounceText 0.4s ease-out;
}

@keyframes bounceText {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* =========================================
   ADAPTACIÓN RESPONSIVA HORIZONTAL (LANDSCAPE)
   ========================================= */
@media (orientation: landscape) and (max-height: 560px), (max-height: 500px) {
  /* HUD en partida horizontal */
  .game-hud {
    padding: 10px 14px;
  }

  .hud-top-bar {
    gap: 6px;
    flex-wrap: nowrap;
  }

  .hud-badge {
    padding: 4px 10px;
    font-size: 13px;
    border-width: 2.5px;
  }

  .heart-icon {
    font-size: 15px;
  }

  .hud-sub-bar {
    margin-top: 3px;
  }

  .hud-streak-badge {
    font-size: 11px;
    padding: 2px 8px;
  }

  .streak-banner {
    padding: 6px 16px;
  }

  .streak-text {
    font-size: 15px;
  }

  /* Mascota anclada en la esquina inferior en horizontal */
  .hud-bottom-bar {
    position: absolute;
    bottom: 10px;
    right: 14px;
    left: auto;
    z-index: 30;
  }

  .mascot-assistant {
    gap: 6px;
  }

  .mascot-avatar {
    width: 44px;
    height: 44px;
  }

  .mascot-bubble {
    font-size: 11px;
    max-width: 150px;
    padding: 4px 8px;
  }

  /* Modal de resumen compacto en horizontal */
  .modal-card {
    max-width: 480px;
    padding: 14px 20px;
    border-radius: 22px;
  }

  .modal-title {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .modal-subtitle {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .stars-container {
    margin-bottom: 8px;
    gap: 8px;
  }

  .star-icon {
    font-size: 28px;
  }

  .stats-grid {
    padding: 8px 12px;
    margin-bottom: 12px;
    gap: 8px;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-value {
    font-size: 20px;
  }

  .modal-buttons {
    flex-direction: row;
    gap: 10px;
  }

  .modal-buttons .btn-cartoon {
    flex: 1;
    font-size: 16px;
    padding: 8px 12px;
  }
}

/* =========================================
   ESTILOS DE LA ALCANCÍA Y MONEDAS (COIN BANK)
   ========================================= */
.coin-bank-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #FDE047 0%, #EAB308 100%);
  border: 3px solid #1E293B;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 18px;
  font-weight: 900;
  color: #78350F;
  box-shadow: 0 4px 0 #1E293B, 0 4px 10px rgba(234, 179, 8, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  user-select: none;
}

.hud-coins-bank {
  background: #FEF3C7;
  border-color: #D97706;
  color: #B45309;
}

.hud-wind-badge {
  background: #E0F2FE;
  border-color: #0284C7;
  color: #0369A1;
  font-size: 13px;
  padding: 4px 10px;
}

.btn-shop {
  flex: 1;
  padding: 12px 18px;
  background: linear-gradient(180deg, #FBBF24 0%, #F59E0B 45%, #D97706 100%);
  border: 3.5px solid #1E293B;
  border-radius: 50px;
  box-shadow: 0 6px 0 #92400E, 0 10px 18px rgba(0, 0, 0, 0.25);
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 2px 0 #92400E, 1px 1px 0 #1E293B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-shop::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 40px 40px 0 0;
  pointer-events: none;
}

.btn-shop:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #92400E, 0 12px 20px rgba(0, 0, 0, 0.3);
}

.btn-shop:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #92400E, 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-shop-icon {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  flex-shrink: 0;
  animation: gentleFloat 2.2s ease-in-out infinite alternate;
}

.btn-shop-small {
  background: linear-gradient(180deg, #FBBF24 0%, #F59E0B 45%, #D97706 100%);
  border: 3px solid #1E293B;
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 900;
  color: #FFFFFF;
  text-shadow: 0 1px 0 #92400E;
  box-shadow: 0 4px 0 #92400E, 0 6px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-shop-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #92400E;
}

.btn-shop-small:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #92400E;
}

.shop-icon-img-sm {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.shop-title-icon {
  width: 32px;
  height: 32px;
  vertical-align: middle;
  margin-right: 8px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.btn-small {
  border: 3px solid #1E293B;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 900;
  background: #FFFFFF;
  color: #1E293B;
  box-shadow: 0 4px 0 #1E293B;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-small:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #1E293B;
}

.btn-icon-small {
  border: 3px solid #1E293B;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 18px;
  background: #FFFFFF;
  box-shadow: 0 4px 0 #1E293B;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-icon-small:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #1E293B;
}

/* =========================================
   PANTALLA DE MAPA DE NIVELES (OVERWORLD)
   ========================================= */
.map-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #38BDF8 0%, #BAE6FD 35%, #86EFAC 75%, #4ADE80 100%);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  box-sizing: border-box;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid #1E293B;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

.map-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-title-bar {
  text-align: center;
  padding: 10px 14px 6px;
  z-index: 10;
}

.map-title-bar h2 {
  font-size: 22px;
  font-weight: 900;
  color: #1E293B;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
  margin: 0;
}

.map-title-bar p {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin: 2px 0 0;
}

.map-scroll-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 16px 80px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.map-path-container {
  display: flex;
  flex-direction: column-reverse; /* Nivel 1 abajo, niveles altos arriba como ascenso a la montaña */
  align-items: center;
  gap: 32px;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}

/* NODOS DE NIVEL EN EL MAPA */
.level-node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
}

/* Alineación en zigzag / serpenteante */
.level-node-wrapper.align-left {
  align-items: flex-start;
  padding-left: 20%;
}

.level-node-wrapper.align-center {
  align-items: center;
}

.level-node-wrapper.align-right {
  align-items: flex-end;
  padding-right: 20%;
}

.level-node {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 4px solid #1E293B;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  position: relative;
  box-shadow: 0 8px 0 #1E293B, 0 10px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.level-node:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #1E293B;
}

/* Estados de los nodos */
.level-node.unlocked {
  background: linear-gradient(180deg, #FDE047 0%, #F59E0B 100%);
  color: #78350F;
}

.level-node.locked {
  background: linear-gradient(180deg, #94A3B8 0%, #64748B 100%);
  color: #CBD5E1;
  cursor: not-allowed;
  opacity: 0.85;
}

.level-node.current {
  background: linear-gradient(180deg, #38BDF8 0%, #0284C7 100%);
  color: #FFFFFF;
  animation: currentLevelPulse 1.8s infinite;
}

@keyframes currentLevelPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 0 #1E293B, 0 0 20px rgba(56, 189, 248, 0.8);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 10px 0 #1E293B, 0 0 28px rgba(56, 189, 248, 1);
  }
}

.level-node.boss {
  border-color: #D97706;
  background: linear-gradient(180deg, #EC4899 0%, #BE185D 100%);
  color: #FFFFFF;
  transform: scale(1.12);
}

.boss-crown {
  position: absolute;
  top: -16px;
  font-size: 20px;
}

.level-node-stars {
  font-size: 11px;
  display: flex;
  gap: 2px;
  margin-top: -3px;
}

.level-node-goal {
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.9);
  color: #1E293B;
  border-radius: 8px;
  padding: 2px 6px;
  margin-top: 5px;
  border: 2px solid #1E293B;
}

/* =========================================
   PANTALLA DE TIENDA DE ARTÍCULOS (SHOP)
   ========================================= */
.shop-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #EDE9FE 0%, #DDD6FE 50%, #C4B5FD 100%);
  display: flex;
  flex-direction: column;
  z-index: 120;
  overflow: hidden;
  box-sizing: border-box;
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 3px solid #1E293B;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.shop-title-bar {
  text-align: center;
  padding: 10px 14px 4px;
}

.shop-title-bar h2 {
  font-size: 22px;
  font-weight: 900;
  color: #1E293B;
  margin: 0;
}

.shop-title-bar p {
  font-size: 13px;
  font-weight: 700;
  color: #5B21B6;
  margin: 2px 0 0;
}

/* PESTAÑAS DE CATEGORÍA */
.shop-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
}

.shop-tab {
  flex: 1;
  max-width: 130px;
  border: 3px solid #1E293B;
  border-radius: 16px;
  padding: 8px 6px;
  font-size: 13px;
  font-weight: 900;
  background: #FFFFFF;
  color: #475569;
  cursor: pointer;
  box-shadow: 0 4px 0 #1E293B;
  transition: all 0.15s ease;
}

.shop-tab.active {
  background: linear-gradient(180deg, #FDE047 0%, #F59E0B 100%);
  color: #78350F;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #1E293B;
}

.shop-items-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #8B5CF6 rgba(255, 255, 255, 0.4);
}

.shop-items-grid::-webkit-scrollbar {
  width: 10px;
}

.shop-items-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  margin: 8px 0;
}

.shop-items-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #A78BFA 0%, #7C3AED 100%);
  border: 2px solid #5B21B6;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.shop-items-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #C4B5FD 0%, #8B5CF6 100%);
}

/* TARJETA DE ARTÍCULO EN LA TIENDA */
.shop-card {
  background: #FFFFFF;
  border: 3px solid #1E293B;
  border-radius: 20px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 6px 0 #1E293B;
  position: relative;
  transition: transform 0.1s ease;
}

.shop-card-preview {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  background: #F1F5F9;
  border: 2px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 8px;
}

.shop-card-name {
  font-size: 13px;
  font-weight: 800;
  color: #1E293B;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-card-price {
  font-size: 13px;
  font-weight: 900;
  color: #D97706;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.btn-card-action {
  width: 100%;
  border: 3px solid #1E293B;
  border-radius: 14px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #1E293B;
  transition: transform 0.1s ease;
}

.btn-card-action:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1E293B;
}

.btn-buy {
  background: linear-gradient(180deg, #4ADE80 0%, #16A34A 100%);
  color: #FFFFFF;
}

.btn-equip {
  background: linear-gradient(180deg, #38BDF8 0%, #0284C7 100%);
  color: #FFFFFF;
}

.btn-equipped {
  background: #E2E8F0;
  color: #0F172A;
  border-color: #059669;
  cursor: default;
  box-shadow: none;
}

/* =========================================
   MODAL DE FIN DE DEMO / INVITACIÓN
   ========================================= */
.demo-card {
  max-width: 440px;
  border: 5px solid #F59E0B;
  box-shadow: 0 12px 0 #B45309, 0 24px 50px rgba(0, 0, 0, 0.4);
  padding: 24px 22px;
  animation: modalPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.demo-trophy-badge {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 8px;
  display: inline-block;
  animation: trophyBounce 1.6s ease-in-out infinite;
}

@keyframes trophyBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.08); }
}

.demo-features-box {
  background: #FEF3C7;
  border: 2px dashed #F59E0B;
  border-radius: 18px;
  padding: 12px 16px;
  text-align: left;
  margin: 14px 0 18px;
}

.demo-features-heading {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #92400E;
  margin-bottom: 8px;
}

.demo-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-features-list li {
  font-size: 13px;
  font-weight: 700;
  color: #78350F;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-modal-buttons {
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.btn-demo-cta {
  width: 100%;
  text-decoration: none;
  background: linear-gradient(180deg, #F59E0B 0%, #D97706 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 6px 0 #92400E !important;
  font-size: 16px !important;
  padding: 12px 18px !important;
  animation: ctaPulse 2s infinite;
}

.btn-demo-cta:active {
  transform: translateY(3px) !important;
  box-shadow: 0 3px 0 #92400E !important;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 6px 0 #92400E, 0 0 0 rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 6px 0 #92400E, 0 0 16px rgba(245, 158, 11, 0.7); }
}

/* Nodo Teaser de Demo en el Mapa */
.level-node.demo-teaser {
  background: linear-gradient(135deg, #FEF08A 0%, #F59E0B 100%);
  border: 3px dashed #B45309;
  color: #78350F;
  box-shadow: 0 5px 0 #92400E;
  cursor: pointer;
}

.level-node.demo-teaser:hover {
  transform: scale(1.08);
}

/* =========================================
   OVERLAY DE ORIENTACIÓN (GIRA TU PANTALLA)
   ========================================= */
.orientation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.orientation-card {
  max-width: 360px;
  width: 100%;
  background: #1E293B;
  border: 4px solid #38BDF8;
  border-radius: 28px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.3);
  color: #FFFFFF;
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rotate-phone-icon {
  font-size: 58px;
  margin-bottom: 12px;
  display: inline-block;
  animation: rotatePhoneAnim 2.2s ease-in-out infinite;
}

@keyframes rotatePhoneAnim {
  0%, 25% { transform: rotate(0deg); }
  50%, 75% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

.orientation-title {
  font-size: 24px;
  font-weight: 900;
  color: #FACC15;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.orientation-desc {
  font-size: 14px;
  font-weight: 700;
  color: #CBD5E1;
  line-height: 1.4;
  margin-bottom: 20px;
}

.orientation-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-fullscreen-toggle {
  background: #1E293B;
  color: #38BDF8;
  border-color: #38BDF8;
  font-size: 20px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
}
