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);
}

/* Wide screens: keep the game in a fixed 750:1334 portrait column and fill the sides with a blurred backdrop. */
body {
  background-color: #1a2233;
  align-items: center;
  overflow: hidden;
}

#PageBg {
  position: fixed;
  top: -4%;
  left: -4%;
  width: 108%;
  height: 108%;
  background: url(page-bg.jpg) center / cover no-repeat;
  filter: blur(14px) brightness(0.95);
  pointer-events: none;
  z-index: 0;
}

#GameDiv {
  position: relative;
  z-index: 1;
  flex: none;
  height: 100%;
  width: min(100vw, calc(100vh * 750 / 1334));
  overflow: hidden;
}

/* boot loading: spinner over the engine splash, removed once the first scene is launched (application.ejs) */
#BootLoading {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    pointer-events: none;
    transition: opacity .3s;
}
#BootLoading.hide { opacity: 0; }
#BootLoading .ring {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, .18);
    border-top-color: #3aa0ff;
    border-radius: 50%;
    animation: boot-spin .9s linear infinite;
}
#BootLoading .text {
    color: #fff;
    font: 700 14px/1 Arial, Helvetica, sans-serif;
    letter-spacing: 3px;
}
#BootLoading .text i { font-style: normal; animation: boot-dot 1.2s infinite; }
#BootLoading .text i:nth-child(2) { animation-delay: .2s; }
#BootLoading .text i:nth-child(3) { animation-delay: .4s; }
@keyframes boot-spin { to { transform: rotate(360deg); } }
@keyframes boot-dot { 0%, 20% { opacity: .15; } 50% { opacity: 1; } 100% { opacity: .15; } }
