:root {
    color-scheme: only light;
}

/* Probe for CSS env(safe-area-inset-*) — read via getComputedStyle in game. */
#safe-area-probe {
    position: fixed;
    pointer-events: none;
    visibility: hidden;
    width: 1px;
    height: 1px;
    padding-top: env(safe-area-inset-top, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
}

body {
    padding: 0;
    margin: 0;
    overflow: hidden;
    background: #243d36;
    width: 100%;
    height: 100vh;
    height: 100dvh;
}

#lil_gui {
    top: 0px;
    left: 0px;
}

#app {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0%);
    width: 100%;
    height: 100vh;
    height: 100dvh;
}

.prePreload {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: #243d36;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4vh;
}

.prePreload.done {
    display: none;
}

.prePreload_logo {
    width: min(40vw, 35vh);
    aspect-ratio: 1.8 / 1;
    background-image: url("./assets/images/artofspin_logo.webp");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.prePreload_logo.visible {
    opacity: 1;
}

.prePreload_bar {
    width: 60vw;
    max-width: 320px;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    overflow: hidden;
}

.prePreload_bar_fill {
    height: 100%;
    width: 0%;
    background: #00efff;
    transition: width 0.15s linear;
}

.splashIntro {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    direction: ltr;
    background-image: url("./assets/images/splash_bg.webp");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-color: #243d36;
    z-index: 1000;
    overflow: hidden;
    visibility: hidden;
}

.splashIntro.ready {
    visibility: visible;
}

.splashIntro_inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    justify-content: space-between;
    padding-top: 2vh;
}

.splash_logo {
    width: 40vw;
    aspect-ratio: 1 / 1;
    background-image: url("./assets/images/splash_logo.webp");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: contain;
    margin-top: 20px;
}

.splash_banner {
    position: absolute;
    width: 65vw;
    aspect-ratio: 1424 / 225;
    background-image: url("./assets/images/banner.webp");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 100% 100%;
    align-self: flex-start;
    display: flex;
    align-items: center;
    top: 15vh;
    top: 15dvh;
}

.splash_spinny {
    width: 22%;
    aspect-ratio: 287 / 302;
    background-image: url("./assets/images/spinny.webp");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-left: 8%;
}

.splash_banner_text {
    color: #fff;
    font-size: 2.7vw;
    font-family: GrandstanderCustom, sans-serif;
    font-weight: 900;
    padding-top: 1vh;
    line-height: 1.5em;
    text-shadow:
        0 0 0.1em #00169b,
        0 0.15em 0 #00169b;
}

#available {
    font-size: 1.7em;
}

.splash_blocks {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.splash_blocks_main {
    height: 100%;
    justify-content: start;
}

.splash_block_description {
    margin-top: auto;
    padding-bottom: 15vh;
}

.splash_block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.splash_dice {
    width: min(80vw, 40vh);
    aspect-ratio: 1 / 1;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-top: -14%;
    margin-bottom: -25%;
}

.splash_text {
    font-family: GrandstanderCustom, sans-serif;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 3px 3px #000000;
    text-align: center;
}

.splash_caption {
    font-size: min(5vw, 3vh);
    max-width: 35vw;
}

.splash_progress_slot {
    position: relative;
    width: 70vw;
    aspect-ratio: 720 / 110;
    margin: 1vh 0 2vh;
}

.splash_progress_slot.is-tap-ready {
    aspect-ratio: auto;
    height: auto;
    min-height: 0;
    box-sizing: border-box;
    padding: 0.6vh 4vw;
    width: 92vw;
}

.splash_progress {
    position: absolute;
    inset: 0;
    background-image: url("./assets/images/loading_bar_bg.webp");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
}

.splash_progress_full {
    position: absolute;
    inset: 20% 6%;
    background-image: url("./assets/images/loading_full.webp");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.2s linear;
}

.splash_progress_text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5vw;
    pointer-events: none;
}

.splash_tap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    font-size: 5vw;
    line-height: 1.25;
    text-align: center;
    animation: smoothBlink 2s infinite alternate;
    margin: 1vh 0 2vh;
}

.splash_progress_slot.is-tap-ready .splash_tap {
    position: relative;
    inset: auto;
    margin: 0;
}

@keyframes smoothBlink {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@media (orientation: portrait) {
    .splash_caption {
        max-width: 80vw;
    }
}

@media (min-aspect-ratio: 1/1.5) and (orientation: portrait) {
    .splash_logo {
        width: 30vw;
        margin-bottom: -9vh;
    }

    .splash_banner {
        top: 17vh;
        top: 17dvh;
        width: 45vw;
    }

    .splash_banner_text {
        font-size: 2.1vw;
    }

    .splash_dice {
        width: min(80vw, 45vh);
    }

    .splash_caption {
        font-size: min(4vw, 3.2vh);
        max-width: 60vw;
        margin-top: 10px;
    }

    .splash_progress_slot {
        width: 55vw;
    }

    .splash_progress_slot.is-tap-ready {
        width: 92vw;
    }

    .splash_progress_text {
        font-size: 2.6vw;
    }

    .splash_tap {
        font-size: 5vw;
    }
}

@media (orientation: landscape) {
    .splash_logo {
        width: 40vh;
        margin-bottom: -4vh;
        margin-left: 5vw;
    }

    .splash_banner {
        width: 60vh;
        top: 5vh;
    }

    .splash_blocks {
        flex-direction: row;
        gap: 4vw;
        align-items: flex-start;
    }

    .splash_block_description {
        margin-top: 20vh;
        margin-left: auto;
        margin-right: 5vw;
    }

    .splash_dice {
        width: 75vh;
        margin-top: -30vh;
    }

    .splash_caption {
        font-size: 5.5vh;
        margin-top: 15px;
    }

    .splash_banner_text {
        font-size: 2.5vh;
    }

    .splash_progress_slot {
        width: min(50vw, 50vh);
    }

    .splash_progress_slot.is-tap-ready {
        width: min(70vw, 90vh);
    }

    .splash_progress_text {
        font-size: min(2.2vw, 3vh);
    }

    .splash_tap {
        font-size: 3vh;
    }
}

@media (max-aspect-ratio: 1.57/1) and (orientation: landscape) {
    .splash_banner {
        width: 60vh;
        top: 25vh;
    }

    .splash_dice {
        width: 45vw;
        margin-top: -20vh;
    }

    .splash_caption {
        font-size: 3vh;
    }
}

.splash_sound_btn {
    position: fixed;
    top: 3vmin;
    right: 3vmin;
    width: 7vmin;
    height: 7vmin;
    min-width: 40px;
    min-height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    z-index: 1100;
}

.splash_sound_on {
    background-image: url("assets/images/sound_on.png");
}

.splash_sound_off {
    background-image: url("assets/images/sound_off.png");
}
