:root {
  --bg: #12100e;
  --bg-raise: #1b1714;
  --bg-sunken: #0e0c0b;
  --line: #3a3128;
  --line-soft: #2a241e;
  --text: #f3ecdf;
  --muted: #b3a38d;
  --gold: #e2b65a;
  --gold-dim: #8c7040;
  --share: #8fce9a;
  --share-bg: #1c3324;
  --grab: #f0c27a;
  --grab-bg: #3a2c18;
  --coord: #d7c4a3;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --top: 58px;
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--top) + 12px); }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(226, 182, 90, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--top);
  padding: 8px 18px;
  background: rgba(18, 16, 14, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

.menu {
  display: none;
  font: inherit;
  color: var(--text);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--gold-dim);
}

.brand strong {
  display: block;
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.brand em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.find {
  margin-left: auto;
}

.find input {
  width: min(280px, 36vw);
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
}

.find input:focus {
  outline: 2px solid var(--gold-dim);
  outline-offset: 1px;
}

::highlight(find) {
  background: var(--gold);
  color: #1a140c;
}

.shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr) 210px;
  align-items: start;
}

.nav, .toc {
  position: sticky;
  top: var(--top);
  max-height: calc(100vh - var(--top));
  overflow: auto;
  padding: 18px 14px 32px;
}

.nav { border-right: 1px solid var(--line-soft); }

.toc {
  border-left: 1px solid var(--line-soft);
  font-size: 0.86rem;
}

.nav-group {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.nav-label {
  margin: 0 8px 6px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.nav a img {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  flex: none;
}

.nav a:hover { background: var(--bg-raise); }

.nav a[aria-current="page"] {
  background: #2a2318;
  box-shadow: inset 2px 0 0 var(--gold);
}

.toc-title {
  margin: 4px 8px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toc a {
  display: block;
  margin: 0;
  padding: 4px 8px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
}

.toc a.h3 { padding-left: 16px; }

.toc a:hover,
.toc a.is-current { color: var(--text); background: var(--bg-raise); }

.toc a.is-current { box-shadow: inset 2px 0 0 var(--gold); }

main { min-width: 0; }

.article {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 32px 96px;
}

.article h1, .article h2, .article h3 {
  font-family: var(--display);
  font-weight: 560;
  line-height: 1.25;
  letter-spacing: 0.01em;
  scroll-margin-top: calc(var(--top) + 14px);
}

.article h1 {
  margin: 0 0 12px;
  font-size: 2rem;
}

.article h2 {
  margin: 2.2rem 0 0.7rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line-soft);
  font-size: 1.45rem;
}

.article h3 { margin: 1.6rem 0 0.5rem; font-size: 1.15rem; }

.article h1 img, .article h2 img, .article h3 img {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  vertical-align: -7px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--gold-dim);
}

.article p { margin: 0.7rem 0; }

.article a { color: #8ec5ef; text-decoration-thickness: 1px; text-underline-offset: 2px; overflow-wrap: anywhere; }
.article a .iconsmall,
.article a .fallback-icon {
  width: 18px;
  height: 18px;
  margin: 0 4px 0 0;
  vertical-align: -3px;
  border-radius: 3px;
}
.article a:hover { color: #c5e4fa; }

.article img {
  width: 18px;
  height: 18px;
  margin-right: 3px;
  vertical-align: -3px;
  border-radius: 3px;
}

.article :is(h1, h2, h3) img { width: 32px; height: 32px; }

.article strong { color: #f6e7c1; font-weight: 650; }

.article ul, .article ol { margin: 0.5rem 0 0.8rem; padding-left: 1.3rem; }
.article li { margin: 0.28rem 0; }
.article li > ul, .article li > ol { margin: 0.2rem 0 0.35rem; }

.article ol {
  list-style: none;
  counter-reset: step;
  padding-left: 0;
}

.article ol > li {
  counter-increment: step;
  position: relative;
  margin: 0.7rem 0;
  padding-left: 2.7rem;
}

.article ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #241e16;
  color: var(--gold);
  border: 1px solid #5a4830;
  font-size: 0.75rem;
  font-weight: 700;
}

.article ol ol { list-style: decimal; counter-reset: none; padding-left: 1.3rem; }
.article ol ol > li { counter-increment: none; padding-left: 0; margin: 0.25rem 0; }
.article ol ol > li::before { content: none; }

.table-wrap {
  margin: 0.8rem 0 1.2rem;
  overflow-x: auto;
  overflow-y: clip;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-raise);
  box-shadow: var(--shadow);
}

.article table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.article th, .article td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-soft);
}

.article thead th {
  position: static;
  background: #2a2318;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid #5a4830;
}

.article td img,
.article th img,
.article td .iconsmall,
.article th .iconsmall {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0 0.35em 0 0;
  vertical-align: -3px;
}

.article td a {
  white-space: normal;
}

.article tr:last-child td { border-bottom: 0; }
.article tbody tr:hover td { background: rgba(226, 182, 90, 0.05); }
.article td:first-child {
  color: #f0d7a4;
  font-weight: 600;
  white-space: nowrap;
}

.article table a {
  display: inline;
  white-space: normal;
  line-height: 1.35;
}

.article table img,
.article table .iconsmall,
.article table ins {
  display: inline-block !important;
  position: static !important;
  float: none !important;
  width: 16px !important;
  height: 16px !important;
  margin: 0 0.35em 0 0 !important;
  vertical-align: -3px !important;
}

.article code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.84em;
  background: #2a241c;
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

.article code.tag {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.12em 0.45em;
  border-radius: 999px;
  vertical-align: 1px;
}

.article code.share { color: var(--share); background: var(--share-bg); }
.article code.grab { color: var(--grab); background: var(--grab-bg); }

.coord {
  color: var(--coord);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.callout {
  margin: 0.9rem 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: #241c12;
  border-radius: 0 8px 8px 0;
}

.article hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.4rem 0;
}

.article blockquote {
  margin: 0.8rem 0;
  padding-left: 12px;
  border-left: 3px solid var(--gold-dim);
  color: var(--muted);
}

.status {
  color: var(--muted);
  padding: 24px 0;
}

.rail {
  position: sticky;
  top: var(--top);
  z-index: 8;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 0 14px;
  padding: 8px 0 10px;
  background: linear-gradient(var(--bg) 75%, transparent);
}
.rail a {
  flex: none;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-raise);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
}
.rail a:hover { color: var(--text); border-color: var(--gold-dim); }

.article thead {
  display: table-header-group;
}

.article thead th {
  position: static;
  background: #2a2318;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.route-board {
  margin: 0.8rem 0 1.2rem;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(226, 182, 90, 0.08), transparent 42%),
    var(--bg-raise);
}
.board-label {
  margin: 0 4px 8px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.bands {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.bands a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 78px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-soft);
  color: var(--text);
  text-decoration: none;
}
.bands a:hover { border-color: var(--gold-dim); }
.bands .lv {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bands .zone, .bands .note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}
.bands .xp {
  display: block;
  position: relative;
  overflow: hidden;
  margin-top: auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: #241c12;
  color: #f6e7c1;
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bands .xp::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  background: rgba(226, 182, 90, 0.35);
}

.bxp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  margin: 0 0 1.2rem;
}
.bxp-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 112px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-soft);
}
.bxp-card h3 { margin: 0; font-size: 1rem; }
.bxp-card p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.bxp-card button {
  align-self: flex-start;
  margin-top: auto;
  padding: 4px 12px;
  font: inherit;
  font-size: 0.82rem;
  color: #f6e7c1;
  background: #241c12;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  cursor: pointer;
}
.bxp-card button:hover { border-color: var(--gold); }

.backdrop {
  display: none;
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 210px minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 760px) {
  .menu { display: inline-block; }
  .brand em { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav {
    position: fixed;
    z-index: 40;
    top: var(--top);
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    max-height: none;
    background: var(--bg);
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow);
  }
  .nav.open { transform: none; }
  .backdrop.show {
    display: block;
    position: fixed;
    z-index: 35;
    top: var(--top);
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.45);
  }
  .article { padding: 18px 16px 72px; }
  .article h1 { font-size: 1.55rem; }
  .find input { width: 42vw; }
}

body.is-map .shell { grid-template-columns: 228px minmax(0, 1fr); }
body.is-map .toc { display: none; }
.article.is-map { max-width: none; padding: 12px 16px 20px; }

.atlas-head h1 { margin: 0 0 6px; font-size: 1.55rem; }
.order-ok, .order-bad { margin: 0 0 8px; font-size: 0.92rem; }
.order-ok { color: var(--share); }
.order-bad { color: #f0b4a0; }
.order-jump, .zone-chip, .map-controls button {
  font: inherit;
  color: var(--text);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.order-jump { margin: 2px 4px 0 0; padding: 3px 8px; font-size: 0.78rem; }
.atlas-zones { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.zone-chip { flex: none; padding: 4px 10px; color: var(--muted); font-size: 0.82rem; }
.zone-chip.is-on { color: #1a140c; background: var(--gold); border-color: var(--gold); }

.atlas-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 12px;
  height: calc(100vh - var(--top) - 150px);
  min-height: 480px;
}
.map-frame, .atlas-meta {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-sunken);
}
.map-frame { position: relative; overflow: hidden; }
.article img.map-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 1024 / 683;
  object-fit: fill;
}
.map-controls {
  position: sticky;
  top: 8px;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin: 8px 8px 0;
}
.map-controls button { padding: 4px 10px; }
.map-stage { position: relative; margin: 8px; }
.article .map-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 1024 / 683;
  object-fit: fill;
  border-radius: 8px;
  background:
    linear-gradient(rgba(226, 182, 90, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 182, 90, 0.08) 1px, transparent 1px),
    #1a1612;
  background-size: 10% 10%;
}
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-path { fill: none; stroke: #f2d48a; stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0.9; }
.map-pins { position: absolute; inset: 0; }
.pin {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4px 0 0 -4px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #f2d48a;
  background: #241e16;
  color: transparent;
  font: 700 0/9px var(--sans);
  cursor: pointer;
}
.pin.is-on {
  z-index: 2;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  background: var(--gold);
  color: #1a140c;
  font-size: 10px;
  line-height: 22px;
}
.pin.is-bad { box-shadow: 0 0 0 2px #c45c4a; }
.map-tip {
  position: sticky;
  bottom: 0;
  margin: 0;
  padding: 8px 10px;
  background: rgba(14, 12, 11, 0.92);
  color: var(--text);
  font-size: 0.84rem;
}

.atlas-meta { overflow: auto; margin: 0; padding: 6px; list-style: none; }
.atlas-meta li {
  margin: 0 0 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
}
.atlas-meta li.is-on { border-color: var(--gold-dim); background: #2a2318; }
.atlas-meta li.is-bad { box-shadow: inset 3px 0 0 #c45c4a; }
.step-kicker { margin: 0; color: var(--gold); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; }
.atlas-meta li p { margin: 0.25rem 0; white-space: normal; overflow-wrap: anywhere; }
.atlas-meta li p:nth-child(2) {
  display: block;
  max-height: 4.6em;
  overflow: hidden;
}
.atlas-meta li.is-on p:nth-child(2) { max-height: none; }
.step-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-decoration: none;
}
.chip.accept { color: var(--share); background: var(--share-bg); }
.chip.turnin { color: var(--grab); background: var(--grab-bg); }
.step-where { color: var(--coord); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.step-why { color: #f0b4a0; font-size: 0.8rem; }

@media (max-width: 1100px) {
  body.is-map .shell { grid-template-columns: 210px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body.is-map .shell { grid-template-columns: minmax(0, 1fr); }
  .atlas-split { grid-template-columns: 1fr; height: auto; }
  .map-frame { height: 62vh; }
  .atlas-meta { height: 48vh; }
}

@media print {
  .topbar, .nav, .toc, .find { display: none !important; }
  body { background: white; color: black; }
  .article a { color: black; }
  .shell { display: block; }
}
