/* Pathfinder: a route map over an encyclopedia. The bar on top is a transit
   line (start, every stop you've made, the target); the page below reads like
   a quiet reference book, with every usable link in teal. */

:root { --teal: #7fd3c7; --teal-ink: #0e6b61; --page: 'Source Serif 4', Georgia, serif; }
.pathfinder { --game: var(--teal); gap: 14px; }

.route { position: sticky; top: calc(57px + env(safe-area-inset-top)); z-index: 9; background: var(--paper); border-bottom: 1px solid var(--rule); }
.route-in { max-width: 500px; margin: 0 auto; padding: 10px 16px 8px; }
.line { display: flex; align-items: center; gap: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; }
.line::-webkit-scrollbar { display: none; }
.stop { flex: 0 0 auto; display: flex; align-items: center; }
.stop span {
  max-width: 132px; padding: 4px 9px; border-radius: 999px; border: 1.5px solid var(--teal-ink);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--paper);
}
.stop.first span { background: var(--teal-ink); color: #fff; }
.stop.goal span { border-style: dashed; color: var(--teal-ink); }
.stop.goal.reached span { border-style: solid; background: var(--green); border-color: var(--green); color: #fff; }
.stop + .stop::before { content: ''; width: 14px; height: 2px; background: var(--teal-ink); }
.stop.goal::before { background: repeating-linear-gradient(90deg, var(--teal-ink) 0 3px, transparent 3px 6px); }
.meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta span:first-child { color: var(--ink); font-weight: 700; }

.goal { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.goal p { margin: 0; font-size: 15px; }
.goal .btn { flex: 0 0 auto; white-space: nowrap; }
.goal b { font: 700 19px var(--slab); color: var(--teal-ink); }

.finder input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--rule);
  font: 500 16px var(--ui); background: var(--wash);
}
.finder input:focus { outline: none; border-color: var(--teal-ink); background: var(--paper); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips:empty { display: none; }
.chip-link {
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--teal-ink); background: #effaf8; cursor: pointer;
  font: 600 13.5px var(--ui); color: var(--teal-ink);
}
.chip-none { font-size: 13.5px; color: var(--muted); }
.chip-link.hot { background: var(--green); border-color: var(--green); color: #fff; }

.wiki { font: 400 17px/1.6 var(--page); color: #1d1d1d; min-height: 50vh; }
.wiki h2.title { margin: 4px 0 10px; font: 700 28px/1.15 var(--slab); color: var(--ink); }
.wiki h2 { margin: 22px 0 6px; font: 600 21px/1.2 var(--page); border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
.wiki h3 { margin: 16px 0 4px; font: 600 18px/1.25 var(--page); }
.wiki p { margin: 0 0 12px; }
.wiki ul { margin: 0 0 12px; padding-left: 22px; }
.wiki li { margin-bottom: 4px; }
.wiki a { color: var(--teal-ink); text-decoration: underline; text-decoration-color: rgba(14, 107, 97, 0.35); text-underline-offset: 2px; cursor: pointer; }
.wiki a:hover { text-decoration-color: currentColor; }
.wiki a.goal-link { background: #e6f5e4; color: #2d6a28; font-weight: 600; }
.wiki .loading { color: var(--muted); font-family: var(--ui); font-size: 15px; }

.credit { margin: 0; font-size: 12.5px; color: var(--muted); }
.credit a { color: var(--muted); }
.tools { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 8px; }

/* results */
.path-list { margin: 8px 0 14px; padding-left: 20px; font-size: 15px; }
.path-list li { margin-bottom: 3px; }
.d-body .best { margin: -6px 0 16px; font-size: 14px; color: var(--muted); }

.more { margin: 18px 0 8px; border-top: 1px solid var(--rule); padding-top: 12px; font-family: var(--ui); }
.more summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--teal-ink); }
.more .chips { margin-top: 10px; }
