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 */
}

/* Prevent screen rotation on input focus */
input,
textarea,
select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Prevent orientation change on input focus */
input:focus,
textarea:focus,
select:focus {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {

  /* iOS Safari specific styles */
  input,
  textarea,
  select {
    -webkit-appearance: none;
    -webkit-border-radius: 0;
    border-radius: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: text;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  input:focus,
  textarea:focus,
  select:focus {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
  }

  /* Prevent zoom on iOS input focus */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
}

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

  cursor: default;
  color: #888;
  background-color: #000;
  background-image: url(./background.4d50e.jpg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;

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

  display: flex;
  flex-direction: column;

  /* fix bug: https://github.com/cocos-creator/2d-tasks/issues/791 */
  /* overflow cannot be applied in Cocos2dGameContainer, 
  otherwise child elements will be hidden when Cocos2dGameContainer rotated 90 deg */
  overflow: hidden;

  /* Prevent orientation change */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000;
  perspective: 1000;

  /* Force portrait orientation */
  min-height: 100dvh;
  /* max-height: 100dvh; */
  min-width: 100vw;
  max-width: 100vw;
}

#Cocos2dGameContainer {
  position: absolute;
  margin: 0;
  left: 0px;
  top: 0px;

  display: -webkit-box;
  -webkit-box-orient: horizontal;
  -webkit-box-align: center;
  -webkit-box-pack: center;

  /* Prevent orientation change */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000;
  perspective: 1000;
}

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

a:link,
a:visited {
  color: #666;
}

a:active,
a:hover {
  color: #666;
}

p.header {
  font-size: small;
}

p.footer {
  font-size: x-small;
}

body #splash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #171717;
  background-image: url(./background.4d50e.jpg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

body #splash::before,
body #splash::after {
  content: "";
  position: absolute;
  left: 50%;
  pointer-events: none;
  z-index: 1;
}

body #splash::before {
  top: 31%;
  width: min(95vw, 680px);
  aspect-ratio: 1080 / 914;
  transform: translate(-50%, -50%);
  background: url(./light.e90f8.png) no-repeat center / contain;
  opacity: 0.85;
}

body #splash::after {
  top: 35%;
  width: min(95vw, 620px);
  aspect-ratio: 748 / 300;
  transform: translate(-50%, -50%);
  background: var(--splash-logo, url(./splash.8e06f.png)) no-repeat center / contain;
  z-index: 2;
}

body #splash .progress-bar {
  position: absolute;
  left: 50%;
  top: 80%;
  width: min(88vw, 390px);
  aspect-ratio: 763 / 52;
  transform: translate(-50%, -50%);
  background: url(./bkg_progres.ad755.png) no-repeat center / 100% 100%;
  z-index: 3;
}

body #splash .progress-track {
  position: absolute;
  left: 2.2%;
  right: 2.2%;
  top: 18%;
  bottom: 18%;
  overflow: visible;
}

body #splash .progress-track span {
  display: block;
  position: relative;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: url(./bar_progress.47ef0.png) no-repeat left center / 100% 100%;
  transition: width 0.3s ease-in-out;
}

body #splash .progress-track span::after {
  content: "";
  position: absolute;
  right: -17px;
  top: 50%;
  width: clamp(24px, 7vw, 36px);
  aspect-ratio: 76 / 78;
  transform: translateY(-50%);
  background: url(./chip.b31e4.png) no-repeat center / contain;
}

body #splash .loading-tip {
  position: absolute;
  left: 10%;
  top: 83.5%;
  width: 80%;
  text-align: center;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(12px, 2.9vw, 16px);
  line-height: 1.45;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  animation: fade-in 0.5s ease-in-out;
  z-index: 3;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* iOS Dynamic viewport support */
@supports (-webkit-touch-callout: none) {
  body {
    transition: padding 0.1s ease;
  }
}
