:root {
  color-scheme: dark;
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #17142b;
  color: #fff;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 0%, #3b3266 0, #17142b 62%);
}
.game-shell { width: min(100%, 1200px); }
.game-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 8px;
}
h1 { margin: 0; font-size: clamp(18px, 3vw, 28px); letter-spacing: .02em; }
button {
  border: 1px solid #7e73ae;
  border-radius: 999px;
  padding: 7px 14px;
  background: #2c264b;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
button:disabled { opacity: .45; cursor: default; }
button:focus-visible { outline: 3px solid #ffcf4a; outline-offset: 2px; }
.game-frame {
  position: relative;
  width: min(100%, calc((100dvh - 66px) * 0.5625));
  max-width: 100%;
  aspect-ratio: 9 / 16;
  margin-inline: auto;
  overflow: hidden;
  border-radius: clamp(0px, 1.5vw, 16px);
  background: #000;
  box-shadow: 0 16px 48px #08061299;
}
#unity-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: #211c3cf2;
}
.loading strong { font-size: clamp(24px, 5vw, 44px); }
.loading[hidden] { display: none; }
progress { width: min(320px, 80%); height: 12px; accent-color: #ffcf4a; }
.warning {
  position: absolute;
  inset-inline: 12px;
  bottom: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #a52636;
  color: #fff;
}
.warning[hidden] { display: none; }
@media (max-width: 520px) {
  body { padding-inline: 0; }
  .game-header { padding-inline: 10px; }
  .game-frame { border-radius: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .loading progress { transition: width .15s ease-out; }
}
