:root {
  --ink: #f4efe6; --dim: rgba(244, 239, 230, .62); --gold: #e0b97c; --panel: rgba(18, 17, 15, .52);
  --line: rgba(244, 239, 230, .16); --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0c0e; color: var(--ink); font-family: var(--sans); }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#view:active { cursor: grabbing; }
button { font: inherit; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
button:hover { background: rgba(244, 239, 230, .12); border-color: rgba(244, 239, 230, .4); }
button.on { background: var(--gold); border-color: var(--gold); color: #1b1610; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

#loader { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; transition: opacity 1.4s ease;
  background: radial-gradient(120% 90% at 50% 100%, #3a2c1d 0%, #14110e 55%, #0a0a0b 100%); }
#loader.done { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; width: min(420px, 80vw); }
.eyebrow { letter-spacing: .32em; text-transform: uppercase; font-size: 11px; color: var(--gold); }
#loader h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 9vw, 84px); margin: 14px 0 30px; letter-spacing: .08em; }
.bar { height: 2px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s; }
#loadmsg { margin-top: 14px; font-size: 12px; color: var(--dim); letter-spacing: .06em; }

#ui { transition: opacity .5s; }
#ui.hidden { opacity: 0; pointer-events: none; }
#ui > * { position: fixed; z-index: 5; }
#top { top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px;
  background: linear-gradient(rgba(0, 0, 0, .42), transparent); pointer-events: none; }
#top > * { pointer-events: auto; }
.brand b { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: .34em; }
.brand span { margin-left: 14px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.tools { display: flex; gap: 8px; font-size: 12px; }
.tools button { backdrop-filter: blur(12px); background: var(--panel); }

#map { left: 18px; top: 50%; transform: translateY(-50%); padding: 8px; border-radius: 14px; background: var(--panel);
  backdrop-filter: blur(14px); border: 1px solid var(--line); }
#mapc { display: block; width: 75px; height: 310px; cursor: pointer; }

#places { right: 18px; top: 64px; bottom: 150px; width: 290px; border-radius: 14px; background: var(--panel);
  backdrop-filter: blur(18px); border: 1px solid var(--line); overflow: auto; transition: transform .35s, opacity .35s; }
#places.closed { transform: translateX(330px); opacity: 0; pointer-events: none; }
#placelist h3 { position: sticky; top: 0; margin: 0; padding: 12px 16px 6px; font: 400 11px var(--sans); letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold); background: rgba(18, 17, 15, .9); }
#placelist a { display: block; padding: 6px 16px; font-size: 13px; color: var(--dim); cursor: pointer; }
#placelist a:hover { color: var(--ink); background: rgba(244, 239, 230, .08); }
#placelist a.cur { color: var(--ink); box-shadow: inset 2px 0 var(--gold); }

#sky { right: 18px; bottom: 22px; width: 330px; padding: 12px 14px; border-radius: 14px; background: var(--panel);
  backdrop-filter: blur(14px); border: 1px solid var(--line); }
.skyrow { display: flex; align-items: center; gap: 10px; }
.skyrow button { width: 30px; height: 30px; padding: 0; font-size: 11px; flex: none; }
#clock { font-variant-numeric: tabular-nums; font-size: 13px; width: 40px; text-align: right; }
#time { flex: 1; appearance: none; height: 4px; border-radius: 4px; outline-offset: 6px;
  background: linear-gradient(90deg, #1b2440 0%, #e99a5b 8%, #9cc3e8 22%, #bcd8f0 55%, #f0c079 74%, #e07a45 82%, #232a4a 90%, #0b0d18 100%); }
#time::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); cursor: pointer; }
#time::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.chips button { font-size: 10.5px; padding: 3px 8px; color: var(--dim); }

#dock { left: 50%; bottom: 22px; transform: translateX(-50%); width: min(620px, calc(100vw - 760px)); min-width: 420px;
  display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; column-gap: 12px;
  padding: 14px 16px 12px; border-radius: 18px; background: var(--panel); backdrop-filter: blur(16px); border: 1px solid var(--line); }
.nav { width: 46px; height: 46px; padding: 0 0 4px; font-size: 28px; line-height: 1; }
#caption { text-align: center; min-height: 74px; transition: opacity .35s, transform .35s; }
#caption.swap { opacity: 0; transform: translateY(6px); }
#capgroup { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
#captitle { font-family: var(--serif); font-size: 25px; line-height: 1.15; margin: 5px 0 4px; }
#capsub { font-size: 12px; color: var(--dim); }
#dockrow { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 11.5px; color: var(--dim); }
#dockrow button { font-size: 11.5px; padding: 4px 11px; }
#count { font-variant-numeric: tabular-nums; }
.hint { margin-left: auto; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#progress { grid-column: 1 / -1; height: 2px; margin-top: 10px; background: var(--line); border-radius: 2px; overflow: hidden; }
#progress i { display: block; height: 100%; width: 0; background: var(--gold); }
#stats { left: 18px; bottom: 14px; font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; letter-spacing: .04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7); pointer-events: none; }
#toast { position: fixed; z-index: 30; left: 50%; top: 74px; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px;
  background: rgba(18, 17, 15, .8); font-size: 12px; opacity: 0; transition: opacity .4s; pointer-events: none; }
#toast.show { opacity: 1; }

@media (max-width: 1180px) {
  #sky { bottom: auto; top: 64px; right: 18px; width: 300px; }
  #places { top: 190px; }
  #dock { width: calc(100vw - 150px); min-width: 0; left: calc(50% + 48px); }
  .brand span, .hint { display: none; }
}
@media (max-width: 640px) {
  #map { display: none; }
  #dock { left: 50%; width: calc(100vw - 20px); bottom: 10px; }
  #sky { left: 10px; right: 10px; width: auto; }
  #captitle { font-size: 20px; }
  #stats { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
