.matches-main {
    width: min(92%, 1180px);
}

.matches-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

.match-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    box-shadow: 0 5px 20px rgb(0 0 0 / 8%);
}

.match-table {
    width: 100%;
    table-layout: fixed;
    font-size: clamp(0.88rem, 3.6vw, 1rem);
}

.match-table > :not(caption) > * > * {
    padding: 0.8rem 0.9rem;
}

.match-table thead th {
    color: #fff;
    background: var(--modality-accent);
    border-bottom: 0;
    vertical-align: middle;
}

.match-heading-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.match-date {
    font-weight: 700;
    white-space: nowrap;
}

.match-type {
    flex: 0 0 auto;
    text-align: right;
}

.match-type-link {
    display: inline-flex;
}

.match-type img {
    width: 1.45rem;
    height: 1.45rem;
    display: inline-block;
    filter: brightness(0) invert(1);
    object-fit: contain;
}

.match-table tbody td {
    width: 50%;
    background: #fff;
    border-color: #e5e5e5;
    vertical-align: middle;
}

.match-table tbody td.match-player-highlight {
    background: #fff9d9;
}

.match-table tbody tr:last-child td {
    border-bottom: 0;
}

.match-table tbody td + td {
    border-left: 1px solid #e5e5e5;
}

.match-result {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.match-position {
    flex: 0 0 auto;
    font-size: 1.4em;
    font-weight: 800;
    line-height: 1;
}

.match-position--1 {
    color: #0d6efd;
}

.match-position--2 {
    color: #198754;
}

.match-position--3 {
    color: #b67b00;
}

.match-position--4 {
    color: #dc3545;
}

.match-player {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    line-height: 1.25;
}

.match-player-name {
    overflow-wrap: anywhere;
}

.match-score {
    color: #555;
    font-size: 0.92em;
    font-variant-numeric: tabular-nums;
}

.matches-message {
    margin: 0;
    padding: 2.5rem 1rem;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #555;
    box-shadow: 0 5px 20px rgb(0 0 0 / 8%);
    text-align: center;
}

@media (min-width: 576px) {
    .matches-main {
        width: min(86%, 1180px);
    }

    .match-table {
        font-size: 1rem;
    }
}

@media (min-width: 992px) {
    .matches-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.75rem;
    }

    .match-table {
        font-size: 1.05rem;
    }
}

.matches-pagination {
    margin-top: 1.5rem;
    text-align: center;
}

.matches-pagination-summary {
    margin-bottom: 0.75rem;
    color: #555;
}

.matches-pagination-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.matches-pagination-links > * {
    padding: 0.65rem 0.85rem;
}

.matches-pagination-links a {
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: var(--modality-accent);
    background: #fff;
    text-decoration: none;
}

.matches-pagination-links a:hover {
    background: #f5f5f5;
    text-decoration: underline;
}

.matches-pagination-links a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.matches-pagination-links [aria-disabled] {
    color: #666;
}

.match-player-name {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.match-player-alias {
    display: block;
    color: var(--modality-accent);
    font-size: .8em;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.match-player-name:has(+ .match-player-alias) {
    align-items: flex-end;
}

.match-player-alias + .match-score {
    margin-top: .35rem;
}

.match-player-name:hover { color: var(--modality-accent); }
.match-player-name:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
    border-radius: 2px;
}
