/* Two-layer splash: native startup image → in-app pour animation */

body.splash-active #authScreen,
body.splash-active #appScreen {
    visibility: hidden;
}

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: var(--color-bg);
    padding:
        env(safe-area-inset-top, 0px)
        env(safe-area-inset-right, 0px)
        env(safe-area-inset-bottom, 0px)
        env(safe-area-inset-left, 0px);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.splash-screen--out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* All glass PNGs share the same canvas size — stack and pour together */
.splash-pint-stack {
    position: relative;
    width: min(11rem, 42vw);
    line-height: 0;
}

.splash-layer--empty {
    position: relative;
    z-index: 3;
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.splash-layer--beer,
.splash-layer--foam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    clip-path: inset(100% 0 0 0);
}

.splash-layer--beer {
    z-index: 1;
}

.splash-layer--foam {
    z-index: 2;
}

.splash-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    opacity: 0;
}

.splash-screen--animate .splash-layer--beer,
.splash-screen--animate .splash-layer--foam {
    animation: splash-pour 1.55s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.splash-screen--animate .splash-title {
    animation: splash-title-in 0.45s ease 1.72s forwards;
}

@keyframes splash-pour {
    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes splash-title-in {
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .splash-screen--animate .splash-layer--beer,
    .splash-screen--animate .splash-layer--foam {
        animation: none;
        clip-path: inset(0 0 0 0);
    }

    .splash-screen--animate .splash-title {
        animation: none;
        opacity: 1;
    }
}
