:root {
  color-scheme: dark;
  background: #13242f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

html,
body {
  position: fixed;
  inset: 0;
  min-height: 100%;
  background: #13242f;
  overscroll-behavior: none;
  touch-action: none;
}

#game-shell {
  position: absolute;
  inset: 0;
}

#game-frame {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(100vw, calc(100vh * 0.5625));
  height: min(100vh, calc(100vw * 1.7777778));
  overflow: hidden;
  transform: translate(-50%, -50%);
  background: #13242f;
  box-shadow: 0 0 72px rgb(0 0 0 / 42%);
}

#unity-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #13242f;
  outline: 0;
}

#orientation-guard {
  display: none;
  position: fixed;
  z-index: 20;
  inset: 0;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 32px;
  color: white;
  text-align: center;
  background: rgb(13 23 32 / 96%);
}

#orientation-guard strong {
  font-size: 24px;
}

#orientation-guard span {
  color: rgb(255 255 255 / 66%);
  font-size: 14px;
}

.phone-glyph {
  width: 54px;
  height: 90px;
  border: 4px solid currentColor;
  border-radius: 10px;
  transform: rotate(-90deg);
  animation: rotate-phone 1.8s ease-in-out infinite;
}

@keyframes rotate-phone {
  0%, 20% { transform: rotate(-90deg); }
  65%, 100% { transform: rotate(0deg); }
}

@media (orientation: landscape) and (pointer: coarse) {
  #orientation-guard {
    display: grid;
  }
}

#loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 18px;
  padding: max(28px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  text-align: center;
  background: linear-gradient(165deg, #162b38, #0d1720);
}

#loading[hidden] {
  display: none;
}

#loading-title {
  font-size: clamp(30px, 9vw, 58px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

#loading-track {
  width: min(64vw, 320px);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 14%);
}

#loading-progress {
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  border-radius: inherit;
  background: #24a77c;
  transition: transform 120ms linear;
}

#loading-copy {
  color: rgb(255 255 255 / 58%);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

#unity-warning {
  position: absolute;
  z-index: 3;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  left: 12px;
  pointer-events: none;
}

.banner {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #14212a;
  background: #ffd86b;
  font-size: 13px;
}

.banner.error {
  color: white;
  background: #d93b45;
}
