body {
  background: #fff;
  color: #000;
}

.league-page {
  max-width: 1280px;
}

.league-page a {
  color: inherit;
}

.league-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 36px 40px 40px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  color: #fff;
  background:
    radial-gradient(800px 400px at 100% 0%, rgba(230, 255, 26, 0.18), transparent 60%),
    linear-gradient(180deg, #1a1a1a 0%, #000 100%);
}

.league-hero--flag {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.5) 48%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.45) 100%),
    var(--country-flag) center / cover no-repeat,
    linear-gradient(180deg, #1a1a1a 0%, #000 100%);
}

.league-hero__crumbs {
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--fc-font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.league-hero__crumbs a {
  color: inherit;
  text-decoration: none;
}

.league-hero__crumbs a:hover,
.league-hero__crumbs span:last-child {
  color: var(--fc-volt);
}

.league-hero__crumbs .sep {
  margin: 0 8px;
  opacity: 0.35;
}

.league-hero__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
  gap: 36px;
  align-items: end;
}

.league-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--fc-font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.league-hero__eyebrow {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--fc-volt);
  font-weight: 700;
}

.league-hero__eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fc-volt);
}

.league-hero__title {
  margin: 0 0 14px;
  color: #fff;
  font-family: var(--fc-font-display);
  font-size: clamp(40px, 5.7vw, 68px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
  hyphens: manual;
  overflow-wrap: normal;
  text-wrap: balance;
  word-break: normal;
}

.league-hero__sub {
  max-width: 66ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.55;
}

.league-hero__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.league-stat {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.league-stat__label {
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--fc-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.league-stat__value {
  margin-top: 8px;
  color: #fff;
  font-family: var(--fc-font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  overflow-wrap: anywhere;
}

.league-stat__value--text {
  font-size: 24px;
  line-height: 1.1;
}

.league-stat--accent .league-stat__value {
  color: var(--fc-volt);
}

.league-stat--pink .league-stat__value {
  color: var(--fc-bubblegum);
}

.league-stat--orange .league-stat__value {
  color: var(--fc-orange);
}

.league-section {
  margin-top: 38px;
}

.league-section--flush {
  margin-top: 0;
}

.league-section__hd {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.league-section__hd h2 {
  margin: 0;
  font-family: var(--fc-font-display);
  font-size: 22px;
  font-weight: 700;
}

.league-section__hd p {
  margin: 4px 0 0;
  color: rgba(0, 0, 0, 0.55);
  font-size: 13px;
}

.league-table {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #ececea;
  border-radius: 10px;
  background: #fff;
}

.league-table__inner {
  min-width: 0;
}

.league-table__head,
.league-table__row {
  display: grid;
  grid-template-columns: 44px minmax(210px, 1.7fr) 68px repeat(6, 48px) 68px;
  gap: 12px;
  align-items: center;
  padding: 12px 22px;
  font-family: var(--fc-font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.league-table__head {
  border-bottom: 1px solid #ececea;
  color: rgba(0, 0, 0, 0.5);
  background: #faf9f5;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-table__head > *,
.league-table__row > * {
  text-align: center;
}

.league-table__head > :nth-child(2),
.league-table__row > :nth-child(2) {
  text-align: left;
}

.league-table__row {
  border-bottom: 1px solid #f3f1eb;
  color: rgba(0, 0, 0, 0.7);
  font-size: 13px;
  text-decoration: none;
  transition: background var(--fc-t-fast);
  content-visibility: auto;
  contain-intrinsic-size: auto 62px;
}

.league-table__row:last-of-type {
  border-bottom: 0;
}

.league-table__row:hover {
  background: #faf9f5;
}

.league-table__rank {
  color: rgba(0, 0, 0, 0.45);
}

/* FAN-604: points lead the table now — make them read as the headline stat. */
.league-table__pts {
  font-weight: 700;
  color: #000;
}

.league-table__team {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.league-table__team-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}

.league-table__team-name {
  overflow: hidden;
  color: #000;
  font-family: var(--fc-font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-table__team-meta {
  margin-top: 3px;
  color: rgba(0, 0, 0, 0.45);
  font-family: var(--fc-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.league-table__pts {
  color: #000;
  font-family: var(--fc-font-display);
  font-size: 16px;
  font-weight: 700;
}

.league-table__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 14px 22px;
  border-top: 1px solid #ececea;
  color: rgba(0, 0, 0, 0.55);
  font-family: var(--fc-font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.league-empty {
  margin: 0;
  padding: 24px;
  color: rgba(0, 0, 0, 0.56);
}

@media (max-width: 1120px) {
  .league-table {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .league-table__inner {
    min-width: 900px;
  }
}

@media (max-width: 900px) {
  .league-page {
    padding: 20px 16px 80px;
  }

  .league-hero {
    padding: 28px 24px 30px;
  }

  .league-hero__top {
    grid-template-columns: 1fr;
  }

  .league-hero__stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .league-table { overflow: visible; }
  .league-table__inner {
    min-width: 0;
    width: 100%;
  }
  .league-table__head { display: none; }
  .league-table__row {
    display: flex;
    flex-wrap: wrap;
    min-width: 0;
    gap: 10px 8px;
    padding: 14px;
  }
  .league-table__rank { flex: 0 0 32px; align-self: flex-start; padding-top: 8px; }
  /* Rank + team fill the first line exactly, so the stat cells always wrap
     into their own chip rows below. */
  .league-table__team { flex: 1 1 calc(100% - 40px); min-width: 0; }
  .league-table__row > :nth-child(n + 3) {
    display: grid;
    flex: 1 1 21%;
    gap: 2px;
    min-width: 0;
    padding: 7px 8px;
    background: #faf9f5;
    border-radius: 4px;
    text-align: start;
  }
  .league-table__row > :nth-child(n + 3)::before {
    content: attr(data-label);
    color: rgba(0,0,0,.48);
    font-size: 8px;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .league-table__pts { font-size: 15px; }
}

@media (max-width: 520px) {
  .league-hero__title {
    font-size: 38px;
  }

  .league-stat__value {
    font-size: 30px;
  }
}
