/* ---------- Teams index: gender chips and search on one line ---------- */

.pitch-site--app .team-index__filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s) var(--space-l);
}

.pitch-site--app .team-index__filters > form {
  flex: 1 1 20rem;
  min-width: 0;
}

/* ---------- Statistics: two columns of percentile groups so labels fit ---------- */

.pitch-site--app .team-statistics .percentile-bar-groups {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
}

.pitch-site--app .team-statistics .percentile-bar-list {
  max-inline-size: none;
}

/* ---------- Squad: one table, a heading row per line of the team ---------- */

.pitch-site--app .squad-table th,
.pitch-site--app .squad-table td {
  padding-block: 0.45rem;
}

.pitch-site--app .squad-table .squad-table__number {
  color: var(--color-ink-medium);
}

.pitch-site--app .squad-table__line-heading {
  background: transparent;
  color: var(--color-ink-dark);
  font-family: var(--font-mono);
  padding-block: var(--space-l) var(--space-xxs);
}

.pitch-site--app .squad-table__line:first-of-type .squad-table__line-heading {
  padding-block-start: var(--space-s);
}

.pitch-site--app .squad-table__line tr:first-child:hover {
  background: transparent;
}

.pitch-site--app .squad-table__player a {
  display: block;
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pitch-site--app .squad-table__team {
  align-items: center;
  display: inline-flex;
  gap: var(--space-xs);
  max-width: 16rem;
  min-width: 0;
}

@media (max-width: 40rem) {
  .pitch-site--app .squad-table th,
  .pitch-site--app .squad-table td,
  .pitch-site--app .team-tournaments th,
  .pitch-site--app .team-tournaments td {
    padding-inline: 0.4rem;
  }

  .pitch-site--app .squad-table__player a {
    max-width: 11rem;
  }

  .pitch-site--app .squad-table__team {
    max-width: 8rem;
  }
}

/* ---------- Results: month cards of compact rows, the team's own name bold ---------- */

.pitch-site--app .team-results__card {
  background: var(--ps-paper-raised);
  border: 2px solid var(--ps-ink);
  border-radius: 10px;
  box-shadow: var(--ps-hard-shadow);
  padding: 14px 12px 10px;
}

.pitch-site--app .team-results__card > .section-label,
.pitch-site--app .team-results__card > .cluster-space-between {
  padding-inline: 6px;
}

.pitch-site--app .team-results__rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pitch-site--app .team-result {
  align-items: center;
  border-radius: 8px;
  color: inherit;
  display: grid;
  font-size: 14px;
  gap: 8px;
  grid-template-areas: "date home score away competition outcome";
  grid-template-columns: 5.5rem minmax(0, 1fr) 3.5rem minmax(0, 1fr) 7.5rem 1.5rem;
  padding: 6px;
  text-decoration: none;
}

.pitch-site--app .team-result:hover {
  background: var(--ps-paper-shade);
}

.pitch-site--app .team-result__date {
  color: var(--color-ink-medium);
  font-family: var(--font-mono);
  font-size: 12px;
  grid-area: date;
}

.pitch-site--app .team-result__team {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  min-width: 0;
}

.pitch-site--app .team-result__team--home {
  flex-direction: row-reverse;
  grid-area: home;
}

.pitch-site--app .team-result__team--away {
  grid-area: away;
}

.pitch-site--app .team-result__team--own .team-result__name {
  font-weight: 700;
}

.pitch-site--app .team-result__team--lost .team-result__name {
  opacity: 0.75;
}

.pitch-site--app .team-result__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pitch-site--app .team-result__goals {
  display: none;
}

.pitch-site--app .team-result__score {
  font-family: var(--font-mono);
  font-weight: 700;
  grid-area: score;
  text-align: center;
  white-space: nowrap;
}

.pitch-site--app .team-result__competition {
  color: var(--color-ink-medium);
  font-size: 12px;
  grid-area: competition;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pitch-site--app .team-result__outcome {
  display: flex;
  grid-area: outcome;
  justify-content: flex-end;
}

@media (max-width: 40rem) {
  .pitch-site--app .team-result {
    grid-template-areas:
      "date home outcome"
      "date away outcome";
    grid-template-columns: 3.75rem minmax(0, 1fr) 1.5rem;
    row-gap: 2px;
  }

  .pitch-site--app .team-result__team--home {
    flex-direction: row;
  }

  .pitch-site--app .team-result__goals {
    display: block;
    font-family: var(--font-mono);
    font-weight: 700;
    margin-inline-start: auto;
  }

  .pitch-site--app .team-result__score,
  .pitch-site--app .team-result__competition {
    display: none;
  }
}

/* ---------- Schedule: one line per fixture under each competition ---------- */

.pitch-site--app .team-schedule section:has(> .schedule-round) {
  background: var(--ps-paper-raised);
  border: 2px solid var(--ps-ink);
  border-radius: 10px;
  box-shadow: var(--ps-hard-shadow);
  padding: 14px 12px 10px;
}

.pitch-site--app .team-schedule section:has(> .schedule-round) > .section-label {
  padding-inline: 6px;
}

.pitch-site--app .team-schedule .schedule-round {
  align-items: baseline;
  border-block-start: 1px solid var(--color-border-subtle);
  display: grid;
  gap: 0 var(--space-s);
  grid-template-columns: 5.5rem minmax(0, 1fr);
  padding-inline: 6px;
}

.pitch-site--app .team-schedule .schedule-round > * + *,
.pitch-site--app .team-schedule .schedule-round .stack-xxs > * + * {
  margin-block-start: 0;
}

.pitch-site--app .team-schedule .schedule-round > .section-label {
  grid-column: 1;
}

.pitch-site--app .team-schedule .schedule-round > .stack-xxs {
  align-items: center;
  display: grid;
  gap: var(--space-s);
  grid-column: 2;
  grid-template-columns: 11rem minmax(0, 1fr);
}

.pitch-site--app .team-schedule .schedule-round .schedule-day {
  color: var(--color-ink-medium);
  font-weight: 500;
}

@media (max-width: 40rem) {
  .pitch-site--app .team-schedule .schedule-round,
  .pitch-site--app .team-schedule .schedule-round > .stack-xxs {
    grid-template-columns: minmax(0, 1fr);
  }

  .pitch-site--app .team-schedule .schedule-round > .stack-xxs {
    grid-column: 1;
    gap: 2px;
  }

  .pitch-site--app .team-schedule .schedule-round {
    padding-block-start: var(--space-xs);
  }
}

/* ---------- Tournaments: the team's line in each table ---------- */

.pitch-site--app .team-tournaments th,
.pitch-site--app .team-tournaments td {
  padding-block: 0.5rem;
}

.pitch-site--app .team-tournaments__number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  width: 4.5rem;
}

.pitch-site--app .team-tournaments__name:hover {
  color: var(--color-accent);
}
