/* Arcane Portal Entrance Animation */

.hogwarts-entrance {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #050714;
    /* Deep, deep midnight */
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1.5s ease-out;
    cursor: none;
    /* Hide default cursor */
}

/* Custom Wand Cursor */
.wand-cursor {
    position: fixed;
    font-size: 32px;
    color: #e0d0a0;
    /* Parchment/Gold color */
    pointer-events: none;
    z-index: 10001;
    transition: transform 0.1s ease-out;
    transform-origin: center center;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
    transform: rotate(-15deg);
}

/* Spell Guide Path */
.spell-guide-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);
    /* Moved up significantly */
    width: 90%;
    max-width: 800px;
    /* Responsive width */
    height: 250px;
    /* Reduced height for sleeker look */
    pointer-events: none;
    z-index: 10;
}

.spell-path-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.spell-path-bg {
    stroke: rgba(255, 255, 255, 0.4);
    /* Increased visibility from 0.15 */
    stroke-width: 4;
    stroke-dasharray: 10, 15;
    fill: none;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

.guide-orb {
    fill: #fff;
    filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 15px #ffd700);
    opacity: 0.9;
}

.spell-path-progress {
    stroke: none;
    /* Hidden, using particles instead */
    fill: none;
    opacity: 0;
}

@keyframes spellPulse {
    0% {
        filter: drop-shadow(0 0 5px #ffd700) drop-shadow(0 0 10px #eaa355);
        opacity: 0.9;
    }

    100% {
        filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 15px #ffae00);
        opacity: 1;
        stroke-width: 7;
    }
}

.spell-point {
    fill: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.spell-point.start {
    fill: #fff;
    filter: drop-shadow(0 0 5px #fff);
}

.spell-point.active {
    fill: #eaa355;
    filter: drop-shadow(0 0 8px #eaa355);
    r: 6;
}

.spell-hint {
    position: absolute;
    bottom: 40px;
    /* bottom: -60px; */
    width: 100%;
    text-align: center;
    color: #eaa355;
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(234, 163, 85, 0.4);
    animation: hintPulse 3s infinite;
}

@keyframes hintPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 15px rgba(234, 163, 85, 0.8);
    }
}

.hogwarts-entrance.fading {
    opacity: 0;
    pointer-events: none;
}

/* Interaction Instruction */
.entrance-instruction {
    position: absolute;
    bottom: 20%;
    color: #f0e6d2;
    /* Lighter parchment color */
    font-family: 'Crimson Text', serif;
    font-size: 1.5rem;
    letter-spacing: 0.2em;
    opacity: 0.8;
    /* Much more visible */
    text-shadow: 0 0 10px rgba(240, 230, 210, 0.3);
    transition: opacity 0.5s ease;
    animation: pulseSlow 3s infinite;
}

@keyframes pulseSlow {

    0%,
    100% {
        opacity: 0.2;
        transform: translateY(0);
    }

    50% {
        opacity: 0.4;
        transform: translateY(-5px);
    }
}

/* Magical Trail System */
.magic-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

/* Magical Trial Variations */
.p-sparkle,
.p-orb,
.p-wisp {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    mix-blend-mode: screen;
    /* Additive glow */
}

/* 1. Sparkles: Tiny, sharp, flickering points */
.p-sparkle {
    filter: blur(0.5px);
    animation: sparkleExit 0.8s ease-out forwards;
}

/* 2. Orbs: Soft, glowing ethereal blooms */
.p-orb {
    filter: blur(3px);
    opacity: 0.6;
    animation: orbExit 1.2s ease-out forwards;
}

/* 3. Wisps: Lingering, smoke-like magical residue */
.p-wisp {
    filter: blur(6px);
    opacity: 0.3;
    animation: wispExit 1.8s ease-in-out forwards;
}

/* 4. Trail Dust: Static, lingering path markers */
.p-trail {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 10%, #ffcc00 40%, #ff8800 100%);
    /* Hot core, orange rim */
    box-shadow: 0 0 5px #ff6600;
    /* Deep glow */
    pointer-events: none;
    animation: trailFade 3s ease-out forwards;
}

@keyframes trailFade {
    0% {
        transform: scale(0.5) translateY(0);
        opacity: 0;
    }

    10% {
        transform: scale(1) translateY(0);
        opacity: 0.9;
    }

    100% {
        transform: scale(0) translateY(-15px) rotate(45deg);
        opacity: 0;
    }
}

@keyframes sparkleExit {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(180deg);
        opacity: 0;
    }
}

@keyframes orbExit {
    0% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
        transform: translate(0, 0) scale(1.2);
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

@keyframes wispExit {
    0% {
        transform: translate(0, 0) scale(0.8);
        opacity: 0.4;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(2);
        opacity: 0;
    }
}

/* Door Opening Effect (Re-calibrated for reveal) */
.magical-doors {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

.door {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, #0a0e27, #1e142d);
    border: 1px solid rgba(212, 165, 116, 0.1);
    transition: transform 2.2s cubic-bezier(0.7, 0, 0.3, 1),
        box-shadow 2.2s cubic-bezier(0.7, 0, 0.3, 1),
        filter 2.2s cubic-bezier(0.7, 0, 0.3, 1);
    box-shadow: 0 0 0 rgba(212, 165, 116, 0);
}

.door-left {
    left: 0;
    transform-origin: left;
}

.door-right {
    right: 0;
    transform-origin: right;
}

.doors-open .door {
    box-shadow: 0 0 50px rgba(212, 165, 116, 0.3);
    filter: brightness(1.2);
}

.doors-open .door-left {
    transform: perspective(1200px) rotateY(-110deg) scale(1.05);
}

.doors-open .door-right {
    transform: perspective(1200px) rotateY(110deg) scale(1.05);
}

/* Mobile Adjustments for Entrance */
@media (max-width: 600px) {
    .spell-hint {
        font-size: 1rem;
        bottom: 50px;
    }

    .entrance-instruction {
        font-size: 1.1rem;
        width: 100%;
        text-align: center;
        padding: 0 1rem;
        bottom: 15%;
    }
}