@supports (padding-top: env(safe-area-inset-top, 0px)) {
  :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);
  }

  /* Cocos rotates the game frame clockwise while the mobile viewport is portrait. */
  @media (orientation: portrait) {
    :root.cq-web-landscape {
      --safe-top: env(safe-area-inset-right, 0px);
      --safe-right: env(safe-area-inset-bottom, 0px);
      --safe-bottom: env(safe-area-inset-left, 0px);
      --safe-left: env(safe-area-inset-top, 0px);
    }
  }
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #111d24;
  font-family: Arial, sans-serif;
}
body, canvas, div {
  outline: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#GameDiv {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
}
#Cocos3dGameContainer, #GameCanvas {
  width: 100%;
  height: 100%;
  margin: 0;
}
canvas { display: block; background: transparent; }
input { user-select: text; -webkit-user-select: text; }
#cq-web-boot {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: max(48px, var(--safe-bottom, 0px));
  background: radial-gradient(circle at 50% 42%, #1e3738 0%, #111d24 72%, #0b1419 100%);
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}
#cq-web-boot.cq-web-boot-done {
  opacity: 0;
}
#cq-web-boot-track {
  width: min(560px, 72vw);
  height: 14px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid #6c3d23;
  background: #1e3738;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
#cq-web-boot-fill {
  width: 15%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff2a2 0%, #ffd765 45%, #bd731a 100%);
  transition: width 0.25s ease-out;
}
