html {
  -ms-touch-action: none;
}

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);
}

/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    /* display: none; <- Crashes Chrome on hover */
    -webkit-appearance: none;
    margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;

  cursor: default;
  color: #888;
  background-color: #333;

  text-align: center;
  font-family: Helvetica, Verdana, Arial, sans-serif;

  display: flex;
  flex-direction: column;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}

#GameDiv, #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 { overscroll-behavior: none; touch-action: none; overflow: hidden; }
body { min-height: calc(var(--mobile-vh, 1vh) * 100); background: #080806; }
#GameDiv { position: fixed; inset: 0; padding: 0; box-sizing: border-box; }
#mobile-controls { position: fixed; z-index: 99990; top: max(8px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); display: flex; gap: 5px; pointer-events: auto; }
#mobile-controls button { min-width: 64px; min-height: 36px; padding: 6px 9px; border: 1px solid rgba(174,126,43,.72); border-radius: 3px; background: rgba(18,15,10,.9); color: #e0c785; font: 600 13px/1.15 "Microsoft YaHei", sans-serif; white-space: nowrap; }
#mobile-controls button:active { background: rgba(99,66,24,.96); }
#mobile-loading, #rotate-device { position: fixed; inset: 0; z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #080806; color: #e6c36a; font-family: "Microsoft YaHei", sans-serif; }
#mobile-loading { background-image: linear-gradient(rgba(4,3,2,.58), rgba(4,3,2,.76)), url("loading-background.jpg"); background-position: center; background-size: cover; }
#mobile-loading::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(87,58,17,.08), rgba(0,0,0,.34)); pointer-events: none; }
#mobile-loading-card { position: relative; width: min(72vw, 620px); padding: clamp(22px, 5vw, 42px); border: 1px solid rgba(175,126,38,.62); background: rgba(11,8,4,.78); box-shadow: 0 18px 65px rgba(0,0,0,.62), inset 0 0 38px rgba(121,77,16,.12); box-sizing: border-box; }
#mobile-loading strong { display: block; font-size: clamp(24px, 6vw, 46px); letter-spacing: .2em; text-shadow: 0 2px 16px #000; }
#mobile-loading span, #rotate-device span { display: block; margin-top: 14px; color: #cfb476; font-size: clamp(12px, 2.7vw, 16px); }
#mobile-loading-detail { opacity: .78; }
#mobile-loading-track { position: relative; height: 10px; margin-top: 22px; overflow: hidden; border: 1px solid rgba(177,125,31,.7); background: rgba(0,0,0,.64); box-shadow: inset 0 0 8px rgba(0,0,0,.85); }
#mobile-loading-fill { position: absolute; inset: 0 auto 0 0; width: 4%; background: linear-gradient(90deg, #6d430f, #c08a2a 58%, #f2cf70); box-shadow: 0 0 15px rgba(222,167,62,.7); transition: width .18s ease-out; }
#mobile-loading-fill::after { content: ""; position: absolute; inset: 0; width: 42%; background: linear-gradient(90deg, transparent, rgba(255,238,174,.78), transparent); animation: chuhan-loading-shine 1.15s linear infinite; }
@keyframes chuhan-loading-shine { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
#mobile-loading.is-hidden { opacity: 0; pointer-events: none; transition: opacity .35s ease; }
#rotate-device { display: none; }
@media (orientation: portrait) and (max-width: 900px) {
  #rotate-device { display: flex; }
  #GameDiv { visibility: hidden; }
}
@media (pointer: coarse) {
  input, textarea, button { font-size: 16px !important; }
}
