html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  background: #78992B;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: #BFDD32;
  overflow: hidden;
}

/* width > height => landscape => 9:16 stage */
@media (orientation: landscape) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #stage {
    inset: auto;
    position: relative;
    height: 100dvh;
    width: calc(100dvh * 9 / 16);
    margin: 0 auto;
  }
}

#unity-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #BFDD32;
}

#loader {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) 6% max(48px, env(safe-area-inset-bottom));
  transition: opacity 350ms ease;
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

#loader-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("bg-pattern.png") repeat;
  background-size: 28% auto;
  opacity: 0.35;
  will-change: background-position;
  pointer-events: none;
}

#loader-logo {
  position: relative;
  z-index: 1;
  width: 70%;
  max-width: 420px;
  max-height: 55%;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

#loader-progress {
  position: relative;
  z-index: 1;
  margin-top: clamp(48px, 12%, 120px);
  width: 60%;
  max-width: 380px;
  height: clamp(14px, 3%, 22px);
  padding: 4px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

#loader-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #FF8E2A 0%, #F56A0F 100%);
  transition: width 120ms linear;
}
