:root { color-scheme: dark; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #111; color: #f3f1ec; }
#stage, #stage canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#crosshair { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); pointer-events: none; }
#hud { position: fixed; left: 16px; top: 14px; pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
#room { font-weight: 650; font-size: 17px; letter-spacing: 0.01em; }
#hint { margin-top: 6px; padding: 4px 9px; display: inline-block; border-radius: 6px; background: rgba(0, 0, 0, 0.55); }
#hint[hidden] { display: none; }
#flash { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); padding: 6px 12px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.6); pointer-events: none; }
#minimap { position: fixed; right: 14px; bottom: 14px; border-radius: 10px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); }
#overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10, 12, 14, 0.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
#overlay[hidden] { display: none; }
.card { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 26px 30px;
  border-radius: 14px; background: rgba(28, 30, 34, 0.94); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
h1 { margin: 0 0 6px; font-size: 24px; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: #b9b3a6; margin: 18px 0 8px; }
#enter { margin: 8px 0 4px; padding: 11px 22px; font: inherit; font-weight: 650; color: #1a1a1a; background: #f2c14e;
  border: 0; border-radius: 9px; cursor: pointer; }
#enter:disabled { background: #6b6658; color: #ddd; cursor: progress; }
#enter:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
@media (max-width: 640px) { .cols { grid-template-columns: 1fr; } }
.keys { margin: 0; padding: 0; list-style: none; }
.keys li { margin: 4px 0; }
ol.keys { counter-reset: none; }
#tour { columns: 2; column-gap: 18px; }
#tour li { break-inside: avoid; }
kbd { display: inline-block; min-width: 1.4em; padding: 1px 6px; margin-right: 3px; text-align: center; font: 600 12px/1.5 ui-monospace, monospace;
  color: #111; background: #ece8df; border-radius: 4px; box-shadow: 0 1px 0 #9b968b; }
.dim { color: #9d978a; }
.small { font-size: 12.5px; margin-top: 18px; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; }

/* loading bar: real download / unpack progress */
#progress { height: 6px; margin: 4px 0 12px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
#progress[hidden] { display: none; }
#progress-fill { height: 100%; background: #f2c14e; transform: scaleX(0); transform-origin: left center; transition: transform 0.2s linear; }
@media (prefers-reduced-motion: reduce) { #progress-fill { transition: none; } }

/* apartment cards in the start card: one button per apartment, the open one pressed; the focus ring is white, 3 px */
.flat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 4px 0 10px; }
.flat-card { display: block; box-sizing: border-box; width: 100%; padding: 8px; text-align: left; font: inherit; color: inherit;
  background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 255, 255, 0.18); border-radius: 12px; cursor: pointer; }
.flat-card:hover { background: rgba(255, 255, 255, 0.11); }
.flat-card[aria-pressed="true"] { border-color: #f2c14e; background: rgba(242, 193, 78, 0.14); cursor: default; }
.flat-card:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.flat-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #2a2d33; }
.flat-name { display: block; margin-top: 8px; font-weight: 650; }
.flat-label { display: block; font-size: 13px; color: #b9b3a6; }
.flat-card[aria-pressed="true"] .flat-label::after { content: " \00b7  open"; color: #f2c14e; }
#flat-notice { margin: 0 0 8px; }
#switch-btn { font: inherit; font-weight: 600; color: #f3f1ec; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; }
#switch-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
#switch-wrap[hidden], #flat-picker[hidden], #flat-notice[hidden] { display: none; }

/* viewpoint buttons and exposure buttons in the menu */
button.stop { all: unset; cursor: pointer; padding: 3px 6px; margin: -3px -6px; border-radius: 6px; }
button.stop:hover { background: rgba(255, 255, 255, 0.08); }
button.stop:focus-visible { outline: 2px solid #f2c14e; }
.exposure button, #menu-btn, #door-btn { font: inherit; font-weight: 600; color: #f3f1ec; background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.exposure { margin: 14px 0 0; }

/* desktop vs touch help */
body:not(.touch) .only-touch { display: none; }
body.touch .only-desktop { display: none; }

/* touch: on-screen controls, no browser gestures on the canvas */
#stage canvas { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#stick { position: fixed; left: 0; top: 0; width: 112px; height: 112px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.45); background: rgba(0, 0, 0, 0.18); }
#stick[hidden] { display: none; }
#stick-knob { position: absolute; left: 32px; top: 32px; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.7); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4); }
#menu-btn { position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  background: rgba(0, 0, 0, 0.5); }
#door-btn { position: fixed; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  padding: 12px 20px; font-size: 16px; color: #1a1a1a; background: #f2c14e; border: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
#menu-btn[hidden], #door-btn[hidden] { display: none; }
body.touch #crosshair { display: none; }
body.touch #minimap { width: 150px; height: auto; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); opacity: 0.9; }
body.touch #hud { left: max(14px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); }
@media (max-height: 480px) {
  .card { padding: 16px 20px; } h2 { margin: 10px 0 6px; } .small { margin-top: 10px; }
  /* landscape phone: the two 16:9 cards would fill the screen and push the start button below the fold */
  .flat-cards { gap: 8px; margin: 2px 0 6px; }
  .flat-card { padding: 5px; }
  .flat-card img { aspect-ratio: auto; height: 18vh; max-height: 78px; }
  .flat-name { margin-top: 4px; }
}

/* [interact] begin */
/* the dot grows and turns yellow when it is on something you can use */
#crosshair.on-target { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: rgba(242, 193, 78, 0.3);
  box-shadow: 0 0 0 2px rgba(242, 193, 78, 0.95), 0 0 0 3px rgba(0, 0, 0, 0.4); }

/* menu: sound button and the list of things to switch (the keyboard and text way to every control) */
#sound-btn[aria-pressed="false"] { opacity: 0.8; }
.things { margin: 0; padding: 0; list-style: none; }
.things li { margin: 3px 0; }
.things button { display: block; width: 100%; box-sizing: border-box; padding: 4px 10px; text-align: left; font: inherit; font-size: 13.5px;
  color: #f3f1ec; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 7px; cursor: pointer; }
.things button:hover { background: rgba(255, 255, 255, 0.14); }
.things button[aria-pressed="true"] { background: rgba(242, 193, 78, 0.2); border-color: rgba(242, 193, 78, 0.6); }
#sound-btn:focus-visible, .things button:focus-visible { outline: 3px solid #f2c14e; outline-offset: 2px; }
#sound-btn, .things button { -webkit-tap-highlight-color: transparent; }
/* touch: the context button sits at the right, above the 150 px floor plan (260:222, so 128 px high), inside the look area. A touch
   that starts in the left 42 % of the screen is the walking joystick (touch.js LEFT_PART), so the button never reaches into it: its
   left edge stays at or right of 42 % of the width (max-width is 58 % less the margins) and it wraps (390 px wide phone: at most
   226 - 12 = 214 px). Bottom left was where pass 2 had put it, which is the thumb's place for walking. */
body.touch #door-btn { left: auto; right: max(10px, env(safe-area-inset-right)); transform: none;
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 128px + 12px);
  max-width: calc(58vw - 12px - env(safe-area-inset-right)); text-align: left; line-height: 1.25; }
/* [interact] end */

/* (each track's rules go in its own block) */
/* [render] begin */
/* still mode: the "Rendering… N samples" chip under the hint, and the menu button */
#pt-chip { margin-top: 6px; padding: 3px 9px; display: inline-block; border-radius: 6px; background: rgba(0, 0, 0, 0.45);
  font-size: 13px; font-variant-numeric: tabular-nums; }
#pt-chip[hidden] { display: none; }
#pt-btn { font: inherit; font-weight: 600; color: #f3f1ec; background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
#pt-btn[aria-pressed="true"] { color: #1a1a1a; background: #f2c14e; border-color: #f2c14e; }
#pt-btn:disabled { opacity: 0.5; cursor: not-allowed; }
#pt-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
#pt-note { margin: 6px 0 0; }
/* [render] end */
