/* Animación inicial para debut */
.debut-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000 ;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.debut-animation.fade-out {
  opacity: 0;
  pointer-events: none;
}

.animation-content {
  text-align: center;
  max-width: 80%;
}

.debut-title {
  font-size: 2.2rem;
  color: #ffffff;
  margin-bottom: 30px;
  animation: fadeInUp 1s ease-out;
  font-weight: bold;
  letter-spacing: 2px;
}

.plant-animation {
  margin: 30px 0;
  animation: bounceIn 1.5s ease-out 0.5s both;
}

.flag-image {
  width: 120px;
  height: 80px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: pulse 2s ease-in-out infinite;
}

.debut-subtitle {
  font-size: 1.3rem;
  color: #c4ffbe;
  margin-bottom: 40px;
  animation: fadeInUp 1s ease-out 1s both;
  font-weight: 500;
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
  animation: fadeInUp 1s ease-out 1.5s both;
}

.loading-fill {
  width: 0%;
  height: 100%;
  background: #ffffff;
  border-radius: 2px;
  animation: loadingProgress 3s ease-out 2s forwards;
}

.game-content {
  opacity: 1;
  min-height: 100vh;
  transition: opacity 0.5s ease-in;
}

.game-content.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Animaciones */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes loadingProgress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

html, body {
  overflow-x: hidden; /* Previene scroll horizontal */
  overflow-y: auto;
  max-width: 100vw;   /* Limita el ancho máximo */
}

body {
  background: #fff url('/images/images/fondojorge.png') no-repeat center top;
  background-size: 500px auto; /* Mantiene el mismo tamaño fijo sin distorsión */
  background-position: center 0px;
  background-attachment: scroll;
  font-family: 'Outfit', Arial, sans-serif;
  color: #444;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 140px;
  padding-bottom: 50px;          /* ✅ Reducido de 150px a 50px */
  width: 100%;        
  max-width: 100vw;   
  box-sizing: border-box;
  overflow-x: hidden; 
}

h1 {
  font-size: 1.7rem;
  color: #bdb76b;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

.levels-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;             
  position: relative;
  width: 100%;
  max-width: 500px;      
  margin: 0 auto 100px auto;  /* Añadido margen inferior de 100px */
  box-sizing: border-box;
}

.level-item {
  width: 100%;        /* Cambiado a porcentaje */
  max-width: 400px;   /* Mantiene el límite máximo */
  display: flex;
  align-items: center;
  position: relative;
  box-sizing: border-box;
}

.level-item.left {
  justify-content: flex-start;
  padding-left: 60px;    /* Más separación horizontal */
}

.level-item.right {
  justify-content: flex-end;
  padding-right: 60px;   /* Más separación horizontal */
}

.level-item.center {
  justify-content: center;
}

.level-circle {
  width: 160px;          /* Reducido de 180px a 160px */
  height: 160px;         /* Reducido de 180px a 160px */
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 0;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  border: none;
  padding: 0;
  appearance: none;
}

.level-circle.locked {
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.level-progress {
  position: absolute;
  bottom: 0;                /* Cambiar de 50% a 0 */
  left: 0;               /* Cambiar de 50% a 0 */
  transform: none;       /* Quitar translate(-50%, -50%) */
  z-index: 3;            
  pointer-events: none;
  width: 100%;           /* Añadir para que ocupe todo el ancho del contenedor */
  height: 100%;          /* Añadir para que ocupe toda la altura del contenedor */
}

.level-bg,
.level-bar {
  fill: none;
  stroke-width: 12;      /* Aumentado de 10 a 12 para que sea más gruesa */
}

.level-bg {
  stroke: #d1d1d155;
}

.level-bar {
  stroke: #ffe066;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 80px 80px;  /* Actualizado para 160px (160/2 = 80) */
  transition: stroke-dashoffset 0.5s;
}

.level-circle img {
  width: 120px;          /* Reducido de 140px a 120px */
  height: 120px;         /* Reducido de 140px a 120px */
  object-fit: contain;
  z-index: 2;            
  position: relative;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 3px 12px #ffe06644;
  margin: 0 auto;
  display: block;
}

.level-label {
  font-size: 1.13em;
  color: #bfa100;
  font-weight: 700;
  text-align: center;
  margin-top: 12px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 0 #fffbe6, 0 2px 4px #ffe06644;
  font-family: 'Outfit', Arial, sans-serif;
}

.nivel-info {
  position: fixed;
  top: 20px;                    /* Margen superior de 20px */
  left: 20px;                   /* Margen izquierdo de 20px */
  right: 20px;                  /* Margen derecho de 20px */
  width: auto;                  /* Eliminar width: 100vw para usar márgenes */
  background: #44bf41;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);  /* Sombra más suave */
  z-index: 100;
  text-align: left;
  padding: 24px 28px 22px 28px;             /* Padding interno más balanceado */
  border-radius: 16px;                      /* Bordes redondos */
  transition: all 0.3s ease;               /* Transición suave */
}

.nivel-info h1 {
  font-size: 1.5em;
  color: #fafafa;
  margin: 0 0 4px 0;
  letter-spacing: 1px;
  text-align: left;
}

.nivel-info p {
  color: #c4ffbe;
  font-size: 1.1em;
  margin: 0;
  text-align: left;
}

.seccion-N1 {
  font-size: 1.5em;
  color: #6e8c6a; /* color más suave */
  margin: 0 0 4px -10px;
  letter-spacing: 1px;
  text-align: left;
}

.seccion-N2 {
  font-size: 1.5em;
  color: #7d7d7d; /* color más suave */
  margin: 0 0 4px -10px;
  letter-spacing: 1px;
  text-align: left;
}

/* Estilo para secciones bloqueadas */
.seccion-title.locked {
  color: #999999 !important;
  opacity: 0.6;
  transition: color 0.3s ease, opacity 0.3s ease;
}

/* Estilo para secciones desbloqueadas */
.seccion-title.unlocked {
  color: #bdb76b;
  opacity: 1;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #496e21;
  border-radius: 8px;
  transition: width 1.2s cubic-bezier(.4,1.6,.4,1);
}

.navbar-top {
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  height: 48px;
  background: #ffffff;
  z-index: 2000;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px #0002;
}

.navbar-flag {
  display: flex;
  align-items: center;
  height: 100%;
  padding-left: 18px;
}

.flag-img {
  height: 32px;
  width: auto;
  display: block;
}

.navbar-bottom {
  width: 100vw;
  position: fixed;
  bottom: 0;
  left: 0;
  height: 48px;
  background: #2d3e50;
  z-index: 2000;
  display: flex;
  align-items: center;
  box-shadow: 0 -2px 8px #0002;
}

.navbar-bottom-content {
  display: flex;
  align-items: center;
  height: 100%;
  padding-left: 18px;
  color: #fff;
  font-size: 1.1em;
  font-weight: bold;
}

.btn-next {
  position: relative;
  z-index: 2;
  background: #27ae60;
  border: 6px solid rgba(255,255,255,0.7); /* Borde blanco opaco y grueso */
  border-radius: 50%;
  width: 64px;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 12px #0002;
  cursor: pointer;
  transition: box-shadow 0.2s;
  padding: 0;
}

.btn-next:hover {
  box-shadow: 0 4px 24px #0003;
}

.bottom-circle {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 80px;
  background: #bd454500;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgb(0, 0, 0);
  z-index: 2000;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.bottom-circle:hover {
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.bottom-circle img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

/* Menú desplegable en la esquina superior derecha */
.user-menu {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
}

.menu-toggle {
  width: 50px;
  height: 50px;
  background: #44bf41;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(68, 191, 65, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 0;
  appearance: none;
}

.menu-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(68, 191, 65, 0.4);
}

.menu-toggle::before,
.menu-toggle::after,
.menu-toggle span {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  position: absolute;
  transition: transform 0.3s;
}

.menu-toggle::before {
  transform: translateY(-6px);
}

.menu-toggle::after {
  transform: translateY(6px);
}

.menu-toggle.active::before {
  transform: rotate(45deg);
}

.menu-toggle.active::after {
  transform: rotate(-45deg);
}

.menu-toggle.active span {
  opacity: 0;
}

.dropdown-menu {
  position: absolute;
  top: 60px;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  min-width: 140px;      /* Reducido de 180px a 140px */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu-item {
  padding: 12px 16px;    /* Reducido padding horizontal de 20px a 16px */
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  text-align: left;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
}

.menu-item:nth-child(2) {  /* Help - segundo elemento */
  margin-bottom: 30px;      /* Espacio muy grande */
  border-bottom: 2px solid #e0e0e0;
}

.menu-item:last-child {
  border-radius: 0 0 12px 12px;
  border-bottom: none;
  color: #e74c3c;
  margin-top: 20px;         /* Espacio muy grande */
  padding-top: 20px;        /* Padding superior muy grande */
}

.menu-item:hover {
  background: #f8f9fa;
}

.menu-item:last-child:hover {
  background: #fee;
}

.menu-item i {
  margin-right: 10px;
  width: 16px;
}

#entry-fade {
  position: fixed;
  inset: 0;
  background:#000;
  opacity:1;
  z-index: 9999;              /* Debajo si tienes algo con 10000 */
  pointer-events:none;
  animation: entryFadeOut .9s ease forwards;
}

@keyframes entryFadeOut {
  0% { opacity:1; }
  100% { opacity:0; }
}

html.entry-no-fade #entry-fade {
  display:none;
  animation:none;
}

@media (prefers-reduced-motion: reduce) {
  #entry-fade {
    animation: entryFadeOut .01s linear forwards;
  }
}

/* Intro más grande dentro del círculo */
.level-circle.level-intro {
  /* elimina posible espacio interior si lo hubiera */
  padding: 0;
}

.level-circle.level-intro img {
  width: 150px;
  height: 150px;
  object-fit: contain;      /* Mantiene proporción sin deformar */
  /* Si quieres que llene incluso recortando un poco, cambia a: object-fit: cover; */
  /* object-fit: cover; */
  filter: none;
  box-shadow: 0 3px 14px #ffe06655;
  transition: transform .25s ease;
}

/* Hover suave solo para intro (opcional) */
.level-circle.level-intro:hover img {
  transform: scale(1.06);
}

