@font-face {
  font-family: Outfit;
  src: url("brand/outfit.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Sora;
  src: url("brand/sora.ttf") format("truetype");
  font-weight: 100 800;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --surround: #110d15;
  --stage: #17121e;
  --surface: #1e1922;
  --raised: #302532;
  --edge: #665766;
  --edge-soft: #413347;
  --ink: #fcf9f5;
  --secondary: #d8cad3;
  --soft: #f0e6ea;
  --accent: #d762b1;
  --accent-text: #f4c4e3;
  --focus: #ffd145;
  --outfit: Outfit, "Segoe UI", Arial, sans-serif;
  --sora: Sora, "Segoe UI", Arial, sans-serif;
  --gutter: clamp(10px, 1.55vw, 28px);
  --mast-h: clamp(70px, 8.6svh, 84px);
  --foot-h: clamp(32px, 4.3svh, 43px);
  --frame-x: clamp(14px, 2.1vw, 32px);
  --frame-y: clamp(14px, 2.4svh, 26px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  padding: 0 var(--gutter);
  padding: env(safe-area-inset-top,0px) max(var(--gutter),env(safe-area-inset-right,0px))
    env(safe-area-inset-bottom,0px) max(var(--gutter),env(safe-area-inset-left,0px));
  overflow: hidden;
  background: var(--surround);
  color: var(--ink);
  font: 400 14px/1.45 var(--sora);
}
svg { display: block; }
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
button:disabled { opacity: .62; cursor: wait; }
[hidden], .defs { display: none !important; }

.mast {
  height: var(--mast-h);
  flex: 0 0 var(--mast-h);
  display: flex;
  align-items: center;
  gap: clamp(13px, 1.6vw, 24px);
}
.brand-lockup {
  display: block;
  flex: 0 0 auto;
  width: clamp(240px, 14vw, 262px);
}
.brand-lockup img { display: block; width: 100%; height: auto; }
.division { flex: 0 0 1px; height: 23px; background: var(--edge-soft); }
.masttag {
  color: var(--soft);
  font: 500 clamp(15px, 1.05vw, 17px)/1.12 var(--outfit);
  letter-spacing: .02em;
  white-space: nowrap;
}
.private {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  color: var(--secondary);
  border: 1px solid var(--edge-soft);
  border-radius: 5px;
  font: 500 10px/1.3 var(--sora);
  white-space: nowrap;
}
.private svg, .tool svg, .glass svg, .plaque-title svg, footer svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.private svg { width: 13px; height: 13px; color: var(--accent-text); }

main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--edge-soft);
  border-radius: 8px;
  background: var(--stage);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
}
#space { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; touch-action: none; }
#space:focus { outline: none; }
.walking #space { opacity: 1; cursor: grab; }
.walking #space:active { cursor: grabbing; }
.framehead {
  position: absolute;
  z-index: 4;
  inset: var(--frame-y) var(--frame-x) auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  pointer-events: none;
}
#frame:not(.walking) .framehead { visibility: hidden; }
.frame-context { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fullscreen-brand { display: none; }
main:fullscreen .fullscreen-brand {
  display: block; flex: 0 0 auto; width: 52px; height: auto;
  border-radius: 5px; background: var(--stage);
}
.fullscreen-brand img { display: block; width: 100%; height: auto; }
.framecaption {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border: 1px solid #786878;
  border-radius: 4px;
  background: rgb(30 25 34 / 94%);
  color: var(--ink);
  font: 550 10px/1.2 var(--sora);
  letter-spacing: .055em;
  white-space: nowrap;
}
.framecaption i, .mapfoot i {
  display: inline-block; width: 6px; height: 6px; flex: 0 0 6px;
  background: var(--accent); border-radius: 50%;
}
.actions { position: relative; display: flex; align-items: center; gap: 7px; pointer-events: auto; }
.control-wrap { position: static; }
.tool, .glass {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid #867586; border-radius: 5px;
  background: rgb(30 25 34 / 95%); color: var(--ink);
  font: 550 12px/1.2 var(--sora);
  box-shadow: 0 1px 5px #110d151f;
}
.tool { width: 41px; height: 41px; padding: 0; }
.tool.controls-button { width: auto; padding: 0 13px; }
.glass { min-height: 39px; padding: 9px 12px; }
.tool:hover, .glass:hover { background: #392c3c; border-color: #bbabb7; }
.tool[aria-expanded="true"], .glass[aria-pressed="true"], .glass[aria-expanded="true"] {
  color: var(--accent-text); background: #3d283b; border-color: var(--accent);
  box-shadow: inset 0 -2px var(--accent);
}
#control-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: min(264px, calc(100vw - 2 * var(--gutter) - 2 * var(--frame-x)));
  max-height: calc(100vh - var(--mast-h) - var(--foot-h) - 78px);
  max-height: calc(100dvh - var(--mast-h) - var(--foot-h) - 78px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
  overflow: auto; overscroll-behavior: contain;
  padding: 16px; border: 1px solid var(--edge); border-radius: 7px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 6px 22px #0b08124d;
  scrollbar-color: var(--edge) var(--surface);
}
#control-panel::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 86px; height: 4px;
  background: linear-gradient(104deg, #512768, #93528c 43%, #d77d7e 78%, #f0bd7a);
  clip-path: polygon(0 0, 100% 0, 95% 100%, 0 100%);
  pointer-events: none;
}
.control-heading, .plaque-title {
  color: var(--secondary);
  font: 600 10px/1.3 var(--sora);
  letter-spacing: .12em; text-transform: uppercase;
}
.control-heading { margin: 2px 0 16px; }
.control-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.control-row strong, .control-row span { display: block; }
.control-row strong { font: 560 16px/1.15 var(--outfit); }
.control-row span { margin-top: 3px; color: var(--secondary); font: 450 11px/1.3 var(--sora); }
.control-row button, #retry {
  min-height: 34px; min-width: 89px; padding: 7px 10px;
  border: 1px solid transparent; border-radius: 4px;
  color: var(--surface); background: var(--soft);
  font: 600 11px/1.3 var(--sora);
}
.control-row button:hover, #retry:hover { background: #f7d7ea; }
.door-track { height: 3px; margin: 11px 0 14px; overflow: hidden; background: var(--edge-soft); border-radius: 2px; }
.door-track i { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.lamp-row { border-top: 1px solid var(--edge-soft); padding-top: 11px; }
.control-row + .lamp-row { margin-top: 11px; }

.walking #walkbar { display: flex; position: absolute; bottom: var(--frame-y); right: var(--frame-x); gap: 7px; }
.plaque {
  display: none; position: absolute; z-index: 2; right: var(--frame-x); bottom: calc(var(--frame-y) + 48px);
  width: 172px; padding: 13px 14px; border: 1px solid var(--edge); border-radius: 6px;
  background: var(--surface); box-shadow: 0 3px 12px #0b081244;
}
.walking .plaque.show { display: block; }
.plaque-title, .mapfoot { display: flex; align-items: center; justify-content: space-between; }
.plaque-title svg { width: 14px; height: 14px; }
#plan { width: 100%; height: 91px; }
#plan > path:last-of-type { stroke: var(--accent); }
#marker path { fill: var(--accent); }
#marker circle { fill: var(--accent-text); stroke: var(--stage); }
.mapfoot { color: var(--secondary); font: 450 9px/1.3 var(--sora); }
.mapfoot i { width: 5px; height: 5px; margin-right: 5px; }
#pad {
  position: absolute; left: var(--frame-x); bottom: var(--frame-y); width: 82px; height: 82px;
  display: none; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid #d6c9d5cc;
  background: rgb(30 25 34 / 68%); touch-action: none;
}
#nub { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--soft); background: #e1d0dbce; pointer-events: none; }
#pad, #space { -webkit-touch-callout: none; }
#toast, #object-tip {
  pointer-events: none; border: 1px solid var(--edge); border-radius: 5px;
  padding: 7px 11px; background: #211b26f5; color: var(--ink);
  font: 500 12px/1.4 var(--sora);
}
#toast {
  position: absolute; left: 50%; top: calc(var(--frame-y) + 53px);
  max-width: min(340px, 84%); width: max-content; text-align: center; opacity: 0;
  transform: translateX(-50%);
}
#toast.on { opacity: 1; }
#object-tip { position: absolute; z-index: 3; white-space: nowrap; }
main:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; background: var(--stage);
  --frame-x: max(12px,env(safe-area-inset-left,0px),env(safe-area-inset-right,0px));
  --frame-y: max(12px,env(safe-area-inset-top,0px),env(safe-area-inset-bottom,0px)); }
main:fullscreen #control-panel { max-height: calc(100dvh - 2 * var(--frame-y) - 54px); }

footer {
  height: var(--foot-h); flex: 0 0 var(--foot-h); display: flex; align-items: center;
  justify-content: space-between; gap: 12px; color: var(--secondary);
  font: 450 10px/1.3 var(--sora);
}
footer > span, footer .desktop { display: inline-flex; align-items: center; gap: 8px; }
footer .mobile { display: none; }
footer svg { width: 14px; height: 14px; }
footer i:not(.cross) { width: 1px; height: 11px; background: var(--edge); margin: 0 3px; }
.cross { position: relative; flex: 0 0 9px; width: 9px; height: 9px; color: var(--accent); }
.cross::before, .cross::after { content: ""; position: absolute; inset: 4px 0 auto; height: 1.5px; background: currentColor; }
.cross::after { transform: rotate(90deg); }
#loading-panel {
  position: absolute; inset: 0; z-index: 6; display: grid; align-content: center;
  justify-items: center; gap: 11px; padding: 24px; background: var(--stage); text-align: center;
}
#loading-panel h1 { margin: 4px 0 0; font: 550 clamp(23px, 3vw, 34px)/1.12 var(--outfit); letter-spacing: -.025em; }
#status { max-width: 420px; color: var(--secondary); font: 450 13px/1.5 var(--sora); }
.loader-mark {
  width: 29px; height: 29px; border: 2px solid var(--edge); border-top-color: var(--accent-text);
  border-radius: 50%; animation: loading-spin 1s linear infinite;
}
.failed .loader-mark { display: none; }
#retry { margin-top: 6px; }
@keyframes loading-spin { to { transform: rotate(360deg); } }

@media (max-width: 740px) {
  :root { --gutter: 9px; --frame-x: 12px; --frame-y: 13px; }
  .mast { gap: 12px; }
}
@media (max-width: 600px), (max-height: 520px) {
  :root { --mast-h: 54px; --foot-h: 29px; }
  .brand-lockup { width: 50px; }
  .mast { gap: 10px; }
  .division { height: 18px; }
  .masttag { font-size: 14px; }
  .private { font-size: 9px; padding: 4px 7px; gap: 5px; }
  .private svg { width: 11px; height: 11px; }
  .framecaption { padding: 6px 8px; font-size: 9px; }
  .frame-context { gap: 6px; }
  .plaque { width: 145px; padding: 11px; }
  #plan { height: 70px; }
  footer { font-size: 9px; }
}
@media (max-width: 510px) {
  .glass { gap: 0; min-width: 41px; min-height: 41px; padding: 9px; }
  .glass span, .glass#maptoggle { font-size: 0; }
  .walking #walkbar { gap: 5px; }
  .tool.controls-button { padding: 0 9px; gap: 6px; font-size: 11px; }
  #pad { width: 74px; height: 74px; }
  .control-row button { min-height: 37px; }
  #footnote { max-width: 57vw; }
}
@media (max-width: 375px) {
  :root { --gutter: 6px; --frame-x: 8px; }
  .mast { gap: 7px; }
  .actions { gap: 4px; }
  .framecaption { gap: 5px; padding-inline: 6px; }
  main:fullscreen .fullscreen-brand { width: 48px; }
}
@media (max-width: 680px) {
  footer > span:first-child { min-width: 0; }
  #footnote { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  #hints { flex: 0 0 auto; white-space: nowrap; }
  footer .desktop { gap: 4px; }
}
@media (max-height: 520px) {
  :root { --frame-y: 8px; --foot-h: 25px; }
  .tool, .glass { min-height: 34px; height: 34px; }
  .plaque { bottom: calc(var(--frame-y) + 39px); }
}
.touch-walk .walking #pad:not([hidden]) { display: flex; }
.touch-walk .tool, .touch-walk .glass { min-height: 44px; }
.touch-walk .tool:not(.controls-button), .touch-walk .glass { min-width: 44px; }
.touch-walk .control-row button { min-height: 44px; }
.touch-walk .plaque { bottom: calc(var(--frame-y) + 51px); }
.touch-walk footer .desktop { display: none; }
.touch-walk footer .mobile { display: block; }
@media (prefers-reduced-motion: reduce) {
  .loader-mark { animation: none; }
}
@media (forced-colors: active) {
  .tool, .glass, #control-panel, .plaque, #toast, #object-tip { border-color: ButtonText; }
  button:focus-visible { outline-color: Highlight; }
}
