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 {
    -webkit-appearance: none;
    margin: 0;
}

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

  cursor: default;
  color: #f8f4ff;
  background-color: #020717;

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

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

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

#hex-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #ffffff;
  background: #020717;
  opacity: 1;
  visibility: visible;
  transition: opacity 420ms ease, visibility 420ms ease;
}

#hex-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(2, 7, 23, 0.28), rgba(2, 7, 23, 0.78)),
    url("loading-background.png");
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
}

#hex-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(84, 216, 255, 0.12), transparent 24%, transparent 76%, rgba(255, 212, 77, 0.1)),
    radial-gradient(circle at 50% 48%, rgba(36, 62, 144, 0.34), transparent 42%);
}

#hex-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.hex-loader-content {
  position: relative;
  z-index: 1;
  width: min(76vw, 420px);
  max-width: calc(100vw - 40px);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  transform: translateY(-2vh);
}

.hex-loader-logo {
  width: min(76vw, 420px);
  max-height: 28vh;
  object-fit: contain;
  filter:
    drop-shadow(0 0 12px rgba(84, 216, 255, 0.5))
    drop-shadow(0 10px 26px rgba(0, 0, 0, 0.55));
}

.hex-loader-bar {
  width: min(68vw, 360px);
  height: 17px;
  padding: 3px;
  border: 1px solid rgba(255, 212, 77, 0.92);
  border-radius: 999px;
  background: rgba(3, 10, 34, 0.82);
  box-shadow:
    0 0 0 1px rgba(84, 216, 255, 0.24),
    0 0 20px rgba(84, 216, 255, 0.35),
    inset 0 1px 8px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}

#hex-loader-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #54d8ff 0%, #ffe66d 58%, #ff8c2a 100%);
  box-shadow:
    0 0 12px rgba(255, 230, 109, 0.8),
    0 0 22px rgba(84, 216, 255, 0.52);
  transition: width 120ms linear;
}

#hex-loader-percent {
  min-height: 22px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff9d6;
  text-shadow:
    0 1px 0 #000000,
    0 0 10px rgba(84, 216, 255, 0.7),
    0 0 16px rgba(255, 212, 77, 0.6);
}

#hex-loader.is-error #hex-loader-fill {
  background: linear-gradient(90deg, #ff5f7d 0%, #ffd15c 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);
}
