/* Data-dense dashboard, dark-only: Aegis gold accent, Radiant green / Dire red semantics, faint crimson glow behind the header */
:root {
  --bg: #0a0c10;
  --surface: #11151c;
  --surface-2: #161b24;
  --surface-hover: #1c222d;
  --border: #232a36;
  --border-strong: #343e4e;
  --fg: #e8ecf2;
  --fg-muted: #97a3b4;
  --fg-dim: #5f6a7a;
  --accent: #e3b04b;
  --accent-strong: #f4cc6e;
  --accent-ink: #1b1405;
  --accent-soft: rgba(227, 176, 75, .14);
  --crimson: #c9372c;
  --good: #4fd286;
  --good-soft: rgba(79, 210, 134, .13);
  --warn: #e6a23c;
  --warn-soft: rgba(230, 162, 60, .14);
  --bad: #f0544a;
  --bad-soft: rgba(240, 84, 74, .13);
  --me: rgba(227, 176, 75, .09);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --radius: 12px;
  --display: 'Russo One', 'Arial Black', system-ui, sans-serif;
  --body: 'Exo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); }
body {
  min-height: 100%;
  color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0;
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(201, 55, 44, .16), transparent 70%),
    radial-gradient(700px 360px at 92% -12%, rgba(227, 176, 75, .10), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 520px);
}
[hidden] { display: none !important; }
img { max-width: 100%; }
svg.i { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .03em; text-transform: uppercase; text-wrap: balance; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { max-width: 1040px; margin: 0 auto; padding-block: 0 72px; display: flex; flex-direction: column; gap: 28px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-inline: -12px; padding: 12px; margin-top: 10px;
  background: rgba(10, 12, 16, .72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255,255,255,.05); border-radius: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg, var(--crimson), #7d1a14); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 6px 18px -6px rgba(201,55,44,.7); }
.brand-mark svg { width: 20px; height: 20px; stroke: #fff2d6; fill: none; stroke-width: 2; stroke-linejoin: round; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text small { font-family: var(--body); font-size: 10px; font-weight: 600; letter-spacing: .22em; color: var(--fg-muted); text-transform: uppercase; }
.brand-text span { font-family: var(--display); font-size: 19px; color: var(--accent); letter-spacing: .04em; }
.nav { display: flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.nav a { text-decoration: none; color: var(--fg-muted); padding: 7px 14px; border-radius: 7px; font-weight: 600; font-size: 14px; transition: color .15s, background .15s; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }
.topbar .updated { margin-left: auto; color: var(--fg-dim); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.topbar .updated::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.topbar .updated:empty::before { display: none; }
.lang-btn { min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); font-weight: 700; font-size: 13px; letter-spacing: .04em; transition: border-color .15s, color .15s; }
.lang-btn:hover { border-color: var(--accent); color: var(--accent-strong); }

/* ---------- search hero ---------- */
.search-box { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 28px; text-align: center; }
.search-box h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.05; background: linear-gradient(180deg, #fff6df, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search-box p { color: var(--fg-muted); max-width: 560px; }
.search-row {
  display: flex; gap: 8px; width: 100%; max-width: 540px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow), 0 0 0 4px rgba(227,176,75,.0); transition: box-shadow .2s, border-color .2s;
}
.search-row { position: relative; }
.history { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 15; padding: 6px; text-align: left; max-height: 380px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); }
.history-head { padding: 6px 10px; }
.history-item { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.history-item:hover { background: var(--surface-hover); }
.history-pick { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: none; background: none; text-align: left; }
.history-pick > img { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.history-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-del { width: 32px; height: 32px; flex-shrink: 0; border: none; border-radius: 6px; background: none; color: var(--fg-muted); font-size: 18px; }
.history-del:hover { background: var(--bad-soft); color: var(--bad); }
.search-row:focus-within { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft); }
.search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding-left: 12px; color: var(--fg-dim); }
.search-field input { flex: 1; min-width: 0; padding: 10px 0; border: none; background: transparent; color: var(--fg); font-size: 16px; }
.search-field input:focus { outline: none; }
.search-field input::placeholder { color: var(--fg-dim); }
.field {
  width: 100%; min-width: 0; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 22px; border-radius: 10px; border: none; white-space: nowrap;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent)); color: var(--accent-ink);
  font-weight: 700; letter-spacing: .02em; box-shadow: 0 6px 18px -8px rgba(227,176,75,.8), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .12s var(--ease), box-shadow .2s, filter .2s;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 8px 24px -8px rgba(227,176,75,.9), inset 0 1px 0 rgba(255,255,255,.35); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface-2); color: var(--fg); border: 1px solid var(--border-strong); box-shadow: none; font-weight: 600; }
.btn.ghost:hover { background: var(--surface-hover); border-color: var(--fg-dim); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }

.loading { text-align: center; padding: 36px 0; color: var(--fg-muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.spinner { display: inline-block; width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-msg { padding: 14px 16px; border: 1px solid rgba(240,84,74,.5); background: var(--bad-soft); border-radius: var(--radius); text-align: center; }
.empty { color: var(--fg-muted); padding: 18px; }

/* ---------- surfaces ---------- */
.stack { display: flex; flex-direction: column; gap: 32px; }
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.pad { padding: 18px; }

.profile { display: flex; align-items: center; gap: 18px; padding: 18px 20px; flex-wrap: wrap; position: relative; overflow: hidden; }
.profile::after { content: ''; position: absolute; inset: 0 0 auto auto; width: 320px; height: 100%; background: radial-gradient(260px 140px at 100% 0%, var(--accent-soft), transparent 70%); pointer-events: none; }
.profile > img { width: 68px; height: 68px; border-radius: 12px; box-shadow: 0 0 0 2px var(--accent), 0 8px 20px -8px rgba(0,0,0,.8); }
.profile h2 { font-size: 26px; text-transform: none; letter-spacing: .01em; }
.profile .meta { color: var(--fg-muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.rank-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.profile .wl { margin-left: auto; text-align: right; position: relative; z-index: 1; }
.emblem { position: relative; display: inline-block; width: var(--s); height: var(--s); flex-shrink: 0; vertical-align: middle; }
.emblem img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.profile > .emblem { order: 3; filter: drop-shadow(0 6px 14px rgba(0,0,0,.6)); }
.profile .wl { order: 4; margin-left: 0; }
.profile > div:not(.wl) { flex: 1; min-width: 0; }
.rank-line { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.big { font-family: var(--display); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }

.period { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; transition: border-color .2s, transform .2s var(--ease); }
.stat:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat .label { display: flex; align-items: center; gap: 7px; }
.stat .label svg { color: var(--accent); width: 15px; height: 15px; }
.stat .value { font-family: var(--display); font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--fg-muted); }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-muted); font-weight: 600; }

.section { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.section-title { font-size: 18px; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.note { color: var(--fg-muted); font-size: 13px; max-width: 75ch; }
.note:empty { display: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.tabs { display: inline-flex; gap: 2px; flex-wrap: wrap; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.tab { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px; border-radius: 7px; border: none; background: transparent; color: var(--fg-muted); font-size: 13px; font-weight: 600; transition: color .15s, background .15s; }
.tab:hover { color: var(--fg); background: var(--surface-hover); }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px rgba(227,176,75,.45); }
.tab:disabled { opacity: .5; cursor: wait; }
.tab svg { width: 15px; height: 15px; }

/* ---------- issues ---------- */
.issue-list { display: flex; flex-direction: column; gap: 8px; }
.issue { display: flex; align-items: center; gap: 14px; padding: 13px 16px; }
.sev { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--bad-soft); color: var(--bad); }
.sev svg { width: 18px; height: 18px; }
.issue.warn .sev { background: var(--warn-soft); color: var(--warn); }
.issue.good .sev { background: var(--good-soft); color: var(--good); }
.issue.info .sev { background: var(--accent-soft); color: var(--accent); }
.issue .body { flex: 1; min-width: 0; }
.issue .title { font-weight: 700; }
.issue .detail { font-size: 13px; color: var(--fg-muted); }
.issue .val { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--fg-muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: rgba(255,255,255,.015); }
td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }
th.num, td.num { text-align: right; }
.hero-cell { display: flex; align-items: center; gap: 10px; }
.hero-cell img { width: 44px; height: 25px; border-radius: 5px; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.hero-icon { width: 34px; height: 19px; border-radius: 4px; object-fit: cover; vertical-align: middle; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.chip { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.chip.pos { background: var(--good-soft); color: var(--good); }
.chip.neg { background: var(--bad-soft); color: var(--bad); }
.pos { color: var(--good); } .neg { color: var(--bad); } .muted { color: var(--fg-muted); } .dim { color: var(--fg-dim); }
.posb { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 700; font-family: var(--display); background: var(--accent-soft); color: var(--accent-strong); }
.posb.approx { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--fg-muted); }

/* ---------- matches ---------- */
.matches { display: flex; flex-direction: column; gap: 6px; }
.match {
  position: relative; display: grid; grid-template-columns: 84px 28px minmax(0, 1fr) 96px 80px 64px 16px; align-items: center; gap: 14px;
  padding: 10px 16px; text-align: left; width: 100%; font-variant-numeric: tabular-nums; overflow: hidden;
  background: linear-gradient(90deg, var(--good-soft), transparent 38%), linear-gradient(180deg, var(--surface-2), var(--surface));
  transition: border-color .15s, transform .15s var(--ease);
}
.match.loss { background: linear-gradient(90deg, var(--bad-soft), transparent 38%), linear-gradient(180deg, var(--surface-2), var(--surface)); }
.match:hover { border-color: var(--border-strong); transform: translateX(3px); }
.match .hero-cell img { width: 56px; height: 32px; }
.res { display: flex; flex-direction: column; line-height: 1.15; }
.res b { font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.res.win b { color: var(--good); } .res.loss b { color: var(--bad); }
.res small { font-size: 11px; color: var(--fg-dim); }
.kda { font-weight: 600; }
.kda .d { color: var(--bad); }
.match .gpm { color: var(--accent); font-size: 13px; font-weight: 600; }
.match .dur { color: var(--fg-muted); font-size: 13px; display: flex; align-items: center; gap: 5px; }
.match .dur svg { width: 13px; height: 13px; }
.match .chev { color: var(--fg-dim); width: 16px; height: 16px; }
.parsed-dot { position: absolute; top: 8px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- positions ---------- */
.pos-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pos-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; text-align: left; color: inherit; transition: border-color .2s, transform .2s var(--ease); }
.pos-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--accent); }
.pos-card:disabled { cursor: default; opacity: .7; }
#posFilter { align-self: flex-start; }
.pos-card.best { border-color: rgba(79,210,134,.55); box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 0 0 3px var(--good-soft); }
.pos-top { display: flex; align-items: center; gap: 12px; }
.ring { --p: 0; --c: var(--fg-dim); width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--border) 0); }
.ring span { width: 46px; height: 46px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-family: var(--display); font-size: 14px; font-variant-numeric: tabular-nums; }
.pos-name { display: flex; flex-direction: column; line-height: 1.2; }
.pos-name b { font-family: var(--display); font-weight: 400; font-size: 15px; }
.pos-heroes { display: flex; gap: 4px; flex-wrap: wrap; }
.best-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--good); }
.best-tag svg { width: 14px; height: 14px; }

/* ---------- dialog ---------- */
dialog {
  margin: auto; width: min(1080px, calc(100vw - 16px)); max-height: calc(100vh - 24px); padding: 0;
  border: 1px solid var(--border-strong); border-radius: 16px; background: var(--bg); color: var(--fg);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.9);
}
dialog[open] { animation: dlg-in .22s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
dialog::backdrop { background: rgba(4, 6, 10, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dlg-head { position: sticky; top: 0; z-index: 3; display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 14px; background: rgba(17, 21, 28, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.dlg-head .row { justify-content: space-between; }
.dlg-head h2 { font-size: 20px; }
.dlg-body { padding: 20px; display: flex; flex-direction: column; gap: 26px; }

.items { display: flex; gap: 3px; flex-wrap: nowrap; }
.items img, .item-icon { width: 32px; height: 24px; border-radius: 4px; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.score { font-family: var(--display); font-size: 20px; }
tr.me td { background: var(--me); }
.player-link { padding: 0; border: none; background: none; color: var(--fg); font-weight: 600; text-align: left; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.player-link:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.bench { display: grid; grid-template-columns: 160px minmax(0,1fr) 54px; gap: 12px; align-items: center; font-size: 13px; }
.track { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; border-radius: 999px; transition: width .5s var(--ease); }
.bench-list { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.bench .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.matrix td.cell { text-align: center; font-weight: 700; min-width: 70px; border-left: 1px solid var(--border); }
.matrix th.hcol { text-align: center; }

.cand { display: grid; grid-template-columns: minmax(160px, 1.2fr) 76px minmax(0, 3fr); gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); transition: background .12s; }
.cand:hover { background: var(--surface-hover); }
.cand:last-child { border-bottom: none; }
.cand.mine { background: var(--me); box-shadow: inset 3px 0 0 var(--accent); }
.breakdown { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; font-variant-numeric: tabular-nums; }
.breakdown span { display: inline-flex; align-items: center; gap: 4px; }
.breakdown img { width: 28px; height: 16px; border-radius: 3px; object-fit: cover; }

.chart-wrap { position: relative; padding: 14px 14px 8px; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-wrap .axis { fill: var(--fg-muted); font-size: 11px; font-family: var(--body); }
.chart-wrap .grid { stroke: var(--border); stroke-width: 1; }
.chart-wrap .zero { stroke: var(--fg-dim); stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: rgba(10,12,16,.95); border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--fg-muted); padding: 0 16px 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

.item-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--border); transition: background .12s; }
.item-row:hover { background: var(--surface-hover); }
.item-row:last-child { border-bottom: none; }
.item-row .name { font-weight: 700; }
.item-row .why { font-size: 12px; color: var(--fg-muted); white-space: normal; }
.item-row .lift { font-family: var(--display); font-size: 19px; text-align: right; }

.picker { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; min-height: 30px; align-items: center; }
.hchip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 4px 3px 3px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.hchip img { width: 38px; height: 22px; border-radius: 5px; object-fit: cover; }
.hchip button { display: grid; place-items: center; width: 24px; height: 24px; border: none; border-radius: 6px; background: none; color: var(--fg-muted); }
.hchip button:hover { background: var(--bad-soft); color: var(--bad); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.example { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }

/* ---------- match map ---------- */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.map-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tb { display: grid; grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 10px; }
.tb-team { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.tb-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.tb-pic { position: relative; width: 100%; max-width: 52px; aspect-ratio: 16 / 9; }
.tb-pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255,255,255,.1); transition: filter .2s; }
.tb-hero.me .tb-pic img { box-shadow: 0 0 0 2px var(--accent); }
.tb-hero.dead .tb-pic img { filter: grayscale(1) brightness(.45); }
.tb-timer { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 400; font-size: 13px; color: #fff; text-shadow: 0 1px 3px #000; }
.tb-hero:not(.dead) .tb-timer { font-family: var(--body); font-size: 9px; font-weight: 700; color: var(--accent-strong); align-items: end; }
.tb-gold { font-size: 11px; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; }
.tb-center { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.tb-score { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-score #tbClock { font-family: var(--display); font-size: 15px; color: var(--fg); }
.tb-k { font-family: var(--display); font-size: 20px; }
#tbR { color: var(--good); } #tbD { color: var(--bad); }
.tb-adv { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.map { position: relative; aspect-ratio: 1; overflow: hidden; padding: 0; }
.map img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: saturate(.85) brightness(.8); }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-side { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
#fogTabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#fogTabs .tab { justify-content: center; }
.map-clock { font-family: var(--display); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent-strong); }
.map-stats { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.map-events { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.map-ev { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 8px; border: none; border-radius: 8px; background: transparent; text-align: left; font-size: 12px; box-shadow: inset 2px 0 0 var(--good); }
.map-ev.loss { box-shadow: inset 2px 0 0 var(--bad); }
.map-ev:hover { background: var(--surface-hover); }
.map-ev .num { color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.map-ev-body { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.map-ev-body .hero-icon { width: 26px; height: 15px; }
.timeline { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.tl-track { position: relative; flex: 1; min-width: 0; height: 52px; }
.tl-marks { position: absolute; left: 8px; right: 8px; top: 0; height: 30px; }
.tl-fight { position: absolute; top: 4px; height: 10px; min-width: 4px; padding: 0; border: none; border-radius: 3px; background: var(--good); opacity: .85; cursor: pointer; }
.tl-fight.loss { background: var(--bad); }
.tl-fight:hover { opacity: 1; transform: scaleY(1.3); }
.tl-ward { position: absolute; top: 20px; width: 2px; height: 8px; border-radius: 1px; background: var(--good); opacity: .7; }
.tl-ward.loss { background: var(--bad); }
.tl-rosh { position: absolute; top: -8px; transform: translateX(-50%); font-style: normal; font-family: var(--display); font-size: 10px; color: var(--good); }
.tl-rosh.loss { color: var(--bad); }
.tl-track input[type="range"] { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; margin: 0; accent-color: var(--accent); cursor: pointer; }
.tl-speed { width: auto; padding: 6px 8px; font-size: 13px; }
#mapPlay { width: 40px; padding: 0; }

/* ---------- entrance motion ---------- */
.reveal > * { animation: rise .45s var(--ease) both; }
.reveal > *:nth-child(2) { animation-delay: .04s; } .reveal > *:nth-child(3) { animation-delay: .08s; }
.reveal > *:nth-child(4) { animation-delay: .12s; } .reveal > *:nth-child(5) { animation-delay: .16s; }
.reveal > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .spinner { animation-duration: 2.5s !important; }
}

@media (max-width: 760px) {
  .topbar { margin-inline: 0; }
  .topbar .updated { margin-left: 0; width: 100%; }
  .profile .wl { margin-left: 0; text-align: left; }
  .profile > div:not(.wl) { flex-basis: calc(100% - 90px); }
  .profile > .emblem { --s: 56px !important; }
  .match { grid-template-columns: 64px 26px minmax(0,1fr) auto 14px; gap: 10px; padding: 10px 12px; }
  .match .gpm, .match .dur { display: none; }
  .match .hero-cell img { width: 44px; height: 25px; }
  .bench { grid-template-columns: 112px minmax(0,1fr) 44px; }
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .two-col { grid-template-columns: 1fr; }
  .map-wrap { grid-template-columns: 1fr; }
  .map-events { max-height: 240px; }
  .cand { grid-template-columns: minmax(0, 1fr) 64px; }
  .cand .breakdown { grid-column: 1 / -1; }
  .search-row { flex-direction: column; }
  .search-field { padding: 4px 10px; }
}
