:root {
  color-scheme: dark;
  background: #0b1422;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: radial-gradient(circle at 50% 30%, #243a55, #0b1422 72%);
}

#unity-container {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#unity-canvas {
  display: block;
  width: min(100vw, calc(100vh * 0.5625));
  height: min(100vh, calc(100vw * 1.7777778));
  max-width: 540px;
  max-height: 960px;
  background: #20344d;
  outline: none;
  touch-action: none;
  box-shadow: 0 0 48px rgba(42, 94, 143, 0.30);
}

#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(74vw, 360px);
  transform: translate(-50%, -50%);
  text-align: center;
  color: #eef8ff;
  text-shadow: 0 2px 6px #000;
}

#unity-loading-title { margin-bottom: 16px; font-size: 26px; font-weight: 700; }
#unity-loading-text { margin-top: 10px; font-size: 14px; color: #b9d5ea; }
#unity-progress-track { height: 12px; overflow: hidden; border: 1px solid #76c9ff; border-radius: 999px; background: #0b1c2d; }
#unity-progress-bar-full { width: 0; height: 100%; background: linear-gradient(90deg, #37a7e8, #7ef1ff); transition: width 120ms linear; }

#unity-warning {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  width: min(92%, 520px);
  transform: translateX(-50%);
  z-index: 3;
}

#unity-warning > div { margin-bottom: 6px; padding: 10px 12px; border-radius: 8px; color: #14202e; background: #ffe77c; }
#unity-warning > .error { color: white; background: #ad2843; }

@media (max-aspect-ratio: 9 / 16) {
  #unity-canvas { width: 100vw; height: calc(100vw * 1.7777778); }
}

@media (min-aspect-ratio: 9 / 16) {
  #unity-canvas { width: calc(100vh * 0.5625); height: 100vh; }
}
