/* Wolf's Path: dark like the game's menus. Bronze borders, gold headings, red kept for things you can miss. */
:root {
  --bg: #0F0E0C;
  --panel: #161411;
  --panel-2: #1C1915;
  --border: #5A4C34;
  --text: #E6DCC4;
  --muted: #B4AA94;
  --gold: #D2AE62;
  --red: #C0473A;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 5px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--serif); color: var(--gold); font-weight: normal; line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3, h4 { font-size: 1.1rem; }
a { color: var(--gold); text-decoration-color: rgba(210, 174, 98, 0.45); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--gold); }
p { margin: 0 0 0.75em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--panel); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }

/* ---------- Header and navigation ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(15, 14, 12, 0.96);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 0;
  padding-top: max(8px, env(safe-area-inset-top));
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.3rem; color: var(--gold); padding-bottom: 4px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 12px; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto; padding: 10px 12px; text-decoration: none; color: var(--muted);
  border-bottom: 2px solid transparent; font-size: 0.95rem;
}
.nav a.on, .nav a:hover { color: var(--gold); border-bottom-color: var(--gold); }
@media (min-width: 760px) {
  .top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 0; }
  .nav { margin: 0; }
}

/* ---------- Page layout ---------- */
.view { width: 100%; max-width: 860px; margin: 0 auto; padding: 16px; flex: 1; outline: none; }
.page-title { margin: 8px 0 12px; }
.intro { margin-bottom: 14px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 14px;
}
.panel.warn { border-color: var(--red); }
.panel.warn h2 { color: var(--text); }
.panel.warn h2::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--red); border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.hero h1 { font-size: 1.9rem; margin-bottom: 4px; }
.hero h1 a { text-decoration: none; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--muted); margin-bottom: 6px; }
.split { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.toolbar { margin: 0 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.loading { padding: 40px 0; text-align: center; }

/* ---------- Buttons, chips and switches ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
  padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--gold); background: #2A2419; color: var(--gold);
  text-decoration: none; cursor: pointer; font-family: var(--serif);
}
.button:hover { background: #352D1F; }
.button.ghost { border-color: var(--border); background: transparent; color: var(--text); }
.button.danger { border-color: var(--red); color: #E6A49B; background: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip {
  border: 1px solid var(--border); background: var(--panel-2); border-radius: 4px;
  padding: 7px 12px; cursor: pointer; text-align: left; min-height: 36px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.small { padding: 5px 10px; min-height: 32px; font-size: 0.88rem; }
.chip.on { border-color: var(--gold); color: var(--gold); background: #2A2419; }
.chip:not(.on) .dot { opacity: 0.4; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid #3A2D1E; flex: 0 0 auto; }
.switch, .radio { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.switch input, .radio input { width: 18px; height: 18px; accent-color: var(--gold); margin: 0; }
.radios { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* ---------- Lists of guide pages ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid rgba(90, 76, 52, 0.45); }
.row:first-child { border-top: 0; }
.row-main { flex: 1; min-width: 0; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 2px; }
.row-main:hover .row-title { color: var(--gold); }
.row-title { font-family: var(--serif); font-size: 1.05rem; }
.row-meta { color: var(--muted); font-size: 0.85rem; }
.row-sum { color: var(--muted); font-size: 0.92rem; }
.row.done .row-title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(180, 170, 148, 0.5); }
.kind { color: var(--gold); margin-right: 6px; }
.kind::after { content: " ·"; color: var(--muted); }
.flag { font-family: var(--sans); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--red); border: 1px solid var(--red); border-radius: 3px; padding: 0 5px; margin-left: 8px; vertical-align: 2px; }
.locks { color: #E6A49B; font-size: 0.88rem; }
.veil { flex: 1; text-align: left; background: repeating-linear-gradient(135deg, #1C1915 0 8px, #201C17 8px 16px); border: 1px dashed var(--border); border-radius: 4px; padding: 10px 12px; color: var(--muted); cursor: pointer; }

/* The tick box: a bronze square that fills gold. */
.tick { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 2px 0; }
.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick .box { width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 4px; background: var(--panel-2); flex: 0 0 auto; display: grid; place-items: center; }
.tick input:checked + .box { background: var(--gold); border-color: var(--gold); }
.tick input:checked + .box::after { content: ""; width: 7px; height: 12px; border: solid #1A150D; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.tick input:focus-visible + .box { outline: 2px solid var(--gold); outline-offset: 2px; }
.row .tick { padding-top: 2px; }

/* Progress bars by act. */
.bar { display: block; height: 6px; background: #2A251D; border-radius: 3px; overflow: hidden; margin: 6px 0 10px; }
.bar span { display: block; height: 100%; background: var(--gold); }
.acts { list-style: none; margin: 0; padding: 0; }
.acts li { display: grid; grid-template-columns: 8.5em 1fr auto; gap: 12px; align-items: center; padding: 4px 0; }
.acts li .bar { margin: 0; }
.acts li.current .act-name { color: var(--gold); }
.act-name { font-family: var(--serif); }
.act-count { color: var(--muted); font-size: 0.85rem; white-space: nowrap; font-family: var(--sans); }

/* ---------- Explore ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: thin; }
.tab { flex: 0 0 auto; padding: 7px 12px; border: 1px solid var(--border); border-radius: 4px; text-decoration: none; color: var(--muted); background: var(--panel); font-size: 0.92rem; }
.tab.on { color: var(--gold); border-color: var(--gold); background: #2A2419; }
.search input {
  width: 100%; padding: 11px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font: inherit; margin-bottom: 14px;
}
.search input::placeholder { color: #8A8170; }

/* ---------- A guide page ---------- */
.crumbs { color: var(--muted); font-size: 0.9rem; margin: 4px 0 10px; }
.entry h1 { font-size: 2rem; margin-bottom: 4px; }
.lede { font-size: 1.08rem; margin-top: 14px; }
.missable, .build, .note { border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; background: var(--panel); }
.missable { border: 1px solid var(--red); border-left-width: 4px; }
.missable h2 { color: #E6A49B; font-size: 1.05rem; margin-bottom: 4px; }
.build { border: 1px solid var(--border); border-left: 4px solid var(--gold); }
.note { border: 1px solid var(--border); }
.build h2, .note h2 { font-size: 1.05rem; margin-bottom: 6px; }
.build h2 .muted { font-family: var(--sans); font-size: 0.85rem; }
.prose { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-top: 14px; overflow-wrap: anywhere; }
.prose h2, .prose h3, .prose h4 { margin-top: 1.1em; }
.prose h4 { font-size: 1.1rem; }
.prose ol, .prose ul { padding-left: 1.4em; margin: 0 0 0.9em; }
.prose li { margin: 0.25em 0; }
.prose strong { color: #F0E6CE; }

/* ---------- Choices ---------- */
.choices { list-style: none; margin: 0; padding: 0; }
.choice { padding: 12px 0; border-top: 1px solid rgba(90, 76, 52, 0.45); }
.choice:first-child { border-top: 0; }
.prompt { margin-bottom: 6px; }
.outlook summary { color: #E6A49B; }
.outlook .eyebrow { margin-top: 8px; }
details summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; padding: 4px 0; }
details[open] summary { color: var(--gold); }
details ul { margin: 6px 0 0; padding-left: 1.2em; color: var(--text); font-size: 0.95rem; }
details li { margin: 4px 0; }
.outlook { border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 10px 12px; margin: 4px 0 12px; background: var(--panel-2); }
.outlook p:last-child { margin: 0; font-family: var(--serif); font-size: 1.05rem; }

/* ---------- Maps ---------- */
.world-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #0B0A08; -webkit-overflow-scrolling: touch; }
.world { position: relative; }
.world canvas { display: block; }
.shield {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; text-decoration: none;
  width: 64px;
}
.shield svg { width: 40px; height: 45px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7)); transition: transform 0.15s; }
.shield-body { fill: #161411; stroke: #5A4C34; stroke-width: 2; }
.shield-line { fill: none; stroke: #D2AE62; stroke-width: 1.4; }
.shield text { fill: #D2AE62; font-family: var(--serif); font-size: 18px; }
.shield .plate {
  margin-top: 2px; background: rgba(15, 14, 12, 0.88); border: 1px solid #5A4C34; border-radius: 3px;
  color: var(--text); font-family: var(--serif); font-size: 0.78rem; padding: 1px 6px; white-space: nowrap;
}
a.shield:hover svg, a.shield:focus-visible svg { transform: scale(1.1); }
a.shield:hover .plate { color: var(--gold); border-color: var(--gold); }
.shield.decorative svg { width: 24px; height: 27px; opacity: 0.75; }
.shield.decorative .plate { font-size: 0.7rem; color: var(--muted); }
.region-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.map-frame { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #D9C9A2; margin-bottom: 8px; }
.region-map { width: 100%; }
.region-canvas { display: block; touch-action: none; cursor: grab; }
.region-canvas:active { cursor: grabbing; }
.map-tools { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; }
.map-tools button { width: 36px; height: 36px; border-radius: 4px; border: 1px solid #3A2D1E; background: rgba(228, 214, 178, 0.92); color: #3A2D1E; font-size: 1.15rem; cursor: pointer; }
.catchall { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; max-width: calc(100% - 64px); }
.pin-button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #3A2D1E; border-radius: 4px; background: rgba(228, 214, 178, 0.92); color: #3A2D1E; font-size: 0.82rem; padding: 5px 9px; cursor: pointer; font-family: var(--serif); }
.pin-button.on { outline: 2px solid #3A2D1E; }
.place-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.82rem; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); text-align: center; }
.foot p { max-width: 760px; margin: 0 auto 6px; }

@media (max-width: 480px) {
  h1, .hero h1, .entry h1 { font-size: 1.5rem; }
  .panel { padding: 13px; }
  .acts li { grid-template-columns: 6.5em 1fr auto; gap: 8px; }
  .prose { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 480px) {
  .nav { justify-content: space-between; margin: 0 -10px; padding: 0 4px; }
  .nav a { padding: 10px 6px; font-size: 0.88rem; }
}
@media (max-width: 600px) {
  .shield { width: 56px; }
  .shield svg { width: 32px; height: 36px; }
  .shield .plate { font-size: 0.7rem; padding: 0 5px; }
  .shield.decorative svg { width: 20px; height: 22px; }
}

/* ---------- Wide screens: lists stay put and the page you pick opens beside them ---------- */
.tools { display: none; }
.groups { display: flex; flex-direction: column; gap: 6px; }
.group {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 4px; background: var(--panel); font-family: var(--serif); font-size: 1.02rem;
}
.group:hover { border-color: var(--gold); }
.group.on { border-color: var(--gold); color: var(--gold); background: #2A2419; }
.empty { padding: 40px 0; text-align: center; }

@media (min-width: 1000px) {
  :root { --top-h: 55px; }
  .top { justify-content: flex-start; gap: 22px; }
  .brand { white-space: nowrap; flex: 0 0 auto; }
  .nav { flex: 0 0 auto; overflow: visible; }
  .tools { min-width: 0; }
  .tools { display: flex; align-items: center; gap: 18px; margin-left: auto; padding-bottom: 6px; }
  #global-search {
    width: min(300px, 26vw); min-width: 0; flex: 0 1 auto; padding: 7px 10px; border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--panel); color: var(--text); font: inherit; font-size: 0.92rem;
  }
  #global-search::placeholder { color: #8A8170; }
  .meter { min-width: 150px; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
  .meter .bar { height: 4px; margin: 4px 0 0; }

  .view { max-width: 1360px; padding: 16px 24px; }
  .view[data-page="entry"] { max-width: 860px; }
  .view[data-page="maps"][data-sub=""] { max-width: 1040px; }

  .panes { display: grid; grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 18px; height: calc(100vh - var(--top-h) - 32px); min-height: 420px; }
  .panes.narrow { grid-template-columns: 300px minmax(0, 1fr); }
  .pane-list, .pane-detail { position: relative; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
  .pane-list { padding-right: 8px; }
  .pane-list .page-title { margin-top: 0; }
  .pane-list .search { display: none; }
  .pane-list .tabs { flex-wrap: wrap; overflow: visible; }
  .pane-list .row { padding-left: 8px; padding-right: 8px; margin: 0 -8px; border-radius: 4px; }
  .row.sel { background: #2A2419; box-shadow: inset 3px 0 0 var(--gold); }
  .row.sel .row-title { color: var(--gold); }
  .pane-detail { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 26px 28px; }
  .pane-detail.bare { background: none; border: 0; padding: 0 8px 0 0; }
  .pane-detail .entry { max-width: 820px; }
  .pane-detail .crumbs { margin-top: 0; }
  .pane-detail .prose { background: none; border: 0; padding: 0; }
  .pane-detail .missable, .pane-detail .build, .pane-detail .note { background: var(--panel-2); }
  .pane-detail.bare .panel { margin: 0; }
  .pane-detail.bare .choices { max-width: 900px; }

  .cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .grid2 .panel { margin: 0; }
  .map-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
  .map-side { position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
}
@media (min-width: 1000px) and (max-width: 1199px) {
  .meter { display: none; }
}
