/* Wiki – the gold design. The wiki rules come from site.css with the colours switched to gold. */
:root {
  color-scheme: dark;
  /* tokens of the gold design (base.css) */
  --bg: #07080d; --fg: #f4efe4; --muted: #9a958a; --line: rgba(255, 214, 120, .12);
  --card: #0f1017; --accent: #f6c453; --accent-fg: #1a1203; --head-bg: rgba(7, 8, 13, .72); --hover: rgba(246, 196, 83, .08);
  /* the same colours under the names the wiki rules (from site.css) use */
  --bg-2: #0f1017;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 214, 120, 0.12);
  --border-strong: rgba(255, 214, 120, 0.22);
  --text: #f4efe4;
  --text-muted: #9a958a;
  --accent-2: #ffd36b;
  --gradient: linear-gradient(180deg, #ffe08a, #f2b134);
  --glow: 0 10px 30px -10px rgba(246, 180, 52, 0.55);
  --ok: #3ddc84; --danger: #ff6b6b; --warn: #fbbf24;
  --radius: 16px; --radius-sm: 10px;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Consolas, monospace;
  --display: "Outfit", "Inter", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
::selection { background: rgba(246, 196, 83, .35); }
@keyframes spin { to { rotate: 360deg; } }

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.page { width: 100%; max-width: 1040px; margin: 0 auto; padding: 72px 24px 96px; }
h1 { margin: 0; font-family: var(--display); font-size: clamp(40px, 6vw, 60px); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; overflow-wrap: anywhere; }
h2 { margin: 0; font-family: var(--display); font-size: clamp(24px, 3vw, 30px); font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
h3 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 600; }
.grad { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 16px 0 0; color: var(--text-muted); font-size: 18px; max-width: 640px; }
.meta { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.muted { color: var(--text-muted); }
.state { margin: 32px 0; padding: 18px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-muted); }
.note { margin: 0 0 20px; padding: 12px 16px; border: 1px solid rgba(251, 191, 36, 0.3); border-radius: var(--radius-sm); background: rgba(251, 191, 36, 0.08); color: var(--text); font-size: 14px; }
.more { color: var(--text-muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.more:hover { color: var(--accent-2); }

/* ---------- markdown ---------- */

.md { line-height: 1.75; overflow-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2 { margin: 40px 0 14px; font-size: 22px; }
.md h3, .md h4 { margin: 26px 0 8px; font-size: 17px; }
.md p, .md ul, .md ol, .md blockquote, .md pre { margin: 0 0 14px; }
.md ul, .md ol { padding-left: 22px; }
.md li + li { margin-top: 6px; }
.md li::marker { color: var(--accent); }
.md a { color: var(--accent-2); text-underline-offset: 3px; }
.md code { padding: 0.15em 0.45em; border-radius: 6px; background: var(--surface-2); font: 0.9em var(--mono); }
.md pre { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.35); overflow: auto; }
.md pre code { padding: 0; background: none; }
.md blockquote { padding: 2px 16px; border-left: 3px solid var(--accent); color: var(--text-muted); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.md-table { margin: 0 0 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-x: auto; }
.md table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.md th, .md td { padding: 9px 14px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.md tbody tr + tr td { border-top: 1px solid var(--border); }
.md tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.md .ta-right { text-align: right; font-variant-numeric: tabular-nums; }
.md .ta-center { text-align: center; }
/* The rules: one panel, each section split by a line. */
.rules-doc { padding: 36px 40px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }

/* ---------- wiki ---------- */

.page-wide { max-width: 1160px; }
.wiki-main { max-width: 1400px; padding-top: 32px; }
.wiki { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-areas: "bar bar" "side page"; gap: 20px 28px; align-items: start; }

/* The wiki's own bar: logo, search with suggestions, tools. */
.wiki-bar { grid-area: bar; display: flex; align-items: center; gap: 20px; padding: 12px 14px 12px 16px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(90deg, rgba(246, 196, 83, 0.1), rgba(255, 255, 255, 0.02) 40%), var(--bg-2); }
.wiki-logo { display: flex; align-items: center; gap: 12px; flex: none; color: var(--text); text-decoration: none; }
.wiki-logo-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--gradient); box-shadow: var(--glow); }
.wiki-logo-mark svg { width: 21px; height: 21px; fill: none; stroke: #1a1203; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wiki-logo b { display: block; font: 700 17px var(--display); line-height: 1.2; }
.wiki-logo small { color: var(--text-muted); font-size: 12px; }
.wiki-find { position: relative; display: flex; align-items: center; gap: 10px; flex: 1; max-width: 620px; margin-left: auto; padding: 0 12px 0 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: rgba(0, 0, 0, 0.4); }
.wiki-find:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(246, 196, 83, 0.15); }
.wiki-find > svg { flex: none; width: 17px; height: 17px; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; }
.wiki-find input { flex: 1; min-width: 0; padding: 11px 0; border: 0; background: none; color: var(--text); font: inherit; outline: none; }
kbd { padding: 1px 7px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; color: var(--text-muted); font: 12px var(--mono); }
.wiki-suggest { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--border-strong); border-radius: 14px; background: #11121a; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9); }
.wiki-suggest a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.wiki-suggest a:hover, .wiki-suggest a.on { background: rgba(246, 196, 83, 0.12); }
.wiki-suggest a > span:last-child { display: grid; min-width: 0; }
.wiki-suggest b { font-weight: 600; }
.wiki-suggest small { overflow: hidden; color: var(--text-muted); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.wsug-all { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.wsug-all a { color: var(--accent-2); font-size: 13.5px; }
.wiki-actions { display: flex; gap: 6px; flex: none; }
.wiki-actions a { padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted); font-size: 13.5px; font-weight: 600; text-decoration: none; transition: color .15s, border-color .15s; }
.wiki-actions a:hover { border-color: var(--accent); color: var(--text); }

/* Sidebar: tools and categories, like a wiki's side menu. */
.wiki-side { grid-area: side; position: sticky; top: 96px; max-height: calc(100vh - 116px); overflow-y: auto; scrollbar-width: thin; }
.wiki-drawer > summary { display: none; }
#wiki-nav { display: grid; gap: 22px; }
#wiki-nav > div > b { display: block; margin: 0 0 8px 10px; color: var(--text-muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.wnav-tools { display: grid; gap: 1px; }
.wnav-tools a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--text-muted); font-size: 14.5px; text-decoration: none; }
.wnav-tools a:hover { background: var(--surface); color: var(--text); }
.wnav-tools a.on { background: rgba(246, 196, 83, 0.12); color: var(--accent-2); }
.wnav-ico { display: inline-grid; flex: none; place-items: center; width: 20px; height: 20px; color: var(--accent); }
.wnav-ico svg, .wiki-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wiki-ico { display: inline-grid; flex: none; place-items: center; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(246, 196, 83, 0.12); color: var(--accent-2); }
.wnav-cats { display: grid; gap: 2px; }
.wnav-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 6px; border: 0; border-radius: 10px; background: none; color: var(--text); font: 600 14px var(--font); text-align: left; cursor: pointer; }
.wnav-head:hover { background: var(--surface); }
.wnav-head .wiki-ico { width: 28px; height: 28px; padding: 6px; border-radius: 8px; }
.wnav-head > span:nth-child(2) { flex: 1; }
.wnav-head small { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.wnav-head .chev { width: 15px; height: 15px; fill: none; stroke: var(--text-muted); stroke-width: 2; transition: transform .2s; }
.wnav-head[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.wnav-head[aria-expanded="false"] + .wnav-list { display: none; }
.wnav-list { display: grid; margin: 2px 0 8px 19px; padding-left: 12px; border-left: 1px solid var(--border); }
.wnav-list a { margin-left: -13px; padding: 5px 10px 5px 13px; border-left: 2px solid transparent; color: var(--text-muted); font-size: 14px; text-decoration: none; }
.wnav-list a:hover { color: var(--text); }
.wnav-list a[aria-current] { border-left-color: var(--accent); color: var(--accent-2); font-weight: 600; }
.wnav-list .wnav-all { font-size: 12.5px; }

/* The page itself: a sheet with tabs, a title and the article. */
.wiki-page { grid-area: page; min-width: 0; padding: 26px 44px 34px; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015) 260px); }
.wiki-page:focus { outline: none; }
.wpage-head { position: relative; margin-bottom: 22px; }
.wtabs { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 4px; }
.wtabs button { padding: 6px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-muted); font: 600 13px var(--font); cursor: pointer; }
.wtabs button:hover { color: var(--text); }
.wtabs button.on { border-bottom-color: var(--accent); color: var(--text); }
.wpage-head h1 { padding-bottom: 10px; border-bottom: 1px solid var(--border-strong); font-size: clamp(30px, 4vw, 40px); line-height: 1.15; }
.wfrom { margin: 8px 0 0; color: var(--text-muted); font-size: 13px; }
.wshort { margin: 0 0 18px; color: var(--text-muted); font-size: 15.5px; font-style: italic; }
.wpage-body .md { font-size: 15.5px; line-height: 1.75; }
.wpage-body .md::after { content: ""; display: block; clear: both; }
.wpage-body .md h2 { margin: 36px 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border-strong); font-size: 24px; scroll-margin-top: 96px; }
.wpage-body .md h3 { margin: 26px 0 8px; font-size: 18px; scroll-margin-top: 96px; }
/* Headings, notes and lines stop at the infobox instead of running under it. */
.wpage-body .md h2, .wpage-body .md h3, .wpage-body .md blockquote, .wpage-body .md p, .wpage-body .md ul, .wpage-body .md ol, .wpage-body .md hr { overflow: hidden; }
.wpage-body .md ul, .wpage-body .md ol { padding-left: 24px; }
.wiki-anchor { margin-left: 10px; color: var(--accent); font-weight: 500; text-decoration: none; opacity: 0; transition: opacity .15s; }
.wpage-body .md h2:hover .wiki-anchor, .wpage-body .md h3:hover .wiki-anchor, .wiki-anchor:focus-visible { opacity: 0.8; }
.wpage-body .md strong { color: #fff; }
.wpage-body .md a { text-decoration: none; }
.wpage-body .md a:hover { text-decoration: underline; }
.wpage-body .md a.new { color: var(--danger); }
.wiki-page mark { padding: 0 2px; border-radius: 4px; background: rgba(246, 196, 83, 0.3); color: var(--text); }
.wsource { max-height: 70vh; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: rgba(0, 0, 0, 0.4); overflow: auto; font: 13px/1.6 var(--mono); white-space: pre-wrap; }

/* Contents box, numbered, with hide / show. */
.wtoc { display: inline-block; min-width: 260px; max-width: 100%; margin: 6px 0 10px; padding: 14px 20px 14px 16px; border: 1px solid var(--border-strong); border-radius: 14px; background: rgba(0, 0, 0, 0.28); }
.wtoc-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.wtoc-head b { font: 700 15px var(--display); }
.wtoc-toggle { padding: 0; border: 0; background: none; color: var(--accent-2); font: 12.5px var(--font); cursor: pointer; }
.wtoc-toggle::before { content: "["; color: var(--text-muted); }
.wtoc-toggle::after { content: "]"; color: var(--text-muted); }
.wtoc.closed ol { display: none; }
.wtoc.closed .wtoc-head { margin-bottom: 0; }
.wpage-body .md .wtoc ol { margin: 0; padding: 0; list-style: none; }
.wpage-body .md .wtoc li { margin: 0; font-size: 14px; line-height: 1.5; }
.wpage-body .md .wtoc li.sub { padding-left: 22px; }
.wtoc a { display: flex; gap: 8px; padding: 2px 0; }
.wtoc-n { min-width: 18px; color: var(--text-muted); }

/* Notes. */
.wpage-body .md .callout { margin: 20px 0; padding: 14px 18px 14px 50px; position: relative; border: 1px solid rgba(246, 196, 83, 0.3); border-radius: 12px; background: rgba(246, 196, 83, 0.07); color: var(--text); }
.wpage-body .md .callout::before { content: "i"; position: absolute; left: 16px; top: 15px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #1a1203; font: 700 13px var(--display); }
.wpage-body .md .callout-tip { border-color: rgba(74, 222, 128, 0.3); background: rgba(74, 222, 128, 0.07); }
.wpage-body .md .callout-tip::before { content: "✓"; background: var(--ok); }
.wpage-body .md .callout-warn { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.wpage-body .md .callout-warn::before { content: "!"; background: var(--warn); }

/* Under the article: categories and last edit. */
.wpage-foot { clear: both; margin-top: 40px; }
.wcats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(0, 0, 0, 0.22); font-size: 14px; }
.wcats b { color: var(--text-muted); font-weight: 600; }
.wcats a { padding: 2px 10px; border-radius: 999px; background: rgba(246, 196, 83, 0.12); color: var(--accent-2); text-decoration: none; }
.wpage-foot p { margin: 14px 0 0; color: var(--text-muted); font-size: 12.5px; }
.wpage-foot p a { color: var(--accent-2); text-decoration: none; }

/* Boxes on the main page and the list pages. */
.wbox { border: 1px solid var(--border); border-radius: 16px; background: rgba(0, 0, 0, 0.18); overflow: hidden; }
.wbox + .wbox { margin-top: 18px; }
.wbox-title { margin: 0; padding: 11px 18px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, rgba(246, 196, 83, 0.16), rgba(255, 214, 120, 0.04)); font: 700 15.5px var(--display); }
.wbox > :not(.wbox-title) { margin: 16px 18px; }
.wmain-hero { margin-bottom: 22px; padding: 30px 32px; border: 1px solid rgba(246, 196, 83, 0.3); border-radius: 18px; background: radial-gradient(70% 140% at 0% 0%, rgba(246, 196, 83, 0.25), transparent 60%), radial-gradient(60% 120% at 100% 100%, rgba(255, 214, 120, 0.14), transparent 60%), var(--bg-2); }
.wmain-hero h2 { font-size: clamp(26px, 3.4vw, 36px); }
.wmain-hero h2 span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wmain-hero p:last-child { max-width: 720px; margin: 10px 0 0; color: var(--text-muted); }
.wmain-hero b { color: var(--text); }
.wmain-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.wfeat-title { font: 700 24px var(--display); color: var(--text); text-decoration: none; }
.wfeat-title:hover { color: var(--accent-2); }
.wbox > .wfeat-title { display: block; margin-bottom: 4px; }
.wbox > .wfeat-cat { display: flex; align-items: center; gap: 8px; margin-top: 0; color: var(--text-muted); font-size: 13px; }
.wfeat p:last-child { color: var(--text-muted); line-height: 1.7; }
.wfeat p a, .wmore, .wportal-more { color: var(--accent-2); font-weight: 600; text-decoration: none; }
.wmore { display: inline-block; font-size: 13.5px; }
.wportal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.wportal { padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.wportal-head { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.wportal-head span:last-child { display: grid; }
.wportal-head small { color: var(--text-muted); font-size: 12px; }
.wportal-head:hover b { color: var(--accent-2); }
.wportal ul { margin: 10px 0 0; padding-left: 18px; font-size: 14px; }
.wportal li::marker { color: var(--accent); }
.wportal a:not(.wportal-head) { color: var(--text-muted); text-decoration: none; }
.wportal ul a:hover { color: var(--text); }
.wportal-more { display: inline-block; margin-top: 6px; font-size: 12.5px; }
.wlist { display: grid; gap: 2px; padding: 0; list-style: none; }
.wbox > .wlist { margin: 10px 8px; }
.wlist li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 8px; font-size: 14.5px; }
.wlist li:hover { background: var(--surface); }
.wlist a { color: var(--text); text-decoration: none; }
.wlist a:hover { color: var(--accent-2); }
.wlist small { flex: none; color: var(--text-muted); font-size: 12.5px; }
.wintro { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 18px; color: var(--text-muted); }
.wintro a { color: var(--accent-2); }
.wcols { column-width: 210px; column-gap: 28px; }
.wcol-group { break-inside: avoid; margin-bottom: 16px; }
.wcol-group h3 { margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); color: var(--accent-2); font-size: 16px; }
.wcol-group ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.8; }
.wcol-group li::marker { color: var(--text-muted); }
.wcol-group a { color: var(--text); text-decoration: none; }
.wcol-group a:hover { color: var(--accent-2); }
.wresults { display: grid; gap: 4px; }
.wresult { padding: 14px 4px; border-bottom: 1px solid var(--border); }
.wresult-title { font: 600 17px var(--display); color: var(--accent-2); text-decoration: none; }
.wresult p { margin: 4px 0; color: var(--text); font-size: 14.5px; }
.wresult small { color: var(--text-muted); font-size: 12.5px; }

/* Page preview when hovering a link. */
.wiki-preview { position: fixed; left: var(--x, 0); top: var(--y, 0); z-index: 40; display: grid; gap: 4px; width: 320px; padding: 16px 18px; border: 1px solid var(--border-strong); border-radius: 14px; background: #11121a; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9); pointer-events: none; }
.wiki-preview small { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.wiki-preview b { font: 700 18px var(--display); }
.wiki-preview p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; }
.wprev-go { margin-top: 4px; color: var(--accent-2); font-size: 12.5px; }

/* Wiki blocks: infobox, stat bars, evolution chain and navbox (```infobox … in the page text). */
.infobox { float: right; width: 290px; margin: 4px 0 24px 32px; border: 1px solid var(--border-strong); border-radius: 18px; background: linear-gradient(180deg, rgba(246, 196, 83, 0.08), rgba(255, 255, 255, 0.02) 140px), var(--bg-2); overflow: hidden; font-size: 14px; line-height: 1.45; box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8); }
.ib-head { display: grid; justify-items: center; gap: 4px; padding: 22px 20px 18px; text-align: center; border-bottom: 1px solid var(--border); }
.ib-art { display: grid; place-items: center; width: 88px; height: 88px; margin-bottom: 8px; border: 1px solid rgba(246, 196, 83, 0.35); border-radius: 22px; background: radial-gradient(circle at 50% 35%, rgba(246, 196, 83, 0.35), rgba(0, 0, 0, 0.4) 70%); box-shadow: 0 0 40px -10px rgba(255, 214, 120, 0.5); }
.ib-art img { width: 64px; height: 64px; image-rendering: pixelated; }
.ib-mono { font: 800 40px var(--display); background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ib-head b { font: 700 21px var(--display); color: var(--text); }
.ib-head small { color: var(--accent-2); font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; }
.ib-head q { margin-top: 6px; color: var(--text-muted); font-style: italic; font-size: 13px; }
.ib-body { padding: 6px 0 10px; }
.ib-body h4 { margin: 12px 18px 4px; color: var(--text-muted); font: 600 11px var(--font); text-transform: uppercase; letter-spacing: 0.1em; }
.ib-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 18px; }
.ib-row:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.ib-row span:first-child { color: var(--text-muted); }
.ib-row span:last-child { text-align: right; font-weight: 600; color: var(--text); }
.wiki-page .md .ib-row a { color: var(--accent-2); text-decoration: none; }

.stat-bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 0 0 18px; clear: none; }
.stat { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.stat span { overflow: hidden; color: var(--text-muted); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.stat b { font: 700 17px var(--display); font-variant-numeric: tabular-nums; }
.stat b small { color: var(--text-muted); font: 500 12px var(--font); }
.stat i { margin-top: 4px; height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--w, 100%), rgba(255, 255, 255, 0.07) var(--w, 100%)); }
.stat.down i { background: linear-gradient(90deg, var(--warn) var(--w), rgba(255, 255, 255, 0.07) var(--w)); }
.stat.down b { color: var(--warn); }
.stat.up b { color: var(--ok); }

.wiki-page .md ol.evo { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px 0; margin: 0 0 20px; padding: 0; list-style: none; }
.evo li { display: grid; align-content: center; gap: 2px; min-width: 130px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.evo li + li { margin: 0 0 0 34px; position: relative; }
.evo li + li::before { content: "→"; position: absolute; left: -26px; top: 50%; transform: translateY(-50%); color: var(--accent); font-weight: 700; }
.wiki-page .md .evo li + li { margin-top: 0; }
.evo li.on { border-color: var(--accent); background: rgba(246, 196, 83, 0.12); box-shadow: 0 0 24px -8px rgba(246, 196, 83, 0.6); }
.evo b { font-size: 14.5px; }
.evo small { color: var(--text-muted); font-size: 12.5px; }
.wiki-page .md .evo a { color: var(--text); text-decoration: none; }
.wiki-page .md .evo a:hover { color: var(--accent-2); }

.navbox { clear: both; display: grid; margin: 48px 0 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.navbox > b { padding: 12px 18px; background: linear-gradient(90deg, rgba(246, 196, 83, 0.18), rgba(255, 214, 120, 0.06)); font: 700 15px var(--display); }
.nb-row { display: grid; grid-template-columns: 150px 1fr; border-top: 1px solid var(--border); }
.nb-row > span { padding: 12px 16px; background: rgba(255, 255, 255, 0.025); color: var(--text-muted); font-size: 13px; font-weight: 600; }
.wiki-page .md .nb-row p { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 10px 14px; }
.nb-item { padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.nb-item:has(a) { background: rgba(246, 196, 83, 0.12); }
.wiki-page .md .nb-item a { color: var(--accent-2); text-decoration: none; }
.nb-item:has(strong) { background: var(--gradient); }
.wiki-page .md .nb-item strong { color: #1a1203; }
.wiki-page .md h2 { clear: none; }

@media (max-width: 1100px) {
  .wiki-actions { display: none; }
  .wmain-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .wiki-main { padding-top: 16px; }
  .wiki { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bar" "side" "page"; gap: 14px; }
  .wiki-bar { flex-wrap: wrap; gap: 12px; }
  .wiki-find { flex-basis: 100%; max-width: none; margin: 0; }
  .wiki-find kbd { display: none; }
  .wiki-side { position: static; max-height: none; overflow: visible; }
  /* On phones the menu is a drawer between the bar and the page. */
  .wiki-drawer { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
  .wiki-drawer > summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-weight: 600; cursor: pointer; list-style: none; }
  .wiki-drawer > summary::-webkit-details-marker { display: none; }
  .wiki-drawer > summary::after { content: "▾"; color: var(--text-muted); transition: transform .2s; }
  .wiki-drawer[open] > summary::after { transform: rotate(180deg); }
  .wiki-drawer #wiki-nav { padding: 0 10px 12px; }
  .wiki-page { padding: 18px 18px 24px; }
  .wtabs { justify-content: flex-start; }
  .wpage-body .md { font-size: 15px; }
  .wtoc { display: block; }
  .wmain-hero { padding: 22px 20px; }
  .wiki-preview { display: none; }
  .infobox { float: none; width: auto; margin: 0 0 24px; }
  .nb-row { grid-template-columns: 1fr; }
  .wpage-body .md ol.evo { flex-direction: column; }
  .wpage-body .md .evo li + li { margin: 30px 0 0; }
  .evo li + li::before { content: "↓"; left: 50%; top: -24px; transform: translateX(-50%); }
}
.step .ip + p { margin-top: 16px; }

/* ---------- first screen on the main page only (wiki-hero.js hides it on every other page) ---------- */
.w-hero { position: relative; isolation: isolate; overflow: hidden; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 100px 16px 110px; text-align: center; }
.w-bg { position: absolute; inset: 0; z-index: -1; }
.w-bg .glow { position: absolute; inset: 0; background: radial-gradient(ellipse 50% 60% at 50% 42%, rgba(246, 180, 52, .16), transparent 70%); }
.w-bg .circle { position: absolute; left: 50%; top: 45%; width: min(820px, 150vw); max-width: none; translate: calc(-50% + var(--mx, 0) * -24px) calc(-50% + var(--my, 0) * -24px); opacity: .14; filter: drop-shadow(0 0 12px rgba(255, 200, 90, .5)); animation: spin 150s linear infinite; transition: translate .6s ease-out; }
.w-hero h1 { font-size: clamp(48px, 9vw, 112px); font-weight: 800; letter-spacing: -.035em; background: linear-gradient(180deg, #fff6dc 20%, #f2b134); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.w-hero .lead { margin: 0; font: 400 clamp(17px, 2vw, 21px)/1.4 var(--display); color: #e0d6c2; max-width: none; }
.w-search { position: relative; width: min(620px, 100%); margin-top: 10px; }
.w-search svg { position: absolute; left: 22px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.w-search input { width: 100%; height: 62px; padding: 0 130px 0 54px; border-radius: 999px; border: 1px solid rgba(246, 196, 83, .35); background: rgba(20, 18, 14, .7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--fg); font: 500 17px var(--font); outline: none; transition: border-color .2s, box-shadow .2s; }
.w-search input::placeholder { color: var(--muted); }
.w-search input:focus { border-color: rgba(246, 196, 83, .8); box-shadow: 0 0 0 4px rgba(246, 196, 83, .12); }
.w-search button { position: absolute; right: 7px; top: 7px; height: 48px; padding: 0 22px; border-radius: 999px; background: linear-gradient(180deg, #ffe08a, #f2b134); color: var(--accent-fg); font-weight: 600; }
.w-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.w-quick a { padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(20, 18, 14, .5); font-size: 14px; font-weight: 600; color: var(--muted); transition: color .2s, border-color .2s; }
.w-quick a:hover { color: var(--fg); border-color: rgba(246, 196, 83, .5); }
.w-count { font-size: 13px; color: var(--muted); }
.scroll { position: absolute; bottom: 26px; left: 50%; translate: -50%; width: 26px; height: 42px; border: 1.5px solid rgba(246, 196, 83, .4); border-radius: 14px; }
.scroll span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); animation: wheel 1.8s infinite; }
@keyframes wheel { 60% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* the wiki itself sits below the fixed header */
.wiki-main { padding-top: 96px; scroll-margin-top: 0; }
.w-hero:not([hidden]) + .wiki-main { padding-top: 40px; }
@media (max-width: 640px) {
  .w-search input { padding-right: 20px; height: 56px; }
  .w-search button { display: none; }
}
