/* Fonts are served from this site (SIL Open Font License, see assets/fonts/). No requests to Google. */
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 200 900; font-display: swap; src: url(/assets/fonts/source-serif-4-latin-opsz-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 200 900; font-display: swap; src: url(/assets/fonts/source-serif-4-latin-ext-opsz-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 200 900; font-display: swap; src: url(/assets/fonts/source-sans-3-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 200 900; font-display: swap; src: url(/assets/fonts/source-sans-3-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Source Sans 3'; font-style: italic; font-weight: 200 900; font-display: swap; src: url(/assets/fonts/source-sans-3-latin-wght-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Source Sans 3'; font-style: italic; font-weight: 200 900; font-display: swap; src: url(/assets/fonts/source-sans-3-latin-ext-wght-italic.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
/* DoW IV Compendium: wiki-style theme. Square corners, serif headings, bordered tables, infobox on the right. */
:root {
  --bg: #14120e; --page: #1d1a15; --panel: #221f19; --panel-2: #1a1813; --well: #12100c;
  --line: #3a3429; --line-2: #4c4535;
  --text: #e8e1d1; --text-2: #c2b8a4; --text-3: #938a77;
  --brass: #d6ad5c; --brass-2: #f0cd84; --good: #8fc98a; --bad: #e08a7a; --blood: #5a2620;
  --head: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --body: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --r: 2px;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--body); min-height: 100vh; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
a { color: var(--brass); text-decoration: none; }
a:hover { color: var(--brass-2); text-decoration: underline; }
button { font: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(28px, 4vw, 34px); font-weight: 600; margin: 0 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
h2 { font-size: 23px; margin: 26px 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
h3 { font-size: 17px; margin: 0 0 6px; font-weight: 700; }
p { margin: 0 0 12px; }
.sub { color: var(--text-3); font-style: italic; margin: 0 0 14px; }
.lead { color: var(--text); }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.mono { font-family: var(--body); font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 14px; font-style: italic; color: var(--text-3); margin: 0 0 2px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--brass); color: #14120e; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-head { background: #0f0d0a; border-bottom: 2px solid var(--blood); }
.site-head .in { max-width: 1320px; margin: 0 auto; padding: 8px 20px; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 700; font-size: 21px; color: var(--text); }
.brand svg { color: var(--brass); }
.brand-logo { display: block; width: 32px; height: 32px; border-radius: 3px; }
.brand:hover { color: var(--text); text-decoration: none; }
.search { position: relative; min-width: 220px; flex: 0 1 320px; }
.search input { width: 100%; background: var(--well); border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 10px 7px 32px; color: var(--text); font: inherit; font-size: 14px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }
.search-results { position: absolute; z-index: 20; top: calc(100% + 2px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line-2); padding: 0; margin: 0; list-style: none; max-height: 360px; overflow: auto; box-shadow: 0 8px 20px rgba(0,0,0,0.5); }
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; color: var(--text); font-size: 14px; border-bottom: 1px solid var(--line); }
.search-results a:hover, .search-results a.on { background: #2c271e; text-decoration: none; }
.search-results .k { color: var(--text-3); font-size: 12px; }
.search-big { max-width: 560px; flex: none; margin: 0 0 18px; }
.search-big input { padding: 10px 12px 10px 38px; font-size: 16px; }
.search-big svg { left: 12px; }

/* Page frame: sidebar + page */
.wrap { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 0 20px; padding: 16px 20px 32px; align-items: start; }
.side-nav { position: sticky; top: 12px; font-size: 14px; }
.side-nav summary { display: none; }
.side-nav nav { display: flex; flex-direction: column; }
.side-nav nav h2 { font-family: var(--body); font-size: 12px; font-weight: 700; color: var(--text-3); border: 0; margin: 16px 0 4px; padding: 0 0 3px; border-bottom: 1px solid var(--line); letter-spacing: 0.02em; }
.side-nav nav a { color: var(--text-2); padding: 3px 0 3px 8px; border-left: 2px solid transparent; }
.side-nav nav a:hover { color: var(--brass-2); }
.side-nav nav a[aria-current="page"], .side-nav nav a.on { color: var(--text); border-left-color: var(--brass); font-weight: 600; }
main { min-width: 0; background: var(--page); border: 1px solid var(--line); padding: 20px 26px 34px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); background: #0f0d0a; }
.site-foot .in { max-width: 1320px; margin: 0 auto; padding: 14px 20px 18px 240px; font-size: 13px; color: var(--text-3); }
.site-foot p { margin: 0 0 4px; }

/* Layout pieces */
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.title-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.title-row h1 { border-bottom: 0; }
.title-row + * { margin-top: 0; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.cols > .main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cols > .side { flex: 1 1 290px; max-width: 360px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.cols > .main > section > h2:first-child, .cols > .main > section:first-child h2 { margin-top: 4px; }
.section { margin-bottom: 22px; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; }
.panel h2 { font-size: 18px !important; margin: 0 0 8px; }
.panel.accent { border-left: 3px solid var(--brass); }
.panel.gap { background: transparent; border-style: dashed; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(var(--min, 260px), 100%), 1fr)); }

/* Infobox (key facts) */
.infobox { border: 1px solid var(--line-2); background: var(--panel-2); font-size: 14px; }
.infobox .ib-title { background: var(--blood); color: #f3e6cf; font: 600 18px/1.3 var(--head); text-align: center; padding: 7px 10px; }
.infobox .tile { display: grid; grid-template-columns: 44% 1fr; gap: 2px 10px; padding: 6px 10px; border-top: 1px solid var(--line); align-items: baseline; }
.infobox .tile .l { color: var(--text-3); font-weight: 600; grid-row: span 2; }
.infobox .tile .v { font-weight: 600; }
.infobox .tile .v.na { color: var(--text-3); font-weight: 400; font-style: italic; font-size: 13px; }
.infobox .tile .v .small { font-weight: 400; color: var(--text-2); }
.infobox .tile .s { font-size: 11px; }
.infobox a.tile:hover { text-decoration: none; background: #2a261e; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); margin-bottom: 18px; }
.tiles .tile { padding: 8px 12px; border-right: 1px solid var(--line); }
.tile .l { font-size: 13px; color: var(--text-3); }
.tile .v { font-size: 17px; }
.tile .v.na { color: var(--text-3); font-size: 14px; font-style: italic; }
.tile .s { font-size: 11px; color: var(--text-3); }
.chg { font-size: 12px; color: var(--good); margin-left: 6px; }

/* Source marks, like wiki references */
.src { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.src::before { content: '['; } .src::after { content: ']'; }
a.src:hover { color: var(--brass); text-decoration: none; }
.tag { display: inline-block; font-size: 12px; padding: 0 5px; border: 1px solid var(--line-2); color: var(--text-3); vertical-align: 1px; line-height: 1.5; }
.tag.guess { color: var(--bad); border-color: rgba(224,138,122,0.45); }
.tag.inf { color: var(--brass); border-color: rgba(214,173,92,0.45); }

/* Buttons and tabs */
.seg { display: inline-flex; border: 1px solid var(--line-2); }
.seg button { padding: 6px 12px; min-height: 36px; border: 0; background: var(--panel); font-weight: 600; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--brass); color: #14120e; }
.tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 4px 0 14px; border-bottom: 1px solid var(--line-2); }
.tab { padding: 6px 14px; min-height: 36px; border: 1px solid transparent; border-bottom: 0; background: transparent; font-weight: 600; font-size: 14px; color: var(--brass); margin-bottom: -1px; }
.tab[aria-selected="true"], .tab[aria-pressed="true"] { border-color: var(--line-2); background: var(--page); color: var(--text); }
nav.tabs .tab { color: var(--brass) !important; }
.chip { padding: 4px 10px; min-height: 32px; border: 1px solid var(--line); background: transparent; font-size: 13px; }
.chip[aria-pressed="true"] { border-color: var(--brass); color: var(--text); background: #2a251b; }
.pill { display: inline; }
.field { display: flex; align-items: center; gap: 8px; background: var(--well); border: 1px solid var(--line-2); padding: 7px 10px; }
.field input { background: transparent; border: 0; color: var(--text); font: inherit; outline: none; width: 100%; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }

/* Main page portals */
.counts { color: var(--text-2); font-size: 14px; }
.portals { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 6px 0 8px; }
.pcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.portal { border: 1px solid var(--line-2); background: var(--panel-2); }
.portal h2 { margin: 0; padding: 6px 12px; background: #2a251c; border-bottom: 1px solid var(--line-2); font-size: 18px; }
.portal-body { padding: 10px 14px; }
.portal-body ul { margin: 0 0 6px; padding-left: 18px; }
.portal-body li + li { margin-top: 3px; }
.portal-body .table-wrap { border: 0; }
table.plainrows th, table.plainrows td { background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 5px 8px 5px 0; font-size: 14px; }
table.plainrows th { font-family: var(--head); font-size: 16px; color: var(--text); text-transform: none; letter-spacing: 0; }
.portal p:last-child { margin-bottom: 0; }

/* Tables: wikitable */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; border: 1px solid var(--line-2); }
th { background: #2a251c; color: var(--text); text-align: left; font-size: 13px; font-weight: 700; padding: 6px 10px; white-space: nowrap; border: 1px solid var(--line-2); }
th button { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; font-weight: inherit; }
th[aria-sort] button::after { content: ' ⇅'; opacity: 0.45; font-weight: 400; }
th[aria-sort="ascending"] button::after { content: ' ▲'; opacity: 1; color: var(--brass); }
th[aria-sort="descending"] button::after { content: ' ▼'; opacity: 1; color: var(--brass); }
td { padding: 6px 10px; border: 1px solid var(--line); background: var(--panel-2); vertical-align: top; }
tbody tr:nth-child(even) td { background: #1f1c16; }
td.n, th.n { text-align: right; }
tr.locked td { opacity: 0.6; }

/* Boxes that were cards */
.card { display: block; background: var(--panel-2); border: 1px solid var(--line); padding: 10px 12px; color: var(--text); }
a.card:hover { border-color: var(--brass); color: var(--text); text-decoration: none; }
a.card h3 { color: var(--brass); }
.card .meta { font-size: 12px; color: var(--text-3); }
.bgroup { margin-bottom: 16px; }
.bgroup > h3 { font-size: 17px; margin: 14px 0 8px; }
.bcard { display: grid; gap: 6px; }
.bcard .top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.chips { display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; line-height: 1.5; min-width: 0; }
.chips a { display: inline-flex; align-items: center; max-width: 100%; min-width: 0; padding: 0; border: 0; background: none; font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.chips a:not(:last-child)::after { content: '·'; color: var(--text-3); margin: 0 7px 0 5px; }
.chips .lk { opacity: 0.7; }
.upbox { border-left: 3px solid var(--brass); background: rgba(214,173,92,0.06); padding: 6px 10px; font-size: 14px; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li + li { margin-top: 6px; }
ol.steps { margin: 0; padding-left: 20px; color: var(--text-2); }
ol.steps li + li { margin-top: 4px; }

/* Factions hub */
.fcard { display: block; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.fcard .n { font-family: var(--head); font-size: 20px; font-weight: 600; }
.fhub h2 { border: 0; margin: 0; padding: 0; }
.ok { color: var(--good); }

/* Maps */
.mapbox { position: relative; aspect-ratio: 262 / 266; background: var(--well); overflow: hidden; }
.mapbox svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mapbox path { fill: #3b3528; fill-rule: evenodd; stroke: var(--text-2); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.mapbox .st { position: absolute; transform: translate(-50%, -50%); width: 18px; height: 18px; border-radius: 50%; background: var(--brass); color: #14120e; font: 700 11px/18px var(--body); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.mapbox.big .st { width: 28px; height: 28px; font-size: 16px; line-height: 28px; }
.mcard { display: block; padding: 0; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.mcard:hover { border-color: var(--brass); text-decoration: none; color: var(--text); }
.mcard .t { padding: 8px 10px; }
dl.facts { margin: 0; display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 14px; }
dl.facts dt { color: var(--text-3); font-weight: 600; }
dl.facts dd { margin: 0; }

/* Reserve slots */
.slots { display: flex; gap: 3px; }
.slots span { flex: 1 1 0; height: 20px; max-width: 40px; background: var(--well); border: 1px solid var(--line); }
.slots span.b { background: var(--text-2); }
.slots span.a { background: var(--brass); }

/* Badges */
.badge { display: flex; gap: 12px; }
.badge .ic { flex: 0 0 40px; height: 40px; border: 1px solid var(--brass); display: grid; place-items: center; font: 700 15px var(--head); color: var(--brass); }

/* Glossary */
dl.gloss { margin: 0; }
dl.gloss > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
dl.gloss dt { font-weight: 700; font-family: var(--head); font-size: 16px; }
dl.gloss dd { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
dl.gloss dd.ex { color: var(--text-3); font-size: 13px; }
.calc input[type=range] { accent-color: var(--brass); width: 100%; }
.calc label { display: grid; grid-template-columns: 150px minmax(0,1fr) 36px; gap: 12px; align-items: center; }
.big-num { font-size: 44px; font-weight: 700; line-height: 1.1; font-family: var(--head); }
.meter { height: 12px; background: var(--well); border: 1px solid var(--line); overflow: hidden; margin: 8px 0 6px; }
.meter > div { height: 100%; background: var(--brass); }

/* Damage bars */
.dmg { display: flex; flex-direction: column; gap: 14px; }
.dmg-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 132px; gap: 12px; align-items: center; }
.dmg-row .t { font-weight: 600; }
.track { position: relative; height: 14px; background: var(--well); border-radius: 3px; }
.track .bar { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; background: var(--brass); min-width: 3px; }
.track .obar { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: rgba(185,181,172,0.22); min-width: 3px; }
.dmg-row .r { font-size: 14px; text-align: right; }
.delta { font-size: 12px; margin-left: 4px; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); margin-top: 14px; }
.legend i { display: inline-block; width: 22px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

[hidden] { display: none !important; }

@media (max-width: 640px) {
  main { padding: 20px 16px 40px; }
  .site-head .in, .site-foot .in { padding-left: 16px; padding-right: 16px; }
  .search { flex: 1 1 100%; }
  .dmg-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .dmg-row .t { grid-column: 1; grid-row: 1; }
  .dmg-row .r { grid-column: 2; grid-row: 1; }
  .dmg-row .track { grid-column: 1 / -1; grid-row: 2; }
  dl.facts { grid-template-columns: 110px 1fr; }
  .calc label { grid-template-columns: 110px minmax(0,1fr) 30px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

tr.me td { background: rgba(201,162,39,0.08); }
.hpbox ul li { margin-bottom: 4px; }
.badge .meta { white-space: nowrap; }
.badge.soon .ic { border-color: var(--line); color: var(--text-3); }
td.n { white-space: nowrap; }
.scroll-hint { display: none; margin: 6px 0 0; font-size: 12px; color: var(--text-3); }
.table-wrap.scrolls + .scroll-hint { display: block; }
@media (max-width: 640px) {
  .table-wrap table { font-size: 13px; }
  .table-wrap th, .table-wrap td { padding: 9px 10px; }
  .table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); max-width: 150px; }
}

/* Tech tree */
.tt { display: flex; flex-direction: column; gap: 8px; }
.tt-lane { display: grid; grid-template-columns: 190px minmax(0, 1fr) 210px minmax(0, 1fr); gap: 10px 28px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.tt-node { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); }
.tt-node.up { border-color: rgba(224,184,74,0.55); }
.tt-node.none { visibility: hidden; }
.tt-lane.no-up > .tt-out { grid-column: 2 / -1; }
.tt-node::after { content: '→'; position: absolute; right: -21px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.tt-out .chips { margin: 0; }
.tt-out .chips a { margin-bottom: 0; }
.tt-out, .tt-node { min-width: 0; }
.tt-node strong { overflow-wrap: anywhere; }
.tt-lane > .tt-out:nth-child(2) { position: relative; }
.chips a.tt-r { border-style: dashed; color: var(--text-2); }
.tt-key { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; }
.tt-key i { width: 14px; height: 10px; border: 1px solid var(--line-2); border-radius: 999px; }
.tt-key i.r { border-style: dashed; }
@media (max-width: 760px) {
  .tt-lane { grid-template-columns: 1fr; gap: 6px; }
  .tt-node::after { content: '↓'; right: auto; left: 14px; top: auto; bottom: -18px; transform: none; }
  .tt-node.none { display: none; }
  .tt-out { padding: 8px 0 4px; }
}

.modelist { columns: 2 200px; column-gap: 24px; margin: 0; padding-left: 18px; color: var(--text-2); }
.modelist li { break-inside: avoid; margin-bottom: 3px; }
@media (max-width: 640px) { .grid.maps-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }

.mt-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 10px; }
.mt-thumbs a { display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--text-2); font-size: 11px; line-height: 1.2; }
.mt-thumbs svg { width: 100%; height: auto; }

select { background: var(--well); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; max-width: 100%; }

/* Wiki theme overrides for older widgets */
.track, .track .bar, .track .obar, .tt-node, .tt-lane, select { border-radius: 0 !important; }
.tt-lane { background: var(--panel-2); padding: 8px 10px; }
.tt-node { background: var(--page); }
.tt-node.up { border-color: var(--brass); }
.chips a.tt-r { font-style: italic; color: var(--text-2); }
.tt-key i { border-radius: 0; }
.legend i { border-radius: 0; }
tr.me td { background: #2e2819 !important; }
@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; padding: 0 0 24px; gap: 0; }
  .side-nav { position: static; background: var(--panel-2); border-bottom: 1px solid var(--line); padding: 0 16px; }
  .side-nav summary { display: block; padding: 10px 0; font-weight: 700; cursor: pointer; }
  .side-nav nav { padding-bottom: 12px; columns: 2; display: block; }
  .side-nav nav a { display: block; }
  .side-nav nav h2 { break-after: avoid; }
  main { border-left: 0; border-right: 0; padding: 16px 16px 28px; }
  .site-foot .in { padding: 14px 16px; }
  .portals { grid-template-columns: 1fr; }
  .cols > .side { max-width: none; }
  .site-head .in { padding: 8px 16px; }
  .search { flex: 1 1 100%; }
}

/* Home: faction list in the Factions portal */
ul.fac-list { list-style: none; margin: 0; padding: 0; }
ul.fac-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.fac-list li:last-child { border-bottom: 0; }
ul.fac-list .fac-name { display: block; font-family: var(--head); font-size: 17px; font-weight: 600; }
ul.fac-list .chips { font-size: 14px; }

/* Coming soon placeholders */
.soon { display: inline-block; font-style: italic; color: var(--text-3); }
.tile .v .soon { font-size: 15px; }
.soon-notice { border: 1px solid var(--line); border-left: 4px solid var(--brass); background: var(--panel-2); padding: 10px 14px; margin: 0 0 18px; }
.soon-box { margin: 14px 0 8px; }
.soon-box h3 { margin: 0 0 4px; }
ul.soon-list { margin: 6px 0 0; }

/* Art banners (official press-kit art) */
.banner { margin: 0 -26px 18px; position: relative; overflow: hidden; background: var(--well); height: clamp(150px, 22vw, 280px); }
main > .banner:first-child { margin-top: -20px; }
.banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.banner::after { content: ''; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to bottom, transparent, var(--page)); pointer-events: none; }
.banner.hero { height: clamp(180px, 28vw, 360px); }
.banner.strip { height: 120px; }
.banner.strip img { object-position: center 35%; }
.card-img { display: block; width: calc(100% + 24px); margin: -10px -12px 10px; height: 110px; object-fit: cover; }
.roadmap img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
@media (max-width: 900px) {
  .banner { margin-left: -16px; margin-right: -16px; }
  main > .banner:first-child { margin-top: -16px; }
  .banner.strip { height: 90px; }
}

/* Game icons */
.ico { flex: none; border-radius: 4px; border: 1px solid var(--line-2); background: #0c0d0b; object-fit: cover; vertical-align: middle; }
.ico-r { background: #1c2212; }
.has-ico { display: flex; align-items: center; gap: 10px; }
td.has-ico { display: table-cell; white-space: nowrap; }
td.has-ico .ico { margin-right: 10px; }
ul.plain li.has-ico { align-items: flex-start; margin-bottom: 6px; }
.chips a .ico, .tt-out a .ico { width: 20px; height: 20px; margin-right: 6px; border-radius: 3px; }
.tt-node a.has-ico { gap: 8px; }
h1.with-ico { display: flex; align-items: center; gap: 16px; }
h1.with-ico .ico { width: 64px; height: 64px; border-radius: 8px; border-color: var(--line); box-shadow: 0 2px 10px rgba(0,0,0,.4); }
@media (max-width: 560px) { h1.with-ico .ico { width: 48px; height: 48px; } }

/* Research calculator on unit pages. */
.rcalc { margin-bottom: 24px; }
.rcalc h2 { font-size: 22px; margin-top: 0; }
.rc-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rc-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 16px; margin: 0 0 12px; }
.rc-item { display: flex; gap: 8px; align-items: flex-start; padding: 6px 4px; cursor: pointer; border-radius: 4px; }
.rc-item:hover { background: rgba(224, 184, 74, 0.06); }
.rc-item input { margin-top: 6px; accent-color: var(--brass); flex: none; }
.rc-item .ico { flex: none; }
.rc-name { font-weight: 600; }
.rc-table { width: 100%; }
.rc-up { color: var(--brass); font-weight: 700; }

/* In-game model picture at the top of the infobox. */
.infobox .ib-pic { margin: 0; background: #0d0e10; border-bottom: 1px solid var(--line); }
.infobox .ib-pic img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
/* Map previews, mode icons and badge icons from the game */
.mapbox.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mapfig { margin: 0 0 16px; }
.mapfig figcaption { margin-top: 6px; }
.mapshot { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--well); }
.mode-ico { vertical-align: -0.2em; margin-right: 6px; opacity: 0.9; }
h3.mode-h { display: flex; align-items: center; gap: 4px; }
.badge .ic.ic-img { flex: 0 0 56px; width: 56px; height: 56px; padding: 0; border: 1px solid var(--line); object-fit: cover; background: #0c0d0b; }
.badge.soon .ic.ic-img { border-color: var(--line); }

/* Hover cards on links. */
.hovercard { position: absolute; z-index: 50; width: 300px; max-width: calc(100vw - 16px); background: #17140f; border: 1px solid var(--brass); box-shadow: 0 8px 24px rgba(0,0,0,.55); padding: 10px 12px; font-size: 13px; line-height: 1.45; color: var(--text); pointer-events: none; }
.hovercard[hidden] { display: none; }
.hc-top { display: flex; gap: 10px; align-items: center; }
.hc-img { width: 96px; height: 96px; object-fit: cover; flex: none; background: #0d0e10; border: 1px solid var(--line); }
.hc-img.hc-icon { width: 48px; height: 48px; }
.hc-img.hc-wide { width: 120px; height: 68px; }
.hc-n { font-family: var(--head); font-weight: 700; font-size: 17px; line-height: 1.2; }
.hc-k { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.hc-f { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.hc-f dt { color: var(--text-3); }
.hc-f dd { margin: 0; font-weight: 600; text-align: right; }
.hc-d { margin: 8px 0 0; color: var(--text-2); }
.hc-note { margin: 6px 0 0; color: var(--brass); font-size: 12px; }

/* Accessibility: links inside text get an underline, so they do not rely on colour alone (WCAG 1.4.1). */
main p a:not(.card):not(.btn), main li a:not(.card):not(.btn), main td a, main dd a, .crumbs a, .site-foot a { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); text-underline-offset: 3px; }
main p a:hover, main li a:hover, main td a:hover, main dd a:hover, .site-foot a:hover { text-decoration-color: currentColor; }
tr.me .muted { color: var(--text-2); }
