/* Splash Screen Styles */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    /* Allows click through after animation if opacity is 0 */
}

.splash-shutter {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #FF3B30;
    /* Pokedex Red (Vibrant) */
    transition: transform 1.2s cubic-bezier(0.2, 0, 0.2, 1);
    /* Door opening: 1.2s */
    will-change: transform;
    z-index: 1;
}

/* Diagonal Split using Clip Path */
/* Top Half: 0,0 -> 100,0 -> 100,45 -> 0,55 */
.shutter-top {
    clip-path: polygon(0 0, 100% 0, 100% 40%, 0 60%);
    background: linear-gradient(135deg, #FF3B30 0%, #D32F2F 100%);
    /* Slight depth */
}

/* Bottom Half: 0,55 -> 100,45 -> 100,100 -> 0,100 */
.shutter-bottom {
    clip-path: polygon(0 60%, 100% 40%, 100% 100%, 0 100%);
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    /* Slight depth */
}

/* Content (Text) */
.splash-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    transition: opacity 0.5s ease;
    /* Slower fade out (was 0.3s) */
}

.splash-title {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-shadow: 2px 4px 0px rgba(0, 0, 0, 0.2);
    margin: 0;
    opacity: 0;
    animation: textFadeIn 0.8s ease forwards 0.3s;
    /* Slower text fade in */
}

.splash-loading-bar {
    width: 0%;
    height: 4px;
    background: white;
    margin: 20px auto 0;
    border-radius: 2px;
    animation: loadingBar 1.0s ease-out forwards 0.5s;
    /* Loading bar: 1.0s */
}

/* Animation States */
#splash-screen.loaded .shutter-top {
    transform: translateY(-101%);
    /* Ensure full clearance */
}

#splash-screen.loaded .shutter-bottom {
    transform: translateY(101%);
    /* Ensure full clearance */
}

#splash-screen.loaded .splash-content {
    opacity: 0;
}

#splash-screen.complete {
    display: none;
}

/* Keyframes */
@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes loadingBar {
    0% {
        width: 0%;
        opacity: 1;
    }

    80% {
        width: 200px;
        opacity: 1;
    }

    100% {
        width: 200px;
        opacity: 0;
    }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .splash-title {
        font-size: 2.5rem;
    }
}