:root {
  --bg: #121418; --panel: #181b20; --panel-2: #16191e; --well: #0e1013;
  --line: #2a2e36; --line-2: #3a3f49;
  --text: #e9e6df; --text-2: #b9b5ac; --text-3: #8d8a83;
  --brass: #e0b84a; --brass-2: #f2d27a; --good: #7fd18b; --bad: #f08a7e;
  --head: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: Inter, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r: 10px;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px 24px 48px; }
a { color: var(--brass); }
a:hover { color: var(--brass-2); }
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; letter-spacing: 0.01em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(38px, 6vw, 56px); font-weight: 700; margin: 4px 0 8px; }
h2 { font-size: 28px; margin: 0 0 12px; }
h3 { font-size: 21px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.lead { color: var(--text-2); max-width: 680px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--brass); text-transform: uppercase; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--brass); color: #121418; padding: 8px 12px; border-radius: 6px; 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 { border-bottom: 1px solid var(--line); background: var(--panel-2); }
.site-head .in { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.brand { font-family: var(--head); font-weight: 700; font-size: 22px; letter-spacing: 0.04em; color: var(--text); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.nav a { color: var(--text-2); text-decoration: none; padding: 8px 0; }
.nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px var(--brass); }
.search { position: relative; min-width: 240px; flex: 0 1 300px; }
.search input { width: 100%; background: var(--well); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px 9px 34px; 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% + 4px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px; margin: 0; list-style: none; max-height: 360px; overflow: auto; box-shadow: 0 12px 30px rgba(0,0,0,0.5); }
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 14px; }
.search-results a:hover, .search-results a.on { background: rgba(224,184,74,0.12); }
.search-results .k { color: var(--text-3); font-size: 12px; }
.search-big { max-width: 640px; flex: none; }
.search-big input { padding: 14px 16px 14px 42px; font-size: 17px; border-color: var(--line-2); border-radius: 8px; }
.search-big svg { left: 14px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); background: var(--panel-2); }
.site-foot .in { max-width: 1200px; margin: 0 auto; padding: 18px 24px; display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; font-size: 13px; color: var(--text-3); }
.site-foot strong { color: var(--text); font-weight: 500; }

/* Layout */
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.title-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.cols { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.cols > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.cols > .side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.section { margin-bottom: 32px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.panel.accent { border-color: var(--brass); }
.panel.gap { background: var(--panel-2); border-style: dashed; border-color: var(--line-2); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(var(--min, 260px), 1fr)); }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 28px; }
.tile { background: var(--panel); padding: 14px 16px; }
.tile .l { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.tile .v { font-family: var(--mono); font-size: 26px; font-weight: 500; }
.tile .v.na { color: var(--text-3); font-size: 18px; }
.tile .s { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.chg { font-size: 12px; color: var(--good); margin-left: 6px; }

/* Source marks */
.src { font-family: var(--mono); font-size: 11px; color: var(--text-3); text-decoration: none; border-bottom: 1px dotted var(--line-2); }
.src:hover { color: var(--brass); }
.tag { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--text-3); vertical-align: middle; }
.tag.guess { color: var(--bad); border-color: rgba(240,138,126,0.4); }
.tag.inf { color: var(--brass); border-color: rgba(224,184,74,0.4); }

/* Buttons */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { padding: 10px 16px; min-height: 44px; border: 0; background: var(--panel); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--brass); color: #121418; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tab { padding: 10px 16px; min-height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; }
.tab[aria-selected="true"], .tab[aria-pressed="true"] { border-color: var(--brass); background: rgba(224,184,74,0.12); }
.chip { padding: 6px 12px; min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: transparent; font-size: 13px; }
.chip[aria-pressed="true"] { border-color: var(--brass); background: rgba(224,184,74,0.12); }
.pill { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; background: var(--panel-2); margin: 0 6px 6px 0; }
.field { display: flex; align-items: center; gap: 8px; background: var(--well); border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 14px; }
.field input { background: transparent; border: 0; color: var(--text); font: inherit; outline: none; width: 100%; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }

/* 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-family: var(--mono); 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; }

/* Tables */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--panel-2); color: var(--text-3); text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; padding: 10px 14px; white-space: nowrap; }
th button { background: none; border: 0; padding: 0; text-transform: inherit; letter-spacing: inherit; font-size: inherit; color: inherit; font-weight: inherit; }
th[aria-sort] button::after { content: ' ↕'; opacity: 0.5; }
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: 11px 14px; border-top: 1px solid var(--line); background: var(--panel); }
td.n, th.n { text-align: right; font-family: var(--mono); }
tr.locked td { opacity: 0.6; }

/* Cards */
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; color: var(--text); text-decoration: none; }
a.card:hover { border-color: var(--line-2); color: var(--text); }
.card .meta { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.bgroup { margin-bottom: 22px; }
.bgroup > h3 { font-size: 14px; font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin: 0 0 10px; }
.bcard { display: grid; gap: 10px; }
.bcard .top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.chips a { display: inline-block; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; margin: 0 6px 6px 0; text-decoration: none; color: var(--text); background: var(--panel-2); }
.chips a:hover { border-color: var(--brass); }
.chips .lk { opacity: 0.65; }
.upbox { border: 1px solid rgba(224,184,74,0.35); background: rgba(224,184,74,0.06); border-radius: 8px; padding: 10px 12px; 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 on home */
.fcard { display: block; padding: 18px 20px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.fcard.live { border-color: var(--brass); }
.fcard.soon { opacity: 0.7; }
.fcard .n { font-family: var(--head); font-size: 28px; font-weight: 700; }
.ok { color: var(--good); }

/* Maps */
.mapbox { position: relative; aspect-ratio: 262 / 266; background: var(--well); border-radius: 8px; overflow: hidden; }
.mapbox svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mapbox path { fill: #3a3f49; 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: #121418; font: 700 11px/18px var(--head); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.mapbox.big .st { width: 28px; height: 28px; font-size: 17px; line-height: 28px; }
.mcard { display: block; padding: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); text-decoration: none; }
.mcard:hover { border-color: var(--line-2); }
.mcard .mapbox { border-radius: 0; }
.mcard .t { padding: 10px 12px; }
dl.facts { margin: 0; display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
dl.facts dt { color: var(--text-3); }
dl.facts dd { margin: 0; }

/* Reserve slots */
.slots { display: flex; gap: 4px; }
.slots span { flex: 1 1 0; height: 22px; max-width: 44px; border-radius: 4px; background: var(--well); }
.slots span.b { background: var(--text-2); }
.slots span.a { background: var(--brass); }

/* Badges */
.badge { display: flex; gap: 14px; }
.badge .ic { flex: 0 0 44px; height: 44px; border-radius: 50%; border: 2px solid var(--brass); display: grid; place-items: center; font: 700 16px var(--head); color: var(--brass); }

/* Glossary */
dl.gloss { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
dl.gloss > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
dl.gloss dt { font-weight: 600; }
dl.gloss dd { margin: 4px 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-family: var(--mono); font-size: 48px; font-weight: 500; line-height: 1.1; }
.meter { height: 14px; background: var(--well); border-radius: 3px; overflow: hidden; margin: 8px 0 6px; }
.meter > div { height: 100%; background: var(--brass); }

[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-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: 4px; }
.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%; }
