.home-team {
  text-align: right;
}
.away-team {
  text-align: left;
}

.matches {
  border-collapse: collapse;
  margin: 0 auto;
  width: calc(100% - 2em);
  text-align: center;

  .match-teams {
    display: flex;
    align-items: center;
    position: relative; /* anchor for the stretched match link */

    &:hover {
      background: var(--color-surface);
    }
  }

  /* Whole-row link to the match details page. The cell collapses to nothing;
     the anchor's ::after overlay makes the entire row clickable while staying a
     real link (open-in-new-tab, keyboard focus, no-JS all work). Scoped to this
     row only, so the details row's own links stay clickable. */
  .match-link-cell {
    width: 0;
    padding: 0;
  }
  /* Empty anchor (labelled via aria-label); its ::after overlay covers the row.
     No clip-path here — that would clip the ::after and kill the click target. */
  .match-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 20;
  }
  .match-teams:has(.match-link:focus-visible) {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
  }

  td {
    vertical-align: middle;
    padding: 0.125rem;
  }

  .match-day {
    font-size: 1.5em;
    font-weight: 200;
    padding: 1em 0 0;
  }

  tr:first-of-type .match-day {
    padding-top: 0;
  }

  .match-details {
    font-size: 0.875em;
    font-variation-settings: "wdth" 90;
    text-transform: uppercase;

    padding: 0 0 1em;

    a {
      color: var(--color-accent);
      font-weight: bold;
      text-decoration: none;

      &:hover {
        text-decoration: underline;
        text-decoration-color: var(--color-accent);
        text-decoration-thickness: 0.125em;
      }
    }
  }

  .team {
    flex: 1;

    &.won {
      color: var(--color-accent);
    }
  }

  .score {
    font-weight: 700;
  }

  .kickoff {
    font-weight: 200;
  }

  .score,
  .kickoff {
    font-size: 1.5em;
    width: 2.5em;
    font-variation-settings: "wdth" 75;
    line-height: 1;
  }
  .flag {
    position: relative;
    z-index: 10;
  }
  .flag-column {
    width: 1.5em;
  }
  .ball {
    width: 0.6em;
    position: relative;
    bottom: 0.05em;
  }
}

@media screen and (min-width: 40em) {
  .matches {
    .team {
      font-size: 2em;
    }
    .score,
    .kickoff {
      font-size: 3em;
    }
    .flag {
      bottom: 0.0625em;
    }
    .ball {
      width: 0.5em;
      bottom: 0.07em;
    }
  }
}
