/* =========================================================
   INTRO CASTILLO MÁGICO PREMIUM
========================================================= */

body.magic-intro-active {
    overflow: hidden;
}

/* =========================================================
   CONTENIDO PRINCIPAL OCULTO INICIALMENTE
========================================================= */

body.magic-intro-active header,
body.magic-intro-active main,
body.magic-intro-active footer {
    opacity: 0;
    transition: opacity 1.2s ease;
}

body.magic-intro-active.content-visible header,
body.magic-intro-active.content-visible main,
body.magic-intro-active.content-visible footer {
    opacity: 1;
}

/* =========================================================
   CONTENEDOR PRINCIPAL
========================================================= */

.magic-intro {
    position: fixed;
    inset: 0;
    z-index: 999999;
    overflow: hidden;

    display: flex;
    justify-content: center;
    align-items: center;

    /* Color base */
    background-color: #4a5d7a;

    /* Capas del muro - IMAGEN DE LADRILLOS + EFECTOS */
    background-image:
        url('../images/FondoMickey.webp');

    background-size: cover;

    background-position: center;

    background-repeat:
        no-repeat,
        no-repeat,
        no-repeat;
}

/* =========================================================
   TEXTURA DE LADRILLOS MEDIEVALES
========================================================= */

.magic-intro::before {
    content: "";
    position: absolute;
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .8;
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* =========================================================
   SOMBRA CENTRAL PARA LA PUERTA
========================================================= */

.magic-intro::after {
    content: "";
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    width: 420px;
    height: 620px;

    background:
        radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0.65) 0%,
            rgba(0, 0, 0, 0.45) 35%,
            rgba(0, 0, 0, 0.12) 65%,
            transparent 100%);

    filter: blur(30px);
    z-index: 0;
    pointer-events: none;
}

/* =========================================================
   OVERLAY
========================================================= */

.magic-overlay {
    position: absolute;
    inset: 0;

    background:
        radial-gradient(circle at center,
            rgba(255, 255, 255, .08),
            transparent 65%);
}

/* =========================================================
   WRAPPER
========================================================= */

.castle-wrapper {
    position: relative;
    z-index: 2;

    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;

    padding: 40px 20px;

    backdrop-filter: blur(1px);

    animation: muroRespira 8s ease-in-out infinite;
}

@keyframes muroRespira {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.005);
    }

    100% {
        transform: scale(1);
    }
}

/* =========================================================
   LUZ MÁGICA
========================================================= */

.magic-light {
    position: absolute;
    width: 550px;
    aspect-ratio: 1/1;
    border-radius: 320px 320px 0 0;
    background:
        radial-gradient(circle,
            rgba(255, 255, 0, .55),
            rgba(255, 255, 0, .12),
            transparent 120%);
    opacity: 0;
    transform: scale(.8);
    transition: all 2s ease;
    backdrop-filter: blur(20px);
}

.magic-light-logo::before {
    content: "";
    background-image: url('../images/elcastillodemickeylogo-pagina.webp');
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 50%;
    background-size: 500px;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

.magic-intro.open .magic-light {

    opacity: 1;

    transform: scale(1.05);
}

/* =========================================================
   MARCO PUERTA
========================================================= */

.castle-door-frame {

    position: relative;

    width: 520px;

    aspect-ratio: .75/1;

    border-radius: 320px 320px 0 0;

    overflow: hidden;

    border: 10px solid #1E90FF;

    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, .06),
            rgba(0, 0, 0, .2));

    backdrop-filter: blur(0);

    box-shadow:
        0 0 40px rgba(30, 144, 255, .2),
        inset 0 0 60px rgba(0, 0, 0, .5),
        0 30px 80px rgba(0, 0, 0, .45);
}

/* =========================================================
   EMBLEMA MICKEY
========================================================= */

.mickey-emblem {

    position: absolute;

    top: 150px;

    width: 100px;
    height: 100px;

    z-index: 35;

    pointer-events: none;
}

.mickey-emblem.mickey-left {
    left: 210px;
}

.mickey-emblem.mickey-right {
    right: 210px;
}

.mickey-svg {

    width: 100px;
    height: 100px;

    fill: #FFD700;
    stroke: #fff;
    stroke-width: 1;

    filter:
        drop-shadow(0 0 10px rgba(255, 215, 0, .8));
}

/* =========================================================
   CONTENEDOR PUERTAS
========================================================= */

.door-container {

    position: absolute;

    inset: 0;

    display: flex;
}

/* =========================================================
   PUERTAS
========================================================= */

.door {

    position: relative;

    width: 280px;
    height: 100%;

    overflow: hidden;

    transition:
        transform 2.2s cubic-bezier(.77, 0, .18, 1);

    background:

        linear-gradient(145deg,
            #1E90FF,
            #0066CC);
}

/* PUERTA IZQUIERDA */

.left-door {

    transform-origin: left center;

    border-right:
        2px solid rgba(255, 255, 255, .1);
}

/* PUERTA DERECHA */

.right-door {

    transform-origin: right center;

    border-left:
        2px solid rgba(255, 255, 255, .1);
}

/* =========================================================
   ANIMACIÓN APERTURA
========================================================= */

.magic-intro.open .left-door {

    transform:
        perspective(1400px) rotateY(-100deg);
}

.magic-intro.open .right-door {

    transform:
        perspective(1400px) rotateY(100deg);
}

/* =========================================================
   BRILLO PUERTA
========================================================= */

.door::before {

    content: "";

    position: absolute;

    inset: 0;

    background:

        linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, .05),
            transparent);
}

/* =========================================================
   DETALLES PUERTA
========================================================= */

.door-detail {

    position: absolute;

    top: 25%;
    left: 50%;

    transform: translateX(-50%);

    width: 70%;
    height: 45%;

    border-radius: 120px 120px 10px 10px;

    border:
        2px solid rgba(255, 255, 255, .08);
}

/* =========================================================
   MANIJAS
========================================================= */

.door-handle {

    position: absolute;

    top: 55%;

    width: 18px;
    height: 18px;

    border-radius: 50%;

    background: #FFD700;
    border: 2px solid #000;

    box-shadow:
        0 0 12px rgba(255, 215, 0, .7);
}

.left-door .door-handle {
    right: 18px;
}

.right-door .door-handle {
    left: 18px;
}

/* =========================================================
   PARTÍCULAS
========================================================= */

.particles span {

    position: absolute;

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #FFD700;

    box-shadow:
        0 0 12px rgba(255, 215, 0, .9);

    animation:
        floatParticle linear infinite;
}

.particles span:nth-child(1) {
    left: 20%;
    top: 80%;
    animation-duration: 7s;
}

.particles span:nth-child(2) {
    left: 35%;
    top: 90%;
    animation-duration: 9s;
}

.particles span:nth-child(3) {
    left: 50%;
    top: 85%;
    animation-duration: 6s;
}

.particles span:nth-child(4) {
    left: 65%;
    top: 95%;
    animation-duration: 10s;
}

.particles span:nth-child(5) {
    left: 80%;
    top: 88%;
    animation-duration: 8s;
}

.particles span:nth-child(6) {
    left: 55%;
    top: 92%;
    animation-duration: 11s;
}

/* =========================================================
   ANIMACIÓN PARTÍCULAS
========================================================= */

@keyframes floatParticle {

    0% {
        transform:
            translateY(0) scale(0);

        opacity: 0;
    }

    20% {
        opacity: 1;
        transform: scale(1);
    }

    100% {

        transform:
            translateY(-100vh) scale(0);

        opacity: 0;
    }
}

/* =========================================================
   CONTENIDO TEXTO
========================================================= */

.intro-content {

    margin-top: 20px;

    text-align: center;

    z-index: 30;

    padding: 20px;
}

.intro-content h1 {

    color: white;

    font-size:
        clamp(2rem, 4vw, 4rem);

    line-height: 1.1;

    text-shadow:
        0 0 20px rgba(0, 0, 0, .5);
}

.intro-content p {

    color: #FFD700;

    margin-top: 14px;

    font-size:
        clamp(1rem, 2vw, 1.4rem);
}

/* =========================================================
   BOTÓN
========================================================= */

.enter-castle-btn {

    position: absolute;

    top: 85%;
    left: 50%;

    transform: translate(-50%, -50%);

    padding: 12px 24px;

    border: none;

    border-radius: 999px;

    cursor: pointer;

    font-size: 0.95rem;

    font-weight: bold;

    color: white;

    background:

        linear-gradient(135deg,
            rgba(255, 255, 255, .18),
            rgba(255, 255, 255, .08));

    backdrop-filter: blur(14px);

    border:
        1px solid rgba(255, 255, 255, .2);

    box-shadow:
        0 0 25px rgba(30, 144, 255, .25);

    transition: .3s ease;

    z-index: 40;
}

.enter-castle-btn:hover {

    transform:
        translate(-50%, -50%) scale(1.05);

    box-shadow:
        0 0 35px rgba(30, 144, 255, .45);
}

.enter-castle-btn.fade-out {

    opacity: 0;

    transition: opacity 0.5s ease;
}

/* =========================================================
   FADE FINAL
========================================================= */

.magic-intro.fade-out {

    animation:
        smoothFade 1.2s ease forwards;
}

@keyframes smoothFade {

    0% {
        opacity: 1;
        filter: blur(0px);
        transform: scale(1);
    }

    100% {
        opacity: 0;
        filter: blur(10px);
        transform: scale(1.15);
        visibility: hidden;
    }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media screen and (max-width:768px) {

    .magic-intro::after {
        width: 260px;
        height: 420px;
    }

    .castle-door-frame {
        width: 260px;
    }

    .door {
        width: 280px;
        height: 100%;
    }

    .mickey-emblem {
        top: 50px;
    }

    .mickey-emblem.mickey-left {
        left: 80px;
    }

    .mickey-emblem.mickey-right {
        right: 80px;
    }

    .magic-light {
        width: 320px;
    }

    .magic-light-logo::before {
        background-size: 280px;
    }

}

@media screen and (max-width:480px) {
    .magic-light {
        width: 400px;
    }

    .magic-light-logo::before {
        background-size: 180px;
    }
}
