/* tier list: header with the view toggle, the S-tier spotlight, then one panel whose filter bar sticks while the page
   scrolls; the table (or the tier rows) under it */
.tier-table { display: flex; flex-direction: column; }
.counters { display: flex; gap: var(--space-2); }
.counter { display: flex; border-radius: var(--radius-sm); }
.counter .champ-cell { --cell-icon: 26px; }
.counter:hover .cell-icon, .counter:focus-visible .cell-icon { box-shadow: var(--ring-amber); }
.tl-champ { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.tl-changed { flex: none; display: flex; padding: var(--space-1); border-radius: var(--radius-sm); color: var(--amber); }
.tl-changed .ui-svg { width: 14px; height: 14px; }
.tl-changed:hover, .tl-changed:focus-visible { background: var(--surface-3); color: var(--text-1); }

/* view toggle in the header */
.tl-view .choice { gap: var(--space-3); }
.tl-view-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- the panel and its sticky filter bar ---------- */
.tier-panel { padding: 0; gap: 0; --tl-filter-h: 64px; }
.tier-panel .tier-filter {
  position: sticky;
  top: calc(-1 * var(--space-9));
  z-index: 4;
  padding: var(--space-6) var(--space-7);
  border-bottom: 1px solid var(--hairline);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: color-mix(in oklch, var(--surface-1) 92%, transparent);
  backdrop-filter: blur(10px);
}
.tier-panel [hidden] { display: none; }
.tier-filter .filter-groups { gap: var(--space-4) var(--space-5); }
.tier-filter .choices:not(.locked) .choice { padding: 0 var(--space-5); }
.tier-filter .field { width: 184px; }
.tier-panel .data-table th { top: calc(var(--tl-filter-h) - var(--space-9)); z-index: 3; background: var(--surface-1); }
.tier-panel .data-table th:first-child, .tier-panel .data-table td:first-child { padding-left: var(--space-7); }
.tier-panel .data-table th:last-child, .tier-panel .data-table td:last-child { padding-right: var(--space-7); }
.tier-panel .data-table tbody tr:last-child td { border-bottom: 0; }

/* ---------- rows: the tier's colour as a left edge and a faint wash ---------- */
.tier-panel .data-table td:first-child { position: relative; }
.tl-edge { position: absolute; left: 0; top: var(--space-3); bottom: var(--space-3); width: 3px; border-radius: 0 var(--radius-xs) var(--radius-xs) 0; background: var(--tier, transparent); }
.tier-panel tbody tr:has(.tl-edge.tier-splus) { --row-tier: var(--tier-splus); }
.tier-panel tbody tr:has(.tl-edge.tier-s) { --row-tier: var(--tier-s); }
.tier-panel tbody tr:has(.tl-edge.tier-a) { --row-tier: var(--tier-a); }
.tier-panel tbody tr:has(.tl-edge.tier-b) { --row-tier: var(--tier-b); }
.tier-panel tbody tr:has(.tl-edge.tier-c) { --row-tier: var(--tier-c); }
.tier-panel tbody tr:has(.tl-edge.tier-d) { --row-tier: var(--tier-d); }
.tier-panel tbody tr[data-row] { background: linear-gradient(90deg, color-mix(in oklch, var(--row-tier, transparent) 7%, transparent), transparent 28%); }
.tier-panel tbody tr:has(.tl-edge.tier-splus) .tl-edge { box-shadow: 0 0 10px color-mix(in oklch, var(--tier-splus) 70%, transparent); }

/* the place, and how far it moved since the previous patch */
.tl-rank-cell { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: var(--space-4); }
.tl-rank { font: 600 var(--fs-md)/1 var(--font-mono); color: var(--text-2); min-width: 2ch; }
.tl-move { font: 600 var(--fs-xs)/1 var(--font-mono); font-variant-numeric: tabular-nums; cursor: default; }
.tl-move.up { color: var(--pos); }
.tl-move.down { color: var(--neg); }
.tl-move.new { color: var(--amber); letter-spacing: .04em; }

/* the win rate: a bar in the tier's colour with a tick at 50%, then the number */
.tl-win { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--space-5); width: 100%; }
.tl-win-bar { position: relative; flex: 1; max-width: 132px; height: 6px; border-radius: var(--radius-pill); background: color-mix(in oklch, var(--surface-3) 80%, transparent); overflow: visible; }
.tl-win-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--text-4); }
.tl-win-fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(100% * var(--size)); border-radius: var(--radius-pill); background: linear-gradient(90deg, color-mix(in oklch, var(--tier, var(--text-3)) 45%, transparent), var(--tier, var(--text-3))); transform-origin: left; }
.tl-win.tier-splus .tl-win-fill { box-shadow: 0 0 8px color-mix(in oklch, var(--tier) 55%, transparent); }
.tl-win-value { min-width: 6ch; text-align: right; font-weight: 600; }
.data-table tr.rise .tl-win-fill { animation: tl-bar var(--dur-count) var(--ease-out) both; animation-delay: calc(120ms + var(--i) * 15ms); }
.tl-games { color: var(--text-2); }
@keyframes tl-bar { from { scale: 0 1; } }

/* ---------- the strongest picks: art-backed tiles lit in their tier's colour ---------- */
.tl-spotlight { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: var(--space-6); }
.tl-spot {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: 84px;
  padding: var(--space-6) var(--space-6) var(--space-6) var(--space-7);
  border: 1px solid color-mix(in oklch, var(--tier) 34%, var(--hairline));
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, color-mix(in oklch, var(--tier) 16%, var(--surface-1)), var(--surface-1) 70%);
  box-shadow: var(--edge-light);
  color: inherit;
  text-decoration: none;
  animation: rise var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i) * 50ms);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast);
}
.tl-spot::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--art) right 18% top 22% / 190% auto no-repeat;
  opacity: .6;
  -webkit-mask-image: linear-gradient(90deg, transparent 15%, #000 75%);
  mask-image: linear-gradient(90deg, transparent 15%, #000 75%);
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-fast);
}
.tl-spot.tier-splus { box-shadow: var(--edge-light), 0 0 0 1px color-mix(in oklch, var(--tier) 30%, transparent), 0 10px 30px -14px color-mix(in oklch, var(--tier) 70%, transparent); }
.tl-spot:hover { transform: translateY(-2px); border-color: color-mix(in oklch, var(--tier) 65%, transparent); }
.tl-spot:hover::before { transform: scale(1.04); opacity: .75; }
.tl-spot-pic { flex: none; width: 48px; height: 48px; border-radius: var(--radius-lg); box-shadow: 0 0 0 1px color-mix(in oklch, var(--tier) 55%, transparent), 0 6px 18px -6px color-mix(in oklch, var(--tier) 65%, transparent); }
.tl-spot-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.tl-spot-name { font: 600 var(--fs-lg)/1.1 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 8px rgb(0 0 0 / .7); }
.tl-spot-win { font: 600 var(--fs-sm)/1 var(--font-mono); color: var(--text-2); }
.tl-spot-win small { font: 500 var(--fs-xs)/1 var(--font-ui); color: var(--text-3); }
.tl-spot .tier { align-self: flex-start; }

/* ---------- tier rows view ---------- */
.tl-rows { display: flex; flex-direction: column; }
.tl-tier-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); border-bottom: 1px solid var(--hairline); background: linear-gradient(90deg, color-mix(in oklch, var(--tier) 9%, transparent), transparent 40%); }
.tl-tier-row:last-child { border-bottom: 0; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.tl-tier-label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); padding: var(--space-7) 0; border-right: 1px solid color-mix(in oklch, var(--tier) 30%, var(--hairline)); box-shadow: inset 3px 0 0 var(--tier); }
.tl-tier-letter { font: 700 var(--fs-2xl)/1 var(--font-display); color: var(--tier); }
.tl-tier-row.tier-splus .tl-tier-letter { text-shadow: 0 0 18px color-mix(in oklch, var(--tier) 70%, transparent); }
.tl-tier-count { font: 600 var(--fs-xs)/1 var(--font-mono); color: var(--text-3); }
.tl-tier-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--space-4); padding: var(--space-6) var(--space-7); }
.tl-tile { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-2); border-radius: var(--radius-lg); color: var(--text-1); text-decoration: none; animation: rise var(--dur-slow) var(--ease-out) both; animation-delay: calc(var(--i) * 20ms); transition: background var(--dur-fast); }
.tl-tile:hover { background: var(--surface-2); }
.tl-tile-pic { width: 60px; height: 60px; border-radius: var(--radius-lg); box-shadow: 0 0 0 1px color-mix(in oklch, var(--tier) 45%, transparent); transition: transform var(--dur-fast) var(--ease-out); }
.tl-tile:hover .tl-tile-pic { transform: translateY(-2px); }
.tl-tile-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 var(--fs-sm)/1.2 var(--font-ui); }
.tl-tile-win { font: 600 var(--fs-xs)/1 var(--font-mono); }
.tl-rows-empty { padding: var(--space-10); text-align: center; color: var(--text-3); font: 500 var(--fs-md)/1.4 var(--font-ui); }
