:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  background: #fffdf8;
}

html,
body {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #fffdf8;
}

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

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#GameDiv {
  position: relative;
  /* 容器由 CSS 持有尺寸；screen.windowSize 写回的内联值不能把下次转屏锁住。 */
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden;
}

#ParcelwayBoot {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #20383c;
  background: radial-gradient(circle at 50% 38%, #fffdf8 0%, #f4ead2 72%, #e4d6b7 100%);
  opacity: 1;
  transition: opacity 220ms ease-out;
}

#ParcelwayBoot[data-state="leaving"] {
  pointer-events: none;
  opacity: 0;
}

#ParcelwayBoot img {
  width: 112px;
  height: 112px;
  object-fit: contain;
}

#ParcelwayBoot strong {
  font-size: 28px;
  letter-spacing: 0.12em;
}

#ParcelwayBoot p {
  margin: 0;
  font-size: 15px;
}

#ParcelwayBoot progress {
  width: min(64%, 280px);
  height: 10px;
  accent-color: #2e9c91;
}

#ParcelwayBoot button {
  min-width: 132px;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 22px;
  color: #fffdf8;
  background: #c8524f;
  font: inherit;
}

@media (min-aspect-ratio: 9 / 16) {
  #GameDiv {
    /* Cocos 会在运行时写入窗口像素尺寸；宽屏必须覆盖这两个内联值。 */
    width: min(100vw, 56.25vh) !important;
    height: 100vh !important;
  }
}

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

#GameCanvas {
  background: transparent;
  touch-action: none;
}
