* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  font-family: Georgia, "Times New Roman", serif;
  color: white;
  overflow: hidden;
}

.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.video-inicio,
.fondo-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-inicio {
  z-index: 0;
  filter: brightness(0.6) contrast(1.12) saturate(1.15);
  transition: opacity 2.5s ease;
}

.fondo-video {
  z-index: 1;
  opacity: 0;
  transition: opacity 2.5s ease;
}

.fondo-video.activo {
  opacity: 0.82;
}

.oscurecer {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 18%, #000 90%);
  z-index: 2;
  pointer-events: none;
}

.portal {
  position: fixed;
  right: 28%;
  top: 54%;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(112,255,210,0.85) 18%, rgba(59,110,255,0.65) 42%, rgba(158,78,255,0.25) 68%, transparent 78%);
  box-shadow:
    0 0 45px #7fffe0,
    0 0 110px #4e8dff,
    0 0 190px #9b55ff;
  filter: blur(5px);
  opacity: 0;
  transform: translateY(-50%) scale(0.45);
  z-index: 4;
  pointer-events: none;
  transition: opacity 1.8s ease, transform 1.8s ease;
  animation: girarPortal 8s linear infinite, respirarPortal 3s ease-in-out infinite;
}

.portal.activo {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.contenido {
  position: absolute;
  left: 7%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  max-width: 600px;
}

.frase {
  font-size: 1.25rem;
  letter-spacing: 1px;
  opacity: 0.9;
  margin-bottom: 20px;
  text-shadow: 0 0 12px rgba(180,255,225,0.45);
}

h1 {
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1.05;
  margin-bottom: 24px;
  text-shadow: 0 0 22px rgba(150,255,220,0.95);
}

.subtitulo {
  font-size: 1.15rem;
  line-height: 1.6;
  max-width: 560px;
  margin-bottom: 30px;
}

button {
  padding: 14px 30px;
  border-radius: 40px;
  border: 1px solid rgba(160,255,221,0.8);
  background: #9fffd8;
  color: #000;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(99,255,208,0.5);
  transition: 0.35s;
  margin-right: 10px;
}

button:hover {
  transform: scale(1.06);
}

.btn-secundario {
  background: rgba(0,0,0,0.45);
  color: #9fffd8;
}

.info-libro {
  margin-top: 28px;
  padding: 24px;
  background: rgba(0,0,0,0.66);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  display: none;
  opacity: 0;
  max-width: 560px;
  transition: 1s ease;
}

.info-libro.activo {
  display: block;
  opacity: 1;
}

.info-libro h2 {
  color: #9fffd8;
  margin-bottom: 12px;
}

.info-libro p {
  line-height: 1.5;
  margin-bottom: 12px;
}

.info-libro a {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 24px;
  background: #9fffd8;
  color: #000;
  text-decoration: none;
  border-radius: 30px;
  font-weight: bold;
}

.carrusel-libros {
  position: fixed;
  right: 5%;
  top: 50%;
  width: 520px;
  height: 620px;
  transform: translateY(-50%);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease;
}

.carrusel-libros.activo {
  opacity: 1;
  pointer-events: auto;
}

.tarjeta-libro {
  position: absolute;
  width: 330px;
  height: 495px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.9s ease;
  box-shadow:
    0 0 35px rgba(151,255,212,0.9),
    0 0 90px rgba(151,255,212,0.35);
  background: #000;
}

.tarjeta-libro img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tarjeta-libro span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 13px;
  background: rgba(0,0,0,0.75);
  color: #9fffd8;
  text-align: center;
  font-weight: bold;
}

.libro-frontal {
  right: 0;
  top: 40px;
  z-index: 3;
  opacity: 1;
  transform: scale(1);
  filter: none;
}

.libro-trasero {
  right: 220px;
  top: 110px;
  z-index: 2;
  opacity: 0.45;
  transform: scale(0.75) rotate(-5deg);
  filter: grayscale(0.5) brightness(0.75);
}

.carrusel-libros.cambiar .libro-frontal {
  right: 220px;
  top: 110px;
  z-index: 2;
  opacity: 0.45;
  transform: scale(0.75) rotate(-5deg);
  filter: grayscale(0.5) brightness(0.75);
}

.carrusel-libros.cambiar .libro-trasero {
  right: 0;
  top: 40px;
  z-index: 3;
  opacity: 1;
  transform: scale(1);
  filter: none;
}

/* PARTÍCULAS */
#particulas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.particula {
  position: absolute;
  opacity: 0.7;
  animation: flotar linear infinite;
}

.particula.agua {
  border-radius: 50%;
  background: rgba(120, 200, 255, 0.3);
  box-shadow: 0 0 12px rgba(120, 200, 255, 0.9);
}

.particula.tierra {
  background: url("assets/hoja.png") no-repeat center;
  background-size: contain;
  animation: flotar linear infinite, girarHoja 6s linear infinite;
}

/* TRANSICIÓN MÁGICA */
#transicionMagica {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle, rgba(180,255,235,0.95) 0%, rgba(80,160,255,0.65) 22%, rgba(120,60,255,0.25) 45%, transparent 70%);
  opacity: 0;
  z-index: 100;
  pointer-events: none;
  transform: scale(0.2);
  filter: blur(8px);
}

#transicionMagica.activa {
  animation: explosionPortal 1.1s ease forwards;
}

/* MAPA */
.oculto {
  display: none !important;
}

.seccion-mapa {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0,0,0,0.96);
  padding: 35px;
}

.seccion-mapa h2 {
  position: absolute;
  top: 30px;
  left: 45px;
  color: #9fffd8;
  font-size: 3rem;
  z-index: 3;
  text-shadow: 0 0 20px rgba(150,255,220,0.8);
}

.cerrar-mapa {
  position: absolute;
  top: 35px;
  right: 45px;
  z-index: 4;
}

.mapa-contenedor {
  position: relative;
  width: 100%;
  height: 100%;
}

.mapa-contenedor img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0.85) saturate(1.1);
}



.punto-mapa.aqueheart { top: 28%; right: 27%; }
.punto-mapa.tierracrest { bottom: 23%; right: 28%; }
.punto-mapa.aerilis { bottom: 25%; left: 23%; }
.punto-mapa.flameguard { top: 29%; left: 27%; }

.detalle-mundo {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(0,0,0,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 45px;
  padding: 60px;
}

.detalle-mundo img {
  width: 55%;
  max-height: 80vh;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 0 45px rgba(151,255,212,0.5);
}

.detalle-texto {
  max-width: 420px;
}

.detalle-texto h2 {
  color: #9fffd8;
  font-size: 3rem;
  margin-bottom: 20px;
}

.detalle-texto p {
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: 25px;
}

/* ANIMACIONES */
@keyframes girarPortal {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}

@keyframes respirarPortal {
  0%, 100% { scale: 1; }
  50% { scale: 1.08; }
}

@keyframes flotar {
  from { transform: translateY(100vh); }
  to { transform: translateY(-10vh); }
}

@keyframes girarHoja {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}

@keyframes explosionPortal {
  0% { opacity: 0; transform: scale(0.2); }
  35% { opacity: 1; transform: scale(1.2); }
  70% { opacity: 0.85; transform: scale(2.2); }
  100% { opacity: 0; transform: scale(3); }
}
.punto-mapa {
  position: absolute;
  padding: 10px 18px;
  font-size: 0.9rem;
  background: rgba(0,0,0,0.65);
  color: #9fffd8;
  border: 1px solid #9fffd8;
  transition: 0.3s;
}

.punto-mapa:hover {
  transform: scale(1.15);
  box-shadow: 0 0 20px #9fffd8, 0 0 40px #9fffd8;
  background: #9fffd8;
  color: #000;
}
.punto-mapa::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(159,255,216,0.4), transparent);
  top: -50px;
  left: -40px;
  opacity: 0;
  transition: 0.3s;
}

.punto-mapa:hover::after {
  opacity: 1;
}
.mapa-contenedor.zoom {
  animation: zoomMapa 0.8s ease forwards;
}

@keyframes zoomMapa {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}
.punto-mapa.aqueheart:hover {
  box-shadow: 0 0 20px #4ecfff, 0 0 40px #4ecfff;
}

.punto-mapa.tierracrest:hover {
  box-shadow: 0 0 20px #6bff9a, 0 0 40px #6bff9a;
}
.punto-mapa.aerilis:hover {
  box-shadow: 0 0 20px #d6f6ff, 0 0 40px #d6f6ff;
}
.punto-mapa.flameguard:hover {
  box-shadow: 0 0 20px #ff6b6b, 0 0 40px #ff6b6b;
}
.pantalla-portal {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: 1.5s ease;
}

.pantalla-portal.salir {
  opacity: 0;
  transform: scale(1.2);
}

.portal-inicial {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,0.9), rgba(120,255,220,0.7), transparent);
  box-shadow:
    0 0 40px #7fffe0,
    0 0 90px #4e8dff,
    0 0 150px #9b55ff;
  animation: girarPortal 6s linear infinite;
  cursor: pointer;
}