/* loading.css */
#loading-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: black; 
    z-index: 9999; overflow: hidden;
}

.progress-wrapper {
    position: absolute; bottom: 40px; left: 50%;
    transform: translateX(-50%); width: 300px;
    text-align: center; z-index: 20;
}

.progress-track {
    width: 100%; height: 2px; background: #f6f0ec33;
    margin-top: 10px; position: relative;
}

.progress-fill {
    height: 100%; background: #f6f0ec; width: 0%;
    transition: width 0.05s linear;
}

.falling-word {
    position: absolute; top: -200px; color: #f6f0ec;
    display: flex; flex-direction: column; align-items: center;
    line-height: 1.1; pointer-events: none;
    font-size: 1.2rem;
}

.falling-word span { display: inline-block; transition: font-weight 0.1s; }

.ripple {
    position: absolute; border: 1px solid #f6f0ec; border-radius: 50%;
    width: 20px; height: 10px; 
    transform: translate(-50%, -50%) scale(0);
    animation: rippleExpand 0.6s ease-out forwards; pointer-events: none;
}

@keyframes rippleExpand {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; border-width: 2px; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; border-width: 0px; }
}

/* --- EXIT ANIMATIONS --- */

/* 1. Bar shrinks to center */
.progress-wrapper.exit-mode {
    transform: translateX(-50%) scaleX(0);
    transition: transform 0.5s ease-in;
    transition-delay: 0.5s;
}

/* 2. Percentage Text falls down */
#loading-percentage.exit-mode {
    transform: translateY(100px);
    transition: transform 0.5s ease-in;
}

/* 3. Background Wipes (Top to Bottom) */
#loading-screen.slide-out {
    /* Clip path is better than height for performance */
    clip-path: inset(0 0 0 0);
    transition: clip-path 1s ease-out;
}

#loading-screen.slide-out-active {
    /* Wipes from Top (0%) down to Bottom (100%) */
    clip-path: inset(100% 0 0 0);
}