:root {
  /* cozy, wooden: walnut panels, cream text, warm lamp-light accent */
  --bg: #1d140e;
  --panel: rgba(52, 36, 24, 0.86);
  --panel-solid: #33241a;
  --text: #f8eedc;
  --muted: #cdbb9d;
  --accent: #eab974;
  --on-accent: #2a1a0c;
  --line: rgba(248, 230, 196, 0.3);
  --shadow: 0 6px 24px rgba(20, 10, 0, 0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, "PingFang SC", "Helvetica Neue", "Noto Sans SC", sans-serif; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--text); color: var(--on-accent); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 8px; }

button { font: inherit; color: var(--text); cursor: pointer; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 0; }
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }
svg .solid { fill: currentColor; stroke: none; }

/* top bar */
.top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; pointer-events: none; }
.top > * { pointer-events: auto; }
h1 { margin: 0; font-size: 26px; }
h1 button { font-size: inherit; font-weight: 700; letter-spacing: 0.06em; font-family: Georgia, "Songti SC", serif; background: none; border-color: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none; padding: 2px 6px; min-height: 40px; border-radius: 10px; text-shadow: 0 1px 8px rgba(30, 15, 0, 0.7); transition: transform .18s ease; }
h1 button:hover { transform: scale(1.12); }
.toggles { display: flex; gap: 6px; align-items: center; }

/* two-state pill: the lit half is the current state */
.switch { display: flex; border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.switch .opt { display: grid; place-items: center; width: 30px; height: 32px; border-radius: 999px; color: var(--muted); transition: background .18s, color .18s; }
.switch .opt b { font-size: 15px; font-weight: 600; }
.switch[aria-checked="false"] .opt:first-child, .switch[aria-checked="true"] .opt:last-child { background: var(--accent); color: var(--on-accent); }
.switch:hover, .round:hover { border-color: var(--accent); }
.round { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; box-shadow: var(--shadow); }
.round[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* things: a grid of small icon tiles */
.things { position: fixed; top: calc(58px + env(safe-area-inset-top)); right: 14px; width: min(264px, calc(100vw - 28px)); background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 8px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.things ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-height: 60vh; overflow-y: auto; }
.things li button { width: 100%; display: grid; justify-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 12px; border-color: transparent; background: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none; font-size: 11px; color: var(--muted); line-height: 1.2; }
.things li button:hover { background: rgba(248, 230, 196, 0.12); color: var(--text); }
.things .emoji { font-size: 24px; line-height: 1.15; }

/* bottom: the floor plan is the menu */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; display: grid; justify-items: center; gap: 6px; padding: 0 14px calc(12px + env(safe-area-inset-bottom)); pointer-events: none; }
.bottom > * { pointer-events: auto; }
.hint { margin: 0; text-align: center; font-size: 13px; text-shadow: 0 1px 6px rgba(20, 10, 0, 0.9); pointer-events: none; transition: opacity .6s; }
.hint.gone { opacity: 0; }
.spot-name { display: flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px 0 14px; border-radius: 999px; font-size: 13px; box-shadow: var(--shadow); }
.spot-name:hover { border-color: var(--accent); }
.spot-name .chev { width: 16px; height: 16px; transition: transform .18s; }
.spot-name[aria-expanded="false"] .chev { transform: rotate(180deg); }
.map[hidden] { display: none; }
.map { display: flex; align-items: stretch; gap: 8px; padding: 8px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.map button { border-radius: 6px; display: grid; place-items: center; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(248, 230, 196, 0.08);
  font-size: 14px; line-height: 1; transition: background .15s; }
.map button:hover { background: rgba(248, 230, 196, 0.22); }
.map button[aria-current="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.map .over { width: 44px; border-radius: 12px; }
.plan { position: relative; width: min(280px, calc(100vw - 28px - 16px - 52px - 2px)); aspect-ratio: 8.4 / 3.6; }
.plan button { position: absolute; }
.plan .bed { background: rgba(234, 185, 116, 0.28); font-weight: 700; font-family: Georgia, serif; }
.plan .room, .plan .back { border-style: dashed; font-size: 16px; }
.plan .door { border-radius: 6px 0 0 6px; }

dialog { background: var(--panel-solid); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 22px;
  width: min(420px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow-y: auto; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(20, 10, 0, 0.55); }
dialog h2 { margin: 0 44px 12px 0; font-size: 20px; font-family: Georgia, "Songti SC", serif; }
dialog img { width: 100%; max-height: 46vh; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
dialog p { margin: 0 0 8px; }
.note { color: var(--muted); font-size: 13px; }
.close { position: absolute; top: 10px; right: 10px; font-size: 22px; line-height: 1; box-shadow: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
