.matches-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    overflow-x: hidden;
}

.match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(8rem, auto) minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    min-height: 6.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #acb2bc;
    text-align: center;
}

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

.match-team-away {
    flex-direction: row-reverse;
}

.match-team-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.team-logo {
    flex: none;
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.match-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.match-date {
    color: #4e5c71;
    font-size: 0.875rem;
    font-weight: 600;
}

.match-score {
    padding: 0.28rem 0.65rem;
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text);
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.match-versus {
    display: none;
}

.match-sign-in {
    color: #a91935;
    font-size: 0.8rem;
    font-weight: 700;
}

.match-link {
    display: block;
    border-radius: 0.5rem;
    color: inherit;
    text-decoration: none;
}

.match-link:hover .match {
    background-color: #fff2f3;
}

.match-link:focus-visible {
    outline: 2px solid #a91935;
    outline-offset: 2px;
}

.match.correct {
    --outcome-color: #38835e;
}

.match.close {
    --outcome-color: #a46f1e;
}

.match.incorrect {
    --outcome-color: #bc5261;
}

.match.correct:hover,
.match.close:hover,
.match.incorrect:hover {
    background-color: color-mix(in srgb, var(--outcome-color) 15%, white);
}

.match-filter-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.match-filter-buttons > a {
    color: rgb(162, 166, 198);
    font-weight: bold;
    text-decoration: none;
}

.upcoming-matches-button:hover {
    color: rgb(185, 226, 178);
}

.finished-matches-button:hover {
    color: rgb(226, 178, 178);
}

.fixture-filters > a {
    display: grid;
    min-width: 5.5rem;
    min-height: 44px;
    padding: 0 0.65rem;
    place-items: center;
    border: 1px solid #cbd2dc;
    border-radius: 0.65rem;
    background: #ffffff;
    color: var(--accent-ink);
    font-size: 0.9rem;
}

.fixture-filters > a:hover {
    border-color: var(--line);
}

.fixture-filters > [aria-current="page"] {
    border-color: var(--surface);
    background: var(--surface);
    color: var(--text);
}

@media (max-width: 600px) {
    .matches-container {
        gap: 0.75rem;
        padding: 0.875rem 0.75rem;
    }

    .match {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        grid-template-areas:
            "date date date"
            "home score away"
            "notice notice notice";
        align-items: start;
        gap: 0 0.55rem;
        min-height: 0;
        padding: 0.75rem;
        border: 1px solid #d8dfe9;
        border-inline-end-color: var(--outcome-color, #d8dfe9);
        border-radius: 0.9rem;
        background: #ffffff;
        box-shadow: 0 2px 8px rgb(13 26 52 / 6%);
        color: var(--accent-ink);
    }

    .match.correct,
    .match.close,
    .match.incorrect {
        border-inline-end-width: 4px;
    }

    .match-link {
        border-radius: 0.9rem;
    }

    .match-team {
        flex-direction: column;
        gap: 0.4rem;
    }

    .match-team-home {
        grid-area: home;
    }

    .match-team-away {
        grid-area: away;
    }

    .match-team .team-logo {
        width: 2.75rem;
        height: 2.75rem;
    }

    .match-team-name {
        max-width: 100%;
        font-size: 0.875rem;
    }

    .match-details {
        display: contents;
    }

    .match-date {
        grid-area: date;
        margin-bottom: 0.65rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e8ecf2;
        font-size: 0.75rem;
    }

    .match-score,
    .match-versus {
        grid-area: score;
        align-self: start;
        margin-top: 0.4rem;
    }

    .match-versus {
        display: block;
        padding: 0.3rem 0.5rem;
        border-radius: 0.45rem;
        background: #f0f3f7;
        color: #4e5c71;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    .match-sign-in {
        grid-area: notice;
        margin-top: 0.65rem;
    }
}
