:root { --bg: rgba(18, 21, 24, 0.72); --line: rgba(255, 255, 255, 0.10); --txt: #eceef0; --dim: #a5adb4; --acc: #e9c98f; --rad: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0c0e10; color: var(--txt); font-size: 13px; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; cursor: crosshair; }
body.locked #view { cursor: none; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .22s ease; }
#fade.on { opacity: 1; }
button, select, input { font: inherit; color: inherit; }
button { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; white-space: nowrap; }
button:hover { background: rgba(255, 255, 255, 0.14); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
button.icon { width: 28px; height: 28px; padding: 0; line-height: 1; }
button.link { background: none; border: none; color: var(--dim); padding: 2px 4px; text-decoration: underline; text-underline-offset: 2px; }
button.link:hover { color: var(--txt); }
select { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; }
select option { background: #1b1f23; }
kbd { display: inline-block; min-width: 1.6em; text-align: center; padding: 1px 5px; border: 1px solid rgba(255, 255, 255, .25); border-bottom-width: 2px; border-radius: 5px; font: 600 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: rgba(255, 255, 255, .06); }

.panel { position: fixed; background: var(--bg); border: 1px solid var(--line); border-radius: var(--rad); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 8px 30px rgba(0, 0, 0, .28); transition: opacity .25s ease; }
.panel > header { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 12px; }
.panel h2 { margin: 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 600; flex: 1; }
.panel.collapsed .panel-body { display: none; }
body.locked .panel { opacity: .5; pointer-events: none; }
body.locked #bar { opacity: .62; }
body.loading .panel, body.loading #hud, body.hideui .panel, body.hideui #roomName { display: none; }

#places { left: 12px; top: 12px; width: 196px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
#places .panel-body { overflow: auto; padding: 0 8px 8px; }
#placeList { display: grid; gap: 2px; margin-bottom: 8px; max-height: calc(100vh - 372px); min-height: 60px; overflow: auto; scrollbar-width: thin; }
#placeList button { text-align: left; background: none; border: none; padding: 5px 6px; border-radius: 6px; }
#placeList button:hover { background: rgba(255, 255, 255, .1); }
#minimap { width: 100%; aspect-ratio: 1; display: block; border-radius: 8px; background: rgba(0, 0, 0, .25); }

#palette { right: 12px; top: 12px; width: 236px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.pal-body { overflow: auto; padding: 0 8px 8px; scrollbar-width: thin; }
.pal-cat { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 10px 4px 4px; }
.pal-cat:first-child { margin-top: 0; }
.pal-head { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; padding: 5px 4px; border-radius: 6px; }
.pal-head .name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.pal-head .chev { color: var(--dim); transition: transform .15s; }
.pal-group.open .chev { transform: rotate(90deg); }
.chip { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); flex: none; }
.pal-detail { display: none; padding: 4px 4px 8px; }
.pal-group.open .pal-detail { display: block; }
.pal-group.open { background: rgba(255, 255, 255, .05); border-radius: 8px; }
.swatches { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.swatch { aspect-ratio: 1; padding: 0; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .22); }
.swatch.sel { outline: 2px solid var(--acc); outline-offset: 1px; }
.pal-tools { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; color: var(--dim); }
.pal-tools input[type=color] { width: 30px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: none; vertical-align: middle; cursor: pointer; }
.pal-empty { color: var(--dim); padding: 4px; }

#bar { left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px 8px; max-width: calc(100vw - 24px); }
#bar .grp { display: flex; align-items: center; gap: 8px; padding: 2px 10px; border-left: 1px solid var(--line); }
#bar .grp:first-child { border-left: none; }
#bar label { color: var(--dim); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
#clock { font-variant-numeric: tabular-nums; min-width: 62px; font-weight: 600; }
.slider-wrap { position: relative; width: 220px; padding-bottom: 6px; }
#ticks { position: absolute; left: 7px; right: 7px; bottom: 0; height: 6px; pointer-events: none; }
#ticks i { position: absolute; top: 0; width: 1px; height: 6px; background: var(--acc); }
#ticks i::after { content: attr(data-l); position: absolute; top: -2px; left: 3px; font: 9px/1 system-ui, sans-serif; color: var(--acc); font-style: normal; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: none; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .22); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .22); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: none; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: none; }
#time { background: linear-gradient(90deg, #0b1020 0%, #0b1020 22%, #e8a36a 25%, #9fc4e8 32%, #bcd8f0 50%, #9fc4e8 74%, #e8946a 81%, #0b1020 85%, #0b1020 100%) center / calc(100% - 14px) 4px no-repeat; }
#time::-webkit-slider-runnable-track { background: none; } #time::-moz-range-track { background: none; }
#volume { width: 84px; }
@media (max-width: 1180px) { .slider-wrap { width: 150px; } #bar .grp { padding: 2px 6px; gap: 6px; } #lightsOn, #lightsOff { padding: 6px 7px; } }

#hud { position: fixed; inset: 0; pointer-events: none; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); transition: transform .12s, background .12s; }
#crosshair.hot { transform: scale(2.1); background: transparent; box-shadow: 0 0 0 1.5px var(--acc), 0 0 0 2.5px rgba(0, 0, 0, .3); }
.pill { position: absolute; left: 50%; transform: translateX(-50%); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; white-space: nowrap; backdrop-filter: blur(10px); }
.pill.subtle { color: var(--dim); font-size: 12px; }
#hoverLabel { top: calc(50% + 26px); }
#pickHint { top: calc(50% + 26px); }
#hoverLabel:not([hidden]) ~ #pickHint { top: calc(50% + 62px); }
#cursorHint { top: 76px; }
#compass { position: absolute; top: 12px; left: 50%; width: 220px; margin-left: -110px; height: 30px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
#compassTape { position: absolute; top: 0; left: 0; height: 30px; width: 1056px; display: flex; flex-wrap: nowrap; will-change: transform; }
#compassTape span { display: block; flex: 0 0 44px; margin: 0; padding: 0; letter-spacing: 0; width: 44px; height: 30px; overflow: hidden; text-align: center; line-height: 30px; font-size: 10px; letter-spacing: .08em; color: rgba(255, 255, 255, .5); }
#compassTape span.cp { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .92); }
#compassTape span.north { color: #ff8a70; }
#compass i { position: absolute; left: 50%; top: 0; width: 2px; height: 7px; margin-left: -1px; background: #fff; border-radius: 1px; }
#compassRead { display: none; }
#hud::after { content: ''; }
#gait { position: absolute; top: 48px; left: 50%; transform: translateX(-50%); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .7); text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
#gait.run { color: #ffd27a; }
body.loading #compass, body.loading #gait, body.hideui #compass, body.hideui #gait { display: none; }
#toast { bottom: 74px; }
#roomName { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .78); text-shadow: 0 1px 4px rgba(0, 0, 0, .7); transition: opacity .4s; }
#perf { position: absolute; left: 220px; top: 12px; margin: 0; padding: 6px 8px; background: rgba(0, 0, 0, .55); border-radius: 6px; font: 11px/1.4 ui-monospace, Menlo, Consolas, monospace; color: #cfe; }

.modal, #overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8, 10, 12, .55); backdrop-filter: blur(6px); z-index: 10; }
#overlay { background: radial-gradient(ellipse at 50% 40%, rgba(20, 26, 30, .55), rgba(6, 8, 10, .92)); transition: opacity .5s ease; }
#overlay.gone { opacity: 0; pointer-events: none; }
[hidden] { display: none !important; }
.card { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; background: rgba(20, 23, 26, .86); border: 1px solid var(--line); border-radius: 18px; padding: 28px 30px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.eyebrow { margin: 0 0 6px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--acc); }
h1 { margin: 0 0 8px; font: 600 30px/1.15 Georgia, "Iowan Old Style", "Times New Roman", serif; letter-spacing: .01em; }
.lede { margin: 0 0 16px; color: var(--dim); line-height: 1.5; font-size: 14px; }
#progress { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 5px; font-size: 12px; color: var(--dim); }
#progress li { display: grid; grid-template-columns: 130px 1fr 54px; gap: 10px; align-items: center; }
#progress .track { height: 3px; background: rgba(255, 255, 255, .12); border-radius: 2px; overflow: hidden; }
#progress .fill { height: 100%; width: 0; background: var(--acc); transition: width .15s; }
#progress li.done .fill { background: #8fc7a0; } #progress li.fail .fill { background: #c9786c; width: 100%; }
#progress .st { text-align: right; font-variant-numeric: tabular-nums; }
#loadError { color: #f0b6a8; background: rgba(160, 60, 40, .18); border: 1px solid rgba(240, 150, 130, .3); border-radius: 8px; padding: 10px 12px; line-height: 1.45; }
#startBtn { width: 100%; padding: 12px; font-size: 15px; font-weight: 600; border-radius: 10px; background: var(--acc); color: #1b1a17; border: none; }
#startBtn:disabled { background: rgba(255, 255, 255, .1); color: var(--dim); cursor: default; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 16px; color: var(--dim); font-size: 12px; }
.keys div { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
#help .card { width: min(520px, calc(100vw - 32px)); } #help h2 { margin: 0 0 4px; font-size: 16px; } #help button { margin-top: 16px; }
@media (max-height: 640px) { .card { padding: 18px 22px; } h1 { font-size: 24px; } }

/* realtor block, contact link, furniture toggle, extended palette */
#agent { position: absolute; left: 16px; bottom: 62px; display: flex; flex-direction: column; gap: 1px; font-size: 11px; line-height: 1.3; color: rgba(255, 255, 255, .82); text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
#agent b { font-size: 12px; font-weight: 600; color: #fff; letter-spacing: .02em; }
#contact { position: absolute; top: 12px; left: calc(50% + 122px); pointer-events: auto; }
#contactBtn { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: #fff; font: inherit; font-size: 12px; cursor: pointer; backdrop-filter: blur(10px); white-space: nowrap; }
#contactBtn:hover { background: rgba(255, 255, 255, .16); }
#contactCard { margin-top: 6px; width: 250px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); backdrop-filter: blur(12px); display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
#contactCard[hidden] { display: none; }
#contactCard a { color: #9fd0ff; text-decoration: underline; text-underline-offset: 2px; }
#contactCard small { color: var(--dim); font-size: 10.5px; line-height: 1.35; }
body.loading #agent, body.loading #contact, body.hideui #agent, body.hideui #contact { display: none; }
#furnBtn { margin: 0 10px 8px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .07); color: #fff; font: inherit; font-size: 12px; cursor: pointer; flex: none; }
#furnBtn:hover { background: rgba(255, 255, 255, .15); }
#furnBtn.on { background: rgba(255, 210, 122, .22); border-color: rgba(255, 210, 122, .5); }
.pal-cat.toggle { cursor: pointer; color: #cfd6dc; }
.pal-group.other { display: none; }
.pal-body.show-other .pal-group.other { display: block; }
.swatches { grid-template-columns: repeat(8, 1fr); gap: 4px; }
.panel.collapsed #furnBtn { display: none; }

#address { position: absolute; top: 8px; right: calc(50% + 124px); text-align: right; display: flex; flex-direction: column; line-height: 1.15; text-shadow: 0 1px 6px rgba(0, 0, 0, .75); white-space: nowrap; }
#address b { font-family: 'Playfair Display', 'Iowan Old Style', Palatino, Georgia, serif; font-weight: 600; font-size: 19px; letter-spacing: .01em; color: #fff; }
#address span { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .78); margin-top: 2px; }
body.loading #address, body.hideui #address { display: none; }
@media (max-width: 1100px) { #address span { display: none; } #address b { font-size: 15px; } }
@media (max-width: 900px) { #address { display: none; } }

#address { align-items: flex-end; }
#facts { font-style: normal; font-size: 12.5px; font-weight: 600; color: #fff; margin-top: 5px; letter-spacing: .02em; }
#mortgage { pointer-events: auto; margin-top: 7px; width: 268px; padding: 9px 11px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); backdrop-filter: blur(12px); text-shadow: none; text-align: left; white-space: normal; display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: rgba(255, 255, 255, .86); }
#mortgage .mrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#mortgage output { font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
#mortgage input[type=range] { width: 100%; margin: 0; accent-color: #ffd27a; }
#mortgage input[type=number] { width: 58px; height: 22px; padding: 0 4px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; text-align: right; }
#mortgage .total { margin-top: 2px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12px; }
#mortgage .total output { font-size: 17px; color: #ffd27a; }
#mortgage .mnote { font-size: 10px; line-height: 1.35; color: var(--dim); }
@media (max-width: 1100px) { #mortgage, #facts { display: none; } }

.slider-wrap { position: relative; }
#timeLabel { position: absolute; left: 50%; bottom: calc(100% + 17px); transform: translateX(-50%); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; color: rgba(255, 255, 255, .96); text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 -1px 0 #000, 0 1px 0 #000, -1px 0 0 #000, 1px 0 0 #000, 0 2px 5px rgba(0, 0, 0, .7); white-space: nowrap; pointer-events: none; }

/* ---------------------------------------------------------------- touch devices */
.touch body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.touch #view { touch-action: none; cursor: default; }
.touch #crosshair, .touch #cursorHint, .touch #gait, .touch #pickHint, .touch #hoverLabel, .touch #minimap, .touch #perf { display: none !important; }
.touch.menus-off .panel, .touch.menus-off #agent, .touch.menus-off #contact, .touch.menus-off #address { display: none !important; }
#joy { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; background: rgba(255, 255, 255, .10); border: 1.5px solid rgba(255, 255, 255, .38); pointer-events: none; }
#joy i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
#joy[hidden] { display: none; }
#tMenu, #tRun { position: absolute; top: 10px; height: 34px; min-width: 64px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: #fff; font: 600 13px/1 inherit; font-family: inherit; pointer-events: auto; backdrop-filter: blur(10px); -webkit-tap-highlight-color: transparent; }
#tMenu { left: calc(50% + 118px); } #tRun { right: calc(50% + 118px); }
#tMenu.on, #tRun.on { background: rgba(255, 210, 122, .28); border-color: rgba(255, 210, 122, .6); }
body.loading #tMenu, body.loading #tRun, body.loading #joy, body.loading #rotateHint { display: none; }
#rotateHint { display: none; position: absolute; left: 50%; top: 54px; transform: translateX(-50%); padding: 7px 14px; border-radius: 999px; background: rgba(14, 22, 28, .82); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; pointer-events: auto; }
@media (orientation: portrait) { .touch #rotateHint:not([hidden]) { display: block; } }
.touch #toast { top: auto; bottom: 76px; }
.touch.menus-off #toast { bottom: 24px; }
.touch .panel { font-size: 13px; }
.touch #places { left: 8px; top: 8px; width: 158px; max-height: calc(100vh - 86px); }
.touch #palette { right: 8px; top: 8px; width: 214px; max-height: calc(100vh - 86px); }
.touch #places .panel-body, .touch #palette .panel-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.touch #bar { left: 8px; right: 8px; bottom: 8px; transform: none; max-width: none; justify-content: center; flex-wrap: wrap; row-gap: 2px; padding: 5px 6px; }
.touch #bar .grp:nth-child(n+3) { display: none; }
.touch #bar .grp { padding: 2px 8px; gap: 8px; }
.touch .slider-wrap { width: min(34vw, 260px); }
.touch #time { height: 30px; }
.touch #timeLabel { display: none; }
.touch #lightsOn, .touch #lightsOff { padding: 8px 10px; }
.touch #agent { left: 12px; bottom: 60px; font-size: 10px; }
.touch #agent b { font-size: 11px; }
.touch #contact { left: 50%; top: 52px; transform: translateX(-50%); }
.touch #contactCard { margin-left: auto; margin-right: auto; }
.touch #address { display: none; }
.touch .swatch { min-height: 26px; }
.touch [data-collapse] { display: none; }
@media (max-width: 620px) { .touch #places { width: 44vw; max-height: 34vh; } .touch #palette { width: 50vw; max-height: 34vh; } .touch .slider-wrap { width: 46vw; } .touch #tMenu { left: auto; right: 10px; top: 48px; } .touch #tRun { right: auto; left: 10px; top: 48px; } }

.touch #placeList { max-height: calc(100vh - 150px); }
.touch #placeList button { padding: 8px 6px; }
@media (max-width: 620px) { .touch #placeList { max-height: calc(34vh - 50px); } }

.touch #places { max-height: calc(100vh - 122px); }
.touch #placeList { max-height: calc(100vh - 178px); }
@media (max-width: 620px) {
  .touch #places, .touch #palette { top: 92px; max-height: 36vh; }
  .touch #placeList { max-height: calc(36vh - 50px); }
  .touch #contact { top: 92px; display: none; }
  .touch #agent { bottom: 104px; }
  .touch #rotateHint { top: 50px; }
}

@media (orientation: portrait) { .touch #rotateHint { top: auto; bottom: 150px; } }
