/* Shared match-history rows, results, replay links and pagination. */
  .match-history-list { display: grid; gap: 8px; }
  .match-history-row {
    display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px;
    align-items: center; padding: 11px; border: 1px solid var(--line);
    border-radius: 11px; background: var(--surface-soft);
  }
  .match-history-copy { min-width: 0; }
  .match-history-title {
    display: flex; align-items: center; gap: 7px; min-width: 0;
    font-size: 13px; font-weight: 850;
  }
  .match-history-title > span:first-child {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .match-history-score {
    font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums;
  }
  .match-history-actions {
    display: grid; justify-items: end; gap: 4px; text-align: right;
  }
  .match-replay-link {
    min-height: 36px; display: inline-flex; align-items: center;
    color: var(--accent-strong); font-size: 11px; font-weight: 850;
    text-decoration: none;
  }
  .match-replay-link:hover { text-decoration: underline; }
  .match-history-pagination {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-top: 12px;
  }
  .match-history-pagination span { color: var(--muted); font-size: 11px; font-weight: 750; }
  .match-history-pagination .btn { min-height: 36px; padding: 7px 12px; font-size: 11px; }
  .history-pages { display: flex; align-items: center; gap: 4px; }
  .history-pages > span { padding: 0 3px; }
  .history-pages .btn { min-width: 34px; padding-inline: 8px; }

@media (max-width: 720px) {
    .match-replay-link {
      min-width: 44px; min-height: 44px; justify-content: flex-end;
      touch-action: manipulation;
    }
    .match-history-pagination .btn {
      min-width: 44px; min-height: 44px; touch-action: manipulation;
    }
    .match-history-row { grid-template-columns: 34px minmax(0, 1fr); gap: 8px; }
    .match-history-actions {
      grid-column: 2; grid-row: 2; grid-auto-flow: column; justify-content: space-between;
      justify-items: stretch; width: 100%; text-align: left;
    }
    .match-history-score { font-size: 17px; }
    .match-history-pagination { flex-wrap: wrap; }
    .match-history-pagination > span { order: 3; width: 100%; text-align: center; }
    .history-pages { order: 2; }
}
.match-history-row > .match-staff-actions { padding-top: 12px; border-top: 1px solid var(--line); }

/* Long team rosters wrap inside the record, including unbroken account handles. */
.match-history-title { flex-wrap: wrap; gap: 5px 8px; }
.match-history-title > span:first-child { flex: 1 1 180px; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.match-history-title > .player-tag { flex: 0 0 auto; }
.match-history-copy .history-meta { margin-top: 4px; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.match-history-copy .history-meta .profile-link { white-space: normal; overflow-wrap: anywhere; }
.match-history-score { white-space: nowrap; }
.match-history-pagination .history-pages { flex-wrap: wrap; justify-content: center; }
@media (max-width: 720px) {
  .match-history-row { align-items: start; }
  .match-history-actions { grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: row; gap: 2px 12px; align-items: center; }
  .match-history-actions .match-history-score { grid-column: 1; grid-row: 1; font-size: 17px; line-height: 1.4; }
  .match-history-actions .history-delta { grid-column: 1; grid-row: 2; font-size: 11px; line-height: 1.4; }
  .match-history-actions .match-replay-link { grid-column: 2; grid-row: 1 / 3; min-width: 64px; min-height: 44px; justify-content: center; align-self: center; }
}
