.league-redesign .site-main:has(.referee-profile) {
  padding-block: clamp(31px, 3.8vw, 55px) 64px;
}

.referee-profile {
  --referee-border: hsl(var(--border));
  --referee-muted: hsl(var(--muted));
  --referee-surface: hsl(var(--surface));
  --referee-accent: hsl(var(--primary));
}

.referee-profile :is(h1, h2, p, dl, dd) { margin: 0; }
.referee-profile h1 {
  font: 800 clamp(34px, 3.65vw, 52px)/1.08 var(--display);
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.referee-profile h2 {
  margin-block-end: 12px;
  font: 800 clamp(22px, 2.23vw, 32px)/1.17 var(--display);
  letter-spacing: -.028em;
}
.referee-profile .site-crumb [aria-current] { color: inherit; font-weight: 700; }
.league-redesign:has(.referee-profile) .home-mobile-bar > details > summary { color: hsl(var(--primary)); }

.referee-profile-heading {
  margin-block: clamp(23px, 3vw, 44px) clamp(29px, 3.8vw, 55px);
}
.referee-profile-heading p {
  margin-block-start: 7px;
  color: var(--referee-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.referee-profile-overview {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: start;
  gap: clamp(26px, 4vw, 58px);
  margin-block-end: clamp(34px, 4.5vw, 65px);
}
.referee-profile-statistics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--referee-border);
}
.referee-profile-statistics > div {
  display: flex;
  flex-direction: column;
  padding: 12px clamp(8px, 1.5vw, 21px) 15px;
}
.referee-profile-statistics > div:first-child { padding-inline-start: 0; }
.referee-profile-statistics > div + div { border-inline-start: 1px solid var(--referee-border); }
.referee-profile-statistics dt {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-height: 24px;
  color: var(--referee-muted);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.referee-card-marker {
  flex: 0 0 10px;
  height: 14px;
  border-radius: 2px;
  margin-block-start: 1px;
}
.referee-card-yellow { background: #e9ae39; }
.referee-card-red { background: #a52d45; }
.referee-profile-statistics dd {
  margin-block-start: 9px;
  font-variant-numeric: tabular-nums;
}
.referee-profile-statistics dd strong {
  display: block;
  font: 800 clamp(28px, 4.25vw, 60px)/1.08 var(--display);
  overflow-wrap: anywhere;
}
.referee-profile-statistics dd small {
  display: block;
  margin-block-start: 4px;
  color: var(--referee-muted);
  font-size: 13px;
}

.referee-profile-tournaments {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.referee-profile-tournaments :is(th, td) { border-block-end: 1px solid var(--referee-border); }
.referee-profile-tournaments th { text-align: start; }
.referee-profile-tournaments thead th {
  padding: 8px;
  background: var(--referee-surface);
  color: var(--referee-muted);
  font-size: 13px;
}
.referee-profile-tournaments tr > :last-child {
  padding-inline: 8px;
  text-align: end;
  width: 60px;
  font-variant-numeric: tabular-nums;
}
.referee-profile-tournaments tbody :is(a, .referee-competition-name) {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 7px 8px;
  overflow-wrap: anywhere;
}
.referee-profile-tournaments a:hover { color: var(--referee-accent); }
.referee-profile-tournaments a:focus-visible { outline-offset: -2px; }

.referee-match-list {
  margin: 0;
  padding: 0;
  border-block-start: 1px solid var(--referee-border);
  list-style: none;
}
.referee-match {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(0, 2.1fr) minmax(80px, .7fr) minmax(0, 3.1fr);
  grid-template-areas: "time home result away";
  align-items: center;
  gap: 9px;
  min-height: 57px;
  padding-block: 6px;
  border-block-end: 1px solid var(--referee-border);
}
.referee-match:hover { background: var(--referee-surface); }
.referee-match:focus-visible { outline-offset: -2px; }
.referee-match time { grid-area: time; color: var(--referee-muted); font-size: 13px; }
.referee-match time small { display: block; }
.referee-match-team {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.28;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.referee-match-home { grid-area: home; flex-direction: row-reverse; text-align: end; }
.referee-match-away { grid-area: away; }
.referee-profile img { flex: none; object-fit: contain; }
.referee-match-result {
  grid-area: result;
  display: grid;
  justify-items: center;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
}
.referee-match-result strong { font-size: 18px; white-space: nowrap; }
.referee-match-result small { color: var(--referee-muted); font-size: 11px; overflow-wrap: anywhere; }

@media (max-width: 880px) {
  .referee-profile-heading { margin-block-start: 20px; }
  .referee-profile-overview { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .referee-profile-statistics dt { gap: 4px; min-height: 31px; font-size: 12px; }
  .referee-card-marker { flex-basis: 7px; height: 11px; }
  .referee-profile-statistics dd { margin-block-start: 6px; }
  .referee-profile-statistics dd strong { font-size: 30px; }
  .referee-profile-statistics dd small { font-size: 11px; }

  .referee-match {
    grid-template-columns: 66px minmax(0, 1fr) minmax(38px, auto);
    grid-template-areas: "time home result" "time away result";
    gap: 4px 7px;
    min-height: 62px;
    padding-block: 8px;
  }
  .referee-match time { font-size: 11px; }
  .referee-match-home { flex-direction: row; text-align: start; }
  .referee-match-team { gap: 5px; font-size: 13px; }
  .referee-match-team img { width: 16px; height: 16px; }
  .referee-match-result { justify-items: end; text-align: end; }
  .referee-match-result strong { font-size: 16px; }
  .referee-match-result small { max-width: 73px; }
}
