/* Champion portrait — reused in stat tables and match-history rows. Riot's
   splash crops are the only imagery in the app, so they read as coloured
   tokens rather than pictures. */
.champion-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  vertical-align: middle;
  background: var(--surface-sunk);
  box-shadow: inset 0 0 0 1px rgba(20, 21, 26, 0.08);
  flex-shrink: 0;
}

/* Gap between the portrait and the adjacent label in history rows.
   (The match roster uses flex `gap` on `.match__player` instead.) */
.history__position .champion-icon {
  margin-right: var(--space-sm);
}

.champion-icon--blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Champion / games / W–L / win-rate list with a mint rate bar. */
.champion-stats__list {
  list-style: none;
  margin: var(--space-sm) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.champion-stats__item {
  display: grid;
  grid-template-columns: 1fr 56px 72px 110px;
  align-items: center;
  gap: var(--space-md);
  padding: var(--row-pad-y) 0;
  border-bottom: var(--border-width) solid var(--border-default);
  font-size: var(--text-base);
}

.champion-stats__item:last-child {
  border-bottom: none;
}

.champion-stats__item--head {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-secondary);
  padding: 0 0 var(--space-sm);
}

.champion-stats__champ {
  display: flex;
  align-items: center;
  gap: var(--space-smd);
  min-width: 0;
}

.champion-stats__name {
  font-weight: var(--weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.champion-stats__games,
.champion-stats__record,
.champion-stats__rate,
.champion-stats__item--head .champion-stats__rate {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.champion-stats__games {
  color: var(--text-secondary);
}

.champion-stats__record {
  color: var(--ink-700);
}

.champion-stats__rate-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.champion-stats__rate {
  font-weight: var(--weight-semibold);
  color: var(--text-win);
}

/* De-emphasise small-sample win rates (under the games threshold). */
.champion-stats__rate--provisional {
  font-weight: var(--weight-regular);
  color: var(--text-tertiary);
}

.champion-stats__bar {
  display: block;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunk);
  overflow: hidden;
}

.champion-stats__bar-fill {
  display: block;
  height: 100%;
  background: var(--mint-500);
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease-out);
}

/* The league-wide champion-stats page around the table. */
.champion-stats--page {
  max-width: var(--measure-mid);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.champion-stats__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.champion-stats__title {
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
}

.champion-stats__meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-secondary);
}

/* The three short lists at the top: what gets picked, what wins, what loses.
   The long table underneath answers everything else. */
.champ-boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.champ-board__note {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.champ-board__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.champ-board__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 2.5rem 3rem;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-2xs) 0;
}

.champ-board__name {
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.champ-board__figure,
.champ-board__rate {
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.champ-board__figure {
  color: var(--text-tertiary);
}

.champ-board__empty {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.champion-stats__all {
  margin-top: var(--space-xl);
}

/* Who plays it, behind the chevron beside the name. */
.champ-who {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.champ-who__item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: var(--text-sm);
}

.champ-who__record {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* A link that reads as a checkbox. The state lives in the URL rather than in
   JavaScript, so it survives a reload and can be sent to somebody. */
.source-toggle {
  margin-bottom: var(--space-lg);
  padding: var(--space-smd) var(--space-md);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.source-toggle__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: inherit;
  text-decoration: none;
}

.source-toggle__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: var(--border-width) solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  font-size: 12px;
  line-height: 1;
  transition: var(--transition-control);
}

.source-toggle__box--on {
  border-color: var(--ink-900);
  background: var(--ink-900);
  color: var(--canvas);
}

.source-toggle__link:hover .source-toggle__box {
  border-color: var(--ink-900);
}

.source-toggle__label {
  font-weight: var(--weight-medium);
}

.source-toggle__note {
  margin: var(--space-xs) 0 0 26px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.champ-who__split {
  color: var(--text-secondary);
  font-size: var(--text-2xs);
  white-space: nowrap;
}
