.match-detail {
  max-width: 40em;
  margin: 0 auto;
  padding: 0 1em;
}

.match-detail .scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1em;
  padding: 1em 0;

  .team {
    height: 100%;
    text-align: center;
  }

  .team-winner {
    display: block;
    font-size: 1rem;
    font-variation-settings: "wdth" 100;
    color: var(--color-accent);
  }

  .team-name {
    display: block;
    font-size: 1.25em;
  }

  .flag {
    width: 3em;
    margin: 0 auto 0.5em;
    height: auto;
  }

  .result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25em;
  }

  .score {
    font-size: 3em;
    font-weight: 700;
    font-variation-settings: "wdth" 75;
    line-height: 1;

    .dash {
      margin: 0 0.2em;
      color: var(--color-text-muted);
    }
  }

  .kickoff {
    font-size: 2em;
    font-weight: 200;
  }

  .penalties {
    font-size: 0.875em;
    color: var(--color-text-muted);
  }

  .match-status {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
  }
}

.match-detail-meta {
  margin: 0;
  text-align: center;
  font-size: 0.875em;
  font-variation-settings: "wdth" 90;
  text-transform: uppercase;
  color: var(--color-text-muted);

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

    &:hover {
      text-decoration: underline;
    }
  }
}

.match-stats {
  margin-top: 1.5em;
}

.match-stats .empty {
  text-align: center;
  color: var(--color-text-muted);
}

/* Home-vs-away comparison: a description list of stat -> {home, away}. The
   label comes first in the DOM (read as "Possession, 61, 40"); CSS `order`
   lays it out as home | label | away with a bar underneath. */
.stat-comparison {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  margin: 0;

  .stat {
    display: grid;
    grid-template-columns: 2.5em 1fr 2.5em;
    align-items: center;
    column-gap: 0.5em;
  }

  dt,
  dd {
    margin: 0;
  }

  .stat-value {
    font-weight: 700;
  }

  .stat-home {
    order: 1;
    text-align: left;
  }

  .stat-label {
    order: 2;
    text-align: center;
    font-size: 0.875em;
    color: var(--color-text-muted);
  }

  .stat-away {
    order: 3;
    text-align: right;
  }

  .stat-bar {
    order: 4;
    grid-column: 1 / -1;
    display: flex;
    height: 1em;
    background: var(--color-surface);
    border-radius: 0.2em;
    overflow: hidden;
  }

  .stat-bar-home {
    background: var(--color-accent);
  }

  .stat-bar-away {
    background: var(--color-border);
  }
}

/* Event timeline */
.timeline {
  list-style: none;
  margin: 2em 0 0;
  padding: 0;

  .timeline-event {
    display: grid;
    grid-template-columns: 3em auto 1fr;
    align-items: center;
    column-gap: 0.5em;
    padding: 0.4em 0;

    &.away {
      direction: rtl;
      text-align: right;
    }
  }

  .timeline-minute {
    color: var(--color-text-muted);
  }

  .timeline-icon {
    font-size: 1.1em;
  }

  .timeline-player {
    font-variation-settings: "wdth" 90;
  }
}

@media screen and (min-width: 40em) {
  .match-detail .scoreboard .team-name {
    font-size: 1.75em;
  }
  .match-detail .scoreboard .score {
    font-size: 4em;
  }
  .match-detail .scoreboard .flag {
    width: 4em;
  }
}
