:root {
  --ink: #f4ead6;
  --muted: #b9ab90;
  --panel: rgba(16, 20, 30, .78);
  --panel-solid: #141a26;
  --line: rgba(244, 234, 214, .16);
  --gold: #e9c27a;
  --verm: #e0775a;
  --f-display: "Cormorant Garamond", Garamond, Georgia, serif;
  --f-caps: "Cinzel", Georgia, serif;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1018; color: var(--ink); font: 14px/1.45 var(--f-ui); }
canvas#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.kicker { font: 600 .68rem/1 var(--f-caps); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }

/* loading */
#loading { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #1d2a40 0%, #0b1018 70%); transition: opacity .8s ease; }
#loading.done { opacity: 0; pointer-events: none; }
.load-inner { width: min(34rem, 88vw); text-align: center; }
.load-inner h1 { font: 600 clamp(2.6rem, 7vw, 4.2rem)/1 var(--f-display); margin: .35rem 0 1rem; color: #fbf1dc; }
.load-inner .quote { font: italic 500 1.15rem/1.5 var(--f-display); color: #d9ccb2; min-height: 4.5em; }
.bar { height: 3px; background: rgba(255, 255, 255, .12); border-radius: 3px; overflow: hidden; margin: 1.2rem 0 .6rem; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #e0775a, #e9c27a); transition: width .25s ease; }
.status { font-size: .8rem; color: var(--muted); letter-spacing: .03em; }

/* chrome */
#topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: .8rem; padding: .6rem .9rem; background: linear-gradient(180deg, rgba(8, 11, 18, .7), rgba(8, 11, 18, 0)); pointer-events: none; }
#topbar > * { pointer-events: auto; }
#topbar .back { color: var(--ink); text-decoration: none; font: 600 .8rem/1 var(--f-caps); letter-spacing: .12em; padding: .5rem .7rem; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); }
#topbar .title { display: flex; flex-direction: column; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
#topbar .title b { font: 600 1.05rem/1.1 var(--f-display); letter-spacing: .01em; }
#topbar .title span { font-size: .72rem; color: var(--muted); }
#topbar .spacer { flex: 1; }
.pill { border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(8px); border-radius: 99px; padding: .45rem .8rem; cursor: pointer; font-size: .8rem; font-weight: 500; }
.pill:hover { background: rgba(40, 48, 66, .9); }

#dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: .9rem; z-index: 20; display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 1rem); }
#dock .group { display: flex; align-items: center; gap: 2px; background: var(--panel); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
#dock button { border: 0; background: transparent; padding: .5rem .75rem; border-radius: 9px; cursor: pointer; font-size: .8rem; font-weight: 500; color: #e7dcc5; white-space: nowrap; }
#dock button:hover { background: rgba(255, 255, 255, .08); }
#dock button.on { background: #e9c27a; color: #1b1308; }
#dock .time { padding: 3px .7rem; gap: .5rem; }
#dock .time .lbl { opacity: .7; }
#dock input[type=range] { width: min(16rem, 34vw); accent-color: #e9c27a; }
#time-read { font-variant-numeric: tabular-nums; min-width: 4.6rem; font-size: .8rem; color: var(--muted); }

#minimap { position: fixed; right: .9rem; bottom: 4.6rem; z-index: 18; width: 360px; height: 130px; border-radius: 10px; border: 1px solid var(--line); background: rgba(10, 16, 26, .7); cursor: crosshair; }
@media (max-width: 800px) { #minimap { display: none; } }

/* places list */
#places { position: fixed; top: 3.6rem; right: .9rem; z-index: 22; width: min(21rem, calc(100vw - 1.8rem)); max-height: calc(100vh - 10rem); display: flex; flex-direction: column; background: var(--panel); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
#place-q { margin: .6rem; padding: .55rem .75rem; border-radius: 8px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--ink); font: inherit; }
#place-list { overflow-y: auto; padding: 0 .3rem .5rem; }
#place-list h4 { font: 600 .64rem/1 var(--f-caps); letter-spacing: .18em; color: var(--gold); margin: .9rem .5rem .4rem; text-transform: uppercase; }
#place-list button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: .42rem .55rem; border-radius: 7px; cursor: pointer; font-size: .86rem; color: #e9dfca; }
#place-list button:hover { background: rgba(255, 255, 255, .08); }

/* info card */
#info { position: fixed; left: .9rem; top: 3.8rem; z-index: 22; width: min(24rem, calc(100vw - 1.8rem)); max-height: calc(100vh - 9rem); overflow-y: auto; background: var(--panel); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 14px; }
#info .close, #help .close { position: absolute; right: .5rem; top: .45rem; z-index: 2; width: 2rem; height: 2rem; border-radius: 99px; border: 0; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.2rem; cursor: pointer; }
#info-img img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 14px 14px 0 0; background: #222; }
#info-img .cap { font-size: .7rem; color: var(--muted); padding: .35rem 1rem 0; }
.info-body { padding: .9rem 1.1rem 1.1rem; }
.info-body h2 { font: 600 1.7rem/1.1 var(--f-display); margin: .35rem 0 .45rem; }
.info-body p { margin: 0 0 .7rem; color: #e3d8c2; }
.info-body dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; margin: .4rem 0 .9rem; font-size: .8rem; }
.info-body dt { color: var(--muted); }
.info-body dd { margin: 0; }
.more { color: var(--gold); text-decoration: none; font-weight: 600; font-size: .85rem; }
.more:hover { text-decoration: underline; }

/* tour caption */
#tour-caption { position: fixed; left: 50%; transform: translateX(-50%); bottom: 5.2rem; z-index: 21; width: min(40rem, calc(100vw - 1.8rem)); background: var(--panel); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1.2rem 1rem; text-align: left; }
#tour-caption h3 { font: 600 1.55rem/1.15 var(--f-display); margin: .3rem 0 .35rem; }
#tour-caption p { margin: 0 0 .7rem; color: #e3d8c2; font-size: .92rem; }
.tour-btns { display: flex; gap: .4rem; }

/* labels */
.lbl3d { position: fixed; left: 0; top: 0; z-index: 10; pointer-events: auto; cursor: pointer; transform: translate(-50%, -100%); white-space: nowrap; font: 600 .7rem/1 var(--f-ui); letter-spacing: .02em; color: #fff7e6; padding: .28rem .5rem; border-radius: 99px; background: rgba(14, 18, 28, .66); border: 1px solid rgba(255, 240, 210, .22); text-shadow: 0 1px 2px rgba(0, 0, 0, .6); transition: opacity .2s; }
.lbl3d::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 1px; height: 6px; background: rgba(255, 240, 210, .5); }
.lbl3d:hover { background: #e9c27a; color: #1b1308; }
#hover-label { position: fixed; z-index: 30; pointer-events: none; transform: translate(12px, 12px); font: 600 .78rem/1 var(--f-ui); background: rgba(14, 18, 28, .85); border: 1px solid var(--line); padding: .4rem .6rem; border-radius: 8px; }

#help { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 45; width: min(36rem, calc(100vw - 2rem)); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.4rem; }
#help h3 { font: 600 1.6rem/1 var(--f-display); margin: .1rem 0 .8rem; }
#help table { border-collapse: collapse; font-size: .86rem; }
#help th { text-align: left; padding: .35rem .8rem .35rem 0; vertical-align: top; color: var(--gold); font-weight: 600; }
#help td { padding: .35rem 0; color: #e3d8c2; }
#help .fine { font-size: .75rem; color: var(--muted); margin: .9rem 0 0; }

body.hero #topbar, body.hero #dock, body.hero #minimap, body.hero .lbl3d, body.hero #loading .quote { display: none !important; }
body.hero #loading { background: #0b1018; }
@media (max-width: 640px) {
  #topbar .title span { display: none; }
  #dock { bottom: .4rem; }
  #dock .toggles { display: none; }
  #info { top: auto; bottom: 4.6rem; max-height: 45vh; }
}
