/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f2f1ed;
  --surface-3: #e8e7e1;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #6b6a65;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --accent: #96570f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(150, 87, 15, 0.10);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --ref: #898781;
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-text: #b42f2f;
  --win: #006300;
  --loss: #b42f2f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --surface-3: #2c2c2a;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --text-3: #a3a198;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --accent: #e0a84f;
    --accent-ink: #1a1209;
    --accent-soft: rgba(224, 168, 79, 0.12);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --good-text: #0ca30c;
    --critical-text: #e66767;
    --win: #0ca30c;
    --loss: #e66767;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --surface-3: #2c2c2a;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --text-3: #a3a198;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #e0a84f;
  --accent-ink: #1a1209;
  --accent-soft: rgba(224, 168, 79, 0.12);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --good-text: #0ca30c;
  --critical-text: #e66767;
  --win: #0ca30c;
  --loss: #e66767;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15px/1.5 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
img { max-width: 100%; }
button, input { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 650; }
h1 { font-size: 28px; letter-spacing: -0.01em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 24px; padding-bottom: 48px; outline: none; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 17px; white-space: nowrap; letter-spacing: 0.01em; }
.brand img { display: block; border-radius: 8px; }
.brand b { color: var(--accent); font-weight: 750; }

/* account */
.auth-slot { position: relative; display: flex; align-items: center; }
.lbl-short { display: none; }
@media (max-width: 640px) {
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .user-chip { max-width: 130px; }
  .nav-link { padding: 8px 6px; }
}
.steam-btn { background: #171a21; color: #ffffff; border-color: rgba(255, 255, 255, 0.16); }
.steam-btn:hover { filter: brightness(1.2); }
.steam-btn svg { flex: none; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; max-width: 220px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 600;
}
.user-chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.menu a, .menu button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; border: 0; background: none;
  text-decoration: none; cursor: pointer; font-size: 14px;
}
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--surface-2); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  padding: 10px 14px; color: var(--text-2); font-weight: 600; text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.tab .count { font-weight: 500; color: var(--text-3); margin-left: 4px; }

/* hero rating cards */
.hero-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.hero-tile { background: var(--surface-2); border-radius: 10px; padding: 14px; display: grid; gap: 10px; min-width: 0; }
.hero-tile .top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hero-tile .top img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex: none; }
.hero-tile .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-tile .sub { font-size: 12px; color: var(--text-3); }
.hero-tile .hr { display: flex; align-items: baseline; gap: 8px; }
.hero-tile .hr b { font-size: 26px; line-height: 1; font-weight: 700; }
.hero-tile .pl { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; }
.hero-tile .pl img { width: 24px; height: 24px; flex: none; }
.hero-tile .stats { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); }
.hero-tile .stats b { display: block; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }

/* skill hexagon */
.radar-block { display: grid; justify-items: center; margin-top: 18px; }
.radar { width: 100%; max-width: 380px; overflow: visible; outline: none; }
.radar:focus-visible { outline: 2px solid var(--series-1); outline-offset: 4px; border-radius: 8px; }
.radar .radar-ring { fill: none; stroke: var(--grid); stroke-width: 1; }
.radar .radar-mid { fill: none; stroke: var(--axis); stroke-width: 1; }
.radar .radar-focus { stroke: var(--text-3); stroke-width: 1; pointer-events: none; }
.radar text { font-family: var(--font); }
.radar .radar-label { font-size: 12px; font-weight: 600; fill: var(--text-2); }
.radar .radar-value { font-size: 12px; fill: var(--text); font-variant-numeric: tabular-nums; }
.radar .radar-note { font-size: 10px; fill: var(--muted); }

/* compare */
.compare-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.compare-panel { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface-2); }
.compare-panel form { display: flex; gap: 8px; }
.compare-panel input { flex: 1; min-width: 0; }
.pick-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.pick-list button {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px; border-radius: 8px;
  border: 0; background: var(--surface); cursor: pointer;
}
.pick-list button:hover, .pick-list button:focus-visible { background: var(--surface-3); }
.pick-list img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.vs-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: stretch; }
.vs-badge { align-self: center; font-weight: 800; color: var(--text-3); letter-spacing: 0.08em; }
.vs-player { display: grid; gap: 8px; justify-items: start; background: var(--surface-2); border-radius: 10px; padding: 14px; min-width: 0; position: relative; }
.vs-player .key-band { position: absolute; top: 14px; right: 14px; }
.vs-player .who { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.vs-player .who img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; }
.vs-player .nm { font-weight: 650; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-player .sr { font-size: 32px; font-weight: 700; line-height: 1; }
.better { font-weight: 700; }
.better-mark { color: var(--good-text); font-size: 12px; margin-left: 4px; }
@media (max-width: 640px) {
  .vs-grid { grid-template-columns: minmax(0, 1fr); }
  .vs-badge { justify-self: center; }
}

/* leaderboard */
.nav-link { color: var(--text-2); text-decoration: none; font-weight: 600; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.lb-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.lb-filters select, .lb-filters input[type="search"] {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; color: var(--text);
}
.lb-filters input[type="search"] { min-width: 200px; flex: 1; max-width: 320px; }
.lb-rank { font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-name { font-weight: 600; overflow-wrap: anywhere; }
.badge-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.badge-cell img { width: 26px; height: 26px; }

/* most played heroes in search results */
.top-heroes { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; }
.top-heroes .th { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); }
.top-heroes img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; background: var(--surface-3); }
.top-search { flex: 1; display: flex; gap: 8px; max-width: 520px; margin-left: auto; }
.top-search input { flex: 1; min-width: 0; }
.top-actions { display: flex; gap: 6px; align-items: center; }

/* ---------------------------------------------------------------- controls */
input[type="search"], input[type="text"] {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
}
input[type="search"]:focus { border-color: var(--series-1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--series-1) 20%, transparent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  padding: 9px 14px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.55; cursor: default; filter: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.icon-btn { padding: 8px; }
.linkish { background: none; border: 0; padding: 0; color: var(--text-2); text-decoration: underline; cursor: pointer; }

/* ---------------------------------------------------------------- layout pieces */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p, .sub { color: var(--text-2); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .grid.two, .grid.three, .grid.side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .top-search { order: 3; flex-basis: 100%; max-width: none; }
  .top-actions { margin-left: auto; }
  h1 { font-size: 23px; }
  .card { padding: 16px; }
}

/* ---------------------------------------------------------------- home */
.hero-search { padding: 56px 0 28px; text-align: center; }
.hero-search h1 { font-size: 40px; letter-spacing: -0.02em; }
.hero-search h1 span { color: var(--accent); }
.hero-search p { color: var(--text-2); max-width: 640px; margin: 12px auto 0; font-size: 16px; }
.big-search { display: flex; gap: 8px; max-width: 640px; margin: 28px auto 0; }
.big-search input { flex: 1; min-width: 0; padding: 14px 16px; font-size: 17px; border-radius: 12px; }
.big-search .btn { padding: 0 22px; font-size: 16px; border-radius: 12px; }
.features { margin-top: 36px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--text-2); font-size: 14px; }
.pinned-card { max-width: 640px; margin: 18px auto 0; }
@media (max-width: 640px) {
  .hero-search { padding-top: 28px; }
  .hero-search h1 { font-size: 30px; }
  .big-search { flex-direction: column; }
  .big-search .btn { padding: 12px; }
}

/* ---------------------------------------------------------------- search results */
.results { list-style: none; margin: 0; padding: 0; }
.results li + li { border-top: 1px solid var(--border); }
.result {
  display: flex; align-items: center; gap: 14px; padding: 12px 8px;
  text-decoration: none; border-radius: 8px;
}
.result:hover { background: var(--surface-2); }
.avatar { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex: none; }
.avatar.lg { width: 84px; height: 84px; border-radius: 16px; }
.result .name { font-weight: 600; }

/* ---------------------------------------------------------------- player header */
.player-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.player-head .who { flex: 1; min-width: 200px; }
.player-head h1 { overflow-wrap: anywhere; }
.rank-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 14px; }
.rank-chip img { width: 30px; height: 30px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; color: var(--text-2); font-size: 13px; }

/* hero figure */
.rating-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr); gap: 24px; align-items: center; }
@media (max-width: 900px) { .rating-card { grid-template-columns: minmax(0, 1fr); } }
.hero-figure-label { font-size: 13px; color: var(--text-2); font-weight: 600; letter-spacing: 0.02em; }
.hero-figure { font-size: 56px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; margin: 4px 0 6px; }
.playing-like { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.playing-like img { width: 34px; height: 34px; }
.explain { color: var(--text-2); font-size: 13px; margin-top: 10px; max-width: 46ch; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.tile-label { font-size: 13px; color: var(--text-2); }
.tile-value { font-size: 24px; font-weight: 650; margin-top: 2px; }
.tile-sub { font-size: 12px; color: var(--text-3); }

/* progress */
.progress { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--series-1) 18%, var(--surface-2)); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--series-1); transition: width 0.4s ease; }
.analyze-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.analyze-bar .progress { flex: 1; min-width: 160px; }

/* ---------------------------------------------------------------- improvement cards */
.improve-list { display: grid; gap: 14px; }
.improve {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: var(--surface);
}
.improve-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.improve-head h3 { font-size: 17px; }
.improve .headline { margin-top: 6px; color: var(--text); font-weight: 500; }
.improve h4 { font-size: 13px; color: var(--text-2); margin: 14px 0 6px; font-weight: 600; letter-spacing: 0.02em; }
.improve ul { margin: 0; padding-left: 18px; }
.improve li { margin: 3px 0; }
.improve .tips li { color: var(--text); }
.rank-num { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--accent-soft); color: var(--accent); flex: none; }

/* ---------------------------------------------------------------- score bars */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 72px; align-items: center; gap: 12px; }
.bar-label { font-size: 14px; font-weight: 550; }
.bar-track { position: relative; height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--series-1); border-radius: 0 4px 4px 0; }
.bar-fill.weak { background: var(--serious); }
.bar-mid { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--axis); }
.bar-value { font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.bar-value small { display: block; font-size: 11px; color: var(--text-3); font-weight: 500; }
.bar-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); margin-top: 10px; flex-wrap: wrap; }
.bar-legend .k { display: inline-block; width: 1px; height: 12px; background: var(--axis); vertical-align: middle; margin-right: 6px; }

.meter { height: 8px; border-radius: 999px; background: var(--surface-2); position: relative; overflow: hidden; }
.meter > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--series-1); }

/* ---------------------------------------------------------------- status chips */
.sev { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.sev svg { flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.result-tag { font-weight: 700; font-size: 13px; }
.result-tag.win { color: var(--win); }
.result-tag.loss { color: var(--loss); }
.score-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-variant-numeric: tabular-nums; }
.score-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---------------------------------------------------------------- mistakes */
.mistakes { list-style: none; margin: 0; padding: 0; }
.mistake { padding: 14px 0; border-top: 1px solid var(--border); }
.mistake:first-child { border-top: 0; padding-top: 0; }
.mistake-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mistake-title { font-weight: 600; }
.mistake-detail { margin-top: 4px; color: var(--text); }
.mistake-tip { margin-top: 6px; color: var(--text-2); font-size: 14px; padding-left: 12px; border-left: 2px solid var(--border-strong); }
.time-tag { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-3); font-weight: 600; }

.freq { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 8px 16px; align-items: center; }
.freq-bar { display: grid; gap: 4px; }
.freq-bar .meter > span { background: var(--series-1); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tr.me td { background: var(--accent-soft); }
.hero-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hero-cell img { width: 28px; height: 28px; border-radius: 6px; background: var(--surface-3); flex: none; object-fit: cover; }
.hero-cell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.delta-good { color: var(--good-text); }
.delta-bad { color: var(--critical-text); }

details.table-view { margin-top: 10px; }
details.table-view summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
details.table-view table { margin-top: 8px; font-size: 13px; }

/* ---------------------------------------------------------------- charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .crosshair { stroke: var(--text-3); stroke-width: 1; pointer-events: none; }
.chart:focus-visible { outline: 2px solid var(--series-1); outline-offset: 4px; border-radius: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.key-line { width: 16px; height: 2px; border-radius: 2px; display: inline-block; }
.key-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.key-band { width: 16px; height: 10px; border-radius: 3px; display: inline-block; }

.tooltip {
  position: fixed; z-index: 100; pointer-events: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 8px 10px; font-size: 13px; max-width: 280px;
}
.tooltip .tt-title { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-row strong { font-variant-numeric: tabular-nums; }
.tooltip .tt-row span { color: var(--text-2); }

/* death map */
.map-wrap { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1 / 1; margin: 0 auto; border-radius: 10px; overflow: hidden; background: #3a3833; }
.map-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: brightness(2.1) contrast(1.05); }
.map-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-dot { stroke: #1a1a19; cursor: pointer; }
.map-dot-g { outline: none; }
.map-dot-g:hover .map-dot, .map-dot-g:focus .map-dot { stroke: #ffffff; }

/* items */
.items-timeline { display: flex; flex-wrap: wrap; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px;
  border-radius: 8px; background: var(--surface-2); font-size: 13px; min-width: 0;
}
.item img { width: 28px; height: 28px; border-radius: 6px; background: var(--surface-3); flex: none; }
.item .t { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.item.gone { opacity: 0.6; }
.item.gone .n { text-decoration: line-through; }
.slot-key { width: 4px; align-self: stretch; border-radius: 2px; }

/* match header */
.match-head { display: flex; gap: 18px; align-items: center; }
.match-head .hero-card { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; background: var(--surface-3); flex: none; }
.mh-title { flex: 1; min-width: 0; }
.big-score { text-align: right; margin-left: auto; flex: none; }
.big-score .v { font-size: 48px; font-weight: 700; line-height: 1; }
.kv { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.kv div { font-size: 13px; color: var(--text-2); }
.kv b { display: block; font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .match-head { flex-wrap: wrap; gap: 12px 14px; }
  .match-head .hero-card { width: 60px; height: 60px; border-radius: 12px; }
  .mh-title { flex: 1 1 200px; }
  .big-score { margin-left: 0; text-align: left; display: flex; align-items: baseline; gap: 10px; flex-basis: 100%; }
  .big-score .v { font-size: 40px; }
  .kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; font-size: 14px; margin-bottom: 12px; }
.back:hover { color: var(--text); }

.notice { padding: 14px 16px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 14px; }
.notice.accent { background: var(--accent-soft); color: var(--text); }
.notice.error { background: color-mix(in srgb, var(--critical) 12%, var(--surface)); color: var(--text); }
.loading { display: flex; align-items: center; gap: 10px; color: var(--text-2); padding: 40px 0; justify-content: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stale { opacity: 0.55; transition: opacity 0.2s; }

.footer { color: var(--text-3); font-size: 12px; padding: 20px 0 28px; border-top: 1px solid var(--border); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .bar-fill, .meter > span, .progress > span { background: Highlight; }
}
