html {
  -ms-touch-action: none;
  background: #fffaf0;
}

body,
canvas,
div {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

body {
  position: absolute;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: #8d7654;
  background: #fffaf0;
  cursor: default;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  text-align: center;
  flex-direction: column;
}

#Cocos2dGameContainer {
  position: absolute;
  top: 0;
  left: 0;
  display: -webkit-box;
  margin: 0;
  background: #fffaf0;
  -webkit-box-align: center;
  -webkit-box-orient: horizontal;
  -webkit-box-pack: center;
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  html.kg-desktop-game-stage,
  html.kg-desktop-game-stage body {
    overflow: hidden;
    background:
      radial-gradient(circle at 50% 16%, rgba(227, 181, 83, .18), transparent 34%),
      linear-gradient(180deg, #fffdf7 0%, #fffaf0 55%, #f4e8cf 100%);
  }

  html.kg-desktop-game-stage #Cocos2dGameContainer {
    position: fixed;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
    overflow: hidden;
    background: #fffaf0;
  }

  html.kg-desktop-game-stage #Cocos2dGameContainer::before,
  html.kg-desktop-game-stage #Cocos2dGameContainer::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    width: max(0px, calc((100% - var(--kg-stage-width)) / 2));
    pointer-events: none;
    background:
      radial-gradient(circle at 50% 16%, rgba(227, 181, 83, .18), transparent 34%),
      linear-gradient(180deg, #fffdf7 0%, #fffaf0 55%, #f4e8cf 100%);
  }

  html.kg-desktop-game-stage #Cocos2dGameContainer::before {
    left: 0;
  }

  html.kg-desktop-game-stage #Cocos2dGameContainer::after {
    right: 0;
  }

  html.kg-desktop-game-stage #GameCanvas {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
  }
}

canvas {
  background-color: transparent;
}

a:link,
a:visited,
a:active,
a:hover {
  color: #775321;
}

p.header {
  font-size: small;
}

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

#splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding:
    max(32px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(32px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  color: #684719;
  background:
    radial-gradient(circle at 50% 16%, rgba(227, 181, 83, .24), transparent 36%),
    linear-gradient(180deg, #fffdf7 0%, #fffaf0 52%, #f8eed8 100%);
  opacity: 1;
  transition: opacity 180ms cubic-bezier(.16, 1, .3, 1);
}

#splash.is-leaving {
  pointer-events: none;
  opacity: 0;
}

.kg-loader {
  display: grid;
  width: min(360px, calc(100vw - 48px));
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.kg-loader-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.kg-loader-brand strong {
  color: #bd7b17;
  font: 800 46px/1 Arial, sans-serif;
  letter-spacing: -.03em;
}

.kg-loader-brand span {
  max-width: 90px;
  color: #775321;
  font: 700 17px/1.05 Arial, sans-serif;
  text-align: left;
}

.kg-loader-status {
  margin: 0;
  color: #8d7654;
  font: 500 14px/1.5 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.progress-bar {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(189, 123, 23, .14);
}

.progress-bar span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #e3b553;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s ease-out;
}

@media (max-width: 420px) {
  .kg-loader {
    width: min(320px, calc(100vw - 48px));
  }

  .kg-loader-brand strong {
    font-size: 42px;
  }

  .kg-loader-brand span {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #splash,
  .progress-bar span {
    transition: none;
  }
}
