/* OPEN HOUSE: light, quiet, out of the house's way */
:root { --ink: #16171d; --dim: #6a6c78; --card: rgba(255, 255, 255, .9); --line: rgba(20, 22, 30, .1); --shadow: 0 10px 40px rgba(30, 40, 60, .16); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #e8eef3; color: var(--ink); font: 15px/1.45 'Space Grotesk', system-ui, sans-serif; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }
.labels { position: absolute; inset: 0; pointer-events: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 16px; font-weight: 500; }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
button:hover { filter: brightness(.96); }
.kicker { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.ora { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); position: relative; flex: none; }
.ora::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; border: 3px solid #fff; }

/* the top bar */
#top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px; padding: 14px 18px; pointer-events: none; }
#top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); background: var(--card); backdrop-filter: blur(10px); padding: 8px 14px 8px 9px; border-radius: 999px; box-shadow: var(--shadow); }
.brand span { font-weight: 700; letter-spacing: .06em; }
.brand em { font-style: normal; color: var(--dim); font-size: 13px; }
#visit { margin-left: auto; display: flex; gap: 6px; background: var(--card); backdrop-filter: blur(10px); padding: 5px; border-radius: 999px; box-shadow: var(--shadow); }
#visit input { border: 0; outline: 0; background: transparent; padding: 6px 12px; width: min(260px, 42vw); }
#visit button { padding: 7px 16px; background: var(--ink); color: #fff; border: 0; }

/* the listing card */
#listing { position: fixed; left: 18px; bottom: 18px; width: min(380px, calc(100vw - 36px)); background: var(--card); backdrop-filter: blur(12px); border-radius: 20px; padding: 18px 20px 16px; box-shadow: var(--shadow); }
#listing h1 { margin: 4px 0 2px; font-size: 24px; line-height: 1.15; }
#l-addr { margin: 0; color: var(--dim); font-size: 14px; }
#l-features { list-style: none; margin: 12px 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
#l-features li { font-size: 13px; background: #f1ede5; border-radius: 999px; padding: 4px 11px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.cta { display: block; margin-top: 14px; font-size: 13px; color: var(--dim); text-decoration: none; border-top: 1px solid var(--line); padding-top: 12px; }
.cta b { color: var(--ink); }
.cta:hover b { text-decoration: underline; }

/* the agent's view */
.switch { display: flex; align-items: center; gap: 10px; margin-top: 12px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 38px; height: 22px; border-radius: 999px; background: #d9d4ca; position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + i { background: #7a5cff; }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--ink); outline-offset: 2px; }
.legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--dim); }
.legend li::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.legend .open::before { background: #2f9a62; } .legend .dark::before { background: #16171d; } .legend .locked::before { background: #c0392b; } .legend .hidden::before { background: #7a5cff; }
.agent-sum { margin: 8px 0 0; font-size: 13px; color: #3c3e48; }
.r-agent { font-size: 13px; padding: 7px 10px; border-radius: 10px; background: #f1ede5; }
.r-agent.dark { background: #16171d; color: #fff; } .r-agent.locked { background: #fbe4e1; color: #8a2318; } .r-agent.hidden { background: #ece6ff; color: #4a2fb8; } .r-agent.open { background: #e2f3ea; color: #1f6b44; }
.room-label.agent span { display: none; }
.room-label.agent::after { content: attr(data-agent); display: block; font-size: 11px; }
.room-label.agent[data-view=open] { box-shadow: inset 0 0 0 2px #2f9a62, 0 4px 14px rgba(30, 40, 60, .18); }
.room-label.agent[data-view=dark] { background: #16171d; color: #fff; }
.room-label.agent[data-view=locked] { background: #c0392b; color: #fff; }
.room-label.agent[data-view=hidden] { background: #7a5cff; color: #fff; }
.room-label.agent[data-view=broken] { background: #f2c230; }

/* the room you're in */
#room { position: fixed; right: 18px; top: 78px; bottom: 18px; width: min(360px, calc(100vw - 36px)); overflow: auto; background: var(--card); backdrop-filter: blur(12px); border-radius: 20px; padding: 16px 20px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
#room h2 { margin: 0; font-size: 26px; line-height: 1.1; }
#room p { margin: 0; }
#r-count { color: var(--dim); }
#r-title { font-weight: 600; }
#r-desc { color: #3c3e48; font-size: 14px; }
#r-items { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
#r-items a { display: block; padding: 6px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; background: #f6f3ee; font-size: 14px; }
#r-items a:hover { background: #ece6db; }
#r-open { color: var(--ink); font-weight: 600; }
#room .row { margin-top: auto; padding-top: 8px; }
#room .back { align-self: flex-start; padding: 6px 12px; font-size: 13px; }

/* labels on the rooms */
.room-label { background: rgba(255, 255, 255, .92); border-radius: 10px; padding: 4px 10px 5px; text-align: center; box-shadow: 0 4px 14px rgba(30, 40, 60, .18); transform: translateY(-50%); white-space: nowrap; transition: opacity .2s; }
.room-label b { display: block; font-size: 13px; font-weight: 600; }
.room-label span { display: block; font-size: 11px; color: var(--dim); }
.room-label.hall { background: var(--ink); color: #fff; }
.room-label.hall span { color: rgba(255, 255, 255, .7); }
.room-label.secret { background: #3a3340; color: #fff; }
.room-label.secret span { color: rgba(255, 255, 255, .65); }
.room-label.small b { font-size: 11px; }
.room-label.small span { display: none; }
.room-label.hidden { opacity: 0; }
.room-label.hover { outline: 2px solid var(--ink); }
.room-label.inside { opacity: 0; }
.out-label { font-size: 11px; font-weight: 600; background: #fff; border-radius: 999px; padding: 2px 8px; box-shadow: 0 3px 10px rgba(30, 40, 60, .16); }

/* the full tour */
.agent-go { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-top: 12px; border-radius: 14px; padding: 10px 14px; background: #16171d; color: #fff; border: 0; }
.agent-go .ora { background: #fff; } .agent-go .ora::after { border-color: #16171d; }
.agent-go b { display: block; font-size: 15px; } .agent-go small { display: block; font-size: 12px; color: rgba(255, 255, 255, .7); font-weight: 400; }
#tourp { position: fixed; right: 18px; top: 78px; bottom: 18px; width: min(380px, calc(100vw - 36px)); overflow: auto; background: var(--card); backdrop-filter: blur(12px); border-radius: 20px; padding: 16px 20px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
#tourp h2 { margin: 0; font-size: 22px; line-height: 1.15; }
#tourp p { margin: 0; }
.t-ask { font-size: 13px; color: var(--dim); font-style: italic; }
#t-status { font-weight: 600; }
.t-note { font-size: 13px; color: var(--dim); }
.t-progress { height: 6px; border-radius: 999px; background: #ece7dc; overflow: hidden; position: relative; }
.t-progress i { position: absolute; top: 0; bottom: 0; left: 0; background: #7a5cff; border-radius: 999px; }
#t-spin { width: 30%; animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { 0% { left: -30%; } 100% { left: 100%; } }
#t-bar { transition: width .4s; }
#t-step { font-size: 14px; min-height: 3em; }
.t-verdict { font-size: 20px; font-weight: 700; }
.t-verdict.ok { color: #1f7a4c; } .t-verdict.part { color: #a06a00; } .t-verdict.no { color: #a12a2a; }
.t-facts, .t-obs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.t-facts li { background: #f4f0e8; border-radius: 10px; padding: 6px 10px; }
.t-obs li { padding-left: 14px; position: relative; color: #3c3e48; } .t-obs li::before { content: '•'; position: absolute; left: 2px; }
#t-answer-box { font-size: 13px; color: #3c3e48; }
#t-live { font-weight: 600; color: var(--ink); font-size: 14px; }
#tourp .back { align-self: flex-start; padding: 6px 12px; font-size: 13px; margin-top: auto; }
body.touring #listing, body.touring #room { display: none !important; }
.agent-bubble { background: #fff; border-radius: 14px; padding: 8px 12px; max-width: 280px; font-size: 12px; line-height: 1.35; box-shadow: 0 8px 24px rgba(30, 40, 60, .22); transform: translateY(-100%); white-space: normal; }
.agent-bubble b { display: block; font-weight: 600; }
.agent-bubble q { display: block; margin-top: 4px; color: #4a4c58; font-style: italic; quotes: '“' '”'; }
.agent-bubble.bad { box-shadow: 0 0 0 2px #c0392b, 0 8px 24px rgba(30, 40, 60, .22); }
@media (max-width: 720px) { #tourp { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; max-height: 48vh; } .agent-bubble { max-width: 200px; font-size: 11px; } }

/* the share sheet */
#sheet { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(22, 23, 29, .45); backdrop-filter: blur(4px); padding: 16px; z-index: 10; }
#sheet .card { background: #fff; border-radius: 20px; padding: 18px 20px 20px; width: min(720px, 100%); box-shadow: var(--shadow); position: relative; }
#sheet h3 { margin: 0 0 12px; font-size: 18px; }
#sheet img { display: block; width: 100%; border-radius: 12px; box-shadow: 0 4px 18px rgba(30, 40, 60, .15); margin-bottom: 14px; }
#sheet .x { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 24px; padding: 2px 8px; }
.btn { display: inline-block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 16px; font-weight: 500; }
.btn:hover { filter: brightness(.96); }

/* walking */
#hud { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; text-align: center; }
#hud > * { pointer-events: auto; }
#hud-room { margin: 0; background: var(--card); backdrop-filter: blur(10px); border-radius: 999px; padding: 8px 16px; font-weight: 600; box-shadow: var(--shadow); }
#hud-room small { display: block; font-weight: 400; font-size: 12px; color: var(--dim); }
#hud-room em { display: block; font-style: normal; font-weight: 500; font-size: 12px; margin-top: 4px; max-width: 360px; white-space: normal; }
#hud-room[data-state] { border-radius: 16px; }
#hud-room[data-state=hidden] em { color: #4a2fb8; } #hud-room[data-state=locked] em { color: #a12a2a; } #hud-room[data-state=dark] em { color: #16171d; }
#hud .hint { margin: 0; font-size: 12px; color: #3c3e48; background: rgba(255, 255, 255, .7); border-radius: 999px; padding: 3px 10px; }
#hud .touch { display: none; }
body.touch #hud .touch { display: inline; } body.touch #hud .desk { display: none; }
#hud-exit { padding: 6px 14px; font-size: 13px; }
body.walking #listing, body.walking #room { display: none !important; }
.walk-here { align-self: flex-start; }

/* loading */
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(232, 238, 243, .72); backdrop-filter: blur(6px); transition: opacity .4s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading .card { background: #fff; border-radius: 20px; padding: 22px 26px; box-shadow: var(--shadow); min-width: min(360px, 86vw); }
#load-text { font-weight: 600; font-size: 17px; margin: 12px 0 6px; }
#load-steps { list-style: none; margin: 0; padding: 0; color: var(--dim); font-size: 14px; }
#load-steps li::before { content: '✓ '; color: #2f8a5a; }
#load-steps li.bad::before { content: '! '; color: #b33; }
.spin { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); margin: 0; background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; opacity: 0; transition: opacity .25s; pointer-events: none; }
#toast.on { opacity: 1; }

/* zooming out to the world map */
.zoomout { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; text-align: left; border-radius: 14px; padding: 8px 12px; background: #f4f0e8; border: 0; }
.zoomout i { width: 26px; height: 26px; flex: none; border-radius: 8px; background: #16171d; position: relative; }
.zoomout i::before, .zoomout i::after { content: ''; position: absolute; width: 8px; height: 8px; border: 2px solid #fff; }
.zoomout i::before { top: 5px; left: 5px; border-right: 0; border-bottom: 0; } .zoomout i::after { bottom: 5px; right: 5px; border-left: 0; border-top: 0; }
.zoomout b { display: block; font-size: 14px; font-weight: 600; } .zoomout small { display: block; font-size: 12px; color: var(--dim); }
/* the way back to the arcade: a pill in the header, a row on the cards, and a line when a game sent you here */
.to-arcade { text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; background: var(--card); backdrop-filter: blur(10px); padding: 9px 14px; border-radius: 999px; box-shadow: var(--shadow); }
a.zoomout { box-sizing: border-box; color: var(--ink); text-decoration: none; }
.zoomout.arcade i::before { top: 7px; left: 10px; width: 0; height: 0; border: 6px solid transparent; border-left: 8px solid #fff; border-right: 0; }
.zoomout.arcade i::after { display: none; }
#listing .zoomout.arcade { margin: 2px 0 10px; }
@media (min-width: 721px) { #listing { max-height: calc(100% - 96px); overflow-y: auto; box-sizing: border-box; } }   /* below the header, on a short window too */
.l-from { margin: 10px 0 0; padding: 9px 12px; border-radius: 12px; background: #16171d; color: #fff; font-size: 13px; line-height: 1.4; }
.l-from a { color: #fff; font-weight: 600; white-space: nowrap; }
/* the visitor's book: your games on this site, from this browser (js/kit.js logRun) */
.book { margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; background: #f4f0e8; }
.book .kicker { margin-bottom: 4px; }
.book ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.book li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.book li b { font-weight: 600; } .book li span { color: var(--dim); text-align: right; }
.book-note { margin: 6px 0 0; font-size: 11px; color: var(--dim); }
.renovate { margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.renovate p { margin: 0; font-size: 13px; color: #3c3e48; } .renovate p.kicker { font-size: 11px; color: var(--dim); }
.renovate button { align-self: flex-start; }
.renovate button:disabled { opacity: .5; cursor: progress; }
.reno-status { border-radius: 10px; padding: 6px 10px; background: #f4f0e8; }
.reno-status.busy { color: var(--dim); } .reno-status.up { background: #16171d; color: #f3d98b !important; font-weight: 600; } .reno-status.bad { background: #fbe4e1; color: #8a2318 !important; }
#zoomhint { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); margin: 0; background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 4; }
#zoomhint.on { opacity: 1; }
#veil { position: fixed; inset: 0; background: #e8eef3; opacity: 0; pointer-events: none; transition: opacity .5s; z-index: 5; }
#veil.on { opacity: 1; }

/* phones: the cards become sheets at the bottom */
@media (max-width: 720px) {
  #top { padding: 10px; gap: 8px; }
  .brand em { display: none; }
  .to-arcade { display: none; }   /* no room beside the search; the cards keep the way back */
  #listing { left: 10px; right: 10px; bottom: 10px; width: auto; padding: 14px 16px; }
  #listing h1 { font-size: 20px; }
  #l-features li:nth-child(n+4) { display: none; }
  #room { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; max-height: 52vh; }
  #room h2 { font-size: 21px; }
}

/* ---- panels as sheets: everything on a computer; on a phone the essentials, and "More" for the rest ---- */
.sheet .grab { display: none; }
.sheet .more { display: flex; flex-direction: column; gap: 8px; }
.sheet .row.main { margin-top: 4px; }
#room .back, #tourp .back { align-self: flex-start; padding: 6px 12px; font-size: 13px; margin-top: 0; }
#listing .more { gap: 0; }
.switch span b { display: block; font-size: 14px; font-weight: 600; }
.switch span small { display: block; font-size: 12px; color: var(--dim); font-weight: 400; line-height: 1.35; }
.journey { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #f4f0e8; display: flex; flex-direction: column; gap: 6px; }
.journey p { margin: 0; font-size: 13px; color: #3c3e48; }
.journey p.kicker { font-size: 11px; color: var(--dim); }
#agent-go { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; background: #16171d; color: #fff; border: 0; }
#agent-go .ora { width: 16px; height: 16px; background: #fff; } #agent-go .ora::after { inset: 4px; border-width: 2px; border-color: #16171d; }
#t-details { display: flex; flex-direction: column; gap: 8px; }
body.walking #tourp { display: none !important; }
@media (max-width: 720px) {
  .brand { padding: 7px 12px 7px 8px; } .brand span { white-space: nowrap; font-size: 13px; }
  /* drawers (drawer.js): shut, the essentials; open, the rest. A grab bar on top; tap or drag */
  .sheet { left: 10px !important; right: 10px !important; top: auto !important; bottom: 10px !important; width: auto !important; max-height: 80vh; overflow: hidden; padding: 12px 14px 14px !important; }
  .sheet.open { overflow-y: auto; overscroll-behavior: contain; }
  .sheet:not(.open), .sheet > :not(.more) { touch-action: none; }
  .sheet:not(.open):not(.dragging) .more { visibility: hidden; }
  .sheet .grab { display: block; position: sticky; top: -12px; z-index: 2; flex: none; align-self: stretch; width: calc(100% + 28px); height: 20px; margin: -12px -14px 0; padding: 0; border: 0; border-radius: 0; background: transparent; cursor: grab; }
  .sheet .grab::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(22, 23, 29, .2); margin: 8px auto 0; }
  .sheet .grab:hover { filter: none; }
  #room .grab, #tourp .grab { margin-bottom: -8px; }
  #listing h1 { font-size: 19px; margin-top: 2px; }
  #listing .kicker { font-size: 10px; }
  #l-addr { font-size: 13px; }
  .sheet .row.main button { padding: 8px 13px; font-size: 14px; }
  #room h2 { font-size: 19px; } #tourp h2 { font-size: 18px; }
  #room .back, #tourp .back { padding: 4px 10px; font-size: 12px; }
  #l-features li:nth-child(n+4) { display: list-item; }
}
