html {
    -ms-touch-action: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

body,
canvas,
div {
    display: block;
    outline: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -khtml-user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    /* display: none; <- Crashes Chrome on hover */
    -webkit-appearance: none;
    margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

body {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    margin: 0;
    position: fixed;
    inset: 0;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;

    cursor: default;
    color: #888;
    background: #000 url("res/loading_mesh.jpg") no-repeat center center;
    background-size: cover;
    background-position: center;

    text-align: center;
    font-family: Helvetica, Verdana, Arial, sans-serif;

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

canvas {
    background-color: rgba(0, 0, 0, 0);
}

#GameDiv,
#Cocos3dGameContainer,
#GameCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

:root {
    --safe-top: env(safe-area-inset-top);
    --safe-right: env(safe-area-inset-right);
    --safe-bottom: env(safe-area-inset-bottom);
    --safe-left: env(safe-area-inset-left);
}

#loading {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#loading-logo,
#loading-slogan {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
    width: auto;
}

/* 与 Cocos loading.scene 对齐（设计分辨率 750×1624、fitHeight）：按视口高度取比例，封顶原图尺寸 */
#loading-logo {
    top: 28.6%;
    height: 8.44vh;                          /* 612×137，137/1624 */
    height: clamp(48px, 8.44vh, 137px);
}

#loading-slogan {
    top: 64%;
    height: 9.36vh;                          /* 388×152，152/1624 */
    height: clamp(50px, 9.36vh, 152px);
}

#loading-footer {
    position: absolute;
    left: 50%;
    bottom: 10%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 450px;
    text-align: center;
    font-size: 12px;
    color: #a4a4a4;
}

#loading-text {
    margin: 0 0 10px;
}

@media (orientation: landscape) {
    /* 横屏视口矮，纯按高度取比例会把 logo 缩成一条；改按高/宽比例取小者 */
    #loading-logo {
        top: 30%;
        height: 7vw;
        height: clamp(44px, min(16vh, 7vw), 137px);
    }

    #loading-slogan {
        top: 65%;
        height: 8vw;
        height: clamp(44px, min(18vh, 8vw), 152px);
    }

    #loading-footer {
        width: 40%;
        bottom: 12%;
    }
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #070707;
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #8e52f6 0%, #75efa6 100%);
    width: 0%;
    /* 进度由游戏侧高频回调驱动（逐资源/逐文件），每次改宽都会取消并重启过渡；
       ease-in-out 起步慢，被反复重置后进度条会远落后于百分比文字，只能用短时长 linear */
    transition: width 0.1s linear;
}
