/* 暗黑模式协议防御：CSS 根节点再次声明浅色主题 */
:root {
    color-scheme: light;
}

html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1a1a2e;
    background-image: url('LoadingBG.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#unity-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#unity-container { position: relative }
#unity-container.unity-mobile { width: 100%; height: 100% }

/* 将游戏画布背景设为透明，以露出 body 的背景图 */
#unity-canvas { background: transparent; } 
.unity-mobile #unity-canvas { width: 100%; height: 100% }

#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }

/* 2. 替换正中间的 Logo */
#unity-logo { 
    /*width: 154px; 
    height: 130px; 
    /* 换成你自己的 Logo 图片 */
     /* background: url('my-center-logo.png') no-repeat center; 
    background-size: contain; */
    display: none;
}

/* 3. 修改进度条：变长、变宽 */
#unity-progress-bar-empty { 
    width: 300px;  /* 【修改】：控制进度条的总长度，从 141px 放大到 300px（可自行增减） */
    height: 30px;  /* 【修改】：控制进度条的粗细/高度，从 18px 放大到 30px */
    margin-top: 20px; 
    margin-left: 0; /* 【修改】：去掉了原来莫名其妙的 6.5px，让它完美居中 */
    background: url('progress-bar-empty-dark.png') no-repeat center; 
    background-size: 100% 100%; /* 【新增！极其关键】：强制让背景图片拉伸适配你修改后的新尺寸，否则图片会错位 */
}
#unity-progress-bar-full { 
    width: 0%; /* 注意：这里保持 0% 不变，代码会控制它 */
    height: 30px; /* 【修改】：必须和上面的 empty 高度保持绝对一致，改为 30px */
    margin-top: 20px; 
    background: url('progress-bar-full-dark.png') no-repeat center; 
    background-size: 100% 100%; /* 【新增！极其关键】：同理，强制拉伸填充图 */
}

/* 4. 修改百分比文字：变大 */
#unity-progress-text {
    color: #ffffff; 
    text-align: center; 
    font-family: Arial, sans-serif;
    font-size: 40px; /* 【修改】：控制字体大小，从 16px 放大到 28px（可自行增减） */
    margin-top: 21px; /* 【修改】：字变大了，稍微把向下的间距拉开一点，避免和进度条挤在一起 */
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8); /* 【修改】：字变大了，阴影也要稍微加重一点才好看 */
}

/* --- 下面是修改过的底栏相关代码 --- */
#unity-footer { position: relative; width: 100%; height: 120px; display: block; }
.unity-mobile #unity-footer { display: none }
#unity-webgl-logo { float:left; width: 120px; height: 120px; }
#unity-build-title { float: right; margin-right: 10px; line-height: 120px; font-family: arial; font-size: 18px }
#unity-fullscreen-button { float: right; width: 38px; height: 38px; margin-top: 21px; cursor: pointer }

#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

/* ========== 全屏容器化 CSS ========== */

/* 修复风险①：重置定位与居中偏移，使用 absolute 保留 WebGLInput 插件定位上下文 */
/* 注意：不同浏览器全屏伪类必须分开写，不能用逗号合并，否则整条规则失效 */

#unity-wrapper:fullscreen {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #000 !important;
    z-index: 999 !important;
}
#unity-wrapper:-webkit-full-screen {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #000 !important;
    z-index: 999 !important;
}
#unity-wrapper:-moz-full-screen {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #000 !important;
    z-index: 999 !important;
}

/* Container 撑满 wrapper（每条伪类独立一行，不可合并） */
#unity-wrapper:fullscreen #unity-container { width: 100% !important; height: 100% !important; }
#unity-wrapper:-webkit-full-screen #unity-container { width: 100% !important; height: 100% !important; }
#unity-wrapper:-moz-full-screen #unity-container { width: 100% !important; height: 100% !important; }

/* Canvas 铺满（每条伪类独立一行，不可合并） */
#unity-wrapper:fullscreen #unity-canvas { width: 100% !important; height: 100% !important; }
#unity-wrapper:-webkit-full-screen #unity-canvas { width: 100% !important; height: 100% !important; }
#unity-wrapper:-moz-full-screen #unity-canvas { width: 100% !important; height: 100% !important; }

/* Footer 隐藏（每条伪类独立一行，不可合并） */
#unity-wrapper:fullscreen #unity-footer { display: none !important; }
#unity-wrapper:-webkit-full-screen #unity-footer { display: none !important; }
#unity-wrapper:-moz-full-screen #unity-footer { display: none !important; }
