/* Lumen's world: the 3D map (/world). Ported from the design prototype. */

:root {
  --bg: #04060c;
  --panel: rgba(12, 14, 22, 0.86);
  --line: rgba(255, 255, 255, 0.10);
  --text: #f3ece0;
  --soft: #d8d0c2;
  --muted: #8f97a8;
  --warm: #ffc66e;
  --serif: "Fraunces", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #04060c; } }
:root[data-theme="dark"] { --bg: #04060c; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
body { color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; touch-action: none; }
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }

.labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.isl { position: absolute; transform: translate(-50%, -50%); padding: 0; border: 0; background: none; border-radius: 50%;
  pointer-events: auto; cursor: default; }
.isl .tt { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; padding: 4px 9px;
  border-radius: 8px; background: rgba(8,8,12,.85); font: 400 14px/1.3 var(--serif); color: var(--text); opacity: 0; pointer-events: none; transition: opacity .2s; }
.isl .tt small { font: 400 11px/1 var(--mono); color: var(--muted); margin-left: 6px; }
.isl:hover .tt, .isl:focus-visible .tt, .isl.tap .tt { opacity: 1; }
.mini { width: 15px; height: 15px; vertical-align: -3px; margin-left: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fog { position: absolute; transform: translate(-50%, -50%); max-width: 220px; text-align: center; font: italic 300 15px/1.4 var(--serif);
  color: #9aa3bd; text-shadow: 0 0 10px rgba(140, 160, 220, .3); }

.chip { pointer-events: auto; border: 1px solid var(--line); background: rgba(10,12,18,.6); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; color: var(--soft); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); flex: none; }
.chip:hover { color: var(--text); border-color: rgba(255,255,255,.22); }
.chip[hidden] { display: none; }

.bottom { position: fixed; left: 0; right: 0; bottom: 0; padding: 28px 16px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(4,6,12,0), rgba(4,6,12,.82) 55%);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.bottom[hidden] { display: none; }
.when { font: 400 13px/1.3 var(--mono); color: var(--soft); min-height: 1.3em; display: flex; gap: 12px; align-items: baseline; }
.hint { color: var(--muted); font: 400 12.5px/1.3 var(--sans); }
.navrow { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.nb { padding: 7px 14px; }
.nb:disabled { opacity: .35; cursor: default; }
.dots { position: relative; flex: 1; display: flex; justify-content: space-between; align-items: center; max-width: 560px; height: 28px; }
.dots::before { content: ""; position: absolute; left: 7px; right: 7px; top: 50%; height: 1px; background: rgba(255,255,255,.18); }
.dots button { position: relative; width: 28px; height: 28px; padding: 0; border: 0; background: none; display: grid; place-items: center; }
.dots button i { width: 9px; height: 9px; border-radius: 50%; background: #3a4256; border: 1px solid rgba(255,255,255,.25); transition: all .3s; }
.dots button.done i { background: rgba(255,198,110,.55); border-color: transparent; }
.dots button.now i { width: 14px; height: 14px; background: var(--warm); box-shadow: 0 0 12px var(--warm); border-color: transparent; }
.pt { position: absolute; transform: translate(-50%, 0); white-space: nowrap; font: 400 16px/1.2 var(--serif); color: #fff3df;
  text-shadow: 0 0 10px rgba(255,190,100,.7), 0 1px 6px #000; opacity: 0; transition: opacity .4s; }
.pt.on { opacity: 1; }

.stop { position: fixed; left: 16px; bottom: 104px; width: 360px; padding: 18px 20px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0,0,0,.5); opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s; pointer-events: none; }
.stop.on { opacity: 1; transform: none; }
.stop .d { font: 400 12.5px/1 var(--mono); color: var(--warm); }
.stop h2 { margin: 8px 0 6px; font: 400 26px/1.15 var(--serif); }
.stop p { margin: 0; color: var(--soft); font-size: 15px; line-height: 1.55; }

.tip { position: fixed; pointer-events: none; padding: 4px 9px; border-radius: 8px; background: rgba(8,8,12,.8); font: 400 14px/1.3 var(--serif);
  color: var(--text); transform: translate(12px, -50%); white-space: nowrap; display: none; }

.card { position: fixed; right: 16px; top: 64px; width: 340px; max-height: calc(100% - 180px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 16px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; pointer-events: none; }
.card.open { opacity: 1; transform: none; pointer-events: auto; }
.card .x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255,255,255,.06);
  color: var(--muted); font-size: 18px; line-height: 1; }
.card .x:hover { color: var(--text); }
.card .head { display: flex; gap: 14px; align-items: center; margin-right: 34px; }
.card canvas { width: 72px; height: 72px; border-radius: 6px; background: #0b0a10; flex: none; image-rendering: pixelated; }
.card .meta { margin: 0 0 2px; color: var(--muted); font-size: 12.5px; }
.card h2 { margin: 0; font: 400 21px/1.2 var(--serif); }
.card .story { margin: 14px 0 0; color: var(--soft); font-size: 14.5px; line-height: 1.6; }
.card details { margin-top: 12px; color: var(--soft); }
.card summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.card details p { margin: 6px 0 0; font: italic 300 15px/1.6 var(--serif); }
.card .art { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }

@media (max-width: 640px) {
  .stop { left: 12px; right: 12px; width: auto; bottom: 108px; padding: 14px 16px; }
  .stop p { font-size: 14px; }
  .nb { padding: 7px 11px; }
  .stop h2 { font-size: 22px; }
  .card { left: 12px; right: 12px; width: auto; top: auto; bottom: 108px; max-height: 52%; }
  .isl { font-size: 13px; }
  .fog { font-size: 13px; max-width: 150px; }
}
@media (prefers-reduced-motion: reduce) { .card, .stop, .pt { transition: none; } }
.loading { position: fixed; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; pointer-events: none; transition: opacity .6s; }
.err { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--soft); }

.err[hidden] { display: none; }
.err a { color: var(--warm); }
.wtop { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 10px; padding: max(14px, env(safe-area-inset-top)) 16px 18px; pointer-events: none; z-index: 3; background: linear-gradient(rgba(4,6,12,.85), rgba(4,6,12,0)); }
.wnav { display: flex; align-items: center; gap: 4px; pointer-events: auto; font-size: 14px; }
.wnav a { color: var(--soft); text-decoration: none; padding: 6px 8px; border-radius: 8px; }
.wnav a:hover { color: var(--text); }
.wnav .brand { font: 400 21px/1 var(--serif); color: var(--text); display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; }
.wnav .mark { width: 10px; height: 10px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 10px var(--warm); }
.wbtns { display: flex; gap: 8px; }
.more { display: block; margin-top: 14px; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255,198,110,.45); text-align: center;
  background: rgba(255,198,110,.08); color: var(--text); font: 500 13.5px/1.2 var(--sans); text-decoration: none; }
.more:hover { background: rgba(255,198,110,.16); }
.card .story:empty { display: none; }
@media (max-width: 640px) { .wnav { font-size: 13px; } .wnav .brand { font-size: 18px; } .card { top: auto; } }
