/*
 * HoFi Billard
 * Resultater v2.0
 *
 * Fælles resultatvisning for fixture-baserede turneringer.
 * Designmål:
 * - resultatet er centrum
 * - kompakte kampkort
 * - holdene står over for hinanden
 * - sekundære data fylder mindre
 */

.results-page {
    max-width: 1180px;
    margin: 0 auto;
}

.results-page-header {
    margin-bottom: 24px;
}


/* ============================================================
   Rundevælger
   Samme visuelle sprog som hovedmenuen:
   - almindelige mørke menupunkter
   - aktivt valg = tydelig blå knap
   ============================================================ */

.round-filter {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(150px, 1fr)
        );

    gap: 12px;

    margin-bottom: 30px;
}

.round-filter a {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding: 10px 16px;

    border: 1px solid transparent;
    border-radius: 11px;

    background: transparent;

    color: var(--text-primary);

    text-decoration: none;
    font-weight: 500;

    transition:
        background .18s ease,
        color .18s ease,
        border-color .18s ease,
        transform .18s ease;
}

.round-filter a:hover {
    background: rgba(255,255,255,.045);
    color: #fff;
    transform: translateY(-1px);
}

.round-filter a.active {
    background: var(--primary-color);
    border-color: var(--primary-color);

    color: #fff;
    font-weight: 700;

    box-shadow:
        0 4px 12px rgba(0,0,0,.16);
}

.round-filter a.active:hover {
    background: var(--primary-color);
    color: #fff;
}


/* ============================================================
   Runde / dato
   ============================================================ */

.round-header {
    display: flex;
    align-items: baseline;
    gap: 8px;

    margin: 40px 0 12px;

    padding: 0 4px;

    color: var(--text-primary);
}

.round-header span {
    color: var(--text-muted);

    font-size: .9rem;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: .06em;
}

.round-header strong {
    font-size: 1.45rem;
    line-height: 1;
}


/* ============================================================
   Kampkort
   ============================================================ */

.result-card {
    margin-bottom: 14px;

    padding: 0;

    overflow: hidden;
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 38px;

    padding: 8px 18px;

    border-bottom: 1px solid var(--border-color);

    color: var(--text-muted);

    font-size: .84rem;
}

.result-meta-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-meta-main strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.result-table {
    white-space: nowrap;
}


/* ============================================================
   Scoreboard
   ============================================================ */

.result-scoreboard {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        150px
        minmax(0, 1fr);

    align-items: center;

    gap: 20px;

    min-height: 96px;

    padding: 16px 28px;
}

.result-side {
    min-width: 0;
}

.result-side-home {
    text-align: left;
}

.result-side-away {
    text-align: right;
}

.result-team-name {
    overflow: hidden;

    color: var(--text-primary);

    font-size: 1.22rem;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-team-caption {
    margin-top: 7px;

    color:
        color-mix(
            in srgb,
            var(--text-muted) 82%,
            transparent
        );

    font-size: .84rem;
}

.result-score {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    white-space: nowrap;
}

.result-score-number {
    min-width: 42px;

    text-align: center;

    font-size: 2.35rem;
    line-height: 1;
    font-weight: 800;
}

.result-score-separator {
    color: var(--text-muted);

    font-size: 1.4rem;
    font-weight: 500;
}

.winner {
    color: #55d66b;
}

.loser {
    color: #ff5656;
}

.draw {
    color: #ffc928;
}


/* ============================================================
   Footer
   ============================================================ */

.result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 40px;

    padding: 6px 18px;

    border-top: 1px solid var(--border-color);

    background:
        rgba(255, 255, 255, .015);
}

.result-status {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    padding: 5px 10px;

    border-radius: 999px;

    font-size: .8rem;
    font-weight: 600;
}

.result-status-approved {
    background: rgba(76, 175, 80, .13);
    color: #55d66b;
}

.result-status-pending {
    background: rgba(255, 193, 7, .13);
    color: #ffc928;
}

.result-open {
    color: var(--text-secondary);

    text-decoration: none;
    font-size: .84rem;
    font-weight: 500;
    opacity: .9;
}

.result-open:hover {
    text-decoration: underline;
}


/* ============================================================
   Empty state
   ============================================================ */

.results-empty {
    margin-top: 20px;
}

.empty-state {
    padding: 50px 20px;

    color: var(--text-muted);

    text-align: center;
}

.empty-state i {
    display: block;

    margin-bottom: 12px;

    font-size: 38px;
}


/* ============================================================
   Mobil
   ============================================================ */

@media (max-width: 760px) {

    .round-filter {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .result-scoreboard {
        grid-template-columns:
            minmax(0, 1fr)
            92px
            minmax(0, 1fr);

        gap: 10px;

        min-height: 92px;

        padding: 14px;
    }

    .result-team-name {
        font-size: 1rem;
    }

    .result-team-caption {
        font-size: .74rem;
    }

    .result-score-number {
        min-width: 30px;

        font-size: 1.8rem;
    }

    .result-score {
        gap: 6px;
    }

}


@media (max-width: 520px) {

    .round-filter {
        grid-template-columns: 1fr 1fr;
    }

    .result-meta {
        padding-left: 12px;
        padding-right: 12px;
    }

    .result-scoreboard {
        grid-template-columns: 1fr;
        gap: 14px;

        padding: 18px;
    }

    .result-side-home,
    .result-side-away {
        text-align: center;
    }

    .result-score {
        grid-row: 2;
    }

    .result-team-caption {
        margin-top: 4px;
    }

    .result-footer {
        padding-left: 12px;
        padding-right: 12px;
    }

}


.results-page .round-filter + .round-header {
    margin-top: 28px;
}
