body {
  cursor: default;
  padding: 0;
  border: 0;
  margin: 0;

  text-align: center;
  background-color: #143d2c;
  font-family: Helvetica, Verdana, Arial, sans-serif;
}

body, canvas, div {
  outline: 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 {
  -webkit-appearance: none;
  margin: 0;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}

/* 舞台：保持 720:1280，在 iPad/小窗内完整装下（不裁切） */
#gd-stage {
  position: relative;
  /* 宽度取「视口宽」与「由高度反推的最大宽」的较小值 */
  width: min(720px, 100vw, calc(100dvh * 720 / 1280));
  aspect-ratio: 720 / 1280;
  height: auto;
  max-width: 100vw;
  max-height: 100dvh;
  max-height: 100vh;
  margin: 8px auto;
  box-sizing: border-box;
}

#GameDiv {
  margin: 0 auto;
  position: relative;
  width: 100% !important;
  height: 100% !important;
  border: 5px solid #1a3d2a;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  box-sizing: border-box;
}

#Cocos3dGameContainer, #GameCanvas {
  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);
}

html, body {
  background: #143d2c;
}

#GameDiv.gd-waiting,
.gd-waiting-chrome {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Loading：绝对定位在舞台内，非浏览器全屏 */
#gd-loading {
  position: absolute;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: #1a5c40 url(./loading_bg.png) center / cover no-repeat;
  color: #fff8e7;
  transition: opacity 0.25s ease;
}
#gd-loading.gd-loading-hide {
  opacity: 0;
  pointer-events: none;
}
.gd-loading-inner {
  width: min(86%, 360px);
  text-align: center;
  padding: 20px 16px 28px;
  background: rgba(12, 48, 34, 0.72);
  border: 3px solid rgba(255, 210, 90, 0.85);
  border-radius: 18px;
}
.gd-loading-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 10px;
  display: block;
}
.gd-loading-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 6px;
  color: #ffe27a;
}
.gd-loading-sub {
  font-size: 13px;
  color: #c8e6d0;
  margin: 0 0 18px;
}
.gd-loading-bar {
  height: 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  border: 2px solid rgba(255, 210, 90, 0.7);
}
#gd-loading-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f97316, #facc15 55%, #fb7185);
  transition: width 0.12s linear;
}
#gd-loading-text {
  margin-top: 12px;
  font-size: 13px;
  color: #e8f5e9;
}

.header {
  color: #ffe27a;
  font-size: 22px;
  margin: 16px 0 8px;
}
.footer {
  color: #9bbb9a;
  font-size: 12px;
  margin: 12px 0 24px;
}
.footer a {
  color: #c8e6d0;
}
