/* A member's profile: identity, the five position tiles, champions, social
   stats, then the full ELO change history. */

.league-member {
  max-width: var(--measure-mid);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.league-member__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.league-member__identity {
  display: flex;
  align-items: baseline;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.league-member__nickname {
  margin: 0;
  font-size: var(--text-4xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.league-member__section-title {
  margin: 0 0 var(--space-smd);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.league-member__section-meta {
  margin: calc(-1 * var(--space-sm)) 0 var(--space-smd);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.league-member__empty {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-base);
}

/* --------------------------------------------------------- position tiles */

.posgrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-smd);
}

.poscard {
  background: var(--surface-sunk);
  border-radius: var(--radius-md);
  padding: var(--space-smd) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.poscard--unplayed {
  opacity: 0.5;
}

/* The member's strongest played position — the only mint on the profile. */
.poscard--best {
  background: var(--surface-win);
  box-shadow: inset 0 0 0 1px var(--border-win);
}

.poscard__role {
  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);
}

.poscard__rating {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums;
}

.poscard__meta {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  white-space: nowrap;
}

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

/* ---------------------------------------------------------------- history */

.history__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: auto auto auto 1fr auto auto auto;
  column-gap: var(--space-md);
  row-gap: var(--space-sm);
}

.history__head,
.history__item {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
}

.history__head {
  padding: 0 var(--space-md);
  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-tertiary);
}

.history__item {
  background: var(--surface-card);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  transition: var(--transition-control);
}

.history__item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* Decay is not a match — it recedes to the sunken ground and a dashed edge. */
.history__item--decay {
  background: var(--surface-sunk);
  border-style: dashed;
  padding: 10px var(--space-md);
  font-size: var(--text-base);
}

.history__item--decay:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-default);
}

.history__link {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  padding: 10px var(--space-md);
  font-size: var(--text-base);
}

.history__date {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.history__position {
  display: flex;
  align-items: center;
  font-weight: var(--weight-medium);
}

.history__col--rating {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 4ch;
  color: var(--text-tertiary);
}

/* The rating a match left behind is the one worth reading. */
.history__col--new {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.history__col--muted {
  color: var(--text-tertiary);
}

@media (max-width: 640px) {
  .history__list {
    grid-template-columns: auto auto auto 1fr auto auto;
    font-size: var(--text-sm);
  }

  .history__col--spacer {
    display: none;
  }
}

/* The admin's edit page. Two columns once there is room — the form on the left,
   what it can't change on the right — because as one narrow column it was a
   metre of scrolling for a dozen fields. */
.member-edit {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: var(--measure-wide);
  margin: 0 auto;
}

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

.member-edit__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-md);
  align-items: start;
}

.member-edit__aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* The shared card is sized for a login box. Here it fills its column. */
.member-edit .card {
  max-width: none;
  margin: 0;
}

.member-edit__row,
.member-edit__roles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-smd);
}

.member-edit__panel-title {
  margin: 0 0 var(--space-smd);
}

.member-edit__facts {
  margin: 0 0 var(--space-smd);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-xs) var(--space-md);
}

.member-edit__label {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.member-edit__value {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.member-edit__empty {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* --bp-md. Name and rank pair up, and the five role slots go side by side
   rather than stacking into a tower. */
@media (min-width: 768px) {
  .member-edit__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-edit__roles {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

/* --bp-lg. Enough width for the read-only panels to sit beside the form. */
@media (min-width: 1024px) {
  .member-edit__layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  }
}

/* The rating line, over the history table that holds its figures. Spaced off
   the heading like the market chart is, so the two sections read the same way
   down the page. */
.rating-trail {
  margin: var(--space-md) 0 var(--space-lg);
}

.rating-trail__caption {
  margin: var(--space-sm) 0 0;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

/* ------------------------------------------------------- the four figures

   A rating, a placing, a self-reported tier and a measured tier. Four claims
   about one player, so each one carries its label and the sentence that says
   which of them it is — the same argument `rank_tag.css` makes about two of
   them sitting side by side in a row. */
.league-member__alias {
  margin: var(--space-2xs) 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.league-member__ranks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
  padding: var(--space-smd) var(--space-md);
  background: var(--surface-sunk);
  border-radius: var(--radius-md);
}

.rank-figure {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rank-figure__label {
  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);
}

/* The chip and the number are different heights, so the row aligns on the
   bottom of whichever one it is rather than on the text inside it. */
.rank-figure__value {
  display: flex;
  align-items: center;
  min-height: 1.5rem;
}

.rank-figure__elo,
.rank-figure__place {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.rank-figure__place {
  text-decoration: none;
}

.rank-figure__place:hover {
  text-decoration: underline;
}

.rank-figure__none {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--text-tertiary);
}

.rank-figure__sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ------------------------------------------------------------ at a glance */

.glance__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}

.glance__champions {
  margin-top: var(--space-md);
}

.glance__caption {
  margin: var(--space-sm) 0 0;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

/* ---------------------------------------------------------------- grouping

   One band per kind of claim: what this league has measured, and what Riot
   says about the rest of their week. The rule across the top is the whole of
   the device — the sections inside keep the look they had, they are just
   under something now. */
.member-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.member-group__header {
  padding-top: var(--space-smd);
  border-top: 2px solid var(--border-strong);
}

.member-group__title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-primary);
}

.member-group__meta {
  margin: var(--space-2xs) 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: var(--measure-mid);
}

.member-group__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding-top: var(--space-md);
}

/* Somebody who has left. Said beside the name, because every figure under it
   is then a record rather than a reading. */
.league-member__suspended {
  margin-left: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 400;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-tertiary);
  vertical-align: middle;
}

/* --------------------------------------------------------------- the roster

   The one control on this page, and only a league admin is shown it: suspend
   somebody, with a reason, or bring them back. Sunken rather than carded, and
   last on the page — it is not a claim about how they have played, and it
   must not sit where a mis-tap can reach it. */
.league-member__roster {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: var(--border-width) solid var(--border-default);
}

.roster-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  max-width: 62ch;
  padding: var(--space-lg);
  background: var(--surface-sunk);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
}

.roster-panel__state {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
}

.roster-panel__when {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* What an admin typed, in their own words, so it reads as a quotation of a
   decision rather than as a figure the app worked out. */
.roster-panel__reason {
  margin: 0;
  font-size: var(--text-base);
  color: var(--text-primary);
}

.roster-panel__reason-none {
  color: var(--text-tertiary);
}

.roster-panel__note {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* A ban, said beside the name to anybody — the one thing a ban has that a
   suspension does not. Coral, because it is a decision against somebody rather
   than a note about where they went; the quiet `--suspended` tag above is what
   an admin sees in the other case. */
.league-member__banned {
  margin-left: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 400;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--coral-700);
  vertical-align: middle;
}

/* Two ways out of one decision, and the choice between the two kinds. */
.roster-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

.roster-panel__switch {
  display: contents;
}

.roster-panel__choice {
  max-width: 62ch;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* Why some rows of the history cost nothing. A sentence rather than a tooltip:
   the per-row badge says which games, and this says why — and a `title`
   nobody can hover on a phone is not an explanation. */
.history__note {
  max-width: 68ch;
  margin: 0 0 var(--space-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
