/* 全屏自适应背景：cover 铺满视口（loading / main 共用，两侧可见）
 * 内容区宽高由引擎 designResolution 504×920 + fitHeight 控制（与 Super_Wildrix 一致）
 */
html {
  -ms-touch-action: none;
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  background-color: #0a1628;
  background-image: url("./assets/common_bg.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

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);
}

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

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  margin: 0;

  cursor: default;
  color: #888;
  background-color: transparent;

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

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

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

/*
 * PC：游戏承载区宽度固定为设计宽度 566px，高度随可视区域变化。
 */
#GameDiv {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: 566px !important;
  height: 100vh !important;
  height: 100dvh !important;
  flex: 0 0 auto;
  background-color: transparent;
}

#GameDiv,
#Cocos3dGameContainer,
#GameCanvas {
  box-sizing: border-box;
  max-width: none !important;
}

#Cocos3dGameContainer,
#GameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  transform: none;
  width: 100% !important;
  height: 100% !important;
  background-color: transparent;
}

/*
 * H5：外层画布占满设备视口。引擎继续根据当前视口做适配，
 * 不沿用 PC 的固定 566px 容器。
 */
@media (max-width: 600px) {
  #GameDiv {
    width: 100vw !important;
    width: 100dvw !important;
    height: 100vh !important;
    height: 100dvh !important;
  }
}

: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);
}
