/******************************************************************************
 *
 * HoFi Billard
 * Spillerstatistik
 *
 ******************************************************************************/

.statistics-players-page {

    max-width: 1100px;
    margin: 0 auto;

}


/******************************************************************************
 * Sæsonvælger
 ******************************************************************************/

.statistics-season-card {

    margin-bottom: 25px;

}

.statistics-season-selector {

    display: flex;

    align-items: center;

    gap: 15px;

}

.statistics-season-selector label {

    font-weight: 600;

    color: var(--text);

    white-space: nowrap;

}

.statistics-season-selector select {

    max-width: 320px;

}


/******************************************************************************
 * Sæsonoverskrift
 ******************************************************************************/

.statistics-season-heading {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin: 25px 0 15px;

}

.statistics-season-heading h2 {

    margin: 0;

    font-size: 22px;

}

.statistics-season-heading p {

    margin-top: 3px;

    color: var(--text-muted);

    font-size: 14px;

}


/******************************************************************************
 * Statistikliste
 ******************************************************************************/

.player-statistics-card {

    padding: 0;

    overflow: hidden;

}

.player-statistics-header {

    display: grid;

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

    align-items: center;

    padding: 14px 22px;

    background: var(--surface-light);

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

    color: var(--text-muted);

    font-size: 13px;

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: .04em;

}

.stat-heading {

    text-align: right;

}

.player-statistics-list {

    display: flex;

    flex-direction: column;

}

.player-statistics-row {

    display: grid;

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

    align-items: center;

    padding: 14px 22px;

    color: var(--text);

    text-decoration: none;

    transition: background var(--transition);

}

.player-statistics-row + .player-statistics-row {

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

}

.player-statistics-row:hover {

    background: rgba(255,255,255,.04);

}


/******************************************************************************
 * Spiller
 ******************************************************************************/

.player-statistics-player {

    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;

}

.player-statistics-avatar {

    width: 42px;

    height: 42px;

    flex: 0 0 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background: var(--surface-light);

    font-size: 21px;

}

.player-statistics-name {

    font-size: 17px;

    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}

.player-statistics-display {

    margin-top: 2px;

    color: var(--text-muted);

    font-size: 13px;

}


/******************************************************************************
 * Tal
 ******************************************************************************/

.player-statistics-average,
.player-statistics-distance {

    text-align: right;

    font-size: 20px;

    font-weight: 700;

}

.player-statistics-average {

    color: var(--primary-hover);

}

.player-statistics-distance {

    color: var(--text);

}


/******************************************************************************
 * Ingen data
 ******************************************************************************/

.statistics-empty {

    padding: 45px 20px;

    text-align: center;

    color: var(--text-muted);

}

.statistics-empty i {

    display: block;

    margin-bottom: 12px;

    font-size: 38px;

}

.statistics-empty p {

    margin: 0;

}


/******************************************************************************
 * Mobil
 ******************************************************************************/

@media (max-width: 700px) {

    .statistics-season-selector {

        align-items: flex-start;

        flex-direction: column;

        gap: 8px;

    }

    .statistics-season-selector select {

        max-width: none;

    }

    .player-statistics-header,
    .player-statistics-row {

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

    }

    .player-statistics-header {

        padding: 12px 14px;

    }

    .player-statistics-row {

        padding: 12px 14px;

    }

    .player-statistics-avatar {

        display: none;

    }

    .player-statistics-player {

        gap: 0;

    }

    .player-statistics-name {

        font-size: 15px;

    }

    .player-statistics-display {

        display: none;

    }

    .player-statistics-average,
    .player-statistics-distance {

        font-size: 17px;

    }

}


/******************************************************************************
 * Aktiv / inaktiv filter
 ******************************************************************************/

.player-status-filter {

    margin-bottom: 20px;

}

.player-status-buttons {

    display: flex;

    gap: 10px;

    flex-wrap: wrap;

}

.player-status-button {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 10px 18px;

    border-radius: 999px;

    background: var(--surface-light);

    color: var(--text-light);

    text-decoration: none;

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

    transition: var(--transition);

}

.player-status-button:hover {

    background: var(--surface-hover);

}

.player-status-button.active {

    background: var(--primary);

    border-color: var(--primary);

    color: #fff;

}



/******************************************************************************
 * v2.0 - sæsontotaler og løbende snit
 ******************************************************************************/

.player-statistics-header,
.player-statistics-row {
    grid-template-columns:
        minmax(240px, 1fr)
        100px
        120px
        110px
        120px
        105px;
    column-gap: 12px;
}

.player-statistics-start-average,
.player-statistics-total-score,
.player-statistics-total-innings,
.player-statistics-average,
.player-statistics-distance {
    text-align: right;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.player-statistics-start-average {
    color: var(--text);
}

.player-statistics-total-score,
.player-statistics-total-innings {
    color: var(--text-light);
}

/* Det vigtigste tal på siden */
.player-statistics-average {
    color: var(--primary-hover);
    font-size: 20px;
}

@media (max-width: 900px) {
    .statistics-players-page {
        max-width: 100%;
    }

    .player-statistics-card {
        overflow-x: auto;
    }

    .player-statistics-header,
    .player-statistics-row {
        min-width: 850px;
    }
}

@media (max-width: 700px) {
    .player-statistics-header,
    .player-statistics-row {
        grid-template-columns:
            minmax(160px, 1fr)
            78px
            90px;
        min-width: 0;
        column-gap: 8px;
    }

    /* Mobil: Spiller | Startsnit | Løbende snit */
    .player-statistics-header .stat-heading:nth-child(3),
    .player-statistics-header .stat-heading:nth-child(4),
    .player-statistics-header .stat-heading:nth-child(6),
    .player-statistics-total-score,
    .player-statistics-total-innings,
    .player-statistics-distance {
        display: none;
    }

    .player-statistics-start-average,
    .player-statistics-average {
        font-size: 16px;
    }
}


/******************************************************************************
 * v2.1 - Forbedring + 1/3-distance / højeste serie
 ******************************************************************************/

.player-statistics-header,
.player-statistics-row {
    grid-template-columns:
        minmax(220px, 1fr)
        92px
        105px
        95px
        105px
        100px
        105px
        92px;
    column-gap: 10px;
}

.player-statistics-improvement,
.player-statistics-one-third {
    text-align: right;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.player-statistics-improvement.is-positive {
    color: #86efac;
}

.player-statistics-improvement.is-negative {
    color: #fca5a5;
}

.player-statistics-improvement.is-neutral {
    color: var(--text-light);
}

.player-statistics-one-third {
    color: var(--text-light);
}

.player-statistics-one-third span {
    color: var(--text-muted);
    font-weight: 400;
}

.player-statistics-one-third.is-achieved {
    color: #86efac;
}

@media (max-width: 1100px) {
    .player-statistics-header,
    .player-statistics-row {
        min-width: 1060px;
    }
}

@media (max-width: 700px) {

    .player-statistics-header,
    .player-statistics-row {
        grid-template-columns:
            minmax(155px, 1fr)
            74px
            82px
            82px;
        min-width: 0;
        column-gap: 7px;
    }

    /*
     * Mobil:
     * Spiller | Startsnit | Løbende snit | Forbedring
     */
    .player-statistics-header .stat-heading:nth-child(3),
    .player-statistics-header .stat-heading:nth-child(4),
    .player-statistics-header .stat-heading:nth-child(7),
    .player-statistics-header .stat-heading:nth-child(8),
    .player-statistics-total-score,
    .player-statistics-total-innings,
    .player-statistics-one-third,
    .player-statistics-distance {
        display: none;
    }

    .player-statistics-improvement {
        font-size: 16px;
    }
}


/* ============================================================
   v2.2 - periodevalg og sortering
   ============================================================ */

.statistics-view-form{
    display:grid;
    grid-template-columns:auto minmax(220px,420px);
    align-items:center;
    gap:.7rem;
}

.statistics-view-form label{
    font-weight:700;
}

.statistics-view-form select{
    min-height:38px;
    padding:.45rem .65rem;
    border:1px solid #46617f;
    border-radius:6px;
    background:#1b2d42;
    color:#eef5fc;
    font-size:.88rem;
}

.statistics-view-form select option,
.statistics-view-form select optgroup{
    background:#1b2d42;
    color:#eef5fc;
}

.statistics-sort-bar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:1rem;
    margin:0 0 .8rem;
}

.statistics-sort-bar > span{
    color:var(--text-muted);
    font-size:.76rem;
    font-weight:700;
}

.statistics-sort-buttons{
    display:flex;
    flex-wrap:wrap;
    gap:.45rem;
}

.statistics-sort-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:34px;
    padding:.4rem .72rem;
    border:1px solid #46617f;
    border-radius:7px;
    background:#1b2d42;
    color:#dce9f6;
    font-size:.76rem;
    font-weight:750;
    text-decoration:none;
    transition:.15s ease;
}

.statistics-sort-button:hover{
    background:#20364f;
    border-color:#5d7fa4;
    color:#fff;
}

.statistics-sort-button.active{
    background:rgba(79,145,255,.18);
    border-color:#4f91ff;
    color:#fff;
}

@media(max-width:700px){

    .statistics-view-form{
        grid-template-columns:1fr;
    }

    .statistics-sort-bar{
        align-items:flex-start;
        flex-direction:column;
    }
}

/* HoFi keglebillard item icon */
.player-statistics-avatar .item-logo { width: 100%; height: 100%; object-fit: contain; display: block; }


/* 10G: Udskrivning af løbende snit */
.statistics-sort-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    flex-wrap:wrap;
    gap:.55rem;
}

.statistics-print-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:.42rem;
    min-height:34px;
    padding:.4rem .78rem;
    border:1px solid #4f91ff;
    border-radius:7px;
    background:rgba(79,145,255,.18);
    color:#fff;
    font-size:.76rem;
    font-weight:750;
    text-decoration:none;
    transition:.15s ease;
}

.statistics-print-button:hover{
    background:#4f91ff;
    border-color:#4f91ff;
    color:#fff;
}

@media(max-width:900px){
    .statistics-sort-actions{
        width:100%;
        justify-content:flex-start;
    }
}
