/* LibNext Wonder Trails — design system */
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2"); font-weight: 300 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --forest-950: #0a1f15;
  --forest-900: #0f2a1d;
  --forest-800: #163b29;
  --forest-700: #1d4a33;
  --forest-600: #25603f;
  --forest-500: #2f7a4f;
  --forest-400: #4f9a6b;
  --moss: #7fa548;
  --lime: #b9d77a;
  --gold: #c9a24a;
  --gold-soft: #ead9a6;
  --clay: #c26b3c;
  --sky: #8fc3d3;
  --river: #2c7f99;
  --paper: #fbfaf5;
  --paper-2: #f4f2ea;
  --mist: #eaf1ec;
  --line: #e2e5dc;
  --ink: #13221a;
  --ink-2: #3c4d43;
  --ink-3: #6b7a70;
  --white: #fff;
  --danger: #b4452f;
  --ok: #2f7a4f;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 27, .06), 0 2px 8px rgba(16, 40, 27, .06);
  --shadow: 0 2px 6px rgba(16, 40, 27, .06), 0 12px 32px rgba(16, 40, 27, .10);
  --shadow-lg: 0 20px 60px rgba(10, 31, 21, .25);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --topbar: 64px;
  --tabbar: 0px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--ui); color: var(--ink); background: var(--paper);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--forest-600); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0 0 .4em; letter-spacing: -.01em; font-variation-settings: "opsz" 72; }
h1 { font-size: clamp(2rem, 4.2vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.eyebrow { font-family: var(--ui); font-size: .75rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--forest-500); margin-bottom: .6em; display: inline-flex; gap: .5em; align-items: center; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.tiny { font-size: .75rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 9999; background: var(--forest-900); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--forest-700); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 44px; padding: .65em 1.25em; border-radius: 999px; border: 1px solid transparent;
  background: var(--bg); color: var(--fg); font-weight: 600; font-size: .95rem; cursor: pointer;
  text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15, 42, 29, .22); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { --bg: transparent; --fg: var(--forest-700); border-color: var(--line); }
.btn.ghost:hover { background: var(--mist); }
.btn.light { --bg: rgba(255, 255, 255, .92); --fg: var(--forest-900); }
.btn.gold { --bg: linear-gradient(135deg, #e3c26d, #c9a24a 55%, #b38a33); --fg: #1a1406; }
.btn.lg { min-height: 56px; padding: .9em 1.8em; font-size: 1.05rem; }
.btn.sm { min-height: 36px; padding: .4em .9em; font-size: .85rem; }
.btn .ico { width: 18px; height: 18px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%;
  background: transparent; border: 1px solid transparent; cursor: pointer; color: inherit; transition: background .2s;
}
.icon-btn:hover { background: rgba(15, 42, 29, .07); }
.icon-btn svg { width: 22px; height: 22px; }

.chip { display: inline-flex; align-items: center; gap: .4em; padding: .3em .75em; border-radius: 999px; background: var(--mist); color: var(--forest-700); font-size: .8rem; font-weight: 600; border: 1px solid transparent; }
.chip.gold { background: #f6eccd; color: #6d5310; }
.chip.blue { background: #e3f0f4; color: #1f5f73; }
.chip.clay { background: #f6e3d8; color: #8a4422; }
.chip button { all: unset; cursor: pointer; }

.seg { display: inline-flex; padding: 4px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: .5em 1em; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: .45em; min-height: 38px; transition: background .25s var(--ease), color .25s; }
.seg button[aria-pressed="true"] { background: var(--forest-700); color: #fff; box-shadow: var(--shadow-sm); }
.seg button svg { width: 16px; height: 16px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.glass { background: rgba(255, 255, 255, .72); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border: 1px solid rgba(255, 255, 255, .6); box-shadow: var(--shadow); }
.glass-dark { background: rgba(10, 31, 21, .55); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); border: 1px solid rgba(255, 255, 255, .14); color: #fff; }

/* ---------- Loader ---------- */
#loader { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 10%, #1e5038 0%, #0b2117 70%); color: #fff; transition: opacity .6s var(--ease), visibility .6s; }
#loader.done { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-mark { width: 74px; height: 74px; margin: 0 auto 18px; }
.loader-mark .ring { transform-origin: 50% 50%; animation: spin 2.4s linear infinite; }
.loader-title { font-family: var(--display); font-size: 1.4rem; letter-spacing: .02em; }
.loader-bar { width: 200px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .15); margin: 16px auto 8px; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--lime), var(--gold)); transition: width .3s var(--ease); }
.loader-status { font-size: .8rem; opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App chrome ---------- */
#app { min-height: 100%; }
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar); z-index: 900;
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  background: rgba(251, 250, 245, .82); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid rgba(15, 42, 29, .07); transition: transform .4s var(--ease), background .3s;
}
body.landing .topbar { transform: translateY(-110%); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--forest-900); min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { line-height: 1.05; }
.brand-text b { font-family: var(--display); font-size: 1.12rem; font-weight: 650; display: block; white-space: nowrap; }
.brand-text span { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .9rem; padding: .55em .85em; border-radius: 999px; transition: background .2s, color .2s; display: inline-flex; gap: .45em; align-items: center; }
.nav a:hover { background: rgba(15, 42, 29, .06); color: var(--forest-900); }
.nav a[aria-current="page"] { background: var(--forest-700); color: #fff; }
.nav a svg { width: 17px; height: 17px; }
.xp-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-weight: 650; font-size: .85rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.xp-pill .lvl { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--forest-500), var(--forest-800)); color: #fff; font-size: .75rem; }
.xp-pill.bump { animation: bump .6s var(--ease); }
@keyframes bump { 30% { transform: scale(1.12); } }
.mode-badge { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: #f6eccd; color: #6d5310; white-space: nowrap; }
.mode-badge.travel { background: #e3f0f4; color: #1f5f73; }

.tabbar { display: none; }

main#view { padding-top: var(--topbar); min-height: 100vh; }
body.landing main#view { padding-top: 0; }
.view-enter { animation: viewIn .5s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.wrap { width: min(1200px, 100% - 40px); margin: 0 auto; }
.page { padding: 40px 0 80px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head p { max-width: 640px; color: var(--ink-2); margin: 0; }

/* ---------- Landing ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; color: #fff; background: #0b2117; isolation: isolate; }
.hero-art { position: absolute; inset: 0; z-index: -3; }
.hero-art svg { width: 100%; height: 100%; }
.hero-photos { position: absolute; inset: 0; z-index: -2; }
.hero-photos .ph { position: absolute; inset: -4%; background-size: cover; background-position: center; opacity: 0; transition: opacity 2.2s ease; will-change: transform, opacity; }
.hero-photos .ph.on { opacity: 1; animation: kenburns 14s ease-out both; }
@keyframes kenburns { from { transform: scale(1.08) translate3d(1%, 1%, 0); } to { transform: scale(1) translate3d(0, 0, 0); } }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(6, 22, 14, .55) 0%, rgba(6, 22, 14, .1) 35%, rgba(6, 22, 14, .35) 62%, rgba(6, 22, 14, .92) 100%), radial-gradient(80% 60% at 20% 80%, rgba(6, 22, 14, .55), transparent 70%); }
.hero-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 22px clamp(18px, 4vw, 48px); }
.hero-top .brand { color: #fff; }
.hero-top .brand-text span { color: rgba(255, 255, 255, .7); }
.hero-content { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 120px clamp(18px, 5vw, 64px) clamp(28px, 6vh, 64px); max-width: 1320px; margin: 0 auto; }
.hero .eyebrow { color: var(--lime); }
.hero h1 { font-size: clamp(2.6rem, 7.5vw, 6.2rem); font-weight: 500; letter-spacing: -.025em; line-height: .98; margin-bottom: .25em; text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--gold-soft); }
.hero-lead { font-size: clamp(1.02rem, 1.6vw, 1.28rem); max-width: 640px; color: rgba(255, 255, 255, .88); margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 30px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: .9rem; color: rgba(255, 255, 255, .78); border-top: 1px solid rgba(255, 255, 255, .16); padding-top: 18px; }
.hero-meta b { color: #fff; font-family: var(--display); font-size: 1.35rem; font-weight: 600; margin-right: 6px; }
.hero-credit { position: absolute; right: 16px; bottom: 10px; font-size: .7rem; color: rgba(255, 255, 255, .6); max-width: 60%; text-align: right; }
.hero-credit a { color: inherit; }
.start-btn { position: relative; overflow: hidden; }
.start-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 3.6s ease-in-out 1.5s infinite; }
@keyframes sheen { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.scroll-cue { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); opacity: .7; }

.landing-section { padding: 90px 0; }
.landing-section.alt { background: var(--paper-2); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-top: 30px; }
.feature { padding: 26px; }
.feature .f-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--mist); color: var(--forest-600); margin-bottom: 16px; }
.feature .f-ico svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.15rem; margin-bottom: .3em; }
.feature p { color: var(--ink-2); font-size: .95rem; margin: 0; }
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 26px; }
.mode-card { position: relative; text-align: left; padding: 26px 26px 24px; border-radius: var(--radius); border: 2px solid var(--line); background: #fff; cursor: pointer; transition: border-color .25s, transform .25s var(--ease), box-shadow .25s; }
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mode-card[aria-pressed="true"] { border-color: var(--forest-500); box-shadow: 0 0 0 4px rgba(47, 122, 79, .12), var(--shadow); }
.mode-card .check { position: absolute; top: 18px; right: 18px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.mode-card[aria-pressed="true"] .check { background: var(--forest-500); border-color: var(--forest-500); color: #fff; }
.mode-card h3 { margin-top: 10px; }
.mode-card ul { margin: 10px 0 0; padding-left: 1.1em; color: var(--ink-2); font-size: .92rem; }
.route-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; align-items: center; }
.route-strip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--moss); }

.site-footer { padding: 36px 0 110px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: space-between; }

/* ---------- Map view ---------- */
.map-view { position: relative; height: calc(100vh - var(--topbar)); height: calc(100svh - var(--topbar)); display: grid; grid-template-columns: 400px 1fr; }
.map-panel { position: relative; z-index: 2; background: var(--paper); border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.map-panel-inner { padding: 22px 22px 120px; }
.map-panel h2 { font-size: 1.6rem; margin-bottom: .2em; }
.map-canvas { position: relative; background: #e8eef0; }
#leaflet-map { position: absolute; inset: 0; background: linear-gradient(180deg, #dce9ee, #e7efe9); }
.leaflet-container { font-family: var(--ui); }
.map-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 6px; }
.stat { padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.stat span { font-size: .75rem; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.est-note { font-size: .78rem; color: var(--ink-3); display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 14px; }
.est-note svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
.stops { list-style: none; padding: 0; margin: 18px 0 0; position: relative; }
.stops::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: repeating-linear-gradient(var(--line) 0 6px, transparent 6px 10px); }
.stop { position: relative; display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 8px 6px; border-radius: 14px; cursor: pointer; transition: background .2s; }
.stop:hover { background: var(--mist); }
.stop .num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: #fff; border: 2px solid var(--line); z-index: 1; transition: all .3s var(--ease); }
.stop.reached .num { background: var(--forest-600); border-color: var(--forest-600); color: #fff; }
.stop.current .num { background: var(--gold); border-color: var(--gold); color: #1a1406; box-shadow: 0 0 0 5px rgba(201, 162, 74, .25); }
.stop.locked { opacity: .55; }
.stop .s-name { font-weight: 650; line-height: 1.2; }
.stop .s-sub { font-size: .78rem; color: var(--ink-3); }
.stop .s-go { font-size: .8rem; }
.travel-bar { position: sticky; bottom: 0; padding: 14px 22px; background: linear-gradient(180deg, rgba(251, 250, 245, 0), var(--paper) 30%); margin-top: auto; display: flex; gap: 10px; }
.travel-bar .btn { flex: 1; }
.map-legend { position: absolute; left: 14px; bottom: 26px; z-index: 500; padding: 10px 12px; border-radius: 12px; font-size: .75rem; display: grid; gap: 4px; }
.map-legend i { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 6px; }
.map-toolbar { position: absolute; top: 14px; right: 14px; z-index: 500; display: flex; gap: 8px; }
.map-toolbar .icon-btn { background: rgba(255, 255, 255, .92); box-shadow: var(--shadow-sm); }
.map-note { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 500; padding: 8px 14px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.wt-pin { position: relative; }
.wt-pin .p { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: #fff; border: 3px solid var(--c, var(--forest-600)); box-shadow: 0 6px 14px rgba(0, 0, 0, .25); display: grid; place-items: center; transition: transform .3s var(--ease); }
.wt-pin .p b { transform: rotate(45deg); font-size: 12px; color: var(--ink); font-weight: 800; }
.wt-pin.reached .p { background: var(--c, var(--forest-600)); }
.wt-pin.reached .p b { color: #fff; }
.wt-pin.locked .p { filter: grayscale(1); opacity: .7; }
.wt-pin:hover .p { transform: rotate(-45deg) scale(1.12); }
.wt-label { font-family: var(--ui); font-size: 11px; font-weight: 700; color: var(--forest-900); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff; white-space: nowrap; }
.wt-country { font-family: var(--display); font-style: italic; font-size: 13px; color: #7d8a84; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 0 4px #fff; }
.wt-state { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(29, 74, 51, .55); white-space: nowrap; text-shadow: 0 0 3px #fff; }
.wt-way { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #8b9a90; }
.wt-way.side { border-color: var(--clay); }
.explorer-token { width: 46px; height: 46px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(201, 162, 74, .45), 0 10px 24px rgba(0, 0, 0, .3); display: grid; place-items: center; }
.explorer-token svg { width: 30px; height: 30px; }
.explorer-token::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(201, 162, 74, .6); animation: pulse 2s ease-out infinite; }
@keyframes pulse { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 14px 16px; font-family: var(--ui); font-size: .88rem; line-height: 1.45; }
.leaflet-popup-content h4 { font-size: 1.05rem; margin: 0 0 4px; }
.route-anim { stroke-dasharray: 2 14; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }

/* ---------- Places list ---------- */
.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.place-card { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: #0b2117; color: #fff; text-decoration: none; aspect-ratio: 4/3.2; box-shadow: var(--shadow-sm); transition: transform .4s var(--ease), box-shadow .4s; isolation: isolate; }
.place-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.place-card .art, .place-card .art svg, .place-card .photo { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.place-card .photo { background-size: cover; background-position: center; opacity: 0; transition: opacity .8s; }
.place-card .photo.loaded { opacity: 1; }
.place-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(5, 18, 12, .85)); }
.place-card .pc-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; }
.place-card h3 { font-size: 1.35rem; margin: 0 0 2px; }
.place-card .pc-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 8px; }
.place-card .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: var(--forest-900); font-weight: 800; font-size: .85rem; }
.place-card.locked { filter: saturate(.3); }
.place-card .lock { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .45); }
.place-card .stamped { width: 54px; height: 54px; transform: rotate(-12deg); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4)); }

/* ---------- Place view ---------- */
.place-hero { position: relative; height: min(72vh, 680px); min-height: 420px; overflow: hidden; color: #fff; background: #0b2117; isolation: isolate; }
.place-hero .art, .place-hero .art svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -3; }
.place-hero .photo { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.2s; transform: scale(1.04); }
.place-hero .photo.loaded { opacity: 1; animation: kenburns 18s ease-out both; }
.place-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(5, 18, 12, .45), rgba(5, 18, 12, 0) 30%, rgba(5, 18, 12, .2) 55%, rgba(5, 18, 12, .9)); }
.place-hero .ph-inner { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: 34px; }
.place-hero h1 { font-weight: 500; font-size: clamp(2.2rem, 6vw, 4.6rem); margin-bottom: .1em; }
.place-hero .ph-sub { font-size: 1.1rem; color: rgba(255, 255, 255, .88); max-width: 700px; }
.place-hero .crumbs { position: absolute; top: 18px; left: 0; right: 0; }
.place-hero .crumbs .wrap { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.photo-credit { position: absolute; right: 12px; bottom: 8px; font-size: .68rem; color: rgba(255, 255, 255, .7); z-index: 2; text-align: right; max-width: 70%; }
.photo-credit a { color: inherit; }
.ph-toggle { display: inline-flex; gap: 6px; }
.place-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 34px; padding: 34px 0 90px; }
.story { font-family: var(--display); font-size: 1.3rem; line-height: 1.5; color: var(--forest-900); font-weight: 400; margin-bottom: 28px; }
.story::first-letter { font-size: 3.2em; float: left; line-height: .8; padding: 6px 10px 0 0; color: var(--forest-600); font-weight: 600; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 34px 0 14px; flex-wrap: wrap; }
.section-title h2 { font-size: 1.55rem; margin: 0; }

.pano { position: relative; border-radius: var(--radius); overflow: hidden; background: #0b2117; box-shadow: var(--shadow); }
.pano-scroll { overflow-x: auto; overflow-y: hidden; cursor: grab; scrollbar-width: thin; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.pano-scroll.dragging { cursor: grabbing; }
.pano-inner { position: relative; height: clamp(300px, 52vh, 520px); aspect-ratio: 2.4 / 1; }
.pano-inner svg.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.pano-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; pointer-events: none; }
.pano-bar > * { pointer-events: auto; }
.pano-label { font-size: .72rem; padding: 6px 10px; border-radius: 999px; }
.pano-ctrls { display: flex; gap: 6px; }
.pano-ctrls .icon-btn { background: rgba(255, 255, 255, .9); color: var(--forest-900); width: 40px; height: 40px; }
.hotspot { position: absolute; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: transparent; display: grid; place-items: center; z-index: 2; }
.hotspot::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); transition: transform .3s var(--ease), background .3s; }
.hotspot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); animation: pulse 2.2s ease-out infinite; }
.hotspot span { position: relative; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.hotspot:hover::before, .hotspot:focus-visible::before { transform: scale(1.15); }
.hotspot.found::after { animation: none; border-color: transparent; }
.hotspot.found::before { background: var(--forest-500); }
.hotspot.found span { background: #fff; width: 8px; height: 8px; }
.hidden-target { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; border: 0; background: transparent; cursor: pointer; z-index: 1; padding: 0; }
.hidden-target:focus-visible { outline: 3px dashed var(--gold); }
.hidden-target.found { box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(201, 162, 74, .8); background: rgba(255, 255, 255, .1); }
.hidden-mode .hotspot { opacity: .25; pointer-events: none; }
.pop { position: absolute; z-index: 5; width: min(320px, 80vw); padding: 16px 16px 14px; border-radius: 16px; background: rgba(255, 255, 255, .96); color: var(--ink); box-shadow: var(--shadow-lg); animation: popIn .35s var(--ease); }
.pop h4 { font-size: 1.1rem; margin: 0 0 4px; }
.pop p { font-size: .92rem; margin: 0; color: var(--ink-2); }
.pop .x { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.hunt-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.hunt-item { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--line); font-size: .85rem; font-weight: 600; color: var(--ink-3); background: #fff; }
.hunt-item.found { border-style: solid; border-color: var(--gold); color: #6d5310; background: #fbf4df; }

.facts-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.fact { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px; }
.fact .fi { width: 34px; height: 34px; border-radius: 10px; background: var(--mist); display: grid; place-items: center; color: var(--forest-600); font-weight: 800; font-size: .85rem; }
.fact p { margin: 0; }

.side-card { padding: 22px; margin-bottom: 18px; }
.side-card h3 { font-size: 1.15rem; }
.stamp-slot { display: flex; align-items: center; gap: 16px; }
.stamp-slot svg { width: 92px; height: 92px; flex: none; }
.progress { height: 8px; border-radius: 8px; background: var(--paper-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--moss), var(--forest-500)); transition: width .8s var(--ease); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9rem; margin: 0; }
.kv dt { font-weight: 700; color: var(--ink-2); }
.kv dd { margin: 0; color: var(--ink-2); }
.sound-ctl { display: flex; align-items: center; gap: 10px; }
.sound-ctl input[type=range] { flex: 1; accent-color: var(--forest-600); }
.place-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; }

/* ---------- Missions ---------- */
.mission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.mission-card { display: flex; flex-direction: column; padding: 24px; text-decoration: none; color: inherit; transition: transform .3s var(--ease), box-shadow .3s; position: relative; overflow: hidden; }
.mission-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mission-card .m-ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 16px; color: #fff; }
.mission-card .m-ico svg { width: 28px; height: 28px; }
.mission-card h3 { margin-bottom: .25em; }
.mission-card p { color: var(--ink-2); font-size: .93rem; flex: 1; }
.mission-card .m-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.mission-card.done { border-color: rgba(47, 122, 79, .4); }
.mission-card.done::after { content: "✓ Complete"; position: absolute; top: 18px; right: 18px; font-size: .75rem; font-weight: 700; color: var(--forest-600); background: var(--mist); padding: 4px 10px; border-radius: 999px; }
.mission-card.lockedm { opacity: .6; }

.game { max-width: 860px; margin: 0 auto; }
.game-head { text-align: center; margin-bottom: 26px; }
.game-head p { color: var(--ink-2); max-width: 640px; margin: 0 auto; }
.game-panel { padding: clamp(18px, 3vw, 32px); }
.q-count { font-size: .8rem; font-weight: 700; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.q-text { font-family: var(--display); font-size: clamp(1.2rem, 2.2vw, 1.55rem); line-height: 1.35; margin: 8px 0 20px; }
.options { display: grid; gap: 10px; }
.opt { text-align: left; padding: 14px 18px; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-weight: 550; transition: border-color .2s, background .2s, transform .2s; min-height: 52px; display: flex; gap: 12px; align-items: center; }
.opt:hover:not([disabled]) { border-color: var(--forest-400); background: var(--mist); }
.opt .k { width: 28px; height: 28px; border-radius: 8px; background: var(--paper-2); display: grid; place-items: center; font-size: .8rem; font-weight: 800; flex: none; }
.opt.right { border-color: var(--ok); background: #e7f3ea; }
.opt.wrong { border-color: var(--danger); background: #f9e9e4; animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.feedback { margin-top: 16px; padding: 14px 16px; border-radius: 14px; font-size: .95rem; }
.feedback.ok { background: #e7f3ea; color: #1d4a33; }
.feedback.no { background: #f9ece6; color: #7a3420; }
.game-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.dest-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dest-chip { padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: .9rem; text-align: left; transition: all .2s; }
.dest-chip:hover:not([disabled]) { border-color: var(--forest-400); }
.dest-chip.wrong { border-color: var(--danger); background: #f9e9e4; }
.dest-chip.right { border-color: var(--ok); background: #e7f3ea; }
.map-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 18px 0; }
.map-tile { aspect-ratio: 1; border-radius: 10px; background: var(--paper-2); border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; position: relative; }
.map-tile svg { width: 100%; height: 100%; }
.map-tile.on { border: 0; animation: tileIn .6s var(--ease); }
@keyframes tileIn { from { transform: rotateY(90deg) scale(.8); } }
.map-tile .q { font-family: var(--display); font-size: 1.4rem; color: var(--ink-3); }
.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; touch-action: none; user-select: none; }
.order-item.dragging { box-shadow: var(--shadow-lg); border-color: var(--gold); z-index: 3; position: relative; }
.order-item .grip { color: var(--ink-3); cursor: grab; }
.order-item .ord-btns { display: flex; gap: 4px; }
.order-item .ord-btns button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.order-item.right { border-color: var(--ok); background: #e7f3ea; }
.order-item.wrong { border-color: var(--danger); background: #f9ece6; }
.match-cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.match-col { display: grid; gap: 8px; align-content: start; }
.match-btn { text-align: left; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: .92rem; font-weight: 550; min-height: 48px; transition: all .2s; }
.match-btn:hover:not([disabled]) { border-color: var(--forest-400); }
.match-btn.sel { border-color: var(--gold); background: #fbf4df; }
.match-btn.done { border-color: var(--ok); background: #e7f3ea; color: var(--forest-800); cursor: default; }
.match-btn.wrong { border-color: var(--danger); animation: shake .4s; }
.match-btn .pairno { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: #fff; font-size: .72rem; margin-right: 8px; }
.num-input { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.num-input input { width: 180px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); font-size: 1.1rem; font-weight: 600; }
.num-input input:focus { border-color: var(--forest-500); outline: none; }
.statepick-map { height: 430px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #e3ecee; }
.climate-stage { position: relative; border-radius: 18px; overflow: hidden; background: #cfe3ea; }
.climate-stage svg { width: 100%; height: auto; }
.climate-range { width: 100%; margin-top: 14px; accent-color: var(--forest-600); height: 30px; }
.step-card { margin-top: 14px; padding: 16px 18px; border-radius: 14px; background: var(--mist); min-height: 96px; }
.step-card h4 { font-size: 1.1rem; margin: 0 0 4px; }
.result-hero { text-align: center; padding: 30px 10px 10px; }
.result-hero .big { font-family: var(--display); font-size: 3.4rem; font-weight: 600; color: var(--forest-700); line-height: 1; }

/* ---------- Passport ---------- */
.passport { display: grid; grid-template-columns: 360px 1fr; gap: 26px; align-items: start; }
.pp-cover { padding: 28px; border-radius: 22px; color: #f4e9c8; background: radial-gradient(120% 80% at 20% 0%, #24543c, #0f2a1d 70%); box-shadow: var(--shadow-lg); position: sticky; top: calc(var(--topbar) + 20px); overflow: hidden; }
.pp-cover::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(234, 217, 166, .3); border-radius: 16px; pointer-events: none; }
.pp-cover .pp-emblem { width: 92px; height: 92px; margin: 6px auto 12px; }
.pp-cover h2 { text-align: center; color: var(--gold-soft); font-size: 1.15rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; }
.pp-avatar { width: 96px; height: 96px; border-radius: 50%; margin: 18px auto 10px; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 4px rgba(234, 217, 166, .5); }
.pp-avatar svg { width: 60px; height: 60px; }
.pp-name { text-align: center; font-family: var(--display); font-size: 1.6rem; color: #fff; }
.pp-rank { text-align: center; font-size: .85rem; color: var(--gold-soft); margin-bottom: 16px; }
.pp-cover .progress { background: rgba(255, 255, 255, .12); }
.pp-cover .progress i { background: linear-gradient(90deg, var(--gold-soft), var(--gold)); }
.pp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; text-align: center; }
.pp-stats b { display: block; font-family: var(--display); font-size: 1.5rem; color: #fff; }
.pp-stats span { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.pp-pages { display: grid; gap: 22px; }
.pp-page { padding: 26px; background: #fffdf6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke='%23e9e2c8' stroke-width='.6'%3E%3Cpath d='M0 80 Q40 60 80 80 T160 80'/%3E%3Cpath d='M0 100 Q40 80 80 100 T160 100'/%3E%3Cpath d='M0 60 Q40 40 80 60 T160 60'/%3E%3C/g%3E%3C/svg%3E"); border: 1px solid #ece4c8; }
.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; }
.stamp-cell { text-align: center; }
.stamp-cell .slot { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #d9cfab; display: grid; place-items: center; color: #b7aa80; font-size: .75rem; padding: 10px; }
.stamp-cell svg { width: 100%; height: auto; }
.stamp-cell .got { animation: stampIn .7s var(--ease) both; }
@keyframes stampIn { 0% { transform: scale(1.8) rotate(-30deg); opacity: 0; } 60% { transform: scale(.94) rotate(-8deg); opacity: 1; } 100% { transform: scale(1) rotate(-6deg); } }
.stamp-cell .lbl { font-size: .8rem; font-weight: 650; margin-top: 6px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.badge { text-align: center; padding: 16px 10px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.badge svg { width: 64px; height: 64px; margin: 0 auto 8px; }
.badge b { display: block; font-size: .88rem; line-height: 1.2; }
.badge span { font-size: .75rem; color: var(--ink-3); }
.badge.locked svg { filter: grayscale(1); opacity: .35; }
.badge.locked b { color: var(--ink-3); }
.emblem-pick, .color-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.emblem-pick button, .color-pick button { width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; }
.emblem-pick button svg { width: 30px; height: 30px; }
.emblem-pick button[aria-pressed="true"], .color-pick button[aria-pressed="true"] { border-color: var(--forest-600); box-shadow: 0 0 0 3px rgba(47, 122, 79, .2); }
.color-pick button { border-radius: 50%; }

/* ---------- Journal ---------- */
.journal { display: grid; grid-template-columns: 380px 1fr; gap: 26px; align-items: start; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 650; font-size: .88rem; }
.field input, .field select, .field textarea { padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; }
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--forest-500); outline: none; box-shadow: 0 0 0 3px rgba(47, 122, 79, .12); }
.entries { display: grid; gap: 14px; }
.entry { padding: 20px 22px; position: relative; background: #fffdf8; }
.entry .e-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--ink-3); margin-bottom: 6px; }
.entry p { font-family: var(--display); font-size: 1.08rem; line-height: 1.55; margin: 0; white-space: pre-wrap; }
.entry.auto p { font-family: var(--ui); font-size: .95rem; color: var(--ink-2); }
.entry .del { position: absolute; top: 10px; right: 10px; }
.mood { display: flex; gap: 6px; flex-wrap: wrap; }
.mood button { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: .85rem; }
.mood button[aria-pressed="true"] { border-color: var(--forest-500); background: var(--mist); }

/* ---------- Gallery ---------- */
.gallery { columns: 3 300px; column-gap: 16px; }
.g-item { break-inside: avoid; margin-bottom: 16px; border-radius: 16px; overflow: hidden; position: relative; cursor: zoom-in; border: 0; padding: 0; width: 100%; display: block; background: #0b2117; }
.g-item img, .g-item svg { width: 100%; height: auto; display: block; transition: transform .6s var(--ease); }
.g-item:hover img, .g-item:hover svg { transform: scale(1.04); }
.g-item figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px; color: #fff; text-align: left; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .75)); font-size: .88rem; font-weight: 600; }
.g-item .tag { position: absolute; top: 10px; left: 10px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, .9); color: var(--forest-900); }
.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(4, 14, 9, .94); display: grid; grid-template-rows: 1fr auto; color: #fff; animation: fade .3s; }
.lightbox .lb-stage { display: grid; place-items: center; padding: 60px 70px 10px; min-height: 0; }
.lightbox .lb-stage img, .lightbox .lb-stage svg { max-width: 100%; max-height: 78vh; width: auto; height: auto; border-radius: 10px; }
.lightbox .lb-stage svg { width: min(100%, 1200px); }
.lightbox .lb-cap { padding: 14px 24px 26px; text-align: center; font-size: .9rem; }
.lightbox .lb-cap small { display: block; opacity: .7; margin-top: 4px; }
.lightbox .lb-cap a { color: var(--gold-soft); }
.lightbox .lb-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .12); color: #fff; width: 52px; height: 52px; }
.lightbox .lb-prev { left: 12px; }
.lightbox .lb-next { right: 12px; }
.lightbox .lb-close { position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, .12); color: #fff; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Fact cards ---------- */
.flip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; perspective: 1400px; }
.flip { position: relative; height: 270px; border: 0; padding: 0; background: transparent; cursor: pointer; text-align: left; }
.flip .fc { position: absolute; inset: 0; border-radius: 20px; padding: 22px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .7s var(--ease); display: flex; flex-direction: column; overflow: hidden; }
.flip .front { color: #fff; justify-content: flex-end; isolation: isolate; }
.flip .front .art, .flip .front .art svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.flip .front::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 20%, rgba(5, 18, 12, .85)); }
.flip .front h3 { font-size: 1.3rem; margin: 0; }
.flip .front .q { font-size: .9rem; opacity: .9; }
.flip .back { transform: rotateY(180deg); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.flip .back p { font-family: var(--display); font-size: 1.1rem; line-height: 1.45; margin: 8px 0 0; flex: 1; }
.flip.flipped .front { transform: rotateY(-180deg); }
.flip.flipped .back { transform: rotateY(0); }
.flip .learned { position: absolute; top: 12px; right: 12px; z-index: 2; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filters button { padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: .85rem; }
.filters button[aria-pressed="true"] { background: var(--forest-700); border-color: var(--forest-700); color: #fff; }

/* ---------- Guide / teacher ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 26px; overflow-x: auto; }
.tabs button { padding: 12px 16px; border: 0; background: transparent; font-weight: 650; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--forest-800); border-color: var(--forest-500); }
.obj-list { counter-reset: o; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.obj-list li { counter-increment: o; display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 16px 18px; }
.obj-list li::before { content: counter(o); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--forest-700); color: #fff; font-weight: 800; font-family: var(--display); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.answer { display: none; margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: #e7f3ea; color: var(--forest-800); font-size: .9rem; }
.show-answers .answer { display: block; }
.rubric { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rubric th, .rubric td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rubric th { width: 160px; font-family: var(--display); }

/* ---------- Settings & misc ---------- */
.settings-list { display: grid; gap: 12px; max-width: 760px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 20px; }
.setting p { margin: 2px 0 0; font-size: .88rem; color: var(--ink-3); }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cfd6cf; transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--forest-500); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.credits-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.credits-table td, .credits-table th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

/* ---------- Toasts & modal ---------- */
#toasts { position: fixed; z-index: 4000; top: calc(var(--topbar) + 12px); right: 16px; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: rgba(15, 42, 29, .94); color: #fff; box-shadow: var(--shadow-lg); animation: toastIn .5s var(--ease) both; }
.toast.out { animation: toastOut .4s var(--ease) both; }
.toast .t-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.toast .t-ico svg { width: 26px; height: 26px; }
.toast b { display: block; font-size: .95rem; }
.toast span { font-size: .82rem; opacity: .85; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.modal-back { position: fixed; inset: 0; z-index: 3500; background: rgba(6, 20, 13, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 18px; animation: fade .25s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; border-radius: 24px; background: var(--paper); padding: 30px; box-shadow: var(--shadow-lg); animation: popIn .4s var(--ease); position: relative; }
.modal .x { position: absolute; top: 12px; right: 12px; }
.modal h2 { font-size: 1.7rem; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 5000; }

.cert { max-width: 860px; margin: 0 auto; aspect-ratio: 1.414; background: #fffdf5; border: 12px solid var(--forest-800); outline: 2px solid var(--gold); outline-offset: -26px; padding: 7% 8%; text-align: center; display: flex; flex-direction: column; justify-content: center; position: relative; box-shadow: var(--shadow); }
.cert h1 { font-size: clamp(1.6rem, 4vw, 2.8rem); color: var(--forest-800); }
.cert .who { font-family: var(--display); font-style: italic; font-size: clamp(1.8rem, 5vw, 3.2rem); color: var(--forest-900); border-bottom: 1px solid var(--gold); display: inline-block; padding: 0 30px 6px; margin: 10px auto 18px; }
.cert .seal { position: absolute; right: 7%; bottom: 8%; width: 110px; height: 110px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav a span { display: none; }
  .nav a { padding: .55em .65em; }
  .map-view { grid-template-columns: 340px 1fr; }
  .place-body { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  :root { --topbar: 58px; --tabbar: 66px; }
  .nav { display: none; }
  .topbar { padding: 0 12px; }
  .topbar .xp-pill { margin-left: auto; }
  .brand-text span { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(251, 250, 245, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); transition: transform .4s var(--ease); }
  body.landing .tabbar { transform: translateY(110%); }
  .tabbar a { display: grid; place-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--ink-3); font-size: .68rem; font-weight: 650; }
  .tabbar a svg { width: 23px; height: 23px; }
  .tabbar a[aria-current="page"] { color: var(--forest-700); }
  .tabbar a[aria-current="page"] svg { transform: translateY(-1px); }
  main#view { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  body.landing main#view { padding-bottom: 0; }
  .map-view { grid-template-columns: 1fr; grid-template-rows: 1fr auto; height: calc(100svh - var(--topbar) - var(--tabbar)); }
  .map-canvas { grid-row: 1; }
  .map-panel { grid-row: 2; max-height: 46svh; border-right: 0; border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; margin-top: -20px; box-shadow: 0 -10px 30px rgba(0, 0, 0, .08); }
  .map-panel-inner { padding: 16px 16px 20px; }
  .map-panel .grab { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 8px auto 0; }
  .map-legend { display: none; }
  .map-note { top: 10px; font-size: .7rem; max-width: 92%; white-space: normal; text-align: center; }
  .travel-bar { padding: 10px 16px; }
  .passport, .journal { grid-template-columns: 1fr; }
  .pp-cover { position: relative; top: 0; }
  .match-cols { grid-template-columns: 1fr; }
  .hero-top .btn { display: none; }
  .page { padding: 26px 0 60px; }
  .place-hero { height: 62svh; min-height: 380px; }
  .story { font-size: 1.15rem; }
  #toasts { top: auto; bottom: calc(var(--tabbar) + 12px); right: 12px; left: 12px; width: auto; }
  .gallery { columns: 2 160px; }
  .lightbox .lb-stage { padding: 56px 10px 10px; }
  .lightbox .lb-btn { top: auto; bottom: 74px; transform: none; }
  .statepick-map { height: 360px; }
}
@media (max-width: 480px) {
  .wrap { width: calc(100% - 28px); }
  .hero-actions .btn { width: 100%; }
  .map-stats { grid-template-columns: 1fr 1fr; }
  .seg button { padding: .5em .7em; font-size: .82rem; }
  .flip { height: 250px; }
  .map-tiles { gap: 4px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
body.rm *, body.rm *::before, body.rm *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }

/* ---------- Print ---------- */
@media print {
  .topbar, .tabbar, #toasts, .no-print, .site-footer, .btn, .tabs { display: none !important; }
  main#view { padding: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
  .answer { display: block !important; }
  .print-only { display: block !important; }
  .cert { box-shadow: none; page-break-inside: avoid; }
}
.print-only { display: none; }

/* ---------- Scene animation ---------- */
.scene .drift { animation: drift 70s ease-in-out infinite alternate; }
.scene .drift.slow { animation-duration: 110s; }
.scene .flow { animation: flow 1.1s linear infinite; }
.scene .flow.f2 { animation-duration: .8s; }
.scene .flowv { stroke-dasharray: 14 10; animation: flow 1s linear infinite; }
.scene .rainl { animation: rain .55s linear infinite; }
.scene .shim { animation: shim 4s ease-in-out infinite; }
.scene .bob { animation: bob 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.scene .trainmove { animation: train 18s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-60px); } to { transform: translateX(80px); } }
@keyframes flow { to { stroke-dashoffset: -56; } }
@keyframes rain { from { transform: translate(0, -40px); } to { transform: translate(-8px, 40px); } }
@keyframes shim { 50% { opacity: .15; } }
@keyframes bob { 50% { transform: translateY(6px); } }
@keyframes train { from { transform: translateX(-120px); } to { transform: translateX(160px); } }
.scene.paused * { animation-play-state: paused !important; }
.ico { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.18em; }
.eyebrow .ico { width: 1.25em; height: 1.25em; }
[hidden] { display: none !important; }
.map-panel { grid-column: 1; grid-row: 1; }
.map-canvas { grid-column: 2; grid-row: 1; }
@media (max-width: 820px) { .map-panel, .map-canvas { grid-column: 1; } .map-canvas { grid-row: 1; } .map-panel { grid-row: 2; } }
.place-body > *, .passport > *, .journal > *, .map-view > * { min-width: 0; }
@media (max-width: 520px) { .mode-badge { display: none; } }

/* ---------- Real media ---------- */
.tour { outline: none; }
.tour-stage { position: relative; aspect-ratio: 16 / 10; max-height: 72vh; width: 100%; border-radius: var(--radius); overflow: hidden; background: #0b2117; box-shadow: var(--shadow); }
.tour-stage:fullscreen { max-height: none; border-radius: 0; aspect-ratio: auto; }
.tour-bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(28px) brightness(.55) saturate(1.2); transform: scale(1.1); }
.tour-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transform: scale(1.03); transition: opacity .7s var(--ease), transform 6s ease-out; }
.tour-img.in { opacity: 1; transform: scale(1); }
.tour-load { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; color: rgba(255,255,255,.8); font-size: .85rem; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--lime); animation: spin 1s linear infinite; display: block; margin: 0 auto; }
.tour-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.88); color: var(--forest-900); width: 46px; height: 46px; z-index: 2; }
.tour-nav.prev { left: 12px; } .tour-nav.next { right: 12px; }
.tour-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; z-index: 2; }
.tour-top .chip { background: rgba(0,0,0,.5); color: #fff; }
.tour-btn { background: rgba(0,0,0,.45); color: #fff; width: 40px; height: 40px; }
.tour-btn:hover { background: rgba(0,0,0,.65); }
.tour-cap { padding: 12px 4px 4px; }
.tour-cap b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.08rem; }
.tour-cap small { color: var(--ink-3); font-size: .78rem; }
.tour-cap small a { color: var(--ink-2); }
.tour-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 4px; scrollbar-width: thin; }
.tour-thumbs button { flex: none; width: 92px; height: 62px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--paper-2); opacity: .7; transition: opacity .2s, border-color .2s; }
.tour-thumbs button[aria-selected="true"] { border-color: var(--forest-500); opacity: 1; }
.tour-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.rpano { position: relative; border-radius: var(--radius); overflow: hidden; background: #0b2117; box-shadow: var(--shadow); }
.rpano-scroll { position: relative; height: clamp(280px, 56vh, 560px); overflow-x: auto; overflow-y: hidden; cursor: grab; scrollbar-width: thin; }
.rpano-scroll.dragging { cursor: grabbing; }
.rpano-scroll img { height: 100%; width: auto; max-width: none; display: block; user-select: none; -webkit-user-drag: none; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.vcard { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.vcard video, .vcard iframe, .vcard .yt-facade { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; max-height: 70vh; }
.vcard figcaption { padding: 12px 14px 14px; }
.vcard figcaption b { display: block; font-size: .98rem; }
.vcard figcaption small { color: var(--ink-3); font-size: .76rem; }
.yt-facade { position: relative; padding: 0; cursor: pointer; overflow: hidden; }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.yt-facade:hover img { transform: scale(1.04); }
.yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.92); color: var(--forest-900); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.yt-play svg { width: 28px; height: 28px; margin-left: 4px; }
.yt-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px; text-align: left; color: #fff; font-weight: 600; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.film-wrap { max-width: 900px; margin-top: 22px; }
.g-vid { position: relative; aspect-ratio: 16 / 10; background: #0b2117; }
.g-vid img { width: 100%; height: 100%; object-fit: cover; }
.lb-video { width: min(1100px, 100%); }
.lb-video .vcard { background: transparent; border: 0; }
.lb-video figcaption { display: none; }
.arrive-photo { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .8s; }
.arrive-photo.loaded { opacity: 1; }
.arrive-credit { position: absolute; right: 8px; bottom: 6px; font-size: .62rem; color: rgba(255,255,255,.85); text-shadow: 0 1px 3px rgba(0,0,0,.8); z-index: 1; }
.arrive-credit a { color: inherit; }
.pop-photo { width: calc(100% + 32px); margin: -14px -16px 10px; height: 120px; object-fit: cover; border-radius: 16px 16px 0 0; display: block; max-width: none; }
.tabs .muted { font-weight: 500; }
@media (max-width: 820px) { .tour-stage { aspect-ratio: 4 / 3.4; } .tour-thumbs button { width: 74px; height: 52px; } .vgrid { grid-template-columns: 1fr; } }
