@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Montserrat:wght@300;400&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#magic-entrance {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0d0614;
    z-index: 100;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    color: #fff;
}

/* Reglas comunes para todas las capas de fondo */
.bg-layer {
    background-size: contain !important; /* Muestra la imagen sin estirarla de más */
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-color: #0d0614 !important; /* El color exacto de tu render para rellenar */
}

.hidden {
    opacity: 0;
}

/* Interfaz flotando arriba de los fondos */
.entrance-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    padding: 0 15px;
    transition: opacity 0.5s ease;
}

.magic-title {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    letter-spacing: 6px;
    color: #ebd1ff;
    text-shadow: 0 0 15px rgba(216, 180, 254, 0.5);
    margin-bottom: 5px;
    margin-top: -12vh;
    width: 100%;
    text-align: center;
}

.magic-subtitle {
    font-size: 1.1rem;
    font-style: italic;
    color: #a78bfa;
    margin-bottom: 4vh;
}

/* Zona de clic perfectamente ubicada sobre el círculo de los chakras del fondo */
.chakra-click-zone {
    width: 160px;
    height: 160px;
    margin-bottom: 24vh;
    cursor: pointer;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.chakra-click-zone:hover {
    background: rgba(167, 139, 250, 0.05);
    box-shadow: 0 0 25px rgba(167, 139, 250, 0.2);
}

#enter-btn {
    background: rgba(13, 6, 20, 0.6);
    border: 2px solid #a78bfa;
    color: #ebd1ff;
    padding: 14px 40px;
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.4s ease;
}

#enter-btn:hover {
    background: #a78bfa;
    color: #0d0614;
    box-shadow: 0 0 20px #a78bfa;
}

/* ==========================================================================
   VIDEO CINEMÁTICO VERTICAL
   ========================================================================== */
.cinema-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: auto;
    height: 0vh;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), 
                height 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
}

.cinema-overlay.active {
    transform: translate(-50%, -50%) scale(1);
    height: 100vh;
}

#bg-magic-video {
    height: 100%;
    width: auto;
}

#particle-canvas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 100;
}

.fade-out { opacity: 0; pointer-events: none; }


/* ==========================================================================
   MÓVILES (Media query unificado sin errores de sintaxis)
   ========================================================================== */
@media screen and (max-width: 768px) {
    
    /* 1. Lograr el encuadre exacto del fondo en celulares */
    .bg-layer {
        background-size: 100% auto !important; /* Fuerza a que el ancho de la imagen coincida con el del celular */
        background-position: center 40% !important; /* Sube o baja la imagen para centrar el portal */
        background-color: #0d0614 !important;
    }

    /* 2. Centrado perfecto del bloque de contenido */
    .entrance-content {
        text-align: center !important;
        padding: 0 20px !important;
        justify-content: space-between !important; /* Distribuye arriba el texto y abajo el botón */
        height: 100% !important;
        box-sizing: border-box !important;
        padding-top: 8vh !important;    /* Espacio superior para el título */
        padding-bottom: 8vh !important; /* Espacio inferior para el botón */
    }

    /* 3. Ajuste fino de textos para que queden flotando elegantemente */
    .magic-title {
        font-size: 2.5rem !important;
        letter-spacing: 4px !important;
        margin: 0 0 10px 0 !important; /* Eliminamos el margen negativo que tiraba todo arriba */
        width: 100% !important;
        text-align: center !important;
    }

    .magic-subtitle {
        font-size: 1rem !important;
        margin: 0 auto !important;
        padding: 0 15px !important;
        max-width: 90% !important;
        line-height: 1.4 !important;
    }

    /* 4. Escondemos temporalmente la zona interactiva intermedia o la adaptamos */
    .chakra-click-zone {
        width: 140px !important;
        height: 140px !important;
        margin: auto !important; /* La deja flotando justo sobre el portal del centro */
    }

    #enter-btn {
        padding: 14px 40px !important;
        font-size: 0.95rem !important;
    }
}

/* Contenedor Flexbox absoluto para fijar a la brujita en el centro de la pantalla */
.brujita-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2; /* Por encima del fondo, por debajo del texto */
    pointer-events: none; /* Crucial: evita que esta capa tape los clics del botón */
}

/* Estado de la Brujita al cargar la página: Casi invisible (10%) y con blur */
.img-brujita-inicio {
    width: 100%;
    max-width: 480px;     /* Tamaño ideal para que no tape todo el fondo */
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    opacity: 0.1;
    filter: blur(5px);
    transition: opacity 1.5s ease-in-out, filter 1.5s ease-in-out; /* Animación de 1.5 segundos */
}

/* Clase que JavaScript le pondrá a la brujita al hacer clic en Entrar */
.img-brujita-visible {
    opacity: 1 !important;
    filter: blur(0px) !important;
}

/* Nos aseguramos de que el video tape tanto a la brujita como al fondo al activarse */
.cinema-overlay {
    z-index: 60 !important; 
}