/*
 * RollWithIt — Core Site Shell
 * Phase 3.2E-C
 *
 * Only presentation required by base.html independently of any
 * PF2e, SWADE or individual page stylesheet belongs here.
 *
 * Do NOT add game-system presentation to this file.
 */


/* =========================================================
   GLOBAL SCROLLBAR
   ========================================================= */

:root,
html,
body {
    scrollbar-width: thin;
    scrollbar-color: #8f6128 #121c29;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #121c29;
    border-left: 1px solid rgba(232, 164, 70, .12);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb {
    background:
        linear-gradient(
            180deg,
            #8f6128 0%,
            #6f491f 100%
        );

    border: 2px solid #121c29;
    border-radius: 999px;

    min-height: 34px;
}

::-webkit-scrollbar-thumb:hover {
    background:
        linear-gradient(
            180deg,
            #c88937 0%,
            #95632a 100%
        );
}

::-webkit-scrollbar-thumb:active {
    background: #e8a446;
}

::-webkit-scrollbar-corner {
    background: #121c29;
}

::-webkit-scrollbar-button {
    width: 0;
    height: 0;
    display: none;
}


/* =========================================================
   GLOBAL LOADING OVERLAY
   ========================================================= */

.global-loading-overlay[hidden] {
    display: none !important;
}

.global-loading-overlay {
    position: fixed !important;
    inset: 0 !important;

    z-index: 2147483000 !important;

    display: grid !important;
    place-items: center !important;

    padding: 24px !important;

    background: rgba(4, 10, 18, .62) !important;

    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;

    cursor: wait !important;
}

.global-loading-card {
    min-width:
        min(340px, calc(100vw - 40px)) !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    gap: 17px !important;

    padding: 18px 22px !important;

    border:
        1px solid rgba(226, 160, 77, .42) !important;

    border-radius: 13px !important;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.018),
            transparent
        ),
        rgba(13, 26, 41, .96) !important;

    box-shadow:
        0 22px 60px rgba(0,0,0,.42),
        inset 0 1px 0 rgba(255,255,255,.018) !important;
}

.global-loading-d20 {
    width: 54px !important;
    height: 54px !important;

    flex: 0 0 54px !important;

    object-fit: contain !important;

    background: transparent !important;
    border: 0 !important;

    filter:
        drop-shadow(0 5px 8px rgba(0,0,0,.30))
        drop-shadow(0 0 8px rgba(226,160,77,.20)) !important;

    animation:
        pf2e-global-d20-loading
        1.05s
        cubic-bezier(.55,.05,.45,.95)
        infinite !important;
}

.global-loading-copy {
    display: grid !important;
    gap: 4px !important;
}

.global-loading-copy strong {
    color:
        var(--ui-color-text, #f4eee5) !important;

    font-size: 1.02rem !important;
    font-weight: 850 !important;
    letter-spacing: .01em !important;
}

.global-loading-copy span {
    color: #aeb8c7 !important;

    font-size: .78rem !important;
    line-height: 1.35 !important;
}

.site-is-loading,
.site-is-loading body {
    cursor: wait !important;
}

@keyframes pf2e-global-d20-loading {
    0% {
        transform: rotate(-8deg) scale(.96);
    }

    45% {
        transform: rotate(172deg) scale(1.06);
    }

    55% {
        transform: rotate(188deg) scale(1.06);
    }

    100% {
        transform: rotate(352deg) scale(.96);
    }
}

@media (prefers-reduced-motion: reduce) {
    .global-loading-d20 {
        animation:
            pf2e-global-d20-pulse
            .9s
            ease-in-out
            infinite alternate !important;
    }

    @keyframes pf2e-global-d20-pulse {
        from {
            transform: scale(.94);
            opacity: .72;
        }

        to {
            transform: scale(1.05);
            opacity: 1;
        }
    }
}

@media (max-width: 560px) {
    .global-loading-card {
        min-width: 0 !important;

        width:
            min(330px, calc(100vw - 32px)) !important;

        padding: 16px 18px !important;
        gap: 14px !important;
    }

    .global-loading-d20 {
        width: 48px !important;
        height: 48px !important;
        flex-basis: 48px !important;
    }
}


/* =========================================================
   PAGE ENTRY TRANSITION
   site-transitions.js owns behavior.
   CSS owns presentation only.
   ========================================================= */

html.pf2e-page-transition-ready body {
    opacity: 0;

    transform: translate3d(0, 7px, 0);

    transition:
        opacity .22s cubic-bezier(.2,.7,.2,1),
        transform .28s cubic-bezier(.16,.84,.24,1);
}

html.pf2e-page-transition-ready
body.pf2e-page-entered {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

html.pf2e-page-transition-ready
body.pf2e-page-leaving {
    opacity: 0;
    transform: translate3d(0, 5px, 0);
}

@media (prefers-reduced-motion: reduce) {
    html.pf2e-page-transition-ready body,
    html.pf2e-page-transition-ready
    body.pf2e-page-entered,
    html.pf2e-page-transition-ready
    body.pf2e-page-leaving {
        transition: none !important;
        transform: none !important;
    }
}
