:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #f1eee6;
  background: #17191c;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --gold: #dfba71;
  --muted: #a5a49f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }

.shell { width: min(1280px, calc(100% - 64px), calc((100vh - 200px) * 16 / 9)); margin: 0 auto; padding: 26px 0 20px; }
.shell-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.brand { display: inline-flex; gap: 11px; align-items: center; font-weight: 760; font-size: 19px; letter-spacing: -.5px; }
.brand-mark { width: 36px; height: 36px; color: var(--gold); flex: none; }
.brand-accent { color: var(--gold); }
.site-link { color: var(--muted); font-size: 13px; white-space: nowrap; }
.site-link:hover { color: #f1eee6; }
.site-link span { margin-left: 5px; }

.game-section { border: 1px solid #363636; border-radius: 12px; overflow: hidden; background: #1d1f22; }
.game-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #111315; }
#unity-canvas { display: block; width: 100%; height: 100%; background: #111315; outline: none; }
.game-frame[data-phase="idle"] #unity-canvas,
.game-frame[data-phase="loading"] #unity-canvas,
.game-frame[data-phase="error"] #unity-canvas { visibility: hidden; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; background: #16181b; }
.start-screen { background: radial-gradient(ellipse at 50% 20%, #37302a 0, #1d1e20 46%, #15171a 100%); }
.eyebrow { position: relative; color: var(--gold); font-size: 11px; letter-spacing: 2.5px; font-weight: 700; margin: 0 0 12px; }
h1, h2 { position: relative; margin: 0; font-weight: 760; letter-spacing: -1.6px; }
h1 { font-size: clamp(29px, 4.5vw, 54px); }
h2 { font-size: clamp(24px, 3vw, 36px); }
.intro { position: relative; margin: 15px 0 27px; color: #cbc7bd; font-size: 15px; line-height: 1.6; }
.start-note { position: relative; margin: 13px 0 0; color: #92918a; font-size: 11px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 18px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-weight: 650; transition: background-color .15s, border-color .15s; }
.button:disabled { opacity: .38; cursor: default; }
.button-primary { position: relative; min-height: 48px; padding: 12px 26px; color: #1a1a18; background: var(--gold); font-size: 15px; }
.button-primary:hover { background: #efd199; }
.button-quiet { min-height: 36px; padding: 8px 12px; border-color: #444341; color: #d3d0c6; background: #242629; font-size: 12px; }
.button-quiet:not(:disabled):hover { background: #343536; border-color: #82765c; }

.city-art { position: absolute; inset: 0; opacity: .22; overflow: hidden; pointer-events: none; }
.city-block { position: absolute; bottom: 0; border-top: 1px solid #af935e; background: linear-gradient(90deg, #211e1b, #52452e); transform: skewY(-8deg); }
.city-block-a { left: 0; width: 20%; height: 48%; }
.city-block-b { right: 0; width: 19%; height: 72%; transform: skewY(8deg); }
.city-block-c { right: 19%; width: 8%; height: 31%; transform: skewY(8deg); }
.city-ground { position: absolute; inset: 72% -10% -10%; transform: rotate(-8deg); background: #121416; border-top: 1px solid #7c694a; }

.loading-screen { gap: 0; }
#zm-progress { appearance: none; display: block; width: min(330px, 85%); height: 6px; border: 0; border-radius: 8px; overflow: hidden; background: #3c3c38; accent-color: var(--gold); margin-top: 30px; }
#zm-progress::-webkit-progress-bar { background: #3c3c38; border-radius: 8px; }
#zm-progress::-webkit-progress-value { background: var(--gold); border-radius: 8px; }
#zm-progress::-moz-progress-bar { background: var(--gold); border-radius: 8px; }
.loading-caption { color: var(--muted); font-size: 13px; margin: 13px 0 0; font-variant-numeric: tabular-nums; }
.error-screen > p:not(.eyebrow) { max-width: 480px; color: #c5c1b8; line-height: 1.6; margin: 18px 0 24px; font-size: 14px; }
.capture-hint { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); max-width: 90%; margin: 0; padding: 12px 18px; border: 1px solid #b79559; border-radius: 6px; color: #f6deb0; background: #17191ce8; font-size: 14px; text-align: center; pointer-events: none; }
.game-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 16px; }
.game-status { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
.game-actions { display: flex; gap: 8px; flex-shrink: 0; }
.shell-footer { padding: 16px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.shell-footer p { margin: 0; }
.control-hints { color: #858780; margin-left: 8px; }
.mobile-note { display: none; }
.shell-footer .version { margin-top: 9px; color: #666c6b; font-size: 10px; }
.noscript-note { padding: 14px; color: var(--gold); text-align: center; }

.game-frame:fullscreen { display: flex; align-items: center; justify-content: center; width: 100vw; height: 100vh; aspect-ratio: auto; border: 0; background: #090b0c; }
.game-frame:fullscreen #unity-canvas { width: min(100vw, calc(100vh * 16 / 9)); height: min(100vh, calc(100vw * 9 / 16)); }

@media (max-width: 700px) {
  .shell { width: calc(100% - 24px); padding-top: 16px; }
  .shell-header { margin-bottom: 16px; }
  .brand { gap: 7px; font-size: 16px; }
  .brand-mark { width: 29px; height: 29px; }
  .site-link { font-size: 11px; }
  .screen { padding: 16px; }
  .eyebrow { font-size: 9px; letter-spacing: 1.7px; margin-bottom: 7px; }
  .intro { margin: 8px 0 15px; font-size: 12px; }
  .button-primary { min-height: 41px; padding: 9px 19px; font-size: 13px; }
  .start-note { margin-top: 8px; font-size: 10px; }
  .game-toolbar { padding: 10px; flex-wrap: wrap; gap: 9px; }
  .game-actions { margin-left: auto; }
  .control-hints { display: block; margin: 2px 0 0; }
  .mobile-note { display: block; margin-top: 5px !important; color: #c4b291; }
  #zm-progress { margin-top: 16px; }
  .capture-hint { font-size: 12px; padding: 9px 12px; }
}

@media (max-width: 420px) {
  h1 { font-size: 26px; letter-spacing: -1px; }
  h2 { font-size: 22px; }
  .intro { max-width: 230px; font-size: 11px; margin-bottom: 11px; }
  .start-note { display: none; }
  .error-screen > p:not(.eyebrow) { margin: 8px 0 12px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}

@media (pointer: coarse) {
  .mobile-note { display: block; margin-top: 5px !important; color: #c4b291; }
}
