.scheduled-matches {
    padding: 1rem;
}

.scheduled-phase {
    border: 1px solid var(--color-border, #d6e0ea);
    border-radius: var(--radius-lg, 8px);
    overflow: hidden;
}

.scheduled-phase-header.card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border, #d6e0ea);
    background: linear-gradient(135deg, #091b33 0%, #123b6b 100%);
    color: #ffffff;
}

.scheduled-phase-heading {
    display: contents;
}

.scheduled-phase-title {
    grid-column: 1 / -1;
    margin: 0;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.scheduled-phase-datetime {
    grid-column: 1;
    grid-row: 2;
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 400;
}

.scheduled-phase-header .linkPdf {
    position: static;
    flex: 0 0 auto;
    margin-left: auto;
    align-self: flex-end;
    transform: none;
    grid-column: 2;
    grid-row: 2;
}

.scheduled-match-columns {
    margin: 0;
    padding: 5px 8px;
    border-top: 1px solid var(--color-orange, #f97316);
    border-bottom: 2px solid var(--color-orange-hover, #ea580c);
    background: var(--color-orange-light, #ffedd5);
    color: var(--color-orange-text, #7c2d12);
    font-size: var(--font-size-xs, 11.5px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.scheduled-match-list {
    border-top: 1px solid var(--color-border, #d6e0ea);
}

.scheduled-match-row {
    margin: 0;
    padding: 0.25rem;
    border-bottom: 1px solid var(--color-border, #d6e0ea);
    border-left: 4px solid transparent;
}

.scheduled-match-row:nth-child(even) {
    background: var(--color-bg-subtle, #f7fafc);
}

.scheduled-match-running {
    border-left-color: var(--color-orange, #f97316);
}

.scheduled-match-complete {
    border-left-color: var(--color-green, #10b981);
}

.scheduled-target {
    font-weight: 700;
}

.scheduled-match-target {
    text-align: center;
    white-space: nowrap;
}

.scheduled-mobile-label {
    color: var(--color-text-secondary, #64748b);
    font-size: 0.75rem;
    font-weight: 400;
}

.scheduled-match-side {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    width: 100%;
}

.scheduled-match-side-left {
    justify-content: flex-end;
    text-align: right;
}

.scheduled-match-side-left .scheduled-match-country {
    margin-right: auto;
    text-align: left;
}

.scheduled-match-side-right {
    justify-content: flex-start;
    text-align: left;
}

.scheduled-match-side-right .scheduled-match-country {
    margin-left: auto;
    text-align: right;
}

.scheduled-match-photo {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.scheduled-match-photo img {
    max-width: 40px;
    height: auto;
}

.scheduled-match-identity {
    min-width: 0;
}

.scheduled-match-identity strong,
.scheduled-match-country,
.scheduled-match-rank {
    display: block;
}

.scheduled-match-country {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--color-text-secondary, #64748b);
    font-size: 0.85rem;
}

.scheduled-match-team-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
}

.scheduled-match-team-mobile-flag {
    flex: 0 0 auto;
}

.scheduled-match-rank,
.scheduled-match-note {
    color: var(--color-text-secondary, #64748b);
    font-size: 0.85rem;
}

.scheduled-match-winner .scheduled-match-identity strong {
    color: var(--color-green-text, #166534);
}

.scheduled-match-result {
    text-align: center;
}

.scheduled-match-score {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: baseline;
    gap: 0.35rem;
    color: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    white-space: normal;
}

.scheduled-match-score > span {
    min-width: 0;
}

.scheduled-match-score > span:first-child {
    text-align: right;
}

.scheduled-match-score > span:last-child {
    text-align: left;
}

.scheduled-match-score:visited,
.scheduled-match-score:hover {
    color: inherit;
    text-decoration: none;
}

.scheduled-score-value {
    display: inline;
}

.scheduled-set-points {
    display: block;
    white-space: nowrap;
}

.scheduled-score-divider {
    color: var(--color-text-secondary, #64748b);
}

.scheduled-tiebreak {
    display: inline-block;
    max-width: 100%;
    margin-left: 0.25em;
    vertical-align: baseline;
    white-space: normal;
    overflow-wrap: anywhere;
}

.scheduled-set-points,
.scheduled-tiebreak {
    font-size: 0.7rem;
    font-weight: 400;
}

.scheduled-match-status {
    color: var(--color-text-secondary, #64748b);
    font-size: 0.9rem;
}

@media (max-width: 767.98px) {
    .scheduled-matches {
        padding: 0.5rem;
    }

    .scheduled-match-target {
        padding-bottom: 0.35rem;
        border-bottom: 1px solid var(--color-border, #d6e0ea);
    }

    .scheduled-match-side-left {
        justify-content: flex-start;
        text-align: left;
    }

    .scheduled-match-side-left .scheduled-match-identity {
        order: 1;
    }

    .scheduled-match-side-left .scheduled-match-photo {
        order: 2;
    }

    .scheduled-match-side-left .scheduled-match-country {
        order: 3;
        margin-right: 0;
        margin-left: auto;
        text-align: right;
    }

    .scheduled-match-side-right {
        justify-content: flex-end;
        text-align: right;
    }

    .scheduled-match-side-right .scheduled-match-country {
        order: 1;
        margin-right: auto;
        margin-left: 0;
        text-align: left;
    }

    .scheduled-match-side-right .scheduled-match-photo {
        order: 2;
    }

    .scheduled-match-side-right .scheduled-match-identity {
        order: 3;
    }

    .scheduled-match-side-individual.scheduled-match-side-left .scheduled-match-photo {
        order: 1;
    }

    .scheduled-match-side-individual.scheduled-match-side-left .scheduled-match-identity {
        order: 2;
    }

    .scheduled-match-side-individual.scheduled-match-side-right .scheduled-match-identity {
        order: 2;
    }

    .scheduled-match-side-individual.scheduled-match-side-right .scheduled-match-photo {
        order: 3;
    }

    .scheduled-match-side-team.scheduled-match-side-left .scheduled-match-photo {
        order: 3;
        margin-left: auto;
    }

    .scheduled-match-side-team.scheduled-match-side-left .scheduled-match-team-mobile-flag {
        order: 1;
    }

    .scheduled-match-side-team.scheduled-match-side-left .scheduled-match-identity {
        order: 2;
        text-align: left;
    }

    .scheduled-match-side-team.scheduled-match-side-right .scheduled-match-photo {
        order: 1;
        margin-right: auto;
    }

    .scheduled-match-side-team.scheduled-match-side-right .scheduled-match-identity {
        order: 2;
        text-align: right;
    }

    .scheduled-match-side-team.scheduled-match-side-right .scheduled-match-team-mobile-flag {
        order: 3;
    }

    .scheduled-match-side-team .scheduled-match-photo {
        min-width: 0;
        max-width: 100%;
    }

    .scheduled-match-result {
        padding: 0.35rem 0;
        border-top: 1px solid var(--color-border, #d6e0ea);
        border-bottom: 1px solid var(--color-border, #d6e0ea);
    }
}