:root {
  color-scheme: dark;
  --background: #0b0a0c;
  --text: #f7f6f8;
  --muted: #c4c1c7;
  --teal: #45c4b3;
  --gradient: linear-gradient(100deg, #7965df, #4386d5 35%, #26a8a0 70%, #40bd79);
  background: var(--background);
  color: var(--text);
  font-family: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; overflow: hidden; }

#unity-canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--background);
  touch-action: none;
}

#loading-screen {
  --gutter: clamp(1rem, 5vw, 5rem);
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right))
    env(safe-area-inset-bottom) max(var(--gutter), env(safe-area-inset-left));
  background:
    radial-gradient(ellipse at 22% 105%, #28204166, transparent 50%),
    radial-gradient(ellipse at 90% 115%, #15423766, transparent 53%),
    linear-gradient(#0b0a0c 42%, #141416);
}

.masthead {
  display: flex;
  flex: none;
  align-items: center;
  gap: .75rem;
  min-height: 4.5rem;
  border-bottom: 1px solid #f7f6f840;
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
}
.masthead img { flex: none; }
.masthead-section { color: var(--muted); font-weight: 700; }
.loading-content {
  display: grid;
  flex: 1 0 auto;
  place-items: center;
  padding: clamp(1.25rem, 6vh, 4rem) 0;
}
.loading-panel { width: min(100%, 31rem); }
.eyebrow {
  margin: 0 0 .85rem;
  color: var(--teal);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(1.65rem, 6.8vw, 3.2rem);
  font-weight: 700;
  line-height: 1.17;
  letter-spacing: -.035em;
}
h1 span {
  color: var(--teal);
  background: var(--gradient);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.loading-meter, #loading-error { margin-top: clamp(1.25rem, 5vh, 2.75rem); }
.meter-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}
#loading-value { color: var(--text); font-variant-numeric: tabular-nums; }
.track {
  height: 8px;
  margin-top: .75rem;
  overflow: hidden;
  border-radius: 999px;
  background: #29272e;
}
.fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient);
  clip-path: inset(0 100% 0 0 round 999px);
  transition: clip-path 180ms ease-out;
}
#error-message { line-height: 1.5; }
#retry {
  padding: .65rem 1.15rem;
  border: 1px solid #ffffff40;
  border-radius: 999px;
  background: #222126;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#retry:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }

#unity-notices {
  position: fixed;
  z-index: 2;
  top: max(.5rem, env(safe-area-inset-top));
  right: max(.5rem, env(safe-area-inset-right));
  left: max(.5rem, env(safe-area-inset-left));
  display: grid;
  justify-items: center;
  gap: .4rem;
  pointer-events: none;
}
.notice {
  max-width: min(100%, 38rem);
  padding: .55rem .85rem;
  border: 1px solid #bf9657;
  border-radius: .55rem;
  background: #25201a;
  font-size: .8rem;
  overflow-wrap: anywhere;
}
.notice.error { border-color: #ee8c8c; background: #2e171b; }

@media (max-width: 430px) {
  .masthead { flex-wrap: wrap; gap: .3rem .65rem; padding: .65rem 0; }
  .masthead-section { flex-basis: 100%; padding-left: 2.65rem; }
}
@media (max-height: 480px) {
  .masthead { min-height: 3.25rem; }
  .loading-content { padding: 1rem 0; }
  h1 { font-size: clamp(1.65rem, 8vh, 2.4rem); }
}
@media (prefers-reduced-motion: reduce) {
  .fill { transition: none; }
}
@media (forced-colors: active) {
  h1 span { -webkit-text-fill-color: currentColor; }
  .track { border: 1px solid CanvasText; }
  .fill { background: Highlight; forced-color-adjust: none; }
}
