:root {
  --ink: #1d1c1a;
  --paper: #f6f3ee;
  --glass: rgba(246, 243, 238, 0.82);
  --glass-solid: rgba(246, 243, 238, 0.93); /* always-visible HUD over the live canvas: no backdrop blur (per-frame GPU cost) */
  --line: rgba(29, 28, 26, 0.12);
  --accent: #8a6a43;
  --muted: #6d6a64;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #d9d4cb; color: var(--ink);
  font: 14px/1.4 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; }
#app, #app canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: fixed; inset: 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: 12px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.brand { background: var(--glass-solid); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-weight: 600; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); display: inline-block; }
.brand .sep { color: var(--muted); }
#hud-room { font-weight: 500; }
.hud-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill, .seg button { font: inherit; border: 1px solid var(--line); background: var(--glass-solid); color: var(--ink); border-radius: 999px; padding: 7px 13px; cursor: pointer; }
.pill:hover, .seg button:hover { background: #fff; }
.seg { display: flex; background: var(--glass-solid); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg button:disabled { opacity: .35; cursor: default; background: transparent; }
.panel { position: absolute; top: 60px; right: 16px; width: min(300px, calc(100vw - 32px)); max-height: calc(100vh - 140px); overflow: auto; background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.panel h3 { margin: 8px 6px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.panel button.room { display: flex; justify-content: space-between; width: 100%; border: 0; background: transparent; font: inherit; text-align: left; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.panel button.room:hover { background: rgba(255,255,255,.8); }
.panel button.room span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.panel label { display: grid; gap: 4px; margin: 8px 6px; }
.panel label.row { display: flex; gap: 8px; align-items: center; }
.panel output { color: var(--muted); font-variant-numeric: tabular-nums; }
.panel select { font: inherit; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.perf { position: absolute; left: 16px; top: 58px; background: rgba(20, 19, 18, 0.78); color: #f3efe8; border-radius: 10px; padding: 7px 10px;
  font: 12px/1.45 ui-monospace, "SF Mono", Consolas, monospace; font-variant-numeric: tabular-nums; pointer-events: none; max-width: calc(100vw - 32px); }
.perf b { font-size: 15px; }
.perf .dim { color: #b9b3a8; }
.hidden { display: none !important; }
#minimap { position: absolute; left: 16px; bottom: 54px; width: 260px; height: 260px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--glass-solid); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--muted); white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.hint b { color: var(--ink); font-weight: 600; }
.start { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(1200px 800px at 50% 40%, rgba(246,243,238,.55), rgba(217,212,203,.9)); backdrop-filter: blur(6px); z-index: 10; padding: 16px; }
.start-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 28px 30px; width: min(420px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.start-card h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.01em; }
.start-card p { margin: 0 0 14px; }
.muted { color: var(--muted); font-size: 13px; }
.bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 10px 0 8px; }
#load-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.cta { width: 100%; margin-top: 8px; font: inherit; font-weight: 600; padding: 11px 14px; border-radius: 12px; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; }
.cta:disabled { opacity: .35; cursor: default; }
.touch { position: fixed; left: 0; bottom: 0; width: 50%; height: 45%; z-index: 5; }
.stick { position: absolute; left: 28px; bottom: 28px; width: 120px; height: 120px; border-radius: 50%; background: rgba(246,243,238,.35); border: 1px solid rgba(255,255,255,.6); }
.stick .knob { position: absolute; left: 40px; top: 40px; width: 40px; height: 40px; border-radius: 50%; background: rgba(246,243,238,.9); }
body.capture .hud, body.capture .start, body.capture .touch { display: none !important; }
@media (max-width: 560px) { .hint { display: none; } #minimap { width: 180px; height: 180px; } }

.cta.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); margin-top: 8px; }
.plan-labels { position: fixed; inset: 0; pointer-events: none; z-index: 3; transition: opacity .3s; }
.plan-label { position: absolute; left: 0; top: 0; text-align: center; font: 600 12px/1.2 "Inter", "Segoe UI", system-ui, sans-serif; color: #1b1a18; white-space: nowrap; letter-spacing: .02em; }
.plan-label span { display: block; font-weight: 400; color: #55524c; font-variant-numeric: tabular-nums; }
.tour-caption { position: fixed; left: 24px; bottom: 74px; z-index: 4; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; max-width: min(420px, calc(100vw - 48px)); }
.tour-caption b { display: block; font-size: 18px; letter-spacing: -.01em; }
.tour-caption span { color: var(--muted); }
.tour-ui { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4; display: flex; gap: 10px; align-items: center; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 999px; padding: 5px 6px 5px 14px; color: var(--muted); font-size: 13px; max-width: calc(100vw - 32px); }
.tour-ui b { color: var(--ink); }
body.touring .hud .hint, body.touring #minimap { display: none !important; }
body.capture .plan-labels, body.capture .tour-caption, body.capture .tour-ui { display: none !important; }
