html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #8ed7f6;
}

body {
  font-family: Arial, Helvetica, sans-serif;
}

.splash-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background-color: #8ed7f6;
  background-image: url("./webgl/spalsh_bk.png");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.splash-shell.is-splash-island-bg {
  background-color: #7aceff;
  background-image: linear-gradient(
    to bottom,
    #7aceff 0%,
    #7aceff 56%,
    #d9fafa 56%,
    #d9fafa 100%
  );
}

.splash-shell.is-neutral-game-bg {
  background-color: #f1f3f5;
  background-image: none;
}

.loading-screen,
.game-stage {
  position: absolute;
  inset: 0;
}

.loading-screen {
  z-index: 2;
  display: grid;
  place-items: end center;
  padding: 0 24px max(46px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  pointer-events: none;
}

.loading-screen.is-complete {
  opacity: 0;
  transition: opacity 280ms ease;
}

.progress-panel {
  width: min(520px, 72vw);
  display: grid;
  grid-template-columns: 1fr 54px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 26px rgba(15, 71, 99, 0.22);
  box-sizing: border-box;
}

.progress-track {
  height: 18px;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 999px;
  background: rgba(48, 131, 176, 0.38);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58c947, #91ec4b);
  transition: width 120ms linear;
}

.progress-text {
  color: #225167;
  font-size: 18px;
  font-weight: 700;
  text-align: right;
  line-height: 1;
}

.game-stage {
  z-index: 1;
  display: grid;
  place-items: center;
  opacity: 0;
}

.splash-shell.is-loaded .game-stage {
  opacity: 1;
}

#gameContainer {
  aspect-ratio: 16 / 9;
  width: min(100vw, calc(100vh * 16 / 9)) !important;
  height: min(100vh, calc(100vw * 9 / 16)) !important;
  background: transparent !important;
}

#gameContainer canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

@media (max-width: 640px) {
  .loading-screen {
    padding-inline: 16px;
  }

  .progress-panel {
    width: min(440px, 86vw);
    grid-template-columns: 1fr 44px;
    gap: 8px;
  }

  .progress-text {
    font-size: 15px;
  }
}
