html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #10131f;
}

body {
    position: absolute;
    text-align: center;
}

.noselect {
    -webkit-user-select: none;
    user-select: none;
}

#full-screen-container,
#unity-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#unity-canvas {
    width: 100%;
    height: 100%;
    background: transparent;
}

#full-screen-container.unity-desktop {
    background: #10131f;
}

#ui-root {
    position: fixed;
    inset: 0;
    /* Keep the game shell above Unity, but below SDK modals such as Xsolla Pay Station. */
    z-index: 100;
    overflow: hidden;
    pointer-events: none;
    background: #10131f;
    transition: opacity 0.25s ease;
}

#ui-root.is-hidden {
    opacity: 0;
}

#ui-root.game-ready {
    background: transparent;
}

#ui-root.game-ready .loading-background,
#ui-root.game-ready .loading-vignette,
#ui-root.game-ready .loading-logo,
#ui-root.game-ready .loading-heroes,
#ui-root.game-ready .loading-leaves,
#ui-root.game-ready .progress {
    opacity: 0;
}

.loading-background {
    position: absolute;
    inset: 0;
    background-image: url("loading-bg-landscape-webp.webp");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.loading-vignette {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(7, 14, 38, 0.08) 0%, rgba(7, 14, 38, 0) 42%, rgba(7, 14, 38, 0.36) 100%),
        linear-gradient(90deg, rgba(7, 14, 38, 0.22) 0%, rgba(7, 14, 38, 0) 22%, rgba(7, 14, 38, 0) 78%, rgba(7, 14, 38, 0.18) 100%);
}

.loading-logo {
    position: absolute;
    left: 50%;
    top: clamp(8px, 2.8vh, 34px);
    width: min(390px, 42vw, 32vh);
    height: auto;
    transform: translateX(-50%);
    filter: drop-shadow(0 10px 8px rgba(36, 18, 0, 0.32));
}

.loading-heroes {
    position: absolute;
    left: 50%;
    bottom: clamp(78px, 8vh, 110px);
    width: min(860px, 64vw, 64vh);
    height: auto;
    transform: translateX(-50%);
    filter: drop-shadow(0 16px 12px rgba(33, 16, 0, 0.25));
}

.loading-leaves {
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: max(100vw, 1100px);
    height: auto;
    transform: translateX(-50%);
}

.progress {
    position: absolute;
    left: 50%;
    bottom: calc(clamp(28px, 4.1vh, 50px) + env(safe-area-inset-bottom));
    width: min(520px, 70vw);
    height: 52px;
    transform: translateX(-50%);
}

.progress-frame {
    position: relative;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 4px solid #171722;
    border-radius: 2px;
    background: #383641;
    box-shadow:
        0 7px 0 rgba(0, 0, 0, 0.24),
        inset 0 3px 0 rgba(255, 255, 255, 0.08),
        inset 0 -4px 0 rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.progress-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("progress-frame-webp.webp") center / 100% 100% no-repeat;
    opacity: 0.22;
    mix-blend-mode: screen;
}

.progress-fill {
    position: absolute;
    left: 7px;
    top: 7px;
    bottom: 7px;
    width: calc(100% - 14px);
    transform: scaleX(0);
    transform-origin: left center;
    background:
        repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.42) 0 22px, rgba(255, 255, 255, 0.02) 22px 44px),
        linear-gradient(180deg, #89b8ff 0%, #5f7cff 52%, #4462e8 100%);
    border-radius: 1px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.34),
        inset 0 -3px 0 rgba(43, 47, 150, 0.45);
}

@media (orientation: portrait) {
    .loading-logo {
        width: min(460px, 76vw, 34vh);
        top: clamp(6px, 1.2vh, 22px);
    }

    .loading-heroes {
        width: min(960px, 116vw, 62vh);
        bottom: clamp(94px, 11vh, 134px);
    }

    .progress {
        width: min(440px, 72vw);
        height: 44px;
    }
}
