:root {
  --bg: rgba(16, 22, 38, 0.86);
  --line: rgba(140, 170, 230, 0.22);
  --text: #eef2fb;
  --muted: #9aa7c2;
  --accent: #3d8bff;
  --good: #3ecf8e;
  --warn: #ffc857;
  --bad: #ff6b6b;
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #131a2e; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
h2 { margin: 0 0 8px; font-size: 14px; letter-spacing: 0.02em; }
p { margin: 0; }
[hidden] { display: none !important; }

.panel { position: fixed; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; backdrop-filter: blur(6px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.brand { top: 14px; left: 14px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.brand strong { font-size: 17px; }
.brand span { color: var(--muted); }
#places { max-width: 210px; }
#osm-credit { position: fixed; right: 8px; bottom: 4px; font-size: 10px; color: rgba(255, 255, 255, 0.6); pointer-events: none; z-index: 5; }
.quest.collapsed { width: auto; max-height: none; overflow: visible; }
.quest.collapsed > :not(h2), .quest.collapsed #quest { display: none; }
.quest-toggle { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.quest-toggle::after { content: " ▸"; color: var(--muted); }
.quest-toggle[aria-expanded="true"]::after { content: " ▾"; }
.overview { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(92vh, 96vw); padding: 10px; z-index: 30; }
.overview-bar { display: flex; gap: 6px; margin-bottom: 8px; }
.overview canvas { display: block; width: 100%; height: auto; border-radius: 8px; cursor: crosshair; }

.quest { top: 70px; left: 14px; width: 270px; max-height: 52vh; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#quest { display: grid; gap: 6px; }
.quest-head { width: 100%; text-align: left; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.quest-head[aria-expanded="true"] { color: var(--text); background: rgba(61, 139, 255, 0.16); }
.quest-head.done { color: var(--good); }
.quest ol { list-style: none; margin: 8px 0 4px; padding: 0 2px; display: grid; gap: 6px; font-size: 14px; }
.quest li small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.quest li { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.quest li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.quest li.done { color: var(--text); }
.quest li.done::before { background: var(--good); border-color: var(--good); }
.quest li.now { color: var(--text); font-weight: 600; }
.quest li.now::before { border-color: var(--warn); }
.hint { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.4; }



.prompt { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 11px 20px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(61, 139, 255, 0.45); }
.toast { left: 50%; bottom: 84px; transform: translateX(-50%); max-width: 420px; font-size: 14px; line-height: 1.45; }
.toast b { display: block; margin-bottom: 4px; }
.toast p + p { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }

.button { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 9px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.button:disabled { opacity: 0.5; cursor: default; }

.dialog { position: fixed; inset: 0; background: rgba(5, 8, 16, 0.55); display: grid; place-items: center; }
.dialog-body { position: static; width: 360px; display: grid; gap: 10px; }
.note { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.error { color: var(--bad); font-size: 13px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }

.muted { color: var(--muted); }
.mono { font-family: Consolas, "Cascadia Mono", monospace; }

.chip { border: 1px solid var(--line); background: rgba(61, 139, 255, 0.16); color: var(--text); border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.chip.static { background: transparent; cursor: default; color: var(--warn) !important; }
.quest li .go { margin-left: auto; border: 1px solid var(--line); background: transparent; color: var(--accent); border-radius: 6px; padding: 1px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.quest li .go[aria-expanded="true"] { background: rgba(61, 139, 255, 0.16); }
.quest li.go-menu { justify-content: flex-end; gap: 6px; font-size: 12px; margin-top: -2px; }
.quest li.go-menu::before { display: none; }
.quest li.go-menu span { margin-right: auto; padding-left: 22px; }
.quest li.go-menu button { border: 1px solid var(--line); background: rgba(61, 139, 255, 0.16); color: var(--text); border-radius: 6px; padding: 2px 7px; font: inherit; cursor: pointer; white-space: nowrap; }
.quest li.go-menu button:hover { border-color: var(--accent); }
.hint.view { margin-top: 6px; color: var(--text); }
.prompt b { display: block; }
.prompt small { display: block; font-weight: 400; opacity: 0.85; font-size: 12px; }
.dialog-body.wide { width: min(560px, 92vw); }

.fade { position: fixed; inset: 0; background: #05070d; opacity: 0; pointer-events: none; transition: opacity 0.28s; }
.fade.on { opacity: 1; }

@media (max-width: 900px) {
  .quest { width: 220px; }
}
