:root {
  --bg: #12141a;
  --card: #1b1e27;
  --line: #2a2e3a;
  --text: #e8eaf0;
  --muted: #9aa0b0;
  --accent: #f2b53a;
  --on: #3ccf6e;
  --vs: #8e5bd8;
  --nc: #3f7fe0;
  --tr: #d84a4a;
  --ns: #a0a4ad;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.top {
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center;
  padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--card);
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 700; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
nav a { color: var(--muted); text-decoration: none; padding: .25rem 0; }
nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); }
main { max-width: 1200px; margin: 0 auto; padding: 1rem; }
footer { color: var(--muted); font-size: .85rem; text-align: center; padding: 2rem 1rem; }
h1 { font-size: 1.6rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); font-weight: 400; }
.notice { background: var(--card); border-left: 3px solid var(--accent); padding: .6rem .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: .5rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; display: flex; flex-direction: column; }
.card .tile { background: var(--bg); }
.label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.grid2 > .card { margin-bottom: 0; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.chart { width: 100%; height: auto; }
.chart rect { fill: var(--accent); }
.chart rect:hover { fill: var(--text); }
.factions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.f { border-radius: 6px; padding: .5rem .75rem; display: flex; justify-content: space-between; background: var(--bg); border-left: 4px solid; }
.f.vs { border-color: var(--vs); } .f.nc { border-color: var(--nc); } .f.tr { border-color: var(--tr); } .f.ns { border-color: var(--ns); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }
table.sortable th { cursor: pointer; user-select: none; }
th[aria-sort="ascending"]::after { content: " \25B2"; }
th[aria-sort="descending"]::after { content: " \25BC"; }
.num { text-align: right; }
tbody tr:hover { background: rgba(255,255,255,.03); }
table.compact td { padding: .3rem .4rem; }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); vertical-align: middle; }
.dot.on { background: var(--on); }
.search { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.search input { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .7rem; font: inherit; min-width: 14rem; }
.search button { background: var(--accent); color: #111; border: 0; border-radius: 6px; padding: .5rem 1rem; font: inherit; font-weight: 700; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 1rem 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.brand img { height: 48px; width: auto; display: block; }
.brand span { font-size: 1.1rem; letter-spacing: .02em; }
.small { font-size: .85rem; }
.timer { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; white-space: nowrap; }
.alerts { display: grid; gap: .75rem; }
.alert-card { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .6rem .75rem; }
.alert-head, .held-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.territory { display: flex; height: 1.4rem; margin-top: .5rem; border-radius: 4px; overflow: hidden; font-size: .75rem; }
.territory .t { flex: 1 1 33%; display: flex; align-items: center; justify-content: center; color: #fff; white-space: nowrap; overflow: hidden; min-width: 0; }
.territory .vs { background: var(--vs); } .territory .nc { background: var(--nc); } .territory .tr { background: var(--tr); }
.held { list-style: none; margin: 0; padding: 0; }
.held li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.held li:last-child { border-bottom: 0; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.events li:last-child { border-bottom: 0; }
.events li.live .timer { color: var(--on); }
.events p { margin: .3rem 0 0; color: var(--muted); }
.mini-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: .75rem; }
.mini-tiles > div { background: var(--bg); border-radius: 6px; padding: .5rem .7rem; display: flex; flex-direction: column; }
.mini-tiles b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.button { display: inline-block; background: var(--accent); color: #111; font-weight: 700; text-decoration: none; border-radius: 6px; padding: .45rem .9rem; margin: .25rem .4rem .25rem 0; }
.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
footer a { color: var(--muted); }

/* Player profile */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.suggest { position: relative; }
.suggest-list { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: .25rem 0; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.4); max-height: 18rem; overflow-y: auto; }
.suggest-list li { padding: .4rem .7rem; cursor: pointer; }
.suggest-list li[aria-selected="true"], .suggest-list li:hover { background: var(--bg); color: var(--accent); }
.profile-head { display: flex; flex-wrap: wrap; gap: .75rem 2rem; align-items: center; border-left: 4px solid var(--line); }
.profile-head.vs { border-left-color: var(--vs); } .profile-head.nc { border-left-color: var(--nc); }
.profile-head.tr { border-left-color: var(--tr); } .profile-head.ns { border-left-color: var(--ns); }
.profile-head h1 { margin: 0; font-size: 1.8rem; overflow-wrap: anywhere; }
.who { display: flex; flex-direction: column; min-width: 0; }
.head-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .4rem 1.25rem; margin: 0; flex: 1 1 24rem; }
.head-facts dt { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.head-facts dd { margin: 0; font-weight: 600; }
.badge { display: inline-block; padding: 0 .45rem; border-radius: 4px; color: #fff; background: var(--ns); font-size: .85rem; }
.badge.vs { background: var(--vs); } .badge.nc { background: var(--nc); } .badge.tr { background: var(--tr); }
.profile-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; margin: 1rem 0; }
.profile-grid > .card, .grid-half > .card { margin-bottom: 0; }
.stack { display: grid; gap: 1rem; align-content: start; }
.stack > .card { margin-bottom: 0; }
.grid-half { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 800px) { .profile-grid, .grid-half { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem 1rem; margin: 0; }
.stats div { border-bottom: 1px solid var(--line); padding-bottom: .35rem; }
.stats dt { color: var(--muted); font-size: .8rem; }
.stats dd { margin: 0; font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats small, .tile small { display: block; font-size: .7rem; font-weight: 400; color: var(--muted); }
.gauge { display: block; width: 100%; max-width: 16rem; margin: 0 auto; }
.gauge path { fill: none; stroke-width: 12; stroke-linecap: butt; }
.gauge .track { stroke: var(--bg); }
.gauge .fill { stroke: var(--accent); }
.gauge text { fill: var(--text); font-size: 15px; font-weight: 700; }
.gauge-legend { display: flex; justify-content: space-between; max-width: 16rem; margin: .25rem auto .5rem; font-size: .8rem; color: var(--muted); }
.gauge-legend b { color: var(--text); }
.usage { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.usage li { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; align-items: baseline; }
.usage .u-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage .u-val { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pbar { grid-column: 1 / -1; width: 100%; height: .45rem; display: block; }
.pbar .track { fill: var(--bg); }
.pbar .fill { fill: var(--accent); }
.big-number { margin: 0 0 .75rem; }
.big-number b { font-size: 1.6rem; }
table.weapons td:first-child { white-space: normal; min-width: 10rem; }
@media (max-width: 560px) {
  .search input { min-width: 0; width: 100%; }
  .search .suggest { flex: 1 1 100%; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .value { font-size: 1.2rem; }
}
