/* 牌友圈 Web 启动页：整图主图 + 进度条 + 底部网址（不再切分层素材） */
html {
  -ms-touch-action: none;
  touch-action: none;
}

body, canvas, div {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  cursor: default;
  color: #888;
  /* 与登录页清屏色一致，避免启动页关掉后闪黑 */
  background-color: #f3f4f6;
  text-align: center;
  font-family: Helvetica, Verdana, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

#GameDiv,
#Cocos3dGameContainer,
#GameCanvas {
  width: 100%;
  height: 100%;
}

/* 画布始终可见并由 #splash 盖住；hidden 会导致部分浏览器不渲染，揭开后黑屏 */
#GameCanvas {
  visibility: visible;
}

#splash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #031711;
  z-index: 500;
}

body:not(.allow-engine-hide) #splash {
  display: block !important;
}

.splash-page-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #031711;
}

.splash-stage {
  position: absolute;
  inset: 0;
  width: min(100vw, calc(100vh * 0.5625)); /* 720/1280 */
  max-width: 720px;
  height: 100%;
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  z-index: 1001;
  background: #031711 url("./splash/splash-background.jpg") center / cover no-repeat;
}

/* 主图容器：默认按原版人物图尺寸摆放（不铺满放大） */
.splash-main {
  position: absolute;
  inset: 0;
  z-index: 1002;
  background-color: transparent;
  overflow: hidden;
  pointer-events: none;
}

.splash-main > img {
  position: absolute;
  left: 50%;
  bottom: 27%;
  width: min(92%, 610px);
  aspect-ratio: 637 / 757;
  height: auto;
  transform: translateX(-50%);
  object-fit: fill;
  display: block;
  border: 0;
  pointer-events: none;
  visibility: hidden;
}

.splash-main.is-ready > img {
  visibility: visible;
}

/* 接近 720×1280 的整页上传主图：铺满手机画幅 */
.splash-main.is-fullpage > img {
  inset: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  transform: none;
  object-fit: fill;
}

.loading-bg-phone-text-copyright {
  position: absolute;
  z-index: 1004;
  left: 50%;
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 50px));
  transform: translateX(-50%);
  width: 86%;
  text-align: center;
  font-size: clamp(16px, 4vw, 26px);
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  letter-spacing: 0.02em;
}

#progresscontainer {
  position: absolute;
  width: min(82.5%, 594px);
  height: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: url("./splash/progress-track.png") center / 100% 100% no-repeat;
  bottom: 18.8%;
  overflow: visible;
  z-index: 10000;
  opacity: 0;
}

#progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: url("./splash/progress-fill.png") left center / 100% 100% no-repeat;
  transition: none;
}

#p-v,
#first-text {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  pointer-events: none;
}

#p-v {
  bottom: calc(100% + 10px);
  font-size: clamp(13px, 3.2vw, 18px);
}

#first-text {
  bottom: calc(100% + 36px);
  font-size: clamp(13px, 3.2vw, 18px);
  display: none;
}

body.game-booted #progresscontainer {
  opacity: 1;
}

body.game-ready #splash {
  transition: opacity 0.2s ease;
}
