#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;
}

body.boot-loading #splash_screen {
    opacity: 0; /* J. Louis - Keep splash logo/button hidden behind the boot loader until the full startup state is ready. */
    pointer-events: none;
}

/* J. Woodward - Content wrapper (excludes .splash_overlay) */
/* J. Woodward - Added :not(#splash_spinner) to prevent specificity override on spinner positioning */
#splash_screen > div:not(.splash_overlay):not(#splash_spinner) {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
    position: relative;
}

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

#splash_screen > div:not(.splash_overlay):not(#splash_spinner) button {
    width: 24rem;
    height: 5rem;
    display: flex; /* J. Woodward - Flex centering for vertical text alignment */
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 1.8rem;
    border-radius: var(--border-radius); /* John R - Match menu rounded corners */
    border: 2px solid #fff;
    cursor: pointer;
    margin-top: 2.5rem;
}

/* ========================================
   VIDEO/IMAGE BACKGROUNDS
   J. Woodward - Added for video intro support
   ======================================== */

/* J. Woodward - 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
   J. Louis - Disabled whenever body.intro-zoom owns the entrance animation
   ======================================== */

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

/* J. Woodward - :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
   J. Woodward - Simple fade out, all elements together
   ======================================== */

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

/* J. Woodward - 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
   J. Woodward - 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; /* J. Woodward - Hidden by default */
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

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

/* ========================================
   SCENE LOAD PROGRESS
   J. Louis - Prototype loader for krpano pano/tile progress on deep links and first scene load.
   ======================================== */

.vn-scene-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    font-family: var(--font-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.vn-scene-loader.is-visible {
    opacity: 1;
    pointer-events: all;
}

body.splash .vn-scene-loader {
    background: rgba(0, 0, 0, 0.92);
}

body.scene-rendered:not(.splash) .vn-scene-loader {
    background: rgba(0, 0, 0, 0.92);
}

.vn-scene-loader__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(34rem, calc(100vw - 4rem));
    gap: 1.8rem;
    opacity: 0.92;
}

.vn-scene-loader__spinner {
    width: 6rem;
    height: 6rem;
    border: 0.45rem solid rgba(255, 255, 255, 0.22);
    border-top-color: rgba(255, 255, 255, 0.94);
    border-radius: 50%;
    animation: vnSceneLoaderSpin 0.9s linear infinite;
}

.vn-scene-loader__content {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 1.2rem;
}

.vn-scene-loader__label {
    font-size: 1.5rem;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: lowercase;
    color: rgba(255, 255, 255, 0.72);
}

.vn-scene-loader__bar {
    width: 100%;
    height: 0.42rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.18);
}

.vn-scene-loader__bar-fill {
    width: 0;
    height: 100%;
    background: #fff;
    transition: width 0.18s linear;
}

@keyframes vnSceneLoaderSpin {
    to { transform: rotate(360deg); }
}

.vn-scene-loader.has-error .vn-scene-loader__bar-fill {
    background: #d93025;
}

body.scene-loading #splash_spinner {
    opacity: 0;
}

@media screen and (max-width: 500px) {
    .vn-scene-loader__panel {
        width: min(30rem, calc(100vw - 4rem));
    }

    .vn-scene-loader__spinner {
        width: 5.2rem;
        height: 5.2rem;
    }
}
