#splash_screen  {
    position: absolute;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-duration);
}

body.splash #splash_screen  {
    opacity: 1;
    pointer-events: all;
}

/* C Gratiot - Content wrapper (excludes .splash_overlay) */
#splash_screen > div:not(.splash_overlay) {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
    position: relative;
}

#splash_screen > div:not(.splash_overlay) img {
    width: 36rem; height: 20rem;
    max-width: 80vw; max-height: 80vh;
    object-fit: contain;
}

#splash_screen > div:not(.splash_overlay) button {
    width: 240px; /* Charles Gratiot Jr. - Restored from legacy intro_window.css */
    height: 50px; /* Charles Gratiot Jr. - Restored from legacy intro_window.css */
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 18px; /* Charles Gratiot Jr. - Restored from legacy intro_window.css */
    border-radius: var(--border-radius); /* John R - Match menu rounded corners */
    border: 2px solid #fff;
    cursor: pointer;
    margin-top: 25px; /* Charles Gratiot Jr. - Restored from legacy intro_window.css */
}

/* ========================================
   VIDEO/IMAGE BACKGROUNDS
   C Gratiot - Added for video intro support
   ======================================== */

/* C Gratiot - When video exists, hide the default dark background */
#splash_screen:has(#splash_video) {
    background-color: transparent;
    backdrop-filter: none;
}

#splash_video {
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
}

#splash_image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}

.splash_overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.25);
    z-index: 2;
}

/* ========================================
   ENTRANCE ANIMATIONS
   C Gratiot - Disabled when body.intro-zoom (Conrad)
   ======================================== */

@keyframes splashFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* C Gratiot - :not(.exiting) ensures entrance CSS stops when exit begins */
body.splash:not(.intro-zoom) #splash_screen:not(.exiting) > div:not(.splash_overlay) img {
    opacity: 0;
    animation: splashFadeInUp 0.6s ease 0.5s forwards;
}

body.splash:not(.intro-zoom) #splash_screen:not(.exiting) > div:not(.splash_overlay) button {
    opacity: 0;
    animation: splashFadeInUp 0.6s ease 1.0s forwards;
    pointer-events: none;
}

body.splash:not(.intro-zoom) #splash_screen:not(.exiting) > div:not(.splash_overlay) button.ready {
    pointer-events: auto;
}

/* ========================================
   EXIT ANIMATIONS
   C Gratiot - Simple fade out, all elements together
   ======================================== */

@keyframes splashFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* C Gratiot - Everything fades together */
#splash_screen.exiting > div:not(.splash_overlay),
#splash_screen.exiting #splash_video,
#splash_screen.exiting #splash_image,
#splash_screen.exiting .splash_overlay {
    animation: splashFadeOut 1.5s ease forwards;
}

/* ========================================
   LOADING SPINNER
   C Gratiot - Safety net: HIDDEN by default, only shows if krpano isn't ready
   ======================================== */

#splash_spinner {
    position: absolute;
    width: 50px;
    height: 50px;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    background-image: url('images/spinner.svg');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0; /* C Gratiot - Hidden by default */
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* C Gratiot - Only show spinner if krpano is slow (prevents black screen) */
#splash_spinner.waiting {
    opacity: 1;
}

/* C Gratiot - Hide during exit animation */
#splash_screen.exiting #splash_spinner {
    opacity: 0;
}

