:root {
  --ink: #f4ede3; --ink-2: #c9bfb1; --panel: rgba(20, 18, 16, .86); --line: rgba(255, 240, 220, .16); --accent: #e0a464; --focus: #ffd28a;
  --gutter: 16px; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0a09; color: var(--ink); font: 15px/1.45 system-ui, "Segoe UI", Roboto, Arial, sans-serif; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; cursor: grab; touch-action: none; outline: none; }
#view:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
#fade { position: fixed; inset: 0; background: #070605; opacity: 1; pointer-events: none; z-index: 5; }
.skip { position: fixed; left: var(--gutter); top: -60px; z-index: 20; background: #000; color: #fff; padding: 8px 12px; border-radius: 6px; }
.skip:focus { top: 10px; }
button, select, .btn { font: inherit; color: var(--ink); background: rgba(255, 245, 230, .08); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; min-height: 40px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { background: rgba(255, 245, 230, .16); }
button:focus-visible, select:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button[disabled] { opacity: .55; cursor: not-allowed; }
kbd { font: 12px/1 ui-monospace, Consolas, monospace; border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; color: var(--ink-2); }
a { color: var(--accent); }

#bar { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px var(--gutter); background: linear-gradient(rgba(10, 9, 8, .78), rgba(10, 9, 8, 0)); pointer-events: none; }
#bar > * { pointer-events: auto; }
.where-box { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand { font-weight: 800; letter-spacing: .18em; color: var(--accent); font-size: 14px; }
#where { margin: 0; font-size: 20px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; gap: 8px; }
.home-link { min-height: 44px; white-space: nowrap; background: rgba(20, 18, 16, .6); color: var(--ink); }
/* phones: the room title must keep its room. With a room open (the Back button shows) the link steps aside, and on very narrow screens it does too (the intro, the Rooms list and the Menu still carry it) */
@media (max-width: 760px) { .home-link { padding: 6px 12px; } #bar:has(#back:not([hidden])) .home-link { display: none; } }
@media (max-width: 359px) { .home-link { display: none; } }   /* landing chat: the Standard page / Home page link on the first screen (44 px target) */
.intro { position: fixed; top: 58px; left: var(--gutter); max-width: min(520px, calc(100vw - 2 * var(--gutter))); margin: 0; z-index: 9; color: var(--ink); font-size: 14px; text-shadow: 0 1px 3px #000; pointer-events: none; background: rgba(12, 11, 10, .55); padding: 6px 10px; border-radius: 8px; }

#list { position: fixed; z-index: 9; left: var(--gutter); top: 112px; width: 232px; max-height: calc(100vh - 230px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; backdrop-filter: blur(6px); }
#list h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); margin: 8px 0 6px; }
#list ol, #list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#list button { width: 100%; justify-content: flex-start; text-align: left; min-height: 36px; padding: 6px 10px; }
#list button[aria-current="page"] { border-color: var(--accent); background: rgba(224, 164, 100, .18); }
#list .note { display: block; font-size: 12px; color: var(--ink-2); padding: 2px 10px 4px; }
.simple-link { margin: 10px 0 2px; font-size: 13px; }
@media (min-width: 761px) { #list:not(.open) { display: none; } }
#list-toggle[aria-expanded="true"] { border-color: var(--accent); }
#wordmark { position: fixed; z-index: 8; left: var(--gutter); bottom: 14px; margin: 0; display: grid; line-height: 1.05; pointer-events: none; text-shadow: 0 1px 4px #000; }
#wordmark span { font-size: 12px; font-weight: 800; letter-spacing: .32em; color: var(--accent); }
#wordmark b { font: 700 22px/1.1 Georgia, 'Times New Roman', serif; letter-spacing: .14em; color: var(--ink); }

#settings { position: fixed; z-index: 11; right: var(--gutter); top: 62px; width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
#settings .check { display: flex; gap: 8px; align-items: center; }
#settings input[type=checkbox] { width: 20px; height: 20px; }
.small { font-size: 12px; color: var(--ink-2); margin: 0; }

#controls { position: fixed; z-index: 9; right: var(--gutter); bottom: 54px; display: flex; gap: 6px; }
#controls button { width: 44px; height: 44px; justify-content: center; font-size: 20px; background: var(--panel); }

#panel { position: fixed; z-index: 12; right: var(--gutter); top: 72px; width: min(380px, calc(100vw - 2 * var(--gutter))); max-height: calc(100vh - 150px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 14px; backdrop-filter: blur(8px); }
#panel h2 { margin: 0 36px 8px 0; font-size: 19px; }
#panel img { max-width: 100%; border-radius: 8px; margin: 4px 0 8px; }
#panel p { margin: 0 0 10px; color: var(--ink); }
#panel-close { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; justify-content: center; font-size: 22px; padding: 0; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }

#hover { position: fixed; z-index: 8; pointer-events: none; background: rgba(12, 11, 10, .9); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 13px; max-width: 300px; }
.help { position: fixed; z-index: 8; left: 50%; background: rgba(12, 11, 10, .5); padding: 3px 10px; border-radius: 6px; transform: translateX(-50%); bottom: 12px; margin: 0; font-size: 13px; color: var(--ink-2); text-shadow: 0 1px 3px #000; white-space: nowrap; pointer-events: none; }
.status { position: fixed; z-index: 8; right: var(--gutter); bottom: 104px; margin: 0; font-size: 13px; color: var(--ink-2); }
.status:empty { display: none; }
.noscript { position: fixed; inset: 40% var(--gutter) auto; z-index: 30; background: #000; padding: 16px; }

/* phone: the room list becomes a strip at the bottom (still always one tap away and in the reading order) */
@media (max-width: 760px) {
  #where { font-size: 17px; }
  .brand { display: none; }
  #bar .tools button { padding: 6px 10px; }
  .intro { top: 54px; font-size: 13px; }
  #wordmark { display: none; }
  #list { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 52vh; border-radius: 14px 14px 0 0; padding: 8px var(--gutter) 12px; transform: translateY(calc(100% - 64px)); transition: transform .25s ease; }
  #list.open { transform: none; }
  #list #rooms { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  #list #rooms button { white-space: nowrap; width: auto; }
  #list > h2:first-child { display: none; }
  #controls { bottom: 76px; }
  .status { bottom: 128px; }
  .help { display: none; }
  #panel { top: auto; bottom: 70px; max-height: 46vh; }
}
@media (prefers-reduced-motion: reduce) { #list { transition: none; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* door walk (2026-11-14): the header keeps one height in every room, so nothing moves when the Back button appears */
#bar { min-height: 60px; box-sizing: border-box; }

