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: #080603;

  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%;
}

#GameLoadingScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  padding-bottom: max(8vh, calc(env(safe-area-inset-bottom) + 48px));
  overflow: hidden;
  background-color: #080603;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04) 55%, rgba(0, 0, 0, 0.58) 100%),
    url('./splash-bg.png');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 1;
  transition: opacity 400ms ease;
}

#GameLoadingScreen.game-loading-screen--hidden {
  pointer-events: none;
  opacity: 0;
}

.game-loading-indicator {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  height: 44px;
  border: 1px solid rgba(219, 174, 89, 0.45);
  border-radius: 22px;
  background: rgba(7, 5, 3, 0.62);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
}

.game-loading-indicator__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8bd68;
  animation: game-loading-pulse 1.1s ease-in-out infinite;
}

.game-loading-indicator__dot:nth-child(2) {
  animation-delay: 140ms;
}

.game-loading-indicator__dot:nth-child(3) {
  animation-delay: 280ms;
}

.game-loading-screen--error .game-loading-indicator__dot {
  background: #c85d50;
  animation: none;
}

@keyframes game-loading-pulse {
  0%, 70%, 100% {
    opacity: 0.35;
    transform: translateY(0) scale(0.85);
  }
  35% {
    opacity: 1;
    transform: translateY(-4px) scale(1);
  }
}

: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);
}
