/*
GeoRankle Stats 7.0

Statistics summary and win distribution.

Used by:
- stats.js
- .stats-summary
- .stats-summary-grid
- .distribution
*/

/* =========================================================
   Stats card
   ========================================================= */

.stats-summary {
    margin-top: 30px;
    padding: 20px;

    border: 1px solid #e7eef7;
    border-radius: 20px;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #f5f9ff
        );

    box-shadow:
        0 8px 24px rgba(15,23,42,.06);
}

.stats-summary h3 {
    margin: 0 0 15px;

    color: #111827;

    font-size: 20px;
    font-weight: 900;
    line-height: 1.2;
}

/* =========================================================
   Summary grid
   ========================================================= */

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 12px;
}

.stats-summary-grid > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    min-width: 0;
    min-height: 86px;

    padding: 15px 10px;

    border: 1px solid #edf2f7;
    border-radius: 16px;

    background: #ffffff;

    text-align: center;

    box-shadow:
        0 5px 14px rgba(15,23,42,.04);
}

.stats-summary-grid strong {
    display: block;

    color: #111827;

    font-size: 24px;
    font-weight: 900;
    line-height: 1.1;
}

.stats-summary-grid span {
    display: block;

    margin-top: 5px;

    color: #64748b;

    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
}

/* =========================================================
   Distribution
   ========================================================= */

.distribution {
    margin-top: 25px;
}

.distribution h3 {
    margin: 0 0 15px;
}

.distribution-row {
    display: grid;
    grid-template-columns: 26px minmax(0,1fr);
    align-items: center;
    gap: 10px;

    margin-bottom: 8px;
}

.distribution-label {
    color: #475569;

    font-size: 14px;
    font-weight: 900;
    text-align: center;
}

.distribution-bar-wrap {
    position: relative;

    min-width: 0;
    min-height: 30px;

    overflow: hidden;

    border-radius: 10px;

    background: #e5e7eb;
}

.distribution-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    min-width: 30px;
    min-height: 30px;

    padding: 5px 9px;

    border-radius: 10px;

    background:
        linear-gradient(
            180deg,
            #ffe35c,
            #ffd400
        );

    color: #332b00;

    font-size: 13px;
    font-weight: 900;
    line-height: 1;

    white-space: nowrap;

    transition:
        width .35s ease;
}

/* =========================================================
   Dark mode
   ========================================================= */

@media (prefers-color-scheme: dark) {

    .stats-summary {
        border-color: #334155;

        background:
            linear-gradient(
                180deg,
                #162130,
                #111827
            );

        box-shadow:
            0 8px 24px rgba(0,0,0,.35);
    }

    .stats-summary h3,
    .stats-summary-grid strong {
        color: #f8fafc;
    }

    .stats-summary-grid > div {
        border-color: #334155;

        background: #1e293b;
    }

    .stats-summary-grid span,
    .distribution-label {
        color: #cbd5e1;
    }

    .distribution-bar-wrap {
        background: #334155;
    }
}

/* =========================================================
   Tablet
   ========================================================= */

@media (max-width:760px) {

    .stats-summary {
        padding: 16px;
    }

    .stats-summary-grid {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }

    .stats-summary-grid > div:last-child {
        grid-column: 1 / -1;
    }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width:480px) {

    .stats-summary {
        margin-top: 22px;
        padding: 14px;
    }

    .stats-summary h3 {
        font-size: 18px;
    }

    .stats-summary-grid {
        gap: 10px;
    }

    .stats-summary-grid strong {
        font-size: 21px;
    }

    .distribution-row {
        gap: 8px;
    }

    .distribution-bar {
        font-size: 12px;
    }
}

/* =========================================================
   High contrast
   ========================================================= */

@media (prefers-contrast: more) {

    .stats-summary,
    .stats-summary-grid > div,
    .distribution-bar-wrap {
        border-width: 2px;
    }
}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .distribution-bar {
        transition: none;
    }
}