/* The page around the game canvas, and the loading screen shown until the game draws its first frame. */

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #1e5b47;
  color: #fffdf7;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Taps on the canvas must not highlight or zoom the page. */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ComposeViewport replaces everything inside its container, so the game gets its own and the loading screen stays. */
#game {
  position: fixed;
  inset: 0;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  box-sizing: border-box;
  background: #1e5b47;
  text-align: center;
}

.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 156px;
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  color: #d9452f;
  font-size: 88px;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-4deg);
}

#loading p {
  max-width: 420px;
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
}

#loading.unsupported .loading-card {
  transform: none;
}

/* A plain link that crawlers see in the HTML before the game draws on the canvas. */
#loading p.other-app {
  position: absolute;
  right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 24px;
  max-width: none;
  font-size: 15px;
  font-weight: 400;
}

#loading a,
.noscript a {
  color: #fffdf7;
  font-weight: 600;
}

/* Without JavaScript the loading screen is hidden and this text takes its place. */
.noscript {
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 24px;
  font-size: 19px;
  line-height: 1.45;
  text-align: center;
}

.noscript p {
  margin: 0 0 20px;
}

@media (prefers-reduced-motion: no-preference) {
  .loading-card {
    animation: deal 1.4s ease-in-out infinite alternate;
  }

  #loading.unsupported .loading-card {
    animation: none;
  }
}

@keyframes deal {
  from {
    transform: rotate(-4deg);
  }

  to {
    transform: rotate(4deg);
  }
}
