:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #111827;
}

* {
  box-sizing: border-box;
}

html,
body,
.game-root {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.game-root {
  position: relative;
  background:
    radial-gradient(circle at 50% 20%, rgb(48 137 149 / 28%), transparent 45%),
    #111827;
}

#GameCanvas {
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

.game-splash,
.game-error {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.8rem;
  padding: 2rem;
  text-align: center;
  background: linear-gradient(155deg, rgb(10 23 36 / 97%), rgb(18 36 49 / 95%));
  transition: opacity 240ms ease;
}

.game-splash[hidden],
.game-error[hidden] {
  display: none;
}

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

.game-splash__mark {
  display: grid;
  width: 5rem;
  height: 5rem;
  place-items: center;
  border: 1px solid rgb(153 225 206 / 38%);
  border-radius: 1.35rem;
  background: rgb(41 113 93 / 30%);
  font-size: 2.6rem;
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 28%);
}

.game-splash h1,
.game-error h2,
.game-splash p,
.game-error p {
  margin: 0;
}

.game-splash h1 {
  font-size: 1.45rem;
}

.game-splash p,
.game-error p {
  color: #9fbdc9;
  font-size: 0.86rem;
}

.game-splash__progress {
  width: min(15rem, 70vw);
  height: 0.3rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 9%);
}

.game-splash__progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4bbda5, #c6e06e);
  animation: game-loading 1.25s ease-in-out infinite alternate;
}

.game-error {
  z-index: 10;
  background: #161b25;
}

.game-error button {
  margin-top: 0.5rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.65rem;
  color: #0b1a1c;
  background: #8ee2cc;
  font: inherit;
  cursor: pointer;
}

@keyframes game-loading {
  from {
    transform: translateX(-12%);
  }
  to {
    transform: translateX(150%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-splash__progress span {
    animation: none;
    transform: none;
  }
}
