/* bf2-rs design tokens, shared by the developer wiki (tools/devwiki/theme/app.css, inlined by
   tools/devwiki/build.py) and the web editor (web/editor/src/index.css, inlined by Vite + Tailwind).
   Base: Battlefield 2's menus (dark blue-grey panels, orange / amber accent, desert tan surfaces).
   Accents per game with [data-game]: "2142" cyan, "heroes" parchment + red; "bf2" or none is the base.
   Raw palette: --bf-c-*; semantic tokens the pages use: --bf-*. */
:root {
  /* palette: BF2 */
  --bf-c-ink-0: #090c10;
  --bf-c-ink-1: #0e1318;
  --bf-c-ink-2: #141b22;
  --bf-c-ink-3: #1a232c;
  --bf-c-ink-4: #222d38;
  --bf-c-ink-5: #2e3b48;
  --bf-c-ink-6: #3d4d5c;
  --bf-c-fog-0: #ece6d8;
  --bf-c-fog-1: #bdb7a8;
  --bf-c-fog-2: #8d9096;
  --bf-c-orange: #f39a1d;
  --bf-c-orange-hi: #ffb547;
  --bf-c-orange-lo: #a8640b;
  --bf-c-amber: #ffcd4f;
  --bf-c-tan: #c9b48a;
  --bf-c-tan-hi: #e6d6b2;
  --bf-c-tan-lo: #7f6f4f;
  --bf-c-sand-0: #f3ecdc;
  --bf-c-sand-1: #e9dec5;
  --bf-c-sand-2: #dccdab;
  --bf-c-olive: #8fb35a;
  --bf-c-steel: #7fa6c4;
  --bf-c-alert: #e4583e;
  /* palette: 2142 */
  --bf-c-2142-cyan: #3fd3ea;
  --bf-c-2142-cyan-hi: #8ae9f7;
  --bf-c-2142-cyan-lo: #12819a;
  --bf-c-2142-steel: #12202a;
  /* palette: Heroes */
  --bf-c-heroes-red: #d9412e;
  --bf-c-heroes-red-hi: #f06a52;
  --bf-c-heroes-red-lo: #9c2516;
  --bf-c-heroes-parchment: #f1e3c0;
  --bf-c-heroes-parchment-lo: #cdb88a;
  --bf-c-heroes-wood: #2a1e14;
  --bf-c-heroes-gold: #f4b63c;

  /* semantic (dark, the default) */
  --bf-bg: var(--bf-c-ink-1);
  --bf-bg-deep: var(--bf-c-ink-0);
  --bf-panel: var(--bf-c-ink-2);
  --bf-panel-2: var(--bf-c-ink-3);
  --bf-panel-3: var(--bf-c-ink-4);
  --bf-line: var(--bf-c-ink-4);
  --bf-line-2: var(--bf-c-ink-5);
  --bf-line-3: var(--bf-c-ink-6);
  --bf-text: var(--bf-c-fog-0);
  --bf-text-2: var(--bf-c-fog-1);
  --bf-text-3: var(--bf-c-fog-2);
  --bf-accent: var(--bf-c-orange);
  --bf-accent-hi: var(--bf-c-orange-hi);
  --bf-accent-lo: var(--bf-c-orange-lo);
  --bf-accent-fg: #170d02;
  --bf-accent-2: var(--bf-c-tan);
  --bf-link: var(--bf-c-amber);
  --bf-surface-tan: var(--bf-c-tan);
  --bf-ok: var(--bf-c-olive);
  --bf-warn: var(--bf-c-amber);
  --bf-bad: var(--bf-c-alert);
  --bf-info: var(--bf-c-steel);
  --bf-game-bf2: var(--bf-c-orange);
  --bf-game-2142: var(--bf-c-2142-cyan);
  --bf-game-heroes: var(--bf-c-heroes-red-hi);
  --bf-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);

  /* type and shape */
  --bf-font-sans: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bf-font-display: Bahnschrift, 'DIN Alternate', 'Barlow Semi Condensed', 'Arial Narrow', 'Segoe UI', sans-serif;
  --bf-font-mono: ui-monospace, 'Cascadia Mono', 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --bf-radius: 4px;
  --bf-radius-lg: 8px;
}

/* light: the desert tan surfaces */
[data-theme='light'] {
  --bf-bg: var(--bf-c-sand-0);
  --bf-bg-deep: var(--bf-c-sand-1);
  --bf-panel: #fbf7ee;
  --bf-panel-2: var(--bf-c-sand-1);
  --bf-panel-3: var(--bf-c-sand-2);
  --bf-line: #ddd0b2;
  --bf-line-2: #cbbb96;
  --bf-line-3: #a9976f;
  --bf-text: #1d1912;
  --bf-text-2: #4a4232;
  --bf-text-3: #74694f;
  --bf-accent: #c26a00;
  --bf-accent-hi: #e07c00;
  --bf-accent-lo: #8a4a00;
  --bf-accent-fg: #fff8ea;
  --bf-accent-2: var(--bf-c-tan-lo);
  --bf-link: #a35400;
  --bf-ok: #4f7a1c;
  --bf-warn: #9a6a00;
  --bf-bad: #b63220;
  --bf-info: #2d6690;
  --bf-game-bf2: #c26a00;
  --bf-game-2142: #0a7f99;
  --bf-game-heroes: #b52f1e;
  --bf-shadow: 0 12px 30px rgba(60, 45, 20, 0.16);
}

/* per-game accents: pages, sections and editor sessions about one game ("bf2" restores the base inside another game's page) */
[data-game='bf2'] {
  --bf-accent: var(--bf-c-orange);
  --bf-accent-hi: var(--bf-c-orange-hi);
  --bf-accent-lo: var(--bf-c-orange-lo);
  --bf-accent-fg: #170d02;
  --bf-accent-2: var(--bf-c-tan);
  --bf-link: var(--bf-c-amber);
}
[data-game='2142'] {
  --bf-accent: var(--bf-c-2142-cyan);
  --bf-accent-hi: var(--bf-c-2142-cyan-hi);
  --bf-accent-lo: var(--bf-c-2142-cyan-lo);
  --bf-accent-fg: #021418;
  --bf-accent-2: #9fc7d6;
  --bf-link: var(--bf-c-2142-cyan-hi);
}
[data-game='heroes'] {
  --bf-accent: var(--bf-c-heroes-red-hi);
  --bf-accent-hi: #ff8a72;
  --bf-accent-lo: var(--bf-c-heroes-red-lo);
  --bf-accent-fg: #fff6e6;
  --bf-accent-2: var(--bf-c-heroes-parchment);
  --bf-link: var(--bf-c-heroes-gold);
}
[data-theme='light'] [data-game='bf2'],
[data-theme='light'][data-game='bf2'] {
  --bf-accent: #c26a00;
  --bf-accent-hi: #e07c00;
  --bf-accent-lo: #8a4a00;
  --bf-accent-fg: #fff8ea;
  --bf-accent-2: var(--bf-c-tan-lo);
  --bf-link: #a35400;
}
[data-theme='light'] [data-game='2142'],
[data-theme='light'][data-game='2142'] {
  --bf-accent: #0a7f99;
  --bf-accent-hi: #0b95b3;
  --bf-accent-lo: #075a6c;
  --bf-accent-fg: #f2fdff;
  --bf-accent-2: #4f8597;
  --bf-link: #086e85;
}
[data-theme='light'] [data-game='heroes'],
[data-theme='light'][data-game='heroes'] {
  --bf-accent: #b52f1e;
  --bf-accent-hi: #cf3a26;
  --bf-accent-lo: #7d1d10;
  --bf-accent-fg: #fff6e6;
  --bf-accent-2: #8c6a3a;
  --bf-link: #9c2516;
}

/* bf2-rs developer wiki theme (tools/devwiki/theme). Colours, type and shape come from the shared tokens
   (web/tokens/bf2.css, inlined by build.py): BF2's blue-grey and orange, 2142 / Heroes accents under [data-game].
   Dark by default, the desert-tan light theme with [data-theme=light]. */
:root, [data-game] {
  --bg: var(--bf-bg); --bg2: var(--bf-bg-deep); --panel: var(--bf-panel); --panel2: var(--bf-panel-2); --panel3: var(--bf-panel-3);
  --line: var(--bf-line); --line2: var(--bf-line-2); --line3: var(--bf-line-3);
  --fg: var(--bf-text); --fg2: var(--bf-text-2); --fg3: var(--bf-text-3);
  --accent: var(--bf-accent); --accent-hi: var(--bf-accent-hi); --accent-fg: var(--bf-accent-fg);
  --accent2: var(--bf-accent-2); --accent3: var(--bf-info); --link: var(--bf-link);
  --ok: var(--bf-ok); --warn: var(--bf-warn); --bad: var(--bf-bad); --code-bg: var(--bf-bg-deep); --shadow: var(--bf-shadow);
  --g-bf2: var(--bf-game-bf2); --g-2142: var(--bf-game-2142); --g-heroes: var(--bf-game-heroes);
}
:root {
  --tk-k: #f0a04b; --tk-s: #b5cf86; --tk-c: #6f7b86; --tk-n: #ffcd4f; --tk-f: #8fbbe0; --tk-v: #dcc28f;
  --mast: 52px; --tabs: 40px; --top: calc(var(--mast) + var(--tabs)); --side: 276px; --toc: 224px;
  --mono: var(--bf-font-mono); --sans: var(--bf-font-sans); --display: var(--bf-font-display); --r: var(--bf-radius); --r2: var(--bf-radius-lg);
}
[data-theme=light] { --tk-k: #a8520a; --tk-s: #4c7a1f; --tk-c: #8a8170; --tk-n: #9a5a00; --tk-f: #1d5d92; --tk-v: #7a5a1c; }
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 14px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.62 var(--sans); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, pre, kbd { font-family: var(--mono); }
::selection { background: color-mix(in srgb, var(--bf-c-orange) 38%, transparent); }
.ic { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- header: masthead (brand, game marks, search, parity) + area tabs */
.top { position: fixed; inset: 0 0 auto 0; z-index: 30; background: var(--bg2); border-bottom: 1px solid var(--line2); }
.mast { height: var(--mast); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel2) 70%, var(--bg2)), var(--bg2)); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.brand-t { display: flex; flex-direction: column; line-height: 1.05; font: 700 17px/1.05 var(--display); letter-spacing: .04em; }
.brand-t small { font: 600 10.5px/1.3 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.marks { display: flex; align-items: center; gap: 4px; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line2); }
.mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); color: var(--accent); transition: background .15s, transform .15s; }
.mark:hover { background: var(--panel2); transform: translateY(-1px); }
.mk { width: 24px; height: 24px; }
.mk-o { fill: color-mix(in srgb, currentColor 16%, transparent); stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.mk-f { fill: currentColor; }
.mk-l { fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; }
[data-game=heroes] .mk-o { fill: var(--bf-c-heroes-parchment); stroke: var(--bf-c-heroes-red); }
[data-game=heroes] .mk-l { stroke: var(--bf-c-heroes-red); }
.search-btn { flex: 1; max-width: 420px; margin-left: auto; display: flex; align-items: center; gap: 10px; height: 34px;
  padding: 0 10px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--panel); color: var(--fg3);
  font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.search-btn:hover { border-color: var(--accent); color: var(--fg2); }
.search-btn span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-btn kbd, .kbd, .side-search kbd, .doc kbd { font-size: 11px; padding: 0 6px; border-radius: 3px; border: 1px solid var(--line2);
  border-bottom-width: 2px; background: var(--panel2); color: var(--fg2); line-height: 1.6; }
.dash-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line2)); color: var(--accent); font: 600 13px var(--display);
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.dash-btn:hover { background: var(--accent); color: var(--accent-fg); text-decoration: none; }
.site-link { color: var(--fg3); font-size: 13px; }
.discord-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.discord-link .ico-discord { width: 16px; height: 12px; flex: none; color: var(--accent); }
.discord-link:hover { color: var(--fg); text-decoration: none; }
/* the site's home mark, first in the masthead (notes/site_index.md "The home mark": the same rules on every page of bf2.us) */
a.bf2us-home{flex:none;font:800 20px/1 'Barlow Condensed',Bahnschrift,'DIN Condensed','Roboto Condensed','Arial Narrow',system-ui,sans-serif;font-stretch:condensed;letter-spacing:.06em;text-transform:none;text-decoration:none;white-space:nowrap;color:#eceae4}a.bf2us-home span{color:#F2C230}a.bf2us-home:hover,a.bf2us-home:focus-visible{color:#fff}
[data-theme="light"] a.bf2us-home { color: #14171a; } [data-theme="light"] a.bf2us-home:hover { color: #000; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r); border: 1px solid var(--line2);
  background: var(--panel); color: var(--fg2); cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.menu-btn { display: none; }
.tabs { height: var(--tabs); display: flex; align-items: stretch; gap: 2px; padding: 0 12px 0 calc(var(--side) - 12px);
  overflow-x: auto; scrollbar-width: none; background: var(--bg2); }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; color: var(--fg2); white-space: nowrap;
  font: 600 13.5px var(--display); letter-spacing: .07em; text-transform: uppercase; }
.tab .ic { width: 16px; height: 16px; opacity: .75; }
.tab:hover { color: var(--fg); text-decoration: none; background: color-mix(in srgb, var(--panel2) 60%, transparent); }
.tab.on { color: var(--accent); }
.tab.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; background: var(--accent);
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 100%, 0 100%); }
.tab.on .ic { opacity: 1; }
.tab-ext { margin-left: auto; color: var(--fg3); }
/* twelve areas and the dashboard on one line down to a 1600 px window (R-0110) */
@media (max-width: 1900px) and (min-width: 901px) { .tab { gap: 0; padding: 0 8px; font-size: 12.5px; letter-spacing: .04em; } .tab .ic { display: none; } }

/* ---- layout */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--toc); padding-top: var(--top); min-height: 100vh; }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 12px 10px 40px 12px;
  border-right: 1px solid var(--line); background: var(--bg2); scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
main { min-width: 0; padding: 26px 44px 90px; }
.doc { max-width: 920px; margin: 0 auto; }
.scrim { display: none; }

/* sidebar search */
.side-search { position: sticky; top: -12px; z-index: 2; display: flex; align-items: center; gap: 8px; height: 52px;
  margin: -12px -10px 10px -12px; padding: 10px 10px 0 12px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.side-search .ic { width: 16px; height: 16px; color: var(--fg3); }
.side-search input { flex: 1; min-width: 0; height: 30px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel);
  color: var(--fg); font: 13.5px var(--sans); padding: 0 8px; }
.side-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.side-search input::-webkit-search-cancel-button { filter: grayscale(1); }
.side-res a { display: block; padding: 6px 9px; border-radius: var(--r); color: var(--fg); font-size: 13.5px; line-height: 1.35; }
.side-res a:hover, .side-res a.sel { background: var(--panel2); box-shadow: inset 2px 0 0 var(--accent); text-decoration: none; }
.side-res .r-p { display: block; color: var(--fg3); font-size: 11.5px; }
.side-res mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 2px; }
.side-res .sd-empty { padding: 14px 8px; font-size: 13px; }
.side.searching .nv { display: none; }

/* sidebar tree: an area per collapsible group */
.nv a { display: flex; align-items: center; gap: 8px; color: var(--fg2); font-size: 13.8px; line-height: 1.35; border-radius: var(--r); }
.nv a:hover { color: var(--fg); background: var(--panel2); text-decoration: none; }
.nv .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-home, .nv-ext { padding: 6px 8px; }
.nv-home .ic, .nv-ext .ic { width: 16px; height: 16px; color: var(--fg3); }
.nv-ext { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0 !important; padding-top: 12px; }
.nv-g { margin: 2px 0; }
.nv-g > summary { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r); cursor: pointer; list-style: none;
  color: var(--fg2); font: 600 12.5px var(--display); letter-spacing: .1em; text-transform: uppercase; user-select: none; }
.nv-g > summary::-webkit-details-marker { display: none; }
.nv-g > summary:hover { background: var(--panel2); color: var(--fg); }
.nv-g > summary .ic { width: 16px; height: 16px; }
.nv-g > summary .ic:last-child { width: 14px; height: 14px; color: var(--fg3); transition: transform .15s; }
.nv-g[open] > summary .ic:last-child { transform: rotate(90deg); }
.nv-g[open] > summary { color: var(--fg); }
.nv-g[open] > summary .ic:first-child { color: var(--accent); }
.nv-n { font: 600 10.5px var(--sans); letter-spacing: 0; color: var(--fg3); padding: 0 6px; border-radius: 3px; background: var(--panel2); }
.nv-l { margin: 2px 0 8px 15px; padding-left: 8px; border-left: 1px solid var(--line); }
.nv-a { padding: 4px 8px; }
.nv-a.on { color: var(--fg); background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.nv-row { display: flex; align-items: center; gap: 2px; }
.nv-row .nv-a { flex: 1; min-width: 0; }
.nv-tw { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: var(--r); background: none;
  color: var(--fg3); cursor: pointer; padding: 0; }
.nv-tw:hover { color: var(--accent); background: var(--panel2); }
.nv-tw .ic { width: 14px; height: 14px; transition: transform .15s; }
.nv-p.open .nv-tw .ic { transform: rotate(90deg); }
.nv-kids { display: none; margin-left: 10px; padding-left: 6px; border-left: 1px dashed var(--line2); }
.nv-p.open .nv-kids { display: block; }
.nv-k { font-size: 13.2px; padding: 3px 8px; }
.tag { display: inline-flex; align-items: center; flex: none; height: 16px; font: 600 9.5px var(--sans); letter-spacing: .06em;
  text-transform: uppercase; padding: 0 5px; border-radius: 3px; border: 1px solid var(--line2); color: var(--fg3); margin: 0; }
.tag-gen { color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 40%, transparent); }
.tag-wip { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

/* on-page table of contents: a column on wide screens, a fold at the top of the page below that */
.toc { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 28px 16px 30px 6px; font-size: 12.8px; scrollbar-width: thin; }
.toc h5, .toc-mini summary { margin: 0 0 8px; font: 600 11.5px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--fg3); }
.toc a { display: block; padding: 3px 0 3px 10px; color: var(--fg3); border-left: 2px solid var(--line); line-height: 1.4; }
.toc a.l3 { padding-left: 22px; font-size: 12.3px; }
.toc a.on, .toc a:hover { color: var(--fg); border-left-color: var(--accent); text-decoration: none; }
.toc-mini { display: none; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.toc-mini summary { margin: 0; padding: 8px 12px; cursor: pointer; }
.toc-mini-l { padding: 0 12px 10px; columns: 2 220px; column-gap: 18px; }
.toc-mini-l a { display: block; padding: 2px 0; font-size: 13px; color: var(--fg2); break-inside: avoid; }
.toc-mini-l a.l3 { padding-left: 12px; color: var(--fg3); }

/* ---- page head: breadcrumbs + pills */
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.8px; color: var(--fg3); }
.crumbs a { color: var(--fg2); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--line3); }
.crumbs [aria-current] { color: var(--fg); }
.pills { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 5px; font: 600 10.5px/1 var(--sans); letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 3px; border: 1px solid var(--line2); color: var(--fg2); white-space: nowrap; }
.pill .mk { width: 14px; height: 14px; }
.pill-gen { color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 45%, transparent); }
.pill-wip { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.pill-game { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* ---- content */
.doc h1, .doc h2, .doc h3 { font-family: var(--display); }
.doc h1 { font-size: 2.15rem; line-height: 1.15; margin: 0 0 14px; letter-spacing: .005em; font-weight: 700; }
.doc > h1::after { content: ""; display: block; width: 64px; height: 3px; margin-top: 10px; background: var(--accent);
  clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 100%, 0 100%); }
.doc h2 { font-size: 1.45rem; margin: 1.9em 0 .6em; padding-top: .45em; border-top: 1px solid var(--line); font-weight: 650; letter-spacing: .01em; }
.doc h3 { font-size: 1.12rem; margin: 1.6em 0 .45em; font-weight: 650; letter-spacing: .01em; }
.doc h4 { font-size: 1rem; margin: 1.3em 0 .4em; color: var(--fg2); }
.doc h2 .anchor, .doc h3 .anchor, .doc h4 .anchor { margin-left: 8px; color: var(--fg3); opacity: 0; font-weight: 400; transition: opacity .15s; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc h4:hover .anchor { opacity: 1; }
.doc p, .doc li { color: var(--fg); }
.doc ul, .doc ol { padding-left: 1.35em; }
.doc li { margin: .2em 0; }
.doc li::marker { color: var(--accent); }
.doc :not(pre) > code { font-size: .86em; padding: .1em .36em; border-radius: 3px; background: var(--panel2); border: 1px solid var(--line); color: var(--fg); word-break: break-word; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.doc blockquote { margin: 1em 0; padding: .2em 1em; border-left: 3px solid var(--accent2); color: var(--fg2); }
.lead { font-size: 1.08rem; color: var(--fg2); }
p.gen { color: var(--fg3); font-size: 12.5px; margin-top: 3em; }

/* code */
.code { margin: 1em 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--code-bg); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 4px 12px; border-bottom: 1px solid var(--line);
  font: 12px var(--mono); color: var(--fg3); background: var(--panel); box-shadow: inset 3px 0 0 var(--accent); }
.copy { font: 600 11px var(--sans); padding: 2px 9px; border-radius: 3px; border: 1px solid var(--line2); background: var(--panel2); color: var(--fg2); cursor: pointer; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.done { color: var(--ok); border-color: var(--ok); }
.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.58; }
.tk-k { color: var(--tk-k); } .tk-s { color: var(--tk-s); } .tk-c { color: var(--tk-c); font-style: italic; }
.tk-n { color: var(--tk-n); } .tk-f { color: var(--tk-f); } .tk-v { color: var(--tk-v); }

/* tables: a long one scrolls inside its box under a sticky header */
.table-wrap { margin: 1em 0; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.table-wrap.tall { max-height: min(72vh, 760px); }
.doc table { border-collapse: collapse; width: 100%; font-size: 13.4px; }
.doc th { text-align: left; background: var(--panel2); color: var(--fg2); font: 600 11.5px var(--display); letter-spacing: .08em;
  text-transform: uppercase; position: sticky; top: 0; z-index: 1; box-shadow: inset 0 -1px 0 var(--line2); }
.doc th, .doc td { padding: 6px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc tr:last-child td { border-bottom: 0; }
.doc tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel) 55%, transparent); }
.doc tbody tr:hover td { background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.yes, .no, .part, .plan { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 3px; font: 600 10.5px var(--sans);
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.yes { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.no { color: var(--fg3); }
.part { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent); }
.plan { color: var(--accent2); background: color-mix(in srgb, var(--accent2) 13%, transparent); }
.filter input { width: 100%; padding: 8px 11px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--panel); color: var(--fg); font: inherit; font-size: 13.5px; }
.filter input:focus { outline: none; border-color: var(--accent); }

/* the unified reference (tools/devwiki/xref.py): scope badges, legend, the name finder, row deep links.
   Fixed hues, not the page's game accent: a scope reads the same on a BF2, 2142 or Heroes page. */
.sc { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 3px; font: 700 10px var(--sans);
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; border: 1px solid; vertical-align: 1px; margin-right: 4px; }
.sc-s { color: var(--accent3); border-color: color-mix(in srgb, var(--accent3) 55%, transparent); background: color-mix(in srgb, var(--accent3) 14%, transparent); }
.sc-c { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.sc-b { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.sc-y { color: var(--fg3); border-color: var(--line2); }
.sc-l { color: var(--fg2); border-color: var(--line2); border-style: dashed; }
.legend { margin: 1em 0 1.2em; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--accent3); border-radius: var(--r); background: var(--panel); font-size: 13px; }
.lg-h { font: 600 12px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--fg2); margin-bottom: 6px; }
.lg-l { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; }
.lg-i { display: flex; align-items: baseline; gap: 6px; color: var(--fg2); }
.lg-i .sc { flex: none; min-width: 58px; justify-content: center; }
.lg-g { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--fg3); }
.lg-g > span:last-child { flex: 1 1 320px; }
/* fixed columns (fast on 2,000-row tables, the same widths on every page); a word breaks only where it overflows */
.table-wrap.xr table { table-layout: fixed; min-width: 760px; }
.table-wrap.xr th, .table-wrap.xr td, .table-wrap.xr code { word-break: normal; overflow-wrap: anywhere; }
.table-wrap.xr :where(th:first-child) { width: 28%; }
.table-wrap.xr :where(th:nth-child(n+2):nth-last-child(n+2)) { width: 14%; }
.table-wrap.xr :where(table:has(th:nth-child(6)) th:first-child) { width: 26%; }
.table-wrap.xr :where(table:has(th:nth-child(6)) th:nth-child(n+2):nth-last-child(n+2)) { width: 12.5%; }
/* the search box's results: full names, a short Kind column */
.table-wrap.xf :where(th:first-child) { width: 38%; }
.table-wrap.xf :where(th:nth-child(2)) { width: 16%; }
.table-wrap.xf :where(th:nth-child(n+3):nth-last-child(n+2)) { width: 12%; }
.table-wrap.xr td:last-child { font-size: 12.6px; color: var(--fg2); }
.table-wrap.xr td .sc + code { display: inline-block; margin-top: 2px; }
.doc tr[id] { scroll-margin-top: 130px; }
.doc tbody tr:target td { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
.doc tbody tr:target td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.xref-find { margin: 1.2em 0; }
.xf-in input { width: 100%; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--panel); color: var(--fg);
  font: inherit; font-size: 15px; box-shadow: inset 3px 0 0 var(--accent); }
.xf-in input:focus { outline: none; border-color: var(--accent); }
.xr-n { color: var(--fg3); font-size: 13px; margin: .6em 0 .2em; }
.xref-find mark, .r-name mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 2px; }
.r-g { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; }
.xg { display: inline-flex; align-items: center; gap: 3px; font: 600 10.5px var(--sans); color: var(--fg3); white-space: nowrap; }
.xg .sc { margin-right: 0; }

/* callouts, badges, cards */
.callout { margin: 1.1em 0; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); border-left: 3px solid var(--accent3); background: var(--panel); }
.callout > p:last-child { margin-bottom: 0; } .callout > p:first-of-type { margin-top: 5px; }
.callout-t { font: 600 12.5px var(--display); letter-spacing: .1em; text-transform: uppercase; }
.c-tip { border-left-color: var(--ok); } .c-tip .callout-t { color: var(--ok); }
.c-warn { border-left-color: var(--bad); } .c-warn .callout-t { color: var(--bad); }
.c-note .callout-t, .c-info .callout-t { color: var(--accent3); }
.c-stub { border-left-color: var(--warn); background: repeating-linear-gradient(-45deg, var(--panel), var(--panel) 12px, color-mix(in srgb, var(--warn) 6%, var(--panel)) 12px, color-mix(in srgb, var(--warn) 6%, var(--panel)) 24px); }
.c-stub .callout-t { color: var(--warn); }
.games { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: .2em 0 .8em; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; font: 700 10.5px var(--sans); padding: 0 8px; border-radius: 3px;
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; transform: rotate(45deg); }
.badge[data-game=heroes] { color: var(--bf-c-heroes-red-hi); background: color-mix(in srgb, var(--bf-c-heroes-parchment) 12%, transparent); }
[data-theme=light] .badge[data-game=heroes] { color: #b52f1e; }
.game-sec { margin: 1.4em 0; padding: 4px 16px 10px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--r);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--panel)), var(--panel) 120px); }
.game-sec-t { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; font: 600 1.05rem var(--display); }
.game-sec-t .games { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 1.1em 0; }
.card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); color: var(--fg); transition: transform .15s, border-color .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }
.card-t { font: 650 15px var(--display); letter-spacing: .02em; } .card-d { color: var(--fg2); font-size: 13.2px; line-height: 1.5; }

/* ---- home: hero, game cards, area cards */
.hero { position: relative; display: flex; align-items: center; gap: 24px; margin: 0 0 18px; padding: 22px 26px; border-radius: var(--r2);
  border: 1px solid var(--line2); overflow: hidden;
  background: radial-gradient(900px 260px at 0% 0%, color-mix(in srgb, var(--bf-c-orange) 17%, transparent), transparent 60%),
              radial-gradient(600px 260px at 100% 100%, color-mix(in srgb, var(--bf-c-tan) 12%, transparent), transparent 60%), var(--panel); }
.hero::before { content: ""; position: absolute; left: 0; top: 0; width: 4px; height: 100%; background: linear-gradient(180deg, var(--bf-c-orange), var(--bf-c-amber)); }
.hero-txt { position: relative; flex: 1; min-width: 0; }
.hero-kicker { font: 600 11.5px var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.hero h1 { margin: 4px 0 8px; font-size: 2.35rem; }
.hero h1::after { display: none; }
.hero p { margin: 0; color: var(--fg2); max-width: 640px; font-size: 14.5px; }
.hero .grid-bg { position: absolute; inset: 0; opacity: .3; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 26px 26px; mask-image: linear-gradient(90deg, transparent, #000 70%); }
.hero-go { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: var(--r); border: 1px solid var(--line2);
  background: var(--panel2); color: var(--fg); font: 600 12.5px var(--display); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-main { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-main:hover { background: var(--accent-hi); color: var(--accent-fg); }
.btn-key kbd { font-size: 11px; padding: 0 5px; border-radius: 3px; border: 1px solid var(--line3); }
.radar { position: relative; flex: none; width: 150px; height: 150px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--bf-c-orange) 45%, transparent);
  background: radial-gradient(circle, transparent 0 30%, color-mix(in srgb, var(--bf-c-orange) 22%, transparent) 30.5% 31%, transparent 31.5% 62%,
    color-mix(in srgb, var(--bf-c-orange) 22%, transparent) 62.5% 63%, transparent 63.5%),
    linear-gradient(transparent calc(50% - .5px), color-mix(in srgb, var(--bf-c-orange) 25%, transparent) 0 calc(50% + .5px), transparent 0),
    linear-gradient(90deg, transparent calc(50% - .5px), color-mix(in srgb, var(--bf-c-orange) 25%, transparent) 0 calc(50% + .5px), transparent 0),
    color-mix(in srgb, var(--bg2) 70%, transparent); overflow: hidden; }
.radar-sweep { position: absolute; inset: 0; border-radius: 50%; animation: sweep 4s linear infinite;
  background: conic-gradient(from 0deg, color-mix(in srgb, var(--bf-c-orange) 55%, transparent), transparent 70deg); }
.blip { position: absolute; width: 8px; height: 8px; border-radius: 50%; animation: blip 4s ease-out infinite; }
.blip.b1 { left: 64%; top: 26%; background: var(--bf-c-orange); box-shadow: 0 0 10px var(--bf-c-orange); animation-delay: .5s; }
.blip.b2 { left: 70%; top: 66%; background: var(--bf-c-2142-cyan); box-shadow: 0 0 10px var(--bf-c-2142-cyan); animation-delay: 1.5s; }
.blip.b3 { left: 24%; top: 60%; background: var(--bf-c-heroes-red-hi); box-shadow: 0 0 10px var(--bf-c-heroes-red-hi); animation-delay: 2.7s; }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes blip { 0% { opacity: 1; transform: scale(1.3); } 70%, 100% { opacity: .15; transform: scale(1); } }

.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.game-card { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--fg); overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, var(--panel)), var(--panel) 65%); transition: transform .15s, box-shadow .15s; }
.game-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; border-color: var(--accent); }
.game-card .mk { grid-row: span 2; width: 38px; height: 38px; color: var(--accent); }
.gc-t { font: 700 15.5px var(--display); letter-spacing: .03em; }
.gc-d { font-size: 12.3px; line-height: 1.4; color: var(--fg2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.game-card[data-game=heroes] { background: linear-gradient(135deg, color-mix(in srgb, var(--bf-c-heroes-parchment) 13%, var(--panel)), var(--panel) 65%); }
.area-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 8px; }
.area-card { position: relative; display: flex; flex-direction: column; padding: 12px 14px 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); transition: border-color .15s; }
.area-card::before { content: ""; position: absolute; left: -1px; top: -1px; width: 14px; height: 14px; border-left: 2px solid var(--accent);
  border-top: 2px solid var(--accent); border-top-left-radius: var(--r); }
.area-card:hover { border-color: var(--line3); }
.ac-head { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.ac-head:hover { text-decoration: none; color: var(--accent); }
.ac-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ac-ic .ic { width: 17px; height: 17px; }
.ac-t { flex: 1; font: 700 14.5px var(--display); letter-spacing: .1em; text-transform: uppercase; }
.ac-n { font: 600 10.5px var(--sans); color: var(--fg3); padding: 1px 6px; border-radius: 3px; background: var(--panel2); }
.ac-head > .ic { width: 14px; height: 14px; color: var(--fg3); }
.ac-d { margin: 7px 0 6px; font-size: 12.6px; line-height: 1.45; color: var(--fg2); }
.ac-l { list-style: none; margin: 0; padding: 0; }
.doc .ac-l li { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13.2px; line-height: 1.75; }
.ac-l li::before { content: ""; flex: none; width: 5px; height: 5px; background: var(--line3); transform: rotate(45deg); }
.ac-l a { color: var(--fg); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-l a:hover { color: var(--accent); }
.ac-more { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--fg3); }
.ac-bars { display: grid; gap: 6px; margin-top: 6px; }
.ac-bars i { display: block; height: 6px; border-radius: 2px; background: var(--panel3); position: relative; overflow: hidden; }
.ac-bars i::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--w)); animation: grow 1.6s cubic-bezier(.2,.8,.2,1) both; }
.ac-bars i:nth-child(1)::after { background: var(--g-bf2); } .ac-bars i:nth-child(2)::after { background: var(--g-2142); animation-delay: .15s; }
.ac-bars i:nth-child(3)::after { background: var(--g-heroes); animation-delay: .3s; }
@keyframes grow { from { transform: scaleX(0); } }

/* diagrams */
figure.diagram { margin: 1.3em 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--panel); }
figure.diagram svg { width: 100%; height: auto; display: block; }
figure.diagram figcaption { margin-top: 8px; font-size: 12.8px; color: var(--fg3); text-align: center; }
.dg-box { fill: var(--panel2); stroke: var(--line2); stroke-width: 1.2; }
.dg-box.a { stroke: var(--accent); } .dg-box.b { stroke: var(--accent2); } .dg-box.c { stroke: var(--accent3); }
.dg-box.g1 { stroke: var(--g-bf2); } .dg-box.g2 { stroke: var(--g-2142); } .dg-box.g3 { stroke: var(--g-heroes); }
.dg-t { fill: var(--fg); font: 600 13px var(--sans); } .dg-s { fill: var(--fg3); font: 11px var(--sans); } .dg-m { fill: var(--fg2); font: 11px var(--mono); }
.dg-line { stroke: var(--line2); stroke-width: 1.5; fill: none; }
.dg-flow { stroke: var(--accent); stroke-width: 2; fill: none; stroke-dasharray: 6 8; animation: dgflow 1.4s linear infinite; }
.dg-flow.b { stroke: var(--accent2); } .dg-flow.c { stroke: var(--accent3); }
.dg-dot { fill: var(--accent); } .dg-dot.b { fill: var(--accent2); } .dg-dot.c { fill: var(--accent3); }
.dg-f1 { fill: var(--g-bf2); } .dg-f2 { fill: var(--g-2142); } .dg-f3 { fill: var(--g-heroes); } .dg-fa { fill: var(--accent); } .dg-fb { fill: var(--accent2); } .dg-fc { fill: var(--accent3); } .dg-fn { fill: var(--fg3); }
.dg-soft { opacity: .32; } .dg-bg { fill: var(--panel3); stroke: var(--line); stroke-width: 1; } .dg-on { fill: #fff; font: 600 12px var(--sans); paint-order: stroke; stroke: rgba(0, 0, 0, .55); stroke-width: 2.5px; }
.dg-box.nofill { fill: none; } .dg-curve { stroke: var(--accent); stroke-width: 2.5; fill: none; } .dg-mid { text-anchor: middle; } .dg-end { text-anchor: end; }
.dg-pulse { animation: dgpulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes dgflow { to { stroke-dashoffset: -28; } }
@keyframes dgpulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dg-flow, .dg-pulse, .dg-move, .radar-sweep, .blip, .ac-bars i::after { animation: none !important; } }

/* search dialog */
.sd { position: fixed; inset: 0; z-index: 60; display: none; background: rgba(4, 6, 10, .62); backdrop-filter: blur(3px); }
.sd.open { display: block; }
.sd-box { width: min(720px, calc(100vw - 24px)); margin: 9vh auto 0; border-radius: var(--r2); border: 1px solid var(--line2); background: var(--bg2);
  box-shadow: var(--shadow); overflow: hidden; border-top: 3px solid var(--accent); }
.sd-in { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.sd-in .ic { color: var(--fg3); }
.sd-in input { flex: 1; height: 52px; border: 0; outline: 0; background: transparent; color: var(--fg); font: 17px var(--sans); }
.sd-res { max-height: 62vh; overflow-y: auto; padding: 6px; }
.sd-res a { display: block; padding: 8px 12px; border-radius: var(--r); color: var(--fg); }
.sd-res a:hover, .sd-res a.sel { background: var(--panel2); text-decoration: none; box-shadow: inset 2px 0 0 var(--accent); }
.sd-res .r-t { font-weight: 600; font-size: 14.5px; } .sd-res .r-p { color: var(--fg3); font-size: 12px; margin-left: 6px; }
.sd-res .r-k { float: right; font-size: 10.5px; color: var(--accent2); border: 1px solid var(--line2); border-radius: 3px; padding: 0 6px; text-transform: uppercase; letter-spacing: .06em; }
.sd-res .r-s { display: block; color: var(--fg2); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-res mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 2px; }
.sd-empty { padding: 24px; color: var(--fg3); text-align: center; font-size: 14px; }
.sd-foot { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--fg3); font-size: 12px; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; }
.pager a { flex: 1; padding: 11px 15px; border: 1px solid var(--line); border-radius: var(--r); color: var(--fg); background: var(--panel); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager small { display: block; color: var(--fg3); font: 600 11px var(--display); letter-spacing: .12em; text-transform: uppercase; }
.pager .nx { text-align: right; }
.foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--fg3); font-size: 12.3px; }
.totop { position: fixed; right: 18px; bottom: 18px; z-index: 20; width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--r);
  border: 1px solid var(--line2); background: var(--panel); color: var(--fg2); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; }
.totop.show { opacity: 1; pointer-events: auto; }
.totop:hover { color: var(--accent); border-color: var(--accent); }
.loading main .doc { opacity: .55; transition: opacity .1s; }

/* per-game pages: a band in the game's colours over the article */
.layout[data-game=heroes] .doc > .page-head, .layout[data-game="2142"] .doc > .page-head, .layout[data-game=bf2] .doc > .page-head {
  padding: 8px 12px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 14%, var(--panel)), var(--panel)); }
.layout[data-game=heroes] .doc > .page-head { background: linear-gradient(90deg, color-mix(in srgb, var(--bf-c-heroes-parchment) 16%, var(--panel)),
  color-mix(in srgb, var(--bf-c-heroes-red) 8%, var(--panel))); }

/* home: no table of contents column, a wider page for the cards */
@media (min-width: 901px) { .layout.home { grid-template-columns: var(--side) minmax(0, 1fr); } }
.layout.home .toc { display: none; }
.layout.home .doc { max-width: 1180px; }
[data-theme=dark] .layout[data-game=heroes] .doc > h1 { color: var(--bf-c-heroes-parchment); }

@media (max-width: 1279px) {
  .layout { grid-template-columns: var(--side) minmax(0, 1fr); }
  .toc { display: none; }
  .toc-mini { display: block; }
  .area-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .site-link { display: none; }
  .search-btn kbd { display: none; }
  .area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { padding-left: 12px; }
}
@media (max-width: 900px) {
  :root { --mast: 50px; --tabs: 38px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: grid; }
  .marks, .dash-btn span { display: none; }
  .dash-btn { padding: 0 9px; }
  .search-btn { max-width: none; }
  .search-btn span { display: none; }
  .search-btn { flex: 0 0 34px; justify-content: center; padding: 0; margin-left: auto; }
  .tab { padding: 0 10px; font-size: 12.5px; }
  .tab-ext { margin-left: 0; }
  .side { position: fixed; top: var(--top); left: 0; width: min(330px, 88vw); z-index: 40; transform: translateX(-102%); transition: transform .2s;
    box-shadow: var(--shadow); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--top) 0 0 0; z-index: 35; background: rgba(4, 6, 10, .55); }
  main { padding: 18px 16px 70px; }
  .doc h1 { font-size: 1.75rem; }
  .hero { padding: 18px 16px 18px 20px; }
  .hero h1 { font-size: 1.75rem; }
  .radar { display: none; }
  .game-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .gc-d { -webkit-line-clamp: 1; }
  .area-grid { grid-template-columns: minmax(0, 1fr); }
  .pills { margin-left: 0; }
  .totop { right: 12px; bottom: 12px; }
}
@media (max-width: 420px) {
  .brand-t small { display: none; }
  .area-grid { grid-template-columns: minmax(0, 1fr); }
}

/* interactive pieces (theme/ix.js): <div class="ix" data-ix="..."> */
.ix { margin: 1.4em 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--panel); }
.ix:empty::before { content: "This piece needs JavaScript."; color: var(--fg3); font-size: 13px; }
.ix-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.ix-head strong { font-size: 15px; color: var(--fg); } .ix-sub { font-size: 12.5px; color: var(--fg3); }
.ix-ctl { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px 18px; align-items: center; margin-bottom: 12px; }
.ix-row { display: grid; grid-template-columns: 108px 1fr 56px; align-items: center; gap: 8px; font-size: 13px; color: var(--fg2); }
.ix-row input[type=range] { width: 100%; accent-color: var(--accent); min-width: 0; }
.ix-o { font: 12.5px var(--mono); color: var(--fg); text-align: right; }
.ix-choice { grid-template-columns: 108px 1fr; }
.ix-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.ix-seg button, .ix-btn { font: 12.5px var(--sans); color: var(--fg2); background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.ix-seg button:hover, .ix-btn:hover { color: var(--fg); border-color: var(--accent); }
.ix-seg button.on { color: var(--bg, #0e1318); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.ix-btn { justify-self: start; } .ix-btn.on { color: var(--bg, #0e1318); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.ix-read { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; margin-bottom: 12px; }
.ix-cell { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); }
.ix-cell span { display: block; font-size: 11px; color: var(--fg3); } .ix-cell b { font: 600 14px var(--mono); color: var(--fg); }
.ix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.ix-fig { margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); min-width: 0; }
.ix-fig figcaption { font: 11.5px var(--mono); color: var(--fg3); margin-bottom: 4px; }
.ix-cv { display: block; width: 100%; } .ix-gl { height: 340px; border: 1px solid var(--line); border-radius: 6px; touch-action: none; cursor: grab; }
.ix-formula { margin: 10px 0 0; padding: 8px 10px; font: 12.5px var(--mono); color: var(--fg); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; white-space: pre-wrap; }
.ix-hud { position: relative; width: 100%; aspect-ratio: 16 / 10; margin-bottom: 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel2); overflow: hidden; }
.ix-hud-r { position: absolute; display: flex; align-items: center; justify-content: center; padding: 2px 4px; font: 12px var(--sans); line-height: 1.2; text-align: center; color: var(--fg2); background: color-mix(in srgb, var(--accent3) 10%, transparent); border: 1px solid var(--line2); border-radius: 6px; cursor: pointer; overflow: hidden; }
.ix-hud-r:hover, .ix-hud-r.on { color: var(--fg); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
@media (max-width: 720px) { .ix-hud-r { font-size: 10px; } }
.ix-pick { display: block; width: 100%; text-align: left; margin: 0 0 6px; padding: 8px 12px 8px 34px; position: relative; background: transparent; color: var(--fg2, var(--fg)); border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13.5px; cursor: pointer; }
.ix-pick::before { content: ""; position: absolute; left: 11px; top: 50%; width: 13px; height: 13px; margin-top: -7px; border: 1.5px solid var(--fg3); border-radius: 3px; }
.ix-pick.on { border-color: var(--accent); color: var(--fg); } .ix-pick.on::before { background: var(--accent); border-color: var(--accent); }
.ix-note { margin: 10px 0 0; font-size: 12.5px; color: var(--fg3); line-height: 1.5; }
.ix-pk { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); gap: 14px; }
.ix-bits { display: flex; flex-wrap: wrap; gap: 3px 2px; align-content: flex-start; }
.ix-run { display: inline-flex; flex-wrap: wrap; gap: 1px; padding: 2px; margin: 0; border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer; --gc: var(--line2); }
.ix-run i { display: block; width: 11px; height: 18px; line-height: 18px; text-align: center; font: 10px var(--mono); font-style: normal; color: var(--fg3); background: color-mix(in srgb, var(--gc) 22%, transparent); border-bottom: 2px solid var(--gc); }
.ix-run i.one { color: var(--fg); background: color-mix(in srgb, var(--gc) 48%, transparent); }
.ix-run:hover, .ix-run.on { border-color: var(--fg); } .ix-run.on { background: color-mix(in srgb, var(--gc) 30%, transparent); }
.g-header { --gc: var(--accent); } .g-window { --gc: var(--accent2); } .g-actions, .g-action { --gc: var(--accent3); } .g-events { --gc: var(--g-2142); }
.g-ghosts { --gc: var(--g-heroes); } .g-control { --gc: var(--g-bf2); } .g-entry { --gc: var(--fg3); }
.ix-side { padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); font-size: 13px; align-self: start; }
.ix-side h4 { margin: 6px 0 8px; font: 600 15px var(--mono); color: var(--fg); }
.ix-tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; color: var(--fg); background: color-mix(in srgb, var(--gc) 35%, transparent); }
.ix-legend { display: flex; flex-wrap: wrap; gap: 4px; grid-column: 1 / -1; }
.ix-side dl { display: grid; grid-template-columns: 82px 1fr; gap: 3px 8px; margin: 0 0 8px; } .ix-side dt { color: var(--fg3); } .ix-side dd { margin: 0; font: 12px var(--mono); color: var(--fg); overflow-wrap: anywhere; }
.ix-side p { margin: 0; color: var(--fg2); line-height: 1.5; }
.ix-hex { margin: 12px 0 0; padding: 8px 10px; font: 11.5px var(--mono); color: var(--fg2); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
/* a long name in a list line (an area's index page) breaks instead of widening the page (R-0110 round 2) */
.doc li { overflow-wrap: anywhere; }
/* a phone: a table of four or more columns keeps a readable width and scrolls sideways in its box (R-0110 round 2) */
@media (max-width: 720px) { .table-wrap:not(.xr):not(.xf) table:has(th:nth-child(4)) { min-width: 620px; } .table-wrap:not(.xr):not(.xf) table:has(th:nth-child(6)) { min-width: 860px; } }
@media (max-width: 720px) { figure.diagram { overflow-x: auto; } figure.diagram > svg { min-width: 620px; } .ix-pk { grid-template-columns: 1fr; } .ix-row { grid-template-columns: minmax(92px, max-content) 1fr 50px; } .ix-choice { grid-template-columns: 1fr; } .ix-gl { height: 260px; } }

/* R-0110 round 5: the parity page's bars (tools/devwiki/parity.py) */
.pbars { margin: 1em 0 1.2em; }
.pbar-row { display: grid; grid-template-columns: 11em 1fr; gap: .8em; align-items: center; margin: .45em 0; }
.pbar-l { font-size: .9em; color: var(--fg2); }
.pbar { display: flex; height: 16px; border-radius: 4px; overflow: hidden; background: var(--line2); }
.pbar-a { background: var(--accent); } .pbar-b { background: var(--accent2); } .pbar-c { background: var(--accent3); } .pbar-n { background: var(--line2); }
.pbar-key { font-size: .82em; color: var(--fg3); margin: .6em 0 0; }
.pbar-key span { display: inline-block; width: .9em; height: .9em; border-radius: 2px; vertical-align: -1px; margin: 0 .25em 0 .9em; }
.pbar-key span:first-child { margin-left: 0; }
@media (max-width: 640px) { .pbar-row { grid-template-columns: 1fr; gap: .15em; } }

/* R-0110 round 7: a folded block (md.py :::fold) */
details.fold { margin: 1em 0; }
details.fold > summary { cursor: pointer; display: inline-block; padding: .35em .8em; border: 1px solid var(--line2); border-radius: var(--r); color: var(--link); font-size: .92em; user-select: none; }
details.fold > summary:hover { border-color: var(--accent); }
details.fold[open] > summary { margin-bottom: .2em; }
/* a table of many columns keeps a readable width and scrolls sideways in its own box (features.py) */
.table-wrap.wide table { min-width: 1180px; }
.table-wrap.wide th { white-space: nowrap; }
.table-wrap.wide td:nth-child(n+2) { min-width: 6.5em; }
.table-wrap.wide th, .table-wrap.wide td, .table-wrap.wide code { word-break: normal; overflow-wrap: anywhere; }
.table-wrap.wide :where(th:first-child) { width: 22%; }

/* R-0110 round 7: the start page's three doors */
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 1em 0 1.6em; }
.door { border: 1px solid var(--line); border-radius: var(--r2); background: var(--panel); padding: 14px 16px; }
.door h3 { margin: 0 0 .3em; font-size: 1.08em; color: var(--accent); }
.door p { margin: 0 0 .6em; font-size: .9em; color: var(--fg2); }
.door ol { margin: 0; padding-left: 1.25em; font-size: .93em; }
.door li { margin: .28em 0; }
@media (max-width: 900px) { .doors { grid-template-columns: 1fr; } }
.pbar-row[hidden], .pbars[hidden] { display: none; }
