/* ==========================================================================
   lol-coach — neon/cyberpunk theme
   Two typefaces carry the design: Chakra Petch (angular, technical) for
   chrome, headings and every number; Inter for anything you actually read
   as prose. Neon lives in borders, accents and glows — never in body text,
   so contrast stays high in both themes.
   ========================================================================== */

/* ---------------------------------- tokens -------------------------------- */
:root {
  --font-display: "Chakra Petch", "Segoe UI Semibold", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #05070e;
  --bg-2: #080b16;
  --surface: #0b1020;
  --surface-2: #0f1628;
  --surface-3: #141d33;
  --line: rgba(125, 175, 255, 0.12);
  --line-strong: rgba(34, 225, 255, 0.34);
  --grid-line: rgba(125, 175, 255, 0.055);

  --text: #e8eefb;
  --text-dim: #97a8c4;
  --text-faint: #6b7c99;

  --cyan: #22e1ff;
  --magenta: #ff2fa0;
  --violet: #a466ff;
  --gold: #ffc857;

  --win: #21b6ff;
  --win-soft: rgba(33, 182, 255, 0.14);
  --loss: #ff3d6e;
  --loss-soft: rgba(255, 61, 110, 0.14);

  --shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  --glow-cyan: 0 0 22px rgba(34, 225, 255, 0.35);
  --glow-magenta: 0 0 22px rgba(255, 47, 160, 0.3);

  --radius: 14px;
  --radius-sm: 9px;
  --cut: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  --cut-sm: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}

[data-theme="light"] {
  --bg: #eceffa;
  --bg-2: #e3e8f6;
  --surface: #ffffff;
  --surface-2: #f4f7fd;
  --surface-3: #e9eefb;
  --line: rgba(18, 38, 76, 0.12);
  --line-strong: rgba(9, 129, 158, 0.4);
  --grid-line: rgba(18, 38, 76, 0.06);

  --text: #0c1526;
  --text-dim: #4d5f80;
  --text-faint: #6f7f9c;

  --cyan: #0784a3;
  --magenta: #cf0d6f;
  --violet: #6d31d6;
  --gold: #a96a00;

  --win: #0d63c9;
  --win-soft: rgba(13, 99, 201, 0.1);
  --loss: #cc1042;
  --loss-soft: rgba(204, 16, 66, 0.09);

  --shadow: 0 14px 32px rgba(20, 40, 80, 0.12);
  --glow-cyan: 0 0 18px rgba(7, 132, 163, 0.22);
  --glow-magenta: 0 0 18px rgba(207, 13, 111, 0.18);
}

/* ---------------------------------- base ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* Several components set an explicit display, which outranks the UA [hidden] rule. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: 0.01em; margin: 0; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--cyan); color: #04070f; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

/* Numbers line up in every table and stat block. */
.num, td.num, .kpi-value, .match-kda b, .stat-value {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

/* -------------------------------- backdrop -------------------------------- */
.grid-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(34, 225, 255, 0.14), transparent 62%),
    radial-gradient(760px 480px at 92% 4%, rgba(255, 47, 160, 0.12), transparent 60%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 46px 100%,
    var(--bg-2);
  mask-image: linear-gradient(180deg, #000 0%, #000 46%, rgba(0, 0, 0, 0.55) 100%);
}

[data-theme="light"] .grid-backdrop {
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(7, 132, 163, 0.13), transparent 62%),
    radial-gradient(760px 480px at 92% 4%, rgba(207, 13, 111, 0.09), transparent 60%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 46px 100%,
    var(--bg-2);
}

/* --------------------------------- topbar --------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-scanline {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
  opacity: 0.7;
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand:hover { text-decoration: none; }

.logo-mark {
  width: 26px;
  height: 26px;
  clip-path: polygon(50% 0, 100% 26%, 100% 74%, 50% 100%, 0 74%, 0 26%);
  background: linear-gradient(140deg, var(--cyan), var(--magenta));
  box-shadow: var(--glow-cyan);
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.14em;
  color: var(--text);
  white-space: nowrap;
}
.logo-text span { color: var(--magenta); }

.rank-chip {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  gap: 9px;
  line-height: 1.15;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  clip-path: var(--cut-sm);
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
}
.rank-chip > span { display: flex; flex-direction: column; }
.rank-crest { width: 26px; height: 26px; flex-shrink: 0; }
.rank-chip-tier { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; }
.rank-chip-lp { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.tabs {
  position: relative;
  display: flex;
  gap: 2px;
  margin-left: auto;
  /* Seven tabs: the bar is what gives way when the window narrows, and it scrolls. */
  min-width: 0;
  flex-shrink: 1;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  white-space: nowrap;
  transition: color 0.18s ease;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: #04070f; }
[data-theme="light"] .tab.is-active { color: #fff; }

.tab-glider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  box-shadow: var(--glow-cyan);
  transition: transform 0.28s cubic-bezier(0.4, 0.9, 0.3, 1), width 0.28s cubic-bezier(0.4, 0.9, 0.3, 1);
  pointer-events: none;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.tabs + .topbar-actions { margin-left: 0; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  clip-path: var(--cut-sm);
  background: var(--surface-2);
  white-space: nowrap;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.status-pill.is-running .status-dot { background: var(--gold); animation: pulse 1.1s ease-in-out infinite; }
.status-pill.is-running { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.status-pill.is-ok .status-dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.status-pill.is-fail .status-dot { background: var(--loss); box-shadow: 0 0 8px var(--loss); }
.status-pill.is-fail { color: var(--loss); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.refresh-btn { gap: 8px; }
.refresh-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.status-pill.is-running ~ .refresh-btn .refresh-icon,
.refresh-btn:disabled .refresh-icon { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-dim);
  clip-path: var(--cut-sm);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.icon-btn:hover { color: var(--cyan); border-color: var(--line-strong); text-decoration: none; }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .icon-moon { display: none; }
[data-theme="light"] .icon-btn .icon-sun { display: none; }
[data-theme="light"] .icon-btn .icon-moon { display: block; }

/* --------------------------------- layout --------------------------------- */
.shell { max-width: 1320px; margin: 0 auto; padding: 22px 20px 72px; }

.view { display: grid; gap: 16px; }

.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start; /* panels size to their content instead of stretching to the tallest */
  gap: 16px;
}
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* --------------------------------- panels --------------------------------- */
.panel {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 22%, var(--magenta) 78%, transparent);
  opacity: 0.55;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-3) 45%, transparent);
}
.panel-head h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text);
}
.panel-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-hint { margin-left: auto; font-size: 12px; color: var(--text-faint); }
.panel-head-actions .panel-hint { margin-left: 0; }

.panel-body { padding: 16px; }
.panel.notice { padding: 16px; }

/* -------------------------------- controls -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--surface-3);
  clip-path: var(--cut-sm);
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.18s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  color: #04070f;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  box-shadow: var(--glow-cyan);
}
[data-theme="light"] .btn-primary { color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text-dim); }
.btn-ghost:hover { color: var(--cyan); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.seg-btn {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active {
  color: #04070f;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
}
[data-theme="light"] .seg-btn.is-active { color: #fff; }

.select-field { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.select-field > span { font-family: var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; }
select, input {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
select:hover, input:hover { border-color: var(--line-strong); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  clip-path: var(--cut-sm);
  background: var(--surface-2);
}
.chip b { font-family: var(--font-display); color: var(--text); }
.chip img { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--line); }
a.chip:hover { color: var(--cyan); border-color: var(--line-strong); text-decoration: none; }

/* ---------------------------------- KPIs ---------------------------------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(166px, 1fr));
  gap: 14px;
}

.kpi {
  position: relative;
  padding: 15px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--cyan), var(--magenta));
}
.kpi-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.kpi-value {
  display: block;
  margin-top: 4px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.kpi-value.pos { color: var(--cyan); text-shadow: 0 0 18px color-mix(in srgb, var(--cyan) 40%, transparent); }
.kpi-value.neg { color: var(--loss); text-shadow: 0 0 18px color-mix(in srgb, var(--loss) 35%, transparent); }
[data-theme="light"] .kpi-value.pos, [data-theme="light"] .kpi-value.neg { text-shadow: none; }
.kpi-sub { font-size: 12px; color: var(--text-dim); }

.meter { height: 6px; margin-top: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; position: relative; }
.meter-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.meter-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--gold); }

/* --------------------------------- charts --------------------------------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font-display); font-size: 10px; fill: var(--text-faint); }
.chart .axis-line { stroke: var(--line); stroke-width: 1; }
.chart .break-even { stroke: var(--gold); stroke-width: 1.4; stroke-dasharray: 5 4; }
.chart-tip {
  position: fixed;
  z-index: 80;
  padding: 7px 11px;
  max-width: 260px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--text);
  pointer-events: none;
  white-space: pre-line;
}
.chart-tip[hidden] { display: none; }

.chart .hit { fill: transparent; stroke: transparent; stroke-width: 2; cursor: pointer; transition: fill 0.12s ease; }
.chart .hit:hover { fill: color-mix(in srgb, var(--cyan) 30%, transparent); stroke: var(--cyan); }
.chart .hit-bar { opacity: 0.82; cursor: pointer; transition: opacity 0.12s ease; }
.chart .hit-bar:hover { opacity: 1; }

#champion-table tbody tr[data-champion] { cursor: pointer; }

.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 3px; border-radius: 2px; background: var(--cyan); }
.legend-swatch.gold { background: var(--gold); }

.form-strip { display: flex; flex-wrap: wrap; gap: 5px; }
.form-pill {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  clip-path: var(--cut-sm);
  color: var(--win);
  background: var(--win-soft);
  border: 1px solid color-mix(in srgb, var(--win) 45%, transparent);
}
.form-pill.loss { color: var(--loss); background: var(--loss-soft); border-color: color-mix(in srgb, var(--loss) 45%, transparent); }

/* --------------------------------- tables --------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 8px 10px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-3) 55%, transparent); }
th.right, td.right { text-align: right; }

.wr-cell { display: flex; align-items: center; gap: 9px; min-width: 132px; }
.wr-bar { position: relative; flex: 1; height: 5px; border-radius: 999px; background: var(--loss-soft); overflow: hidden; }
.wr-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--win), var(--cyan)); border-radius: 999px; }
.wr-value { font-family: var(--font-display); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  clip-path: var(--cut-sm);
  border: 1px solid var(--line);
  color: var(--text-dim);
  background: var(--surface-3);
}
.tag.core { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, transparent); background: color-mix(in srgb, var(--cyan) 12%, transparent); }
.tag.gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 12%, transparent); }

/* ------------------------------ history feed ------------------------------ */
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  position: sticky;
  top: 62px;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 30px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
}

.donut { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
.donut svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.donut-track { stroke: var(--loss-soft); }
.donut-arc { stroke: url(#donut-grad); stroke-linecap: round; transition: stroke-dasharray 0.5s ease; }
.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.15;
}
.donut-center b { font-family: var(--font-display); font-size: 20px; font-variant-numeric: tabular-nums; }
.donut-center span { font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.06em; }

.stat-block { min-width: 92px; }
.stat-block.grow { flex: 1 1 240px; }
.stat-label { font-family: var(--font-display); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--text-faint); }
.stat-value { display: block; font-size: 19px; font-weight: 700; line-height: 1.25; }
.stat-note { font-size: 11.5px; color: var(--text-dim); }

.match-list { display: grid; gap: 7px; }

.day-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 2px 2px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.day-header::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-header .day-tally { font-variant-numeric: tabular-nums; color: var(--text-dim); letter-spacing: 0.04em; }

.match {
  position: relative;
  display: grid;
  grid-template-columns: 4px 52px minmax(130px, 0.95fr) 112px 116px minmax(0, 1.35fr) 34px;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, color-mix(in srgb, var(--win) 7%, transparent), transparent 34%), var(--surface);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.match.loss { background: linear-gradient(90deg, color-mix(in srgb, var(--loss) 7%, transparent), transparent 34%), var(--surface); }
.match:hover { border-color: var(--line-strong); transform: translateX(2px); }

.match-accent { align-self: stretch; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: linear-gradient(var(--win), color-mix(in srgb, var(--win) 40%, transparent)); }
.match.loss .match-accent { background: linear-gradient(var(--loss), color-mix(in srgb, var(--loss) 40%, transparent)); }

.match-champ { position: relative; width: 52px; height: 52px; }
.match-champ img,
.match-champ .champ-fallback {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  object-fit: cover;
  display: block;
  background: var(--surface-3);
}
.champ-fallback {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--cyan);
}
.role-badge {
  position: absolute;
  right: -2px;
  bottom: -4px;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 1px 4px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}
.role-badge img { width: 15px; height: 15px; display: block; }

.match-title { min-width: 0; }
.champ-name { font-family: var(--font-display); font-size: 15px; font-weight: 600; display: block; }
.match-meta { font-size: 11.5px; color: var(--text-faint); display: flex; gap: 7px; flex-wrap: wrap; }
.match-meta i { font-style: normal; color: var(--line-strong); }

.match-outcome { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.outcome-pill {
  padding: 3px 10px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--win);
  background: var(--win-soft);
  border: 1px solid color-mix(in srgb, var(--win) 45%, transparent);
  clip-path: var(--cut-sm);
}
.match.loss .outcome-pill { color: var(--loss); background: var(--loss-soft); border-color: color-mix(in srgb, var(--loss) 45%, transparent); }
.lp-delta { font-family: var(--font-display); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-faint); }
.lp-delta.pos { color: var(--gold); }
.lp-delta.neg { color: var(--loss); }

.match-kda { text-align: left; }
.match-kda b { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.match-kda b .dead { color: var(--loss); }
.match-kda > span { display: block; font-size: 11.5px; color: var(--text-dim); }

.match-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.match-stats b { font-family: var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }

.match-toggle {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: transform 0.2s ease, color 0.18s ease;
}
.match-toggle:hover { color: var(--cyan); border-color: var(--line-strong); }
.match.is-open .match-toggle { transform: rotate(180deg); color: var(--cyan); }

.match-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 4px 0 0 14px;
  padding: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
}
.detail b { display: block; font-family: var(--font-display); font-size: 15px; }
.detail span { color: var(--text-faint); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

.skeleton {
  height: 74px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 50%, var(--surface) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.25s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.feed-sentinel { height: 8px; }
.feed-end, .feed-empty {
  padding: 26px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* --------------------------------- verdict -------------------------------- */
.verdict {
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: linear-gradient(140deg, color-mix(in srgb, var(--cyan) 10%, transparent), transparent 70%), var(--surface-2);
}
.verdict.warn { border-color: color-mix(in srgb, var(--magenta) 55%, transparent); background: linear-gradient(140deg, color-mix(in srgb, var(--magenta) 12%, transparent), transparent 70%), var(--surface-2); }
.verdict-code { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--magenta); }
.verdict h3 { margin: 6px 0 8px; font-size: 18px; }
.verdict p { margin: 0; color: var(--text-dim); }

.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.mini {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.mini .stat-value { font-size: 17px; }

/* ---------------------------------- prose --------------------------------- */
.prose { font-size: 14.5px; line-height: 1.72; color: var(--text-dim); max-width: 92ch; }
.prose h1 { font-size: 23px; color: var(--text); margin: 0 0 14px; letter-spacing: 0.02em; }
.prose h2 {
  font-size: 16px;
  color: var(--text);
  margin: 30px 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.prose h3 { font-size: 14px; color: var(--text); margin: 22px 0 8px; letter-spacing: 0.07em; text-transform: uppercase; }
.prose p { margin: 0 0 12px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 5px; }
.prose code { font-family: var(--font-mono); font-size: 12.5px; padding: 1px 5px; border-radius: 5px; background: var(--surface-3); color: var(--cyan); }
.prose blockquote {
  margin: 14px 0;
  padding: 11px 15px;
  border-left: 2px solid var(--cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--cyan) 8%, transparent);
  color: var(--text);
}
.prose table { margin: 10px 0 18px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.prose .placeholder { color: var(--text-faint); font-style: italic; }

/* --------------------------------- console -------------------------------- */
.run-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.run-card {
  display: grid;
  gap: 3px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.run-card:hover:not(:disabled) { border-color: var(--line-strong); transform: translateY(-2px); }
.run-card:disabled { opacity: 0.45; cursor: not-allowed; }
.run-card b { font-family: var(--font-display); font-size: 14px; letter-spacing: 0.04em; }
.run-card span { font-size: 12px; color: var(--text-faint); }

.console {
  margin: 0;
  max-height: 460px;
  overflow: auto;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------------------------- icons --------------------------------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.panel-icon, .kpi-icon, .tab svg, .info-btn svg, .btn .ico {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.tab svg { width: 15px; height: 15px; }
.btn .ico { width: 15px; height: 15px; flex-shrink: 0; }
.panel-icon { width: 16px; height: 16px; color: var(--cyan); }
.kpi-icon { width: 16px; height: 16px; color: var(--cyan); }

/* Riot's own art: tier crests and lane icons ship their own colours. */
.kpi-crest { width: 34px; height: 34px; margin: -5px -2px -7px -3px; flex-shrink: 0; }
.role-cell { display: inline-flex; align-items: center; gap: 8px; }
.role-cell img { opacity: 0.9; }

.kpi-head { display: flex; align-items: center; gap: 8px; }
.kpi-head .info-btn { margin-left: auto; }
.kpi-unit { font-size: 0.5em; color: var(--text-faint); font-weight: 600; }
.kpi-value .kpi-value-sm { font-size: 21px; }

/* -------------------------------- info popup ------------------------------- */
.info-btn {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  vertical-align: -3px;
  transition: color 0.15s ease, background 0.15s ease;
}
.info-btn svg { width: 14px; height: 14px; }
.info-btn:hover, .info-btn.is-open {
  color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 16%, transparent);
}

.info-pop {
  position: fixed;
  z-index: 70;
  padding: 15px 16px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-2);
  box-shadow: var(--shadow), var(--glow-cyan);
  font-size: 13px;
  line-height: 1.62;
  color: var(--text-dim);
  max-height: min(72vh, 540px);
  overflow-y: auto;
  animation: toast-in 0.16s ease;
}
.info-pop[hidden] { display: none; }
.info-pop p { margin: 0 0 8px; }
.info-pop p:last-child { margin-bottom: 0; }
.info-pop strong { color: var(--text); font-weight: 600; }
.info-pop code { font-family: var(--font-mono); font-size: 12px; padding: 1px 5px; border-radius: 5px; background: var(--surface-3); color: var(--cyan); }

.info-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.info-emoji { font-size: 17px; line-height: 1; }
.info-head h4 {
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text);
}
.info-close {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
}
.info-close:hover { color: var(--loss); background: var(--loss-soft); }

.info-block {
  margin-top: 11px;
  padding: 10px 12px;
  border-left: 2px solid var(--cyan);
  border-radius: 0 9px 9px 0;
  background: color-mix(in srgb, var(--cyan) 9%, transparent);
}
.info-block b {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.info-verdict {
  margin-top: 11px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12.5px;
}
.info-verdict.tone-good { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, transparent); background: color-mix(in srgb, var(--cyan) 9%, transparent); }
.info-verdict.tone-warn { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.info-verdict.tone-neutral { color: var(--text-dim); }

.donut-info { align-self: flex-start; margin: 4px 0 0 -10px; }
.stat-label .info-btn, .panel-head .info-btn { vertical-align: -4px; }

/* -------------------------------- scoreboard ------------------------------- */
.back-link { justify-self: start; width: max-content; }

.match-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--win);
  border-radius: var(--radius);
  background: linear-gradient(100deg, color-mix(in srgb, var(--win) 12%, transparent), var(--surface) 55%);
  box-shadow: var(--shadow);
}
.match-hero.lost { border-left-color: var(--loss); background: linear-gradient(100deg, color-mix(in srgb, var(--loss) 12%, transparent), var(--surface) 55%); }

.hero-result { display: flex; flex-direction: column; }
.hero-result b { font-family: var(--font-display); font-size: 24px; letter-spacing: 0.04em; color: var(--win); }
.match-hero.lost .hero-result b { color: var(--loss); }
.hero-result span { font-size: 12px; color: var(--text-dim); }

.hero-champ { display: flex; align-items: center; gap: 12px; }
.hero-champ img { border-radius: 12px; border: 1px solid var(--line-strong); }
.hero-champ b { display: block; font-family: var(--font-display); font-size: 17px; }
.hero-champ span { font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.hero-meta { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-dim); }

.scoreboard.won { border-left: 3px solid var(--win); }
.scoreboard.lost { border-left: 3px solid var(--loss); }
.team-totals { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-dim); }
.obj { font-variant-numeric: tabular-nums; white-space: nowrap; }

.sb-table { font-size: 12.5px; }
.sb-table td { padding: 7px 10px; vertical-align: middle; }
.sb-table tr.is-me { background: color-mix(in srgb, var(--cyan) 9%, transparent); }
.sb-table tr.is-me td:first-child { box-shadow: inset 2px 0 0 var(--cyan); }

.sb-champ { display: flex; align-items: center; gap: 9px; min-width: 210px; }
.sb-portrait { position: relative; flex-shrink: 0; }
.sb-portrait img { border-radius: 9px; border: 1px solid var(--line); display: block; }
.sb-level {
  position: absolute;
  right: -4px;
  bottom: -5px;
  min-width: 17px;
  padding: 0 3px;
  font-family: var(--font-display);
  font-size: 10px;
  text-align: center;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}
.sb-runes { display: grid; grid-template-columns: repeat(2, 18px); gap: 2px; flex-shrink: 0; }
.sb-runes img { border-radius: 4px; background: var(--surface-3); display: block; }
.sb-name { min-width: 0; display: flex; flex-direction: column; }
.sb-name b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.sb-name span { font-size: 11px; color: var(--text-faint); }

.sb-kda { white-space: nowrap; }
.sb-kda b { font-family: var(--font-display); font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-kda b .dead { color: var(--loss); }
.sb-kda > span { display: block; font-size: 11px; color: var(--text-faint); }
.sb-sub { display: block; font-size: 10.5px; color: var(--text-faint); font-family: var(--font-body); }

.sb-bar { position: relative; min-width: 96px; height: 17px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.sb-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 55%, transparent)); }
.sb-bar.taken i { background: linear-gradient(90deg, var(--loss), color-mix(in srgb, var(--loss) 50%, transparent)); }
.sb-bar span {
  position: relative;
  display: block;
  padding: 0 6px;
  line-height: 17px;
  font-family: var(--font-display);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
[data-theme="light"] .sb-bar span { text-shadow: none; }

.sb-items { display: flex; gap: 2px; }
.sb-items img { border-radius: 5px; border: 1px solid var(--line); display: block; }
.item-empty { width: 24px; height: 24px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--line); }

.split-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.split-bar i { display: block; height: 100%; }
.split-bar .phys { background: var(--gold); }
.split-bar .magic { background: var(--cyan); }
.split-bar .true { background: var(--text-dim); }

.match { cursor: pointer; }
.match-toggle { cursor: pointer; }

@media (max-width: 900px) {
  .sb-table th:nth-child(6), .sb-table td:nth-child(6),
  .sb-table th:nth-child(7), .sb-table td:nth-child(7) { display: none; }
  .hero-meta { margin-left: 0; }
}

/* ----------------------------------- meta ---------------------------------- */
.patch-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(120deg, color-mix(in srgb, var(--magenta) 10%, transparent), var(--surface));
  box-shadow: var(--shadow);
}
.patch-badge { display: flex; align-items: baseline; gap: 10px; }
.patch-label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.patch-badge b {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.02em;
  color: var(--text);
  text-shadow: 0 0 20px color-mix(in srgb, var(--magenta) 45%, transparent);
}
[data-theme="light"] .patch-badge b { text-shadow: none; }
.patch-meta { display: flex; flex-direction: column; font-size: 12px; color: var(--text-dim); }
.patch-head .btn { margin-left: auto; }

.patch-summary { margin: 0 0 14px; color: var(--text-dim); }
.patch-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }

.patch-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.patch-card.is-quiet { opacity: 0.62; }
.patch-card-head { display: flex; align-items: center; gap: 11px; }
.patch-card-head img { border-radius: 8px; border: 1px solid var(--line-strong); }
.patch-card-head div { display: flex; flex-direction: column; min-width: 0; }
.patch-card-head b { font-family: var(--font-display); font-size: 15px; }
.patch-card-head span { font-size: 11px; color: var(--text-faint); }
.patch-card-head .tag { margin-left: auto; }

.change-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 7px; }
.change {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-dim);
}
.change-what { flex: 1; min-width: 120px; }
.change-values { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--text-faint); }
.change-values b { color: var(--text); }
.change-values b.up { color: var(--cyan); }
.change-values b.down { color: var(--loss); }
.change .slot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 5px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cyan);
  border: 1px solid color-mix(in srgb, var(--cyan) 45%, transparent);
  border-radius: 5px;
}
.tag.nerf { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 45%, transparent); background: var(--loss-soft); }
.muted-note { font-size: 11.5px; color: var(--text-faint); }

#notes-locales { margin-left: 4px; }
.notes-list { display: grid; gap: 8px; }
.note {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
}
.note summary {
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--text);
  list-style: none;
}
.note summary::-webkit-details-marker { display: none; }
.note summary::before { content: "▸ "; color: var(--cyan); }
.note[open] summary::before { content: "▾ "; }
.note summary:hover { color: var(--cyan); }
.note-text {
  margin: 0;
  padding: 0 14px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

.thinking-note { margin-left: 10px; font-size: 12px; color: var(--text-faint); font-style: italic; }

.rec-sources {
  margin-top: 20px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.rec-sources b {
  display: block;
  margin-bottom: 7px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.rec-sources ul { margin: 0 0 8px; padding-left: 18px; }
.rec-sources li { font-size: 12.5px; margin-bottom: 3px; }
.rec-sources .muted-note { margin: 0; }

.source-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 11px; }
.source-list li { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 2px solid var(--cyan); }
.source-list li.is-off { border-left-color: var(--line); opacity: 0.75; }
.source-list b { font-family: var(--font-display); font-size: 12.5px; color: var(--text); }
.source-list span { font-size: 12px; color: var(--text-dim); }

/* --------------------------------- coach AI -------------------------------- */
.chat-panel { display: flex; flex-direction: column; }

.chat-model {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  clip-path: var(--cut-sm);
  background: var(--surface-2);
}
.chat-model::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}
.chat-model.is-online::before { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.chat-model.is-offline::before { background: var(--loss); }

.chat-log {
  flex: 1;
  min-height: 44vh;
  max-height: calc(100vh - 330px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.user { justify-content: flex-end; }
.msg-body { display: grid; gap: 6px; min-width: 0; flex: 1; }
.msg.user .msg-body { display: flex; justify-content: flex-end; }

.msg-avatar {
  width: 26px;
  height: 26px;
  margin-top: 2px;
  flex-shrink: 0;
  clip-path: polygon(50% 0, 100% 26%, 100% 74%, 50% 100%, 0 74%, 0 26%);
  background: linear-gradient(140deg, var(--cyan), var(--magenta));
}

.bubble {
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-dim);
  max-width: min(76ch, 88%);
  overflow-wrap: anywhere;
}
.msg.bot .bubble { border-left: 2px solid var(--cyan); border-radius: 4px 13px 13px 13px; }
.msg.user .bubble {
  color: var(--text);
  border-color: color-mix(in srgb, var(--magenta) 40%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--magenta) 14%, transparent), var(--surface-3));
  border-radius: 13px 4px 13px 13px;
  max-width: min(64ch, 78%);
}
.msg.is-error .bubble { border-color: color-mix(in srgb, var(--loss) 50%, transparent); }

.bubble.prose { max-width: min(76ch, 88%); justify-self: start; }
.msg.user .bubble.prose { max-width: min(64ch, 78%); }
.bubble.prose h1, .bubble.prose h2, .bubble.prose h3 { margin: 14px 0 7px; font-size: 12.5px; }
.bubble.prose > :first-child { margin-top: 0; }
.bubble.prose p:last-child, .bubble.prose ul:last-child { margin-bottom: 0; }
.chat-error { margin: 6px 0 0; color: var(--loss); font-size: 13px; }

.typing { display: inline-flex; gap: 5px; padding: 4px 0; }
.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  animation: typing 1s ease-in-out infinite;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-foot { border-top: 1px solid var(--line); padding: 14px 16px 16px; background: color-mix(in srgb, var(--surface-3) 35%, transparent); }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chat-suggestion { cursor: pointer; font-family: inherit; text-align: left; }
.chat-suggestion:hover { color: var(--cyan); border-color: var(--line-strong); }

.chat-composer { display: flex; gap: 10px; align-items: flex-end; }
.chat-composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 160px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
}
.chat-composer textarea:focus { border-color: var(--line-strong); outline: none; box-shadow: var(--glow-cyan); }
.chat-composer textarea:disabled { opacity: 0.6; }
.chat-send, .chat-stop { height: 44px; flex-shrink: 0; }
.chat-note { margin: 10px 0 0; font-size: 11.5px; color: var(--text-faint); }
.chat-note code { font-family: var(--font-mono); font-size: 11px; }

@media (max-width: 720px) {
  .chat-log { max-height: none; min-height: 52vh; padding: 14px; }
  .bubble, .msg.user .bubble { max-width: 92%; }
}

/* --------------------------------- toasts --------------------------------- */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 9px; }
.toast {
  padding: 11px 15px;
  min-width: 220px;
  border: 1px solid var(--line-strong);
  clip-path: var(--cut-sm);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toast-in 0.22s ease;
}
.toast.error { border-color: color-mix(in srgb, var(--loss) 60%, transparent); color: var(--loss); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --------------------------------- states --------------------------------- */
.empty-state {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.empty-state h3 { font-size: 16px; }
.empty-state p { margin: 0; color: var(--text-dim); max-width: 62ch; }

/* ---------------------------------- login --------------------------------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card {
  width: min(400px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand .logo-text { font-size: 19px; }
.login-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-faint); }
.login-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--text-faint); }
.login-error { margin: 0; min-height: 20px; font-size: 12.5px; color: var(--loss); }

/* ------------------------------- responsive ------------------------------- */
@media (max-width: 1080px) {
  .panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2, .span-3 { grid-column: span 2; }
}

/* Seven tabs plus a primary action need the width: the rank chip is the first to
   go, since the dashboard shows the same rank in a KPI card. */
@media (max-width: 1500px) {
  .rank-chip { display: none; }
}

/* The refresh button keeps its icon but drops its label before anything clips. */
@media (max-width: 1240px) {
  .refresh-btn .btn-label { display: none; }
  .refresh-btn { padding: 9px 11px; }
}

@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; padding: 10px 14px; }
  .tabs { order: 3; width: 100%; margin-left: 0; border-radius: 12px; }
  .tab-glider { border-radius: 10px; }
  .topbar-actions { margin-left: auto; }
  .filters { top: 0; position: static; }

  .match {
    grid-template-columns: 4px 52px minmax(0, 1fr) 34px;
    grid-template-areas:
      "accent champ title toggle"
      "accent outcome outcome outcome"
      "accent kda kda kda"
      "accent stats stats stats";
    row-gap: 9px;
    padding-bottom: 13px;
  }
  .match-accent { grid-area: accent; }
  .match-champ { grid-area: champ; }
  .match-title { grid-area: title; }
  .match-outcome { grid-area: outcome; flex-direction: row; align-items: center; gap: 10px; }
  .match-kda { grid-area: kda; }
  .match-kda > span { display: inline; margin-left: 8px; }
  .match-stats { grid-area: stats; }
  .match-toggle { grid-area: toggle; }
  .match-details { margin-left: 0; }
}

@media (max-width: 720px) {
  .shell { padding: 16px 12px 60px; }
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: span 1; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .donut { grid-column: span 2; justify-self: center; }
  .rank-chip { display: none; }
  .kpi-value { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ----------------------------------- draft --------------------------------- */
.draft-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  align-items: start;
}
.draft-build { margin-top: 16px; }

.field-label {
  display: block;
  margin: 14px 0 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.field-label:first-child { margin-top: 0; }
.muted { color: var(--text-faint); font-weight: 400; }

.seg-lanes { display: flex; flex-wrap: wrap; width: 100%; border-radius: var(--radius-sm); }
.seg-lanes .seg-btn { flex: 1 1 auto; padding: 6px 9px; font-size: 11.5px; white-space: nowrap; }

.champ-input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.champ-input:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: var(--glow-cyan);
}

.chip-input { display: flex; gap: 7px; }
.chip-input .champ-input { flex: 1; min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 12px;
}
.chip img { border-radius: 999px; display: block; }
.chip-x {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.chip-x:hover { color: var(--loss); background: var(--loss-soft); }

.draft-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.draft-corpus { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; }

/* --- ranked pool --- */
.threat { margin-bottom: 14px; }
.threat-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.draft-duo { margin: 0 0 12px; font-size: 12.5px; color: var(--text-dim); }
.warn-line { margin: 0 0 10px; font-size: 12.5px; color: var(--gold); }

.picks { display: grid; gap: 7px; }
.pick {
  display: grid;
  grid-template-columns: 22px 40px 1fr;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.pick:hover { border-color: var(--line-strong); transform: translateX(2px); }
.pick.is-active {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 9%, var(--surface-2));
  box-shadow: inset 2px 0 0 var(--cyan);
}
.pick-rank {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-faint);
  text-align: center;
}
.pick.is-active .pick-rank { color: var(--cyan); }
.pick-icon { border-radius: 9px; border: 1px solid var(--line); display: block; }
.pick-body { display: grid; gap: 5px; min-width: 0; }
.pick-body .wbar { max-width: 320px; }
.pick-title { display: flex; align-items: center; gap: 7px; }
.pick-title b { font-family: var(--font-display); font-size: 14px; }
.pick-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.pick-numbers b { color: var(--text); }

/* The Wilson interval as a range: a wide bar reads as "not measured yet". */
.wbar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.wbar-range { position: absolute; top: 0; height: 100%; border-radius: 999px; opacity: 0.45; }
.wbar-point { position: absolute; top: -2px; width: 2px; height: 12px; margin-left: -1px; border-radius: 2px; }
.wbar-mid { position: absolute; left: 50%; top: 0; width: 1px; height: 100%; background: var(--line-strong); opacity: 0.7; }
.wbar.good .wbar-range { background: var(--win); }
.wbar.good .wbar-point { background: var(--win); box-shadow: 0 0 8px var(--win); }
.wbar.bad .wbar-range { background: var(--loss); }
.wbar.bad .wbar-point { background: var(--loss); box-shadow: 0 0 8px var(--loss); }
.wbar.thin .wbar-range { background: var(--text-faint); }
.wbar.thin .wbar-point { background: var(--text-dim); }
.wbar.is-empty { display: flex; align-items: center; justify-content: center; height: 8px; }
.wbar.is-empty span { font-size: 9px; color: var(--text-faint); }
.tag-thin { color: var(--text-faint); border-color: var(--line); background: transparent; }
.tag-good { color: var(--win); border-color: color-mix(in srgb, var(--win) 45%, transparent); background: var(--win-soft); }
.tag-bad { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 45%, transparent); background: var(--loss-soft); }

/* --- build --- */
.build-sample { margin: 0 0 14px; font-size: 12px; }
.build-section { margin-bottom: 16px; }
.build-section h3 {
  margin-bottom: 9px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.item-list { display: grid; gap: 7px; list-style: none; }
.item-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.item-card img { border-radius: 7px; border: 1px solid var(--line); flex-shrink: 0; }
.item-body { display: grid; gap: 3px; min-width: 0; }
.item-head { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.item-head b { font-size: 13.5px; }
.item-gold { font-family: var(--font-mono); font-size: 11.5px; color: var(--gold); }
.item-record { font-size: 11px; }
.item-record.good { color: var(--win); }
.item-record.bad { color: var(--loss); }
.item-path { font-size: 11.5px; color: var(--text-faint); }
.item-path i { font-family: var(--font-mono); font-style: normal; color: var(--gold); opacity: 0.8; }
.item-why { font-size: 11.5px; color: var(--text-dim); }
.build-notes { display: grid; gap: 5px; margin: 0; padding-left: 17px; }
.build-notes li { font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }

/* --- live game --- */
.live-banner {
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  box-shadow: var(--glow-cyan);
}
.live-head { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; font-size: 13px; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--loss);
  box-shadow: 0 0 10px var(--loss);
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.live-teams { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.live-team { display: flex; align-items: center; gap: 6px; }
.live-label {
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-right: 3px;
}
.live-champ img { border-radius: 8px; border: 1px solid var(--line); display: block; }
.live-champ.is-me img { border-color: var(--cyan); box-shadow: 0 0 10px rgba(34, 225, 255, 0.45); }
.live-vs { font-family: var(--font-display); color: var(--text-faint); font-size: 12px; }
.live-none { margin: 0 0 16px; font-size: 12.5px; color: var(--text-dim); }

.empty { margin: 0; padding: 18px 0; font-size: 13px; color: var(--text-dim); text-align: center; }

@media (max-width: 900px) {
  .draft-layout { grid-template-columns: 1fr; }
}

/* --- what the coach looked up before answering --- */
.chat-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}
.chat-steps-head {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.chat-step {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--cyan) 8%, transparent);
  color: var(--text-dim);
  font-size: 11px;
}
.item-stats { font-size: 11.5px; color: var(--text-dim); }
.item-effect {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.5;
  padding-left: 9px;
  border-left: 2px solid var(--line);
}

/* --- global benchmark: always shown next to his own numbers --- */
.global-box {
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--violet) 7%, var(--surface-2));
}
.global-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 9px; font-size: 12.5px; }
.global-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 9px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.global-label { min-width: 150px; color: var(--text-dim); }
.global-mine b { color: var(--cyan); }
.global-vs { color: var(--text-faint); font-size: 11px; }
.global-world b { color: var(--violet); }
.global-link { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.global-link:hover { color: var(--cyan); }
.global-note { margin: 7px 0 0; font-size: 11px; line-height: 1.5; color: var(--text-faint); }

/* ----------------------------------- duelo --------------------------------- */
.duel-headline {
  margin: 0 0 15px;
  padding: 11px 14px;
  border-left: 2px solid var(--cyan);
  border-radius: 4px var(--radius-sm) var(--radius-sm) 4px;
  background: color-mix(in srgb, var(--cyan) 8%, var(--surface-2));
  font-size: 13.5px;
  line-height: 1.55;
}

.duel-quads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quad {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.quad b { font-family: var(--font-display); font-size: 21px; line-height: 1; }
.quad span { font-size: 11px; color: var(--text-dim); line-height: 1.35; }
.quad.good { border-color: color-mix(in srgb, var(--win) 45%, transparent); }
.quad.good b { color: var(--win); }
.quad.bad { border-color: color-mix(in srgb, var(--loss) 45%, transparent); }
.quad.bad b { color: var(--loss); }
.quad.warn b { color: var(--gold); }

.duel-note { margin: 11px 0 17px; font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.duel-note b { color: var(--text); }

.duel-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.duel-table th {
  padding: 7px 9px;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.duel-table td { padding: 7px 9px; border-bottom: 1px solid var(--line); }
.duel-table tr:last-child td { border-bottom: 0; }
.duel-table tr:hover td { background: color-mix(in srgb, var(--cyan) 5%, transparent); }
.duel-label { color: var(--text-dim); white-space: nowrap; }
.duel-num.good { color: var(--win); }
.duel-num.bad { color: var(--loss); }
.duel-num.flat { color: var(--text-faint); }

.duel-bar-cell { width: 34%; min-width: 130px; }
.duel-bar { position: relative; height: 9px; border-radius: 3px; background: var(--surface-3); }
.duel-bar i { position: absolute; top: 0; height: 100%; border-radius: 3px; }
.duel-bar i.good { background: var(--win); }
.duel-bar i.bad { background: var(--loss); }
.duel-zero { position: absolute; left: 50%; top: -2px; width: 1px; height: 13px; background: var(--line-strong); }

.duel-sub {
  margin: 20px 0 10px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.duel-hardest { display: flex; flex-wrap: wrap; gap: 8px; }
.duel-enemy {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.duel-enemy:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.duel-enemy img { border-radius: 7px; border: 1px solid var(--line); }
.duel-enemy span { display: grid; gap: 1px; text-align: left; }
.duel-enemy b { font-size: 13px; }
.duel-enemy em { font-style: normal; font-size: 11px; color: var(--text-faint); }
.duel-foot { margin: 16px 0 0; font-size: 11.5px; }
.table-scroll { overflow-x: auto; }

@media (max-width: 780px) {
  .duel-quads { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------- ritmo ---------------------------------- */
.rhythm-headline {
  margin: 0 0 13px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
}
.rhythm-list { display: grid; gap: 5px; }
.rhythm-row {
  display: grid;
  grid-template-columns: 116px 1fr 42px 40px 92px;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
}
.rhythm-label { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rhythm-track { position: relative; height: 14px; border-radius: 3px; background: var(--surface-3); overflow: visible; }
.rhythm-track i { position: absolute; left: 0; top: 0; height: 100%; border-radius: 3px; background: var(--text-faint); opacity: 0.45; }
.rhythm-track i.good { background: var(--win); opacity: 0.8; }
.rhythm-track i.bad { background: var(--loss); opacity: 0.8; }
.rhythm-track em {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 18px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 7px rgba(34, 225, 255, 0.6);
}
.rhythm-base { position: absolute; top: 0; width: 1px; height: 100%; margin-left: -0.5px; background: var(--line-strong); }
.rhythm-wr { text-align: right; font-family: var(--font-mono); }
.rhythm-wr.good { color: var(--win); }
.rhythm-wr.bad { color: var(--loss); }
.rhythm-n { text-align: right; color: var(--text-faint); font-family: var(--font-mono); }
.rhythm-p { color: var(--text-faint); font-family: var(--font-mono); font-size: 10.5px; }
.rhythm-row.is-sig .rhythm-p { color: var(--gold); }

.rhythm-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 11px; font-size: 10.5px; color: var(--text-faint); }
.rhythm-legend .swatch { display: inline-block; width: 10px; height: 8px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.rhythm-legend .swatch.flat { background: var(--text-faint); opacity: 0.45; }
.rhythm-legend .swatch.mark { width: 2px; height: 12px; background: var(--cyan); }
.rhythm-legend .swatch.base { width: 1px; height: 12px; background: var(--line-strong); }
.rhythm-requeue { margin: 12px 0 0; font-size: 12px; color: var(--text-dim); }
.rhythm-foot { margin: 10px 0 0; font-size: 10.5px; line-height: 1.5; }

@media (max-width: 720px) {
  .rhythm-row { grid-template-columns: 90px 1fr 38px 36px; }
  .rhythm-p { display: none; }
}

/* ------------------------------- lane curve -------------------------------- */
.curve-panel { margin-top: 16px; }
.curve-svg { width: 100%; height: auto; display: block; }
.curve-axis { fill: var(--text-faint); font-size: 10px; font-family: var(--font-mono); }
.curve-axis.gold { fill: var(--gold); }
.curve-svg circle[data-tip]:hover { fill: color-mix(in srgb, var(--cyan) 55%, transparent); }
.curve-foot { margin: 9px 0 0; font-size: 11.5px; line-height: 1.5; }

/* --------------------------------- muertes --------------------------------- */
.deaths-panel { margin-top: 16px; }
.deaths-layout { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 20px; align-items: start; }
.death-map { width: 100%; height: auto; display: block; }
.death-dot { opacity: 0.75; transition: r 0.1s; }
.death-dot.home { fill: var(--cyan); }
.death-dot.far { fill: var(--magenta); }
.death-dot:hover { r: 5; opacity: 1; }
.death-legend { margin: 9px 0 0; font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.death-legend .dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.death-legend .dot.home { background: var(--cyan); }
.death-legend .dot.far { background: var(--magenta); }

.deaths-side { display: grid; gap: 9px; align-content: start; }
.death-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.death-stat b { font-family: var(--font-display); font-size: 21px; color: var(--cyan); line-height: 1; }
.death-stat span { font-size: 11.5px; color: var(--text-dim); display: grid; gap: 2px; }
.death-stat em { font-style: normal; font-size: 10.5px; color: var(--text-faint); }

.death-phases { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 3px; }
.death-phases td { padding: 6px 9px; border-bottom: 1px solid var(--line); color: var(--text-dim); }
.death-phases tr:last-child td { border-bottom: 0; }
.death-phases b { color: var(--text); font-family: var(--font-mono); }

.death-hist { display: flex; align-items: flex-end; gap: 1px; height: 84px; margin-top: 4px; }
.death-bar {
  flex: 1;
  min-width: 2px;
  display: flex;
  align-items: flex-end;
  border-radius: 2px 2px 0 0;
  background: var(--cyan);
  opacity: 0.75;
  transition: opacity 0.12s;
}
.death-bar:hover { opacity: 1; }
.death-bar i { display: block; width: 100%; border-radius: 2px 2px 0 0; background: var(--magenta); }
.death-hist-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); }

@media (max-width: 820px) {
  .deaths-layout { grid-template-columns: 1fr; }
}

/* ----------------------------- orden de compra ----------------------------- */
.order-tempo { display: block; margin-bottom: 11px; font-size: 12px; color: var(--text-dim); }
.order-tempo b { color: var(--cyan); font-family: var(--font-mono); }
.order-track { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.order-slot {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 112px;
  padding: 10px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: center;
}
.order-num { font-family: var(--font-display); font-size: 10px; letter-spacing: 0.1em; color: var(--text-faint); }
.order-slot img { border-radius: 7px; border: 1px solid var(--line); }
.order-slot b { font-size: 11.5px; line-height: 1.25; }
.order-when { font-family: var(--font-mono); font-size: 11px; color: var(--gold); }
.order-share { font-size: 10px; }
.order-share.good { color: var(--win); }
.order-share.bad { color: var(--loss); }
.order-alts { display: flex; gap: 4px; margin-top: 3px; }
.order-alts em {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-style: normal;
  font-size: 9.5px;
  color: var(--text-faint);
  cursor: help;
}
.order-alts em img { border-radius: 4px; border: 0; }
.order-alts em.better { color: var(--cyan); }
.order-arrow { align-self: center; color: var(--text-faint); font-size: 17px; flex-shrink: 0; }
.order-foot { margin: 8px 0 0; font-size: 11px; }
.order-better {
  margin: 10px 0 0;
  padding: 8px 11px;
  border-left: 2px solid var(--gold);
  border-radius: 4px var(--radius-sm) var(--radius-sm) 4px;
  background: color-mix(in srgb, var(--gold) 8%, var(--surface-2));
  font-size: 12px;
  line-height: 1.55;
}

/* ---------------------------------- plan ----------------------------------- */
.plan-panel { margin: 16px 0; }
.plan-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.plan-item:first-child { padding-top: 0; }
.plan-item:last-of-type { border-bottom: 0; }
.plan-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--cyan);
}
.plan-item.conf-baja .plan-rank { border-color: var(--line); color: var(--text-faint); }
.plan-body { min-width: 0; }
.plan-body h3 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.3;
}
.plan-lp {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  border-radius: 999px;
  padding: 2px 9px;
  cursor: help;
}
.plan-evidence { margin: 0 0 5px; font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }
.plan-action { margin: 0 0 7px; font-size: 12.5px; line-height: 1.55; }
.plan-meta { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 11px; }
.plan-meta a { color: var(--text-faint); }
.plan-meta a:hover { color: var(--cyan); }
.tag.gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 12%, transparent); }

.plan-cleared {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--win) 6%, var(--surface-2));
}
.plan-cleared-head {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.plan-cleared p { margin: 0 0 4px; font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }
.plan-cleared p:last-child { margin-bottom: 0; }
.plan-foot { margin: 11px 0 0; font-size: 11px; }
.session-user {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.coverage-note {
  margin: -4px 0 0;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}
.feed-end { display: grid; justify-items: center; gap: 9px; padding: 22px 0; }
.feed-end p { margin: 0; }
.feed-end-note { font-size: 11.5px; color: var(--text-faint); text-align: center; max-width: 46ch; line-height: 1.5; }

/* The minimap is Riot artwork under our data: dimmed enough that the dots read,
   and dimmed differently per theme because the scrim is the page behind it. */
.death-map-art { opacity: 0.6; }
.death-map-scrim { fill: var(--bg); opacity: 0.3; }
:root[data-theme="light"] .death-map-art,
:root:not([data-theme="dark"]) .death-map-art { opacity: 0.75; }
:root[data-theme="light"] .death-map-scrim,
:root:not([data-theme="dark"]) .death-map-scrim { opacity: 0.12; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .death-map-art { opacity: 0.6; }
  :root:not([data-theme="light"]) .death-map-scrim { opacity: 0.3; }
}
