/* Last 5 — uniform grid of 5 result cards. One canonical pattern, used by
   match H2H form widget AND team overview form card. Fixed 5 columns
   (grid 1fr × 5) on mobile so every card has identical width; no
   horizontal scroll by design — one glance, done.

   Each card: colored bar (win/draw/loss) + opponent logo + score + date +
   league chip. Consumers supply already-computed rows (result, logo, etc);
   partial is purely presentational. */

@layer components {
  .last5-scroll {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 0 4px 4px;
  }

  /* World-Cup group card reuses the last-5 mini-card verbatim, but shows the
     team's 3 group matches across instead of 5 recent results. Same chrome,
     same bar, same flag + result/kickoff stack — only the column count and
     the outer padding (it sits inside a .card body) differ. */
  .last5-scroll--group {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 16px 16px;
  }

  .last5-card {
    display: grid;
    grid-template-rows: 4px auto auto auto auto;
    min-width: 0;
    min-height: 96px;
    border-radius: 8px;
    background: var(--color-surface-hover);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
  }

  a.last5-card:hover .last5-card__league {
    color: var(--color-accent);
  }

  /* Live tint — only relevant where the partial renders in-play fixtures
     (World-Cup group card). Recent-form rows are always finished. */
  .last5-card.is-live {
    background: color-mix(in srgb, var(--color-live, #ef4444) 12%, transparent);
  }

  .last5-card__bar {
    display: block;
    width: 100%;
    background: var(--color-text-muted);
  }

  .last5-card__bar--win {
    background: var(--color-win);
  }

  .last5-card__bar--draw {
    background: var(--color-draw, var(--color-text-muted));
  }

  .last5-card__bar--loss {
    background: var(--color-loss);
  }

  .last5-card__opponent {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0 4px;
  }

  .last5-card__logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
  }

  .last5-card__logo--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: var(--weight-bold, 700);
  }

  .last5-card__score {
    text-align: center;
    font-family: var(--font-title);
    font-size: 14px;
    font-weight: var(--weight-bold, 700);
    color: var(--color-text);
    padding: 0 4px;
  }

  .last5-card__date {
    text-align: center;
    font-size: 10px;
    color: var(--color-text-muted);
    padding: 4px 4px 0;
  }

  /* stylelint-disable-next-line no-descending-specificity */
  .last5-card__league {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 4px 8px;
    min-width: 0;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
  }

  .last5-card__league-logo {
    width: 10px;
    height: 10px;
    object-fit: contain;
    flex-shrink: 0;
  }

  .last5-card__league-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
}
