:root {
  color-scheme: dark;
  --ink: #080a08;
  --panel: #10140f;
  --panel-2: #151a13;
  --line: #2c3329;
  --line-strong: #414b3d;
  --paper: #f0f2e8;
  --muted: #788074;
  --quiet: #525a50;
  --acid: #c8f04c;
  --orange: #ff9d2e;
  --cyan: #54cfdb;
  --red: #ed6f5e;
  --purple: #b59aec;
  --blue: #6e9ef1;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--ink); }
body { min-height: 100vh; margin: 0; background: var(--ink); color: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.stats-shell { width: min(1680px, 100%); margin: 0 auto; padding: 0 42px 38px; }
.stats-topbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--line); }
.stats-brand { min-width: 0; display: flex; align-items: center; gap: 20px; color: var(--muted); text-decoration: none; }
.stats-brand img { width: 162px; height: auto; display: block; }
.stats-brand-name { color: var(--paper); font-size: 17px; font-weight: 850; letter-spacing: -.035em; white-space: nowrap; }
.stats-brand span { padding-left: 20px; border-left: 1px solid var(--line-strong); font-size: 9px; font-weight: 850; letter-spacing: .18em; white-space: nowrap; }
.stats-live-state { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.stats-live-state > a { padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 5px; color: #c7cbc1; text-decoration: none; font-weight: 800; letter-spacing: .06em; }
.stats-live-state > a:hover { border-color: var(--acid); color: var(--acid); }
.stats-live-pill { display: inline-flex; align-items: center; gap: 7px; color: #bdc2b7; font-weight: 850; letter-spacing: .12em; }
.stats-live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); animation: live-pulse 2.2s ease-in-out infinite; }
.stats-live-pill.stale i { background: var(--orange); }
@keyframes live-pulse { 50% { opacity: .4; transform: scale(.78); } }

main { padding-top: 34px; }
.stats-hero { display: grid; grid-template-columns: minmax(210px, .28fr) minmax(0, 1fr); gap: 12px; }
.stats-hero-readout { min-width: 0; min-height: 576px; display: flex; flex-direction: column; justify-content: space-between; padding: 27px 26px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.stats-hero-readout > p { margin: 0; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.stats-hero-readout > strong { display: block; overflow: hidden; color: var(--acid); font-size: clamp(88px, 10vw, 174px); font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -.09em; line-height: .78; text-overflow: ellipsis; }
.stats-hero-detail { display: grid; gap: 8px; color: #8c9487; font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.stats-chart-console { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); overflow: hidden; }
.stats-chart-toolbar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.stats-segment { display: flex; align-items: center; gap: 4px; }
.stats-segment button { min-height: 34px; padding: 0 13px; border: 1px solid transparent; border-radius: 4px; color: #737b70; background: transparent; cursor: pointer; font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.stats-segment button:hover { color: #c9cec3; background: #181d16; }
.stats-segment button.active { border-color: #52603f; color: var(--acid); background: #1b2316; }
.stats-segment.compact button { min-height: 30px; padding-inline: 10px; }
.stats-server-filters { min-height: 45px; display: flex; align-items: center; gap: 6px; padding: 7px 17px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.stats-server-filters::-webkit-scrollbar { display: none; }
.stats-server-filter { flex: 0 0 auto; min-height: 27px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #30372e; border-radius: 999px; color: #747c71; background: #0c0f0b; cursor: pointer; font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.stats-server-filter i { width: 5px; height: 5px; border-radius: 50%; background: #4f574c; }
.stats-server-filter.active { border-color: #66754e; color: #dce1d4; background: #1a2116; }
.stats-server-filter.active i { background: var(--server-color, var(--acid)); }
.stats-server-filter[data-tone="0"] { --server-color: var(--acid); }
.stats-server-filter[data-tone="1"] { --server-color: var(--orange); }
.stats-server-filter[data-tone="2"] { --server-color: var(--cyan); }
.stats-server-filter[data-tone="3"] { --server-color: var(--purple); }
.stats-server-filter[data-tone="4"] { --server-color: var(--red); }
.stats-server-filter[data-tone="5"] { --server-color: var(--blue); }
.stats-chart-stage { position: relative; min-height: 408px; background: #0a0d09; }
#history-chart { width: 100%; height: 408px; display: block; overflow: visible; }
#chart-guides line { stroke: #20261e; stroke-width: 1; vector-effect: non-scaling-stroke; }
#chart-guides text, #chart-axis text { fill: #5f675c; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
#chart-area { fill: rgba(200,240,76,.055); }
#chart-line { fill: none; stroke: var(--acid); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#chart-line.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: chart-draw .7s ease-out forwards; }
@keyframes chart-draw { to { stroke-dashoffset: 0; } }
#chart-server-lines path { fill: none; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; opacity: .58; vector-effect: non-scaling-stroke; }
#chart-crosshair { stroke: #899181; stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
#chart-focus-point { fill: var(--acid); stroke: #0a0d09; stroke-width: 3; vector-effect: non-scaling-stroke; }
#chart-tooltip rect { fill: #1a2018; stroke: #4b5546; stroke-width: 1; vector-effect: non-scaling-stroke; }
#chart-tooltip-time { fill: #81897d; font-size: 10px; font-weight: 700; letter-spacing: .05em; }
#chart-tooltip-value { fill: #eef1e8; font-size: 17px; font-weight: 850; }
#chart-hit { cursor: crosshair; pointer-events: all; }
.stats-chart-empty, .stats-chart-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #697166; font-size: 9px; font-weight: 850; letter-spacing: .16em; pointer-events: none; }
.stats-chart-loading { gap: 11px; background: #0a0d09; }
.stats-chart-loading i { width: 8px; height: 8px; background: var(--acid); animation: loading-block .8s steps(2, end) infinite; }
@keyframes loading-block { 50% { transform: rotate(45deg) scale(.72); opacity: .5; } }
.stats-period-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.stats-period-strip > div { min-width: 0; min-height: 76px; padding: 14px 17px; border-right: 1px solid var(--line); }
.stats-period-strip > div:last-child { border-right: 0; }
.stats-period-strip span, .stats-period-strip small { display: block; overflow: hidden; color: var(--quiet); font-size: 7px; font-weight: 800; letter-spacing: .1em; text-overflow: ellipsis; white-space: nowrap; }
.stats-period-strip strong { display: block; margin: 6px 0 3px; overflow: hidden; color: #dfe3d8; font-size: 18px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }

.stats-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.stats-kpis article { min-width: 0; min-height: 112px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.stats-kpis span, .stats-kpis small { display: block; overflow: hidden; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-overflow: ellipsis; white-space: nowrap; }
.stats-kpis strong { display: block; margin: 12px 0 7px; overflow: hidden; color: #eef1e8; font-size: 25px; font-variant-numeric: tabular-nums; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.stats-kpis small { color: var(--quiet); }

.stats-section { margin-top: 64px; }
.stats-section-heading, .stats-board-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 17px; }
.stats-section-heading span, .stats-board-heading span { display: block; margin-bottom: 7px; color: var(--orange); font-size: 7px; font-weight: 900; letter-spacing: .15em; }
.stats-section-heading h2, .stats-board-heading h2 { margin: 0; font-size: 25px; font-weight: 880; letter-spacing: -.035em; }
.stats-section-heading > strong, .stats-board-heading > b { color: #7d8578; font-size: 9px; font-weight: 800; letter-spacing: .06em; }
.stats-server-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats-server-card { min-width: 0; min-height: 218px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.stats-server-card.offline { border-color: #56342f; }
.stats-server-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.stats-server-card-number { display: flex; align-items: center; gap: 10px; }
.stats-server-card-number i { width: 9px; height: 9px; background: var(--server-color); transform: rotate(45deg); }
.stats-server-card-number strong { font-size: 15px; }
.stats-server-card-top > span { color: #87907f; font-size: 7px; font-weight: 850; letter-spacing: .1em; }
.stats-server-card.offline .stats-server-card-top > span { color: var(--red); }
.stats-server-card-value { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-top: 30px; }
.stats-server-card-value strong { color: #eef2e7; font-size: 48px; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -.06em; line-height: .82; }
.stats-server-card-value span { max-width: 58%; overflow: hidden; color: #6e766a; font-size: 8px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.stats-server-card progress { width: 100%; height: 4px; margin: 20px 0 15px; border: 0; appearance: none; background: #262d24; }
.stats-server-card progress::-webkit-progress-bar { background: #262d24; }
.stats-server-card progress::-webkit-progress-value { background: var(--server-color); }
.stats-server-card progress::-moz-progress-bar { background: var(--server-color); }
.stats-server-card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 14px; border-top: 1px solid #272e25; }
.stats-server-card-meta span, .stats-server-card-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-server-card-meta span { color: var(--quiet); font-size: 7px; font-weight: 800; }
.stats-server-card-meta b { margin-top: 4px; color: #b7bdb2; font-size: 9px; font-variant-numeric: tabular-nums; }
.tone-0 { --server-color: var(--acid); }
.tone-1 { --server-color: var(--orange); }
.tone-2 { --server-color: var(--cyan); }
.tone-3 { --server-color: var(--purple); }
.tone-4 { --server-color: var(--red); }
.tone-5 { --server-color: var(--blue); }

.stats-board-grid { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 8px; margin-top: 64px; }
.stats-board { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.stats-board-heading { align-items: center; margin-bottom: 12px; }
.stats-board-heading h2 { font-size: 20px; }
.stats-leader-row { min-height: 55px; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-top: 1px solid #272e25; }
.stats-leader-row > i { color: #555e52; font-size: 8px; font-style: normal; font-variant-numeric: tabular-nums; }
.stats-leader-row > div { min-width: 0; }
.stats-leader-row strong, .stats-leader-row small, .stats-leader-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-leader-row strong { color: #dfe3d9; font-size: 10px; }
.stats-leader-row small { margin-top: 3px; color: #626a5f; font-size: 7px; }
.stats-leader-row b { color: #c8d0c1; font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.stats-faction-row { padding: 14px 0 12px; border-top: 1px solid #272e25; }
.stats-faction-row-top, .stats-faction-row-meta { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.stats-faction-row-top strong { min-width: 0; overflow: hidden; color: #dfe3d9; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.stats-faction-row-top strong i { width: 7px; height: 7px; display: inline-block; margin-right: 8px; border-radius: 50%; background: var(--faction-color, var(--acid)); }
.stats-faction-row-top b { color: #bdc4b8; font-size: 10px; font-variant-numeric: tabular-nums; }
.stats-faction-row progress { width: 100%; height: 3px; display: block; margin: 9px 0 7px; border: 0; appearance: none; background: #262d24; }
.stats-faction-row progress::-webkit-progress-bar { background: #262d24; }
.stats-faction-row progress::-webkit-progress-value { background: var(--faction-color, var(--acid)); }
.stats-faction-row progress::-moz-progress-bar { background: var(--faction-color, var(--acid)); }
.stats-faction-row-meta { color: #626a5f; font-size: 7px; font-weight: 750; }
.faction-tone-0 { --faction-color: var(--acid); }
.faction-tone-1 { --faction-color: var(--orange); }
.faction-tone-2 { --faction-color: var(--cyan); }
.faction-tone-3 { --faction-color: var(--purple); }
.faction-tone-4 { --faction-color: var(--red); }
.faction-tone-5 { --faction-color: var(--blue); }

.stats-roster-section { margin-bottom: 64px; }
.roster-heading { align-items: center; }
.stats-roster-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); scrollbar-color: #4a5346 #11150f; scrollbar-width: thin; }
.stats-roster-wrap:focus-visible { outline: 1px solid #63705b; outline-offset: 2px; }
.stats-roster-row { width: 100%; min-width: 900px; min-height: 54px; display: grid; grid-template-columns: 34px minmax(180px, 1.5fr) 70px minmax(100px, .8fr) 110px 90px 70px; align-items: center; gap: 15px; padding: 0 18px; border-bottom: 1px solid #272e25; color: #aeb5a9; font-size: 9px; }
.stats-roster-row.head { min-height: 38px; color: #5e665b; background: #151a13; font-size: 7px; font-weight: 850; letter-spacing: .08em; }
.stats-roster-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-roster-row > span:first-child { color: #596157; font-variant-numeric: tabular-nums; }
.stats-roster-row .player-name { color: #e0e4da; font-weight: 720; }
.stats-roster-row .player-cash { color: #c9df93; font-weight: 750; font-variant-numeric: tabular-nums; }
.stats-roster-row .player-ping.high { color: var(--red); }
.stats-roster-empty, .stats-list-empty { padding: 34px 18px; color: #60685d; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-align: center; }

.stats-footer { min-height: 72px; display: flex; align-items: center; gap: 24px; border-top: 1px solid var(--line); color: #596157; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.stats-footer a { color: #858d81; text-decoration: none; }
.stats-footer a:hover { color: var(--acid); }
.stats-footer span { margin-left: auto; font-variant-numeric: tabular-nums; }
.stats-error { position: fixed; z-index: 10; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: rgba(8,10,8,.96); }
.stats-error strong { color: var(--red); font-size: 15px; letter-spacing: .16em; }
.stats-error button { min-height: 38px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 5px; color: #dbe0d5; background: var(--panel-2); cursor: pointer; font-size: 8px; font-weight: 850; letter-spacing: .1em; }

@media (max-width: 1180px) {
  .stats-shell { padding-inline: 28px; }
  .stats-hero { grid-template-columns: 190px minmax(0, 1fr); }
  .stats-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-board-grid { grid-template-columns: 1fr 1fr; }
  .stats-board.faction-board { grid-column: 1 / -1; }
}

@media (max-width: 850px) {
  .stats-shell { padding-inline: 20px; }
  .stats-topbar { min-height: 74px; }
  .stats-brand span { display: none; }
  .stats-live-state time { display: none; }
  main { padding-top: 22px; }
  .stats-hero { grid-template-columns: 1fr; }
  .stats-hero-readout { min-height: 190px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 22px; }
  .stats-hero-readout > strong { grid-column: 2; grid-row: 1 / span 2; font-size: clamp(78px, 22vw, 140px); }
  .stats-hero-detail { align-self: end; }
  .stats-chart-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .stats-chart-stage, #history-chart { min-height: 350px; height: 350px; }
  .stats-server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-board-grid { grid-template-columns: 1fr; }
  .stats-board.faction-board { grid-column: auto; }
}

@media (max-width: 580px) {
  .stats-shell { padding: 0 12px 24px; }
  .stats-brand img { width: 132px; }
  .stats-live-state { gap: 10px; }
  .stats-live-state > a { padding-inline: 9px; }
  .stats-hero-readout { min-height: 164px; padding: 18px; }
  .stats-chart-toolbar { padding: 11px; overflow-x: auto; }
  .stats-segment { width: max-content; }
  .stats-server-filters { padding-inline: 11px; }
  .stats-chart-stage, #history-chart { min-height: 310px; height: 310px; }
  .stats-period-strip { grid-template-columns: 1fr 1fr; }
  .stats-period-strip > div:nth-child(2) { border-right: 0; }
  .stats-period-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-kpis article { padding: 15px; }
  .stats-section, .stats-board-grid { margin-top: 48px; }
  .stats-section-heading { align-items: flex-start; }
  .stats-section-heading h2 { font-size: 22px; }
  .stats-server-grid { grid-template-columns: 1fr; }
  .stats-server-card { min-height: 205px; }
  .roster-heading { align-items: flex-start; flex-direction: column; }
  .stats-footer { flex-wrap: wrap; gap: 16px; padding: 18px 0; }
  .stats-footer span { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
