/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 1. Estilos generales del cuerpo */
body.portal-magico-body {
  font-family: 'Caveat', cursive;
  background: url("../assets/butterflies-bg.jpg") no-repeat center center fixed;
  background-size: cover;
  color: #4b0082; /* Uva oscuro */
  position: relative;
  min-height: 100vh;
  cursor: none;
}
body.portal-magico-body::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(180, 150, 255, 0.4); /* velo lavanda */
  z-index: 0;
}

/* 2. Header y navegación */
header {
  background: #4b0082;
  padding: 1rem;
  color: #fff;
  text-align: center;
  position: relative;
  z-index: 1;
}
nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  margin-top: 0.5rem;
  gap: 2rem;
}
nav a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}
nav a.active {
  text-decoration: underline;
}

/* 3. Contenedor principal */
.portal-container {
  position: relative;
  z-index: 1;
  padding: 2rem;
  text-align: center;
}
.intro {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 2rem;
  margin: 0 auto 2rem;
  max-width: 900px;
  color: #4b0082;
  font-size: 1.4rem;
  text-shadow: 0 0 4px rgba(255,255,255,0.6);
}

/* 4. Botones mágicos */
.portales {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}
.btn-portal {
  font-size: 1.2rem;
  padding: 1rem 2rem;
  border-radius: 30px;
  background: linear-gradient(135deg, #ffb6f9, #b8f3ff, #c5a3ff);
  color: #4b0082;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
  transition: all 0.4s ease;
}
.btn-portal:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.9), inset 0 0 8px #fff;
}
.btn-portal.disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* 5. Mariposa gloriosa */
.mariposa-central {
  background-image: url("../assets/mariposa-magica.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 150px; height: 150px;
  margin: 0 auto 2rem;
  animation: flotar 5s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
@keyframes flotar {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* 6. Cursor personalizado */
.cursor-mariposa {
  position: fixed;
  top: 0; left: 0;
  width: 40px; height: 40px;
  background-image: url("../assets/mariposa-magica.png");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}

/* 7. Galería de insignias mágicas */
.galeria-logros-footer {
  margin: 3rem auto 2rem;
  max-width: 800px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1;
}
.badges-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}
.badge-item {
  width: 80px; height: 80px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: grayscale(100%) opacity(0.4);
  transition: filter 0.3s ease;
}
.badge-item.unlocked {
  filter: none;
}
.badge-label {
  text-align: center;
  font-size: 1rem;
  margin-top: 0.2rem;
  color: #4b0082;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
}

/* 8. Footer completo */
footer {
  background-color: #4b0082;
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  position: relative;
  z-index: 1;
}
.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem;
}
.footer-section h3 {
  margin-bottom: 0.5rem;
}
.footer-section ul {
  list-style: none;
  padding: 0;
}
.footer-section a {
  color: #ffeaff;
  text-decoration: none;
  font-weight: bold;
}
.footer-section a:hover {
  text-decoration: underline;
}

/* 9. Popup de logro desbloqueado */
.badge-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  background: rgba(75, 0, 130, 0.9);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  font-family: 'Caveat', cursive;
  text-align: center;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  z-index: 9999;
  transition: transform 0.5s ease, opacity 0.5s ease;
}
.badge-popup.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
