/* ✅ SPLASH LOADER */
#splash-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #0865FE;
    z-index: 999999;
    display: flex; justify-content: center; align-items: center;
    flex-direction: column;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    will-change: transform, opacity;
}

#splash-loader img {
    width: 110px;
    height: 110px;
    animation: spin 1s linear infinite, bounce 1s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 10px rgba(0, 122, 255, 0.6));
}

/* ✅ Splash Progress Bar */
#splash-progress {
    width: 50%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 14px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}
#splash-progress.progress-active::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ff7300, #ffeb00, #47ff00, #00ffc3, #0066ff, #8000ff, #ff0080);
    background-size: 300%;
    animation: progress-loop 1.5s infinite linear;
    border-radius: 3px;
}

/* ✅ SPLASH SUBTITLE TEXT */
#splash-subtitle {
    margin-top: 16px;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0;
    animation: fadeInSubtitle 1.5s ease-in-out 0.8s forwards;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    max-width: 80%;
}

/* ✅ Subtitle fade animations */
.subtitle-fade-in {
    opacity: 1 !important;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.subtitle-fade-out {
    opacity: 0 !important;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* 🔊 SOUND TOGGLE BUTTON */
#sound-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 100000;
    transition: opacity 0.3s ease;
}
#sound-toggle:hover {
    opacity: 0.8;
}

/* ⏭️ SKIP BUTTON */
#skip-splash {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 100000;
}
#skip-splash:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ✅ AJAX CLICK LOADER */
#ajax-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.2);
    display: flex; justify-content: center; align-items: center;
    flex-direction: column;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    will-change: transform, opacity;
}
@supports not ((-webkit-backdrop-filter: blur(6px)) or (backdrop-filter: blur(6px))) {
    #ajax-loader {
        background: rgba(0, 0, 0, 0.5);
    }
}
#ajax-loader img {
    width: 110px;
    height: 110px;
    animation: spin 1s linear infinite, bounce 1s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 10px rgba(0, 122, 255, 0.6));
}

/* ✅ AJAX Progress Bar */
#ajax-progress {
    width: 50%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 14px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}
#ajax-progress.progress-active::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ff7300, #ffeb00, #47ff00, #00ffc3, #0066ff, #8000ff, #ff0080);
    background-size: 300%;
    animation: progress-loop 1.5s infinite linear;
    border-radius: 3px;
}

/* ANIMATIONS */
@keyframes spin {
    0% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
}
@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-12px); }
}
@keyframes progress-loop {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
@keyframes fadeInSubtitle {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes subtitleBounce {
    0% { transform: translateX(-50%) scale(0.95); opacity: 0.5; }
    50% { transform: translateX(-50%) scale(1.05); opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}