.cup-content {
  padding-block: var(--space-24) var(--space-32);
  scroll-margin-top: var(--space-12);
}
.cup-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-12);
}
.cup-tabs {
  display: flex;
  gap: var(--space-4);
}
.cup-tools button,
.cup-tools select {
  min-height: 44px;
  padding: var(--space-8) var(--space-16);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--forest);
  font-size: var(--type-small);
  font-weight: 400;
}
.cup-tools button[aria-pressed="true"] {
  background: var(--forest);
  color: var(--paper);
  border-color: var(--forest);
}
.cup-tools select {
  margin-left: var(--space-4);
}
#games-count {
  margin: var(--space-12) 0 var(--space-16);
}
.month-games {
  margin: var(--space-24) 0;
}
.month-games h2 {
  font-size: var(--type-subheading);
  padding-bottom: var(--space-8);
  border-bottom: 2px solid var(--crest-gold);
}
.month-games ul {
  list-style: none;
}
.cup-source {
  margin-top: var(--space-24);
  padding-top: var(--space-12);
  border-top: 1px solid var(--rule);
}
/* Match sheet */
.match-header {
  background: var(--forest);
  color: var(--paper);
  border-top: 4px solid var(--crest-gold);
}
.game-number {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-12) clamp(var(--space-16), 3vw, var(--space-32));
  font-size: var(--type-caption);
  border-bottom: 1px solid var(--light-rule);
}
.game-number span:first-child {
  font-weight: 700;
}
.match-board {
  max-width: none;
  margin: 0;
  color: inherit;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(var(--space-8), 3vw, var(--space-48));
  padding: var(--space-24) clamp(var(--space-16), 3vw, var(--space-32));
  text-align: center;
}
.team-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-12);
  line-height: 1.08;
  font-size: var(--type-section);
}
.team-badge img {
  width: clamp(58px, 7vw, 95px);
  height: clamp(58px, 7vw, 95px);
  object-fit: contain;
  background: var(--paper);
  padding: var(--space-4);
  border-radius: var(--radius);
}
.match-result {
  display: grid;
  gap: var(--space-4);
  font-family: var(--body);
}
.match-result b {
  font-weight: 700;
  font-size: var(--type-display);
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.match-result small {
  color: var(--paper);
  font-weight: 700;
  font-size: var(--type-caption);
  line-height: 1.25;
  letter-spacing: normal;
}
.period-line {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--ice);
  color: var(--forest);
  padding: var(--space-8);
}
.period-line > span {
  padding: 0 var(--space-16);
  text-align: center;
}
.period-line > span + span {
  border-left: 1px solid var(--rule);
}
.period-line b {
  font-weight: 700;
  font-size: var(--type-lead);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.game-breakdown {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  align-items: start;
  gap: clamp(var(--space-24), 4vw, 65px);
  margin: 0 0 var(--space-32);
}
.scoring h3,
.comparison caption {
  font: 600 var(--type-section) / 1.1 var(--head);
  color: var(--forest);
  text-align: left;
}
.timeline-key,
.table-note {
  font-size: var(--type-caption);
  color: var(--muted);
  line-height: 1.45;
}
.timeline-key {
  margin: var(--space-8) 0 var(--space-16);
}
.timeline-period {
  margin: 0 0 var(--space-24);
}
.timeline-period h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  color: var(--paper);
  background: var(--forest);
  padding: var(--space-8) var(--space-12);
  margin: 0;
  font: 600 var(--type-lead) var(--head);
}
.timeline-period h4 span {
  font: 400 var(--type-caption) var(--body);
}
.timeline-period ol {
  list-style: none;
  position: relative;
  padding-block: var(--space-8);
}
.timeline-period ol::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  border-left: 2px solid var(--rule);
  transform: translateX(-1px);
}
.goal-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-8);
  position: relative;
  padding: var(--space-4) 0;
}
.period-clock {
  grid-area: 1/2;
  justify-self: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-round);
  padding: 3px var(--space-8);
  color: var(--forest);
  font-weight: 700;
  font-size: var(--type-caption);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.goal-credit {
  grid-area: 1/1;
  text-align: right;
  border-inline-end: 3px solid var(--forest);
  background: var(--ice);
  padding: var(--space-8) var(--space-12);
  overflow-wrap: anywhere;
}
.away-goal .goal-credit {
  grid-column: 3;
  text-align: left;
  border: 1px solid var(--rule);
  border-inline-start: 3px solid var(--green);
  background: var(--paper);
}
.goal-credit strong {
  display: block;
  font-weight: 700;
  font-size: var(--type-lead);
  line-height: 1.25;
  color: var(--forest);
  margin-top: var(--space-4);
}
.goal-credit p,
.goal-score span {
  margin: var(--space-4) 0 0;
  font-size: var(--type-caption);
  line-height: 1.35;
}
.goal-score {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
}
.goal-score span {
  margin: 0;
  color: var(--muted);
}
.goal-score b {
  font-size: var(--type-caption);
  color: var(--forest);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.away-goal .goal-score {
  justify-content: flex-start;
}
.empty-period {
  padding: var(--space-12) 0 0;
  color: var(--muted);
}
.game-stats {
  min-width: 0;
}
.comparison {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  margin-bottom: var(--space-8);
}
.comparison caption {
  margin-bottom: var(--space-16);
}
.comparison th,
.comparison td {
  padding: var(--space-8) var(--space-4);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.comparison th:first-child,
.comparison td:first-child {
  text-align: left;
}
.comparison th:last-child,
.comparison td:last-child {
  text-align: right;
}
.comparison thead {
  background: var(--ice);
  color: var(--forest);
}
.comparison thead th {
  font-size: var(--type-caption);
  line-height: 1.3;
}
.comparison thead th:nth-child(2) {
  width: 42%;
}
.comparison tbody th {
  font-weight: 400;
  font-size: var(--type-caption);
}
.comparison td {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.comparison td small {
  font-weight: 400;
  font-size: var(--type-caption);
}
.stat-bar {
  display: flex;
  height: 4px;
  margin: var(--space-4) auto 0;
  max-width: 118px;
  background: var(--green);
}
.stat-bar i {
  display: block;
  height: 100%;
  background: var(--forest);
}
.table-note {
  margin: 0 0 var(--space-24);
}
.game-stats {
  scroll-margin-top: var(--space-12);
}
@media (max-width: 920px) {
  .game-breakdown {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 740px) {
  .match-board {
    gap: var(--space-8);
    padding: var(--space-16) var(--space-8);
  }
  .team-badge {
    font-size: var(--type-lead);
    overflow-wrap: anywhere;
  }
  .team-badge img {
    width: 52px;
    height: 52px;
  }
  .match-result b {
    font-size: var(--type-section);
  }
  .match-result small {
    font-size: var(--type-caption);
  }
  .goal-event {
    grid-template-columns: 53px minmax(0, 1fr);
    gap: var(--space-8);
  }
  .period-clock {
    grid-column: 1;
    font-size: var(--type-caption);
    padding-inline: var(--space-4);
  }
  .timeline-period ol::before {
    left: 26px;
  }
  .goal-credit,
  .away-goal .goal-credit {
    grid-column: 2;
    text-align: left;
    border: 0;
    border-inline-start: 3px solid var(--forest);
  }
  .away-goal .goal-credit {
    border: 1px solid var(--rule);
    border-inline-start: 3px solid var(--green);
  }
  .goal-score {
    justify-content: flex-start;
  }
  .period-line > span {
    padding-inline: var(--space-12);
  }
}

/* Cup fixtures and match rosters */
.cup-tools :is(button, select):is(:hover, :focus-visible, :active) {
  border-color: var(--green);
  box-shadow: inset 0 -2px var(--green);
}
.match-shortcuts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  margin-bottom: var(--space-8);
  font-size: var(--type-caption);
}
.match-shortcuts a {
  padding-block: var(--space-4);
}
.match-shortcuts .stats-jump {
  display: none;
}
@media (max-width: 920px) {
  .match-shortcuts .stats-jump {
    display: inline;
  }
}
.match-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 2px solid var(--crest-gold);
  margin: var(--space-12) 0 var(--space-24);
  font-weight: 400;
  font-size: var(--type-caption);
  line-height: 1.35;
  color: var(--forest);
}
.match-sources {
  display: flex;
  gap: var(--space-4);
  justify-self: end;
  max-width: 100%;
}
.match-place,
.match-sources a {
  min-height: 54px;
  padding: var(--space-8) var(--space-12);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
  font: inherit;
}
.match-place {
  display: grid;
  align-content: center;
  justify-self: start;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.match-toolbar a {
  display: grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
}
.match-sources a:hover {
  background: var(--ice);
  border-color: var(--green);
}
.match-views {
  width: clamp(278px, 28vw, 360px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--forest);
  border-radius: var(--radius);
  background: var(--ice);
}
.match-views a {
  min-height: 46px;
  padding: var(--space-8) var(--space-8);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: var(--type-lead);
  line-height: 1.15;
  color: var(--forest);
}
.match-views a:hover {
  background: var(--paper);
}
.match-views a[aria-selected="true"] {
  background: var(--forest);
  color: var(--paper);
}
.match-toolbar a:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}
@media (width > 740px) and (max-width: 920px) {
  .match-sources {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .match-sources a {
    min-height: 42px;
    padding: var(--space-4) var(--space-8);
  }
}
@media (width > 920px) and (hover: hover) and (pointer: fine) {
  .match-toolbar {
    position: sticky;
    top: var(--site-nav-height, 76px);
    z-index: 10;
    margin-top: 0;
    padding-top: var(--space-12);
    background: var(--paper);
  }
  /* Extend the var(--paper) background through the gutters without widening the controls. */
  .match-toolbar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    box-shadow: 0 0 0 100vmax var(--paper);
    clip-path: inset(0 -100vmax);
  }
  #game-report [role="tabpanel"],
  #game-report [role="tabpanel"] :focus,
  #game-report .game-stats {
    scroll-margin-top: calc(var(--cup-game-nav-height, 84px) + var(--space-8));
  }
}
@media (max-width: 740px) {
  .match-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--space-4);
    margin: var(--space-8) 0 var(--space-16);
    padding-bottom: var(--space-8);
    font-size: var(--type-caption);
  }
  .match-views,
  .match-sources {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 1fr;
  }
  .match-views {
    width: 100%;
    padding: 2px;
  }
  .match-views a {
    min-height: 44px;
    padding: var(--space-4) 2px;
    font-size: var(--type-body);
  }
  .match-place,
  .match-sources {
    justify-self: stretch;
  }
  .match-place,
  .match-sources a {
    min-height: 42px;
    padding: var(--space-4) 3px;
  }
}

.club-sheets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(var(--space-16), 3vw, var(--space-32));
  align-items: start;
}
.club-sheet {
  min-width: 0;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--crest-gold);
}
.club-sheet header {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-height: 88px;
  padding: var(--space-12) var(--space-16);
  background: var(--forest);
  color: var(--paper);
}
.club-sheet header img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--paper);
}
.club-sheet header span {
  font-size: var(--type-caption);
}
.club-sheet h2 {
  color: inherit;
  font-size: var(--type-subheading);
  overflow-wrap: anywhere;
}
.club-sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-small);
}
.club-sheet th,
.club-sheet td {
  padding: var(--space-8) var(--space-12);
  border-bottom: 1px solid var(--rule);
  text-align: left;
  line-height: 1.4;
}
.club-sheet thead {
  color: var(--forest);
  background: var(--ice);
  font-size: var(--type-caption);
}
.club-sheet tbody th {
  font-weight: 400;
  overflow-wrap: anywhere;
}
.club-sheet tbody td:first-child {
  width: 3.5em;
  color: var(--forest);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.club-sheet tbody td:last-child {
  width: 7em;
  color: var(--muted);
}
.club-sheet tbody tr:last-child > * {
  border-bottom: 0;
}
.club-sheet tbody tr:hover {
  background: var(--hover);
}
.sheet-empty {
  margin: 0;
  padding: var(--space-16) var(--space-16);
}
.credit-number {
  white-space: nowrap;
}
@media (max-width: 740px) {
  .club-sheets {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 740px) {
  .club-sheet td,
  .club-sheet th {
    padding: var(--space-8);
  }
}

@media (max-width: 740px) {
  .cup-tools button,
  .cup-tools select {
    font-size: var(--type-caption);
    padding: var(--space-8) var(--space-8);
  }
}

main:has(#game-report:not([hidden])) .page-title {
  display: none;
}
