:root {
  --bg: #0b0b0e;
  --surface: #141419;
  --surface-2: #1b1b22;
  --line: #272730;
  --text: #f2f2f4;
  --muted: #a6a6b0;
  --accent: #ffd100;
  --up: #4ade80;
  --down: #ff8a8a;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 6px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
a:hover { color: var(--accent); }
[tabindex="-1"]:focus { outline: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.05; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; text-transform: uppercase; }
h2 { font-size: clamp(1.7rem, 3vw, 2.1rem); font-weight: 700; text-transform: uppercase; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #000; padding: 8px 12px; z-index: 10; font-weight: 700; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
main { outline: none; padding-bottom: 48px; }
.loading, .empty { color: var(--muted); padding: 8px 0; }

/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.brand { font: 800 1.6rem/1 var(--display); text-transform: uppercase; text-decoration: none; letter-spacing: 0.02em; }
.brand span { color: var(--accent); margin-left: 2px; }
.freshness { color: var(--muted); font-size: 1rem; display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.4; }
.freshness .stale { color: #ffb454; }
.freshness a { color: var(--text); text-underline-offset: 3px; }

/* ---------- home ---------- */
.intro { padding: 40px 0 8px; }
.lead { color: var(--muted); margin-top: 10px; max-width: 60ch; }
.controls { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; padding: 20px 0 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { color: var(--muted); font-size: 1rem; }
select {
  appearance: none; -webkit-appearance: none;
  font: 600 1.05rem var(--body); color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a6a6b0' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 40px 10px 14px; min-height: 46px; min-width: 220px; cursor: pointer;
}
select:hover { border-color: #3c3c48; }
.roles { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.role-btn {
  --role: var(--accent);
  font: 600 1.05rem var(--body); color: var(--muted); background: none; border: 0;
  padding: 10px 14px; min-height: 46px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.role-btn:hover { color: var(--text); }
.role-btn[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--role); }

.tiers { margin-top: 16px; }
.tier { display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); }
.tier-letter { font: 800 3.6rem/0.9 var(--display); color: #8a8a95; padding-top: 4px; }
.tier-S .tier-letter { color: var(--accent); font-size: 4.4rem; }
.tier-A .tier-letter { color: #e8e8ec; }
.tier-B .tier-letter { color: #c4c4cc; }
.tier-C .tier-letter { color: #a6a6b0; }
.tier-D .tier-letter { color: #8f8f9a; }
.tier-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.tier-S .tier-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.card {
  display: flex; flex-direction: column; text-decoration: none; height: 100%;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border-bottom: 3px solid var(--role);
  transition: transform .15s ease, background-color .15s ease;
}
.card:hover { transform: translateY(-2px); background: var(--surface-2); color: var(--text); }
.card-img {
  width: 100%; height: auto; aspect-ratio: 1;
  background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--role) 30%, transparent), transparent 70%);
}
.card-name { font: 700 1.1rem/1.1 var(--display); text-transform: uppercase; padding: 8px 10px 0; overflow-wrap: anywhere; }
.card-wr { font-size: 1rem; color: var(--muted); padding: 2px 10px 10px; font-variant-numeric: tabular-nums; margin-top: auto; } /* same baseline across a row when a name wraps */
.tier-S .card-name { font-size: 1.3rem; }
.tier-S .card-wr { color: var(--text); }
.note { color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.patch-line { color: var(--muted); margin-top: 6px; }
.patch-line a, .patch-note a { color: var(--text); text-underline-offset: 3px; }

/* trend arrows: up green, down red, never alone (text or aria-label says the number) */
.delta { font-variant-numeric: tabular-nums; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.card { position: relative; }
.card-wr .delta { margin-left: 6px; }
.card-move {
  position: absolute; top: 6px; right: 8px; font: 700 1rem/1 var(--display);
  text-shadow: 0 1px 2px #000, 0 0 6px #000;
}
.card-move.up { color: var(--up); }
.card-move.down { color: var(--down); }

/* what changed this week */
.changes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.movers-col h3 { font-size: 1.3rem; text-transform: uppercase; margin-bottom: 8px; }
.movers-col.up h3 { color: var(--up); }
.movers-col.down h3 { color: var(--down); }
.movers { list-style: none; margin: 0; padding: 0; }
.mover {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.mover .face { grid-row: 1 / 3; }
.mover-name { font-weight: 700; }
.mover-tier { font: 700 1.2rem/1 var(--display); grid-row: 1 / 3; grid-column: 3; }
.mover-detail { color: var(--muted); grid-column: 2; font-size: 1rem; }
.mover:hover .mover-name { color: var(--accent); }

/* ---------- blocks ---------- */
.block { padding-top: 48px; }
.block > h2 { margin-bottom: 6px; }
.sub { color: var(--muted); margin-bottom: 20px; }

.videos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 24px 16px; }
.video { display: flex; flex-direction: column; gap: 8px; text-decoration: none; }
.video img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--surface); }
.video-title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { color: var(--muted); font-size: 1rem; }
.video:hover .video-title { color: var(--accent); }

/* ---------- hero detail ---------- */
.back { display: inline-block; margin: 24px 0 8px; color: var(--muted); text-decoration: none; padding: 6px 0; font-weight: 600; }
.hero-head { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 32px; align-items: center; }
.hero-art { border-radius: var(--radius); background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--role) 32%, transparent), transparent 70%); }
.hero-img { width: 100%; height: auto; aspect-ratio: 1; }
.hero-info { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero-role { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--role); flex: none; }
.hero-info h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); overflow-wrap: anywhere; }
.hero-tier { display: flex; align-items: center; gap: 16px; font-weight: 600; line-height: 1.3; }
.tier-big { font: 800 4rem/0.85 var(--display); color: var(--text); }
.tier-big.tier-S { color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { color: var(--muted); font-size: 1rem; font-weight: 600; }
.stat-value { font: 700 2.2rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 1rem; line-height: 1.35; }
.why { color: var(--muted); max-width: 62ch; }
.why a { color: var(--text); }

.teamups { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.teamup { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.teamup-top { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.teamup-icon { width: 48px; height: 48px; }
.teamup-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.teamup-wr { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.teamup-wr .muted { font-size: 1rem; white-space: nowrap; }
.teamup-value { font: 700 1.9rem/1 var(--display); font-variant-numeric: tabular-nums; }
.teamup-with { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.teamup-with a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; }
.teamup-with a:hover span { color: var(--accent); }
.face { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); box-shadow: 0 0 0 2px var(--role); }
details summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 4px 0; }
details summary:hover { color: var(--text); }
details[open] summary { margin-bottom: 6px; }

.chart { width: 100%; height: 300px; }
.chart.chart-empty { height: auto; }

/* tips from the videos */
.tip-group + .tip-group { margin-top: 28px; }
.tip-group h3 { font-size: 1.3rem; text-transform: uppercase; margin-bottom: 10px; }
.tips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 12px; }
.tip { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.tip-text { color: #e4e4e8; max-width: 70ch; }
.tip-source { color: var(--muted); font-size: 1rem; margin-top: auto; }
.tip-source a { color: var(--text); text-underline-offset: 3px; }
.tip-source a:hover, .patch-line a:hover, .patch-note a:hover { color: var(--accent); }
.tip-old { color: #ffb454; }
.tip-heroes { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tip-heroes a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; }
.tip-heroes a:hover span { color: var(--accent); }
.patch-note { color: var(--muted); }
.rank-table { margin-top: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child { text-align: left; }
thead th { color: var(--muted); font-weight: 600; }

.abilities { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 12px; }
.ability { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; }
.ability-icon { width: 48px; height: 48px; border-radius: var(--radius); background: var(--surface-2); }
.ability h3 { font-size: 1.2rem; text-transform: uppercase; margin-bottom: 4px; }
.ability-key { font: 600 1rem var(--body); color: var(--muted); text-transform: none; margin-left: 6px; }
.is-ult .ability-key { color: var(--accent); }
.ability-text { white-space: pre-line; color: #d4d4da; max-width: 70ch; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding-top: 32px; padding-bottom: 48px; color: var(--muted); }
.foot h2 { color: var(--text); margin-bottom: 12px; font-size: 1.5rem; }
.foot ul { padding-left: 20px; margin: 12px 0; display: grid; gap: 8px; max-width: 80ch; }
.foot strong { color: var(--text); }
.foot a { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-head { grid-template-columns: 1fr; gap: 8px; }
  .hero-art { max-width: 360px; width: 100%; margin: 0 auto; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .freshness { align-items: flex-start; text-align: left; }
  .intro { padding-top: 28px; }
  .controls { flex-direction: column; align-items: stretch; }
  select { width: 100%; }
  .roles { justify-content: space-between; }
  .role-btn { padding: 10px 6px; flex: 1; }
  .tier { grid-template-columns: 1fr; gap: 10px; padding: 16px 0; }
  .tier-letter, .tier-S .tier-letter { font-size: 2.8rem; }
  .tier-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .tier-S .tier-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .card-name { font-size: 1rem; line-height: 1; padding: 6px 6px 0; }
  .card-wr { padding: 2px 6px 8px; }
  .tier-S .card-name { font-size: 1.15rem; }
  .stats { grid-template-columns: 1fr; gap: 8px; }
  .stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; padding: 12px 14px; }
  .stat-label { grid-column: 1; grid-row: 1; }
  .stat-value { grid-column: 1; grid-row: 2; font-size: 2rem; }
  .stat-sub { grid-column: 2; grid-row: 1 / 3; text-align: right; }
  .intro { padding-top: 20px; }
  .lead { margin-top: 6px; }
  .chart { height: 260px; }
  .changes { grid-template-columns: 1fr; }
  .hero-art { max-width: 280px; }
}
@media (prefers-reduced-motion: no-preference) {
  a, summary, select, .role-btn, .video-title, .teamup-with span, .tip-heroes span, .mover-name { transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
