:root {
  --bg: #0b0d12;
  --panel: #12151d;
  --panel-2: #151821;
  --tile: #1d2230;
  --line: #222837;
  --line-soft: #1a1f2b;
  --line-strong: #2d3445;
  --text: #f2f3f5;
  --soft: #c9cfdb;
  --muted: #9aa3b5;
  --lime: #c6f432;
  --pink: #ff7a93;
  --rose: #ffb3cd;
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--lime); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 4px; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 18px; }
i { font-style: normal; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--lime); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.mono { font-family: var(--mono); font-size: 13px; }
.dim { color: var(--muted); }
.small { font-size: 13px; }
.lime { color: var(--lime); }
.rose { color: var(--rose); }
.strong { font-weight: 600; }
.lbl { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lbl.rose { color: var(--rose); }

/* Shell */
.rail {
  width: 72px; flex: none; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid #1e2330;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 0;
}
.rail-logo { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.rail-link { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.rail-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rail-link:hover { background: var(--panel); }
.rail-link.on { background: var(--line-soft); color: var(--text); }
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 32px; border-bottom: 1px solid #1e2330; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-logo { display: none; }
.search { position: relative; width: 320px; max-width: 100%; }
.search input {
  width: 100%; height: 44px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 0 14px 0 40px; color: var(--text); font: inherit; font-size: 14px;
}
.search input::placeholder { color: var(--muted); }
.search-icon { position: absolute; left: 13px; top: 13px; color: var(--muted); pointer-events: none; display: flex; }
.wrap { width: 100%; max-width: 1400px; margin: 0 auto; padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 22px; flex: 1; }
.footer { padding: 24px 32px 32px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 32px; justify-content: space-between; border-top: 1px solid #1e2330; }
.tabbar { display: none; }

/* Ticker */
.ticker { height: 52px; flex: none; display: flex; align-items: center; border-bottom: 1px solid #1e2330; overflow: hidden; white-space: nowrap; }
.ticker a { display: inline-flex; align-items: center; gap: 10px; padding: 0 22px; height: 52px; border-right: 1px solid #1e2330; font-size: 14px; }
.ticker b { font-weight: 600; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }

/* Shared pieces */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.pad { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.page-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap; }
.page-head.stack { flex-direction: column; align-items: flex-start; gap: 8px; }
.intro { color: var(--soft); max-width: 720px; font-size: 16px; }
.block { display: flex; flex-direction: column; gap: 14px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.block-head a { font-size: 14px; color: var(--soft); padding: 6px 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); margin-right: 10px; vertical-align: 2px; }
.code { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--soft); border: 1px solid #3a4152; border-radius: 5px; padding: 2px 6px; }
.code.dim { color: var(--muted); }
.chip { font-size: 12px; color: #dde2eb; background: var(--line-soft); border-radius: 6px; padding: 3px 9px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.chg { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.chg.up { color: var(--lime); }
.chg.down { color: var(--pink); }
.chg.flat { color: var(--muted); }
.av {
  width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--tile); border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--soft);
}
.nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nm b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm > span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border: 1px solid #3a4152; border-radius: 12px; font-weight: 600; }
.btn.primary { background: var(--lime); border-color: var(--lime); color: var(--bg); }
.btn.primary:hover { color: var(--bg); filter: brightness(1.08); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; border-radius: 6px; padding: 3px 8px; text-transform: uppercase; }
.tag.live { color: var(--lime); border: 1px solid #4c5f14; }
.tag.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.tag.rose, .tag.wait { color: var(--rose); border: 1px solid #7a3552; }
.tag.ok { color: var(--bg); background: var(--lime); }
.tag.idle { color: var(--soft); border: 1px solid #3a4152; }
.empty { padding: 28px 20px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 14px; }
.empty b { color: var(--text); font-weight: 600; font-size: 15px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi-tile { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.kpi-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 8px; }
.kpi { font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1; letter-spacing: -0.03em; }
.kpi small { font-size: 18px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi .chg { font-family: var(--display); font-size: 40px; gap: 10px; }
.kpi .chg svg { width: 20px; height: 18px; }
.kpi-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-tile.gta6, .panel.gta6 { border-color: #5a3046; }

/* Banner */
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-radius: 14px; flex-wrap: wrap; }
.banner-text { flex: 1 1 320px; color: var(--soft); }
.banner-text strong { color: var(--text); }
.pill { background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; }

/* Collector cards */
.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.card { display: block; padding: 3px; border-radius: 20px; min-width: 0; }
.card:hover { color: inherit; transform: translateY(-2px); }
.card-face {
  height: 100%; min-height: 330px; background: var(--panel); border-radius: 17px; padding: 16px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.card-top { align-self: stretch; display: flex; justify-content: space-between; align-items: flex-start; }
.card-score { display: block; font-family: var(--display); font-weight: 700; font-size: 46px; line-height: 0.9; letter-spacing: -0.03em; }
.card-tier { display: block; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 6px; }
.card-name { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.15; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-stats { align-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; border-top: 1px solid #262b38; padding-top: 12px; margin-top: auto; text-align: center; }
.card-stats b { display: block; font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.1; }
.card-stats i { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.emblem path { fill: var(--emblem-fill); stroke: var(--tier-ink); }
.emblem text { fill: var(--tier-ink); font-family: var(--display); }
.tier-legendary { --tier-ink: #ffc4ea; --emblem-fill: #241a30; background: linear-gradient(135deg, #ff8ad4, #8ad4ff 28%, #b8ff8a 50%, #ffe38a 72%, #c48aff); }
.tier-gold { --tier-ink: #ffe38a; --emblem-fill: #2a2412; background: linear-gradient(135deg, #ffe38a, #c78a1b 35%, #fff3c4 55%, #b07010); }
.tier-silver { --tier-ink: #c9d6f2; --emblem-fill: #1e2030; background: linear-gradient(135deg, #e8f0ff, #8fa3c8 35%, #ffffff 55%, #7c8fb5); }
.tier-bronze { --tier-ink: #f0b48a; --emblem-fill: #2a1c12; background: linear-gradient(135deg, #f0b48a, #9a5a2e 35%, #ffd9bd 55%, #7e4320); }
.card-tier { color: var(--tier-ink); }
.tier-mystery { background: var(--line-strong); }
.tier-mystery .card-face { justify-content: center; gap: 12px; background: repeating-linear-gradient(45deg, #12151d 0, #12151d 14px, #171b25 14px, #171b25 28px); }
.card-q { font-family: var(--display); font-weight: 700; font-size: 104px; line-height: 1; color: #5c6578; }
.card-note { font-size: 13px; color: var(--muted); text-align: center; }

/* Tables */
.tables { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tables.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.table { overflow: hidden; }
.table > h2 { padding: 16px 20px 12px; font-size: 17px; }
.tr { display: flex; align-items: center; gap: 14px; padding: 0 20px; min-height: 60px; border-top: 1px solid var(--line-soft); }
.tr:hover { background: var(--panel-2); color: inherit; }
.tr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }

/* Server list */
.filters { display: flex; flex-direction: column; gap: 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--soft); }
.filter.on { background: var(--lime); border-color: var(--lime); color: var(--bg); font-weight: 600; }
.filter.on:hover { color: var(--bg); }
.list-head { display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
.list-row { padding-top: 8px; padding-bottom: 8px; }
.c-rank { width: 40px; flex: none; }
.c-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.c-lang { width: 48px; flex: none; }
.c-num { width: 120px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.c-num b { font-family: var(--display); font-weight: 700; font-size: 17px; }
.c-num i { color: var(--muted); font-size: 13px; }
.c-chg { width: 70px; flex: none; display: flex; justify-content: flex-end; }
.list .chips { flex-wrap: nowrap; overflow: hidden; }
.desc { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

/* Server page */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); }
.hero { padding: 3px; border-radius: 20px; }
.hero-face { background: var(--panel); border-radius: 17px; padding: 24px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; }
.hero-score { display: flex; flex-direction: column; align-items: center; }
.hero-score .card-score { font-size: 60px; }
.hero-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.hero-main h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 700; overflow-wrap: anywhere; }
.cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.dl { margin: 0; display: flex; flex-direction: column; }
.dl div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid #1e2330; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.similar { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.similar-tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; min-width: 0; }
.chart { display: flex; gap: 12px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 220px; color: var(--muted); font-family: var(--mono); font-size: 12px; text-align: right; }
.chart-plot { flex: 1; min-width: 0; }
.chart-plot svg { display: block; width: 100%; height: 220px; }
.chart-grid { stroke: #1e2330; stroke-width: 1; fill: none; }
.chart-area { fill: var(--lime); fill-opacity: 0.1; }
.chart-line { fill: none; stroke: var(--lime); stroke-width: 2.5; stroke-linejoin: round; }
.chart-x { display: flex; justify-content: space-between; padding-top: 8px; color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* Languages and GTA 6 */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.lang-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 14px; }
.lang-tile b { font-family: var(--display); font-size: 19px; font-weight: 600; }
.lang-tile span { font-size: 13px; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.step .tag { align-self: flex-start; }
.prose { gap: 10px; max-width: 820px; }
.prose h2 { margin-top: 10px; }
.prose p { color: var(--soft); }

@media (max-width: 1180px) {
  .cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .card { flex: 0 0 220px; scroll-snap-align: start; }
  .tables, .tables.two { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  body { padding-bottom: 64px; }
  .rail { display: none; }
  .brand-logo { display: flex; }
  .topbar { padding: 0 16px; gap: 12px; height: 56px; }
  .brand { font-size: 17px; flex: none; }
  .search { flex: 1; width: auto; }
  .wrap { padding: 16px 16px 28px; gap: 16px; }
  .footer { padding: 20px 16px; }
  h1 { font-size: 21px; }
  .ticker { height: 44px; }
  .ticker a { height: 44px; padding: 0 14px; font-size: 13px; }
  .kpis { gap: 12px; }
  .kpi-tile { padding: 14px; gap: 8px; }
  .kpi, .kpi .chg { font-size: 28px; }
  .cards { margin-right: -16px; padding-right: 16px; gap: 12px; }
  .card { flex-basis: 196px; }
  .card-face { min-height: 290px; }
  .tr { padding: 0 14px; gap: 12px; }
  .table > h2 { padding: 14px 14px 10px; }
  .list-head { display: none; }
  .c-rank { width: 26px; }
  .c-lang, .c-chg { display: none; }
  .c-num { width: auto; }
  .c-num i { display: none; }
  .hero-face { padding: 18px; }
  .hero-actions, .hero-actions .btn { width: 100%; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 5;
    background: #0f1218; border-top: 1px solid var(--line);
  }
  .tab-link { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--muted); }
  .tab-link.on { color: var(--lime); }
}
