/* Statistics page aligned with the Schedule and Standings dark layout. */
.stats-page {
    background-color: #080d13 !important;
    background-image: none !important;
    color: #f4f7fb;
}

.stats-page-panel {
    width: min(1320px, calc(100% - 40px));
    max-width: none;
    margin: 28px auto 52px;
    padding: 24px 26px 26px;
    box-sizing: border-box;
    overflow: visible;
    background: #101820 !important;
    border: 1px solid #2a3540;
    border-radius: 10px;
    box-shadow: 0 15px 34px rgba(0, 0, 0, .32) !important;
    font-family: 'Inter', sans-serif;
}

.stats-page-header {
    margin-bottom: 18px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2a3540;
}

.stats-page-header h1 {
    margin: 0;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.stats-main-tabs {
    display: flex;
    gap: 5px;
    margin: 0 0 18px;
    padding: 5px;
    overflow-x: auto;
    background: #0b1219;
    border: 1px solid #2a3540;
    border-radius: 7px;
}

.stats-main-tab {
    width: auto;
    min-width: 112px;
    margin: 0;
    padding: 11px 18px;
    color: #97a6b5;
    background: transparent;
    border: 0;
    border-radius: 5px;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .045em;
    text-transform: uppercase;
    cursor: pointer;
}

.stats-main-tab:hover {
    color: #fff;
    background: #151f29;
}

.stats-main-tab.active {
    color: #fff;
    background: #1688f5;
    box-shadow: 0 4px 12px rgba(22, 136, 245, .2);
}

.stats-panel { display: none; }
.stats-panel.active {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.stats-filter-select-row {
    grid-column: 1;
    grid-row: 1 / span 20;
    display: flex;
    flex-direction: column;
    gap: 17px;
    margin: 0;
    padding: 17px;
    position: sticky;
    top: 16px;
    background: #101820;
    border: 1px solid #2a3540;
    border-radius: 7px;
}

.stats-filter-select-row::before {
    content: "Filter Statistics";
    display: block;
    margin-bottom: 1px;
    padding-bottom: 11px;
    color: #fff;
    border-bottom: 2px solid #1688f5;
    font-size: .9rem;
    font-weight: 900;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.stats-select-box {
    width: 100%;
    max-width: none;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.stats-select-box span {
    color: #91a0af !important;
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.stats-select-box select {
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    color: #f5f8fc !important;
    background: #151f29 !important;
    border: 1px solid #303d49 !important;
    border-radius: 5px;
    font: inherit;
    font-size: .8rem;
    font-weight: 800;
    outline: none;
    color-scheme: dark;
}

.stats-select-box select:focus {
    border-color: #1688f5 !important;
    box-shadow: 0 0 0 2px rgba(22, 136, 245, .18) !important;
}

.stats-panel > :not(.stats-filter-select-row) {
    grid-column: 2;
    min-width: 0;
}

.stats-section-title {
    margin: 0;
    padding: 15px 19px;
    color: #fff !important;
    background: #0b1219;
    border: 1px solid #2a3540;
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.stats-section-title.goalie-title { margin-top: 18px; }

.leader-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    background: #101820;
    border: 1px solid #2a3540;
    border-radius: 0 0 7px 7px;
}

.leader-card {
    min-height: 220px;
    padding: 16px;
    color: #e8eef5;
    background: #151f29 !important;
    border: 1px solid #2b3742 !important;
    border-radius: 7px;
    box-shadow: none !important;
}

.leader-card-title {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 13px;
    color: #f7f9fc;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.leader-card-title span { color: #4aa4ff; }
.leader-card-title:hover,
.leader-featured:hover .leader-featured-name,
.leader-rank-row:hover .leader-rank-name { color: #4aa4ff; }

.leader-card-body {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.leader-featured {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: inherit;
    text-align: center;
    text-decoration: none;
}

.leader-initials {
    margin-bottom: 14px;
    color: #fff;
    font-size: 3.35rem;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -.08em;
}

.leader-featured-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    align-items: center;
    max-width: 145px;
}

.leader-featured-number {
    grid-row: span 2;
    color: #91a0af;
    font-size: .7rem;
    font-weight: 900;
}

.leader-featured-name {
    color: #fff;
    font-size: .8rem;
    font-weight: 900;
    line-height: 1;
    text-align: left;
    text-transform: uppercase;
}

.leader-featured-team {
    grid-column: 1 / -1;
    margin-top: 8px;
    color: #9eabb8;
    font-size: .72rem;
    font-weight: 800;
}

.leader-ranking-list {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leader-rank-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(82px, 145px) minmax(55px, 1fr) 36px;
    gap: 8px;
    align-items: center;
    color: #dce4ec;
    text-decoration: none;
}

.leader-rank-name {
    overflow: hidden;
    font-size: .64rem;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.leader-rank-bar {
    height: 7px;
    overflow: hidden;
    background: #344352;
    border-radius: 999px;
}

.leader-rank-bar span {
    display: block;
    height: 100%;
    background: #1688f5;
    border-radius: inherit;
}

.leader-rank-value {
    color: #fff;
    font-size: .68rem;
    font-weight: 900;
    text-align: right;
}

.leader-empty-message {
    padding: 45px 0;
    color: #97a5b3;
    font-size: .82rem;
    font-weight: 800;
    text-align: center;
}

.stats-table-shell {
    overflow-x: auto;
    padding: 14px;
    background: #101820 !important;
    border: 1px solid #2a3540 !important;
    border-radius: 7px;
    scrollbar-color: #44515d #0b1219;
}

.league-stats-table {
    width: 100%;
    min-width: 980px;
    margin: 0;
    overflow: hidden;
    background: #151f29;
    border: 1px solid #2b3742;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 7px;
    font-family: 'Inter', sans-serif;
    font-size: .7rem;
}

.goalies-stats-table { min-width: 1120px; }

.league-stats-table th,
.league-stats-table td {
    box-sizing: border-box;
    white-space: nowrap;
}

.league-stats-table th {
    height: 40px;
    padding: 9px 8px;
    color: #eaf0f6 !important;
    background: #0b1219 !important;
    border-bottom: 1px solid #40505d;
    font-size: .59rem;
    font-weight: 900;
    letter-spacing: .03em;
    text-align: center;
    text-transform: uppercase;
}

.league-stats-table td {
    height: 51px;
    padding: 8px;
    color: #e4ebf2 !important;
    background: #151f29 !important;
    border-bottom: 1px solid #2d3944 !important;
    font-size: .7rem;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
}

.league-stats-table tbody tr:nth-child(even) td { background: #131c25 !important; }
.league-stats-table tbody tr:hover td { background: #1a2732 !important; }
.league-stats-table tbody tr:last-child td { border-bottom: 0 !important; }

.league-stats-table th:nth-child(2),
.league-stats-table td:nth-child(2),
.players-stats-table th:nth-child(3),
.players-stats-table td:nth-child(3),
.goalies-stats-table th:nth-child(3),
.goalies-stats-table td:nth-child(3) { text-align: left; }

.stats-sort-btn {
    appearance: none;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
    text-transform: inherit;
}

.stats-sort-btn:hover { color: #4aa4ff; }

.stats-entity-cell,
.stats-player-name-cell,
.stats-team-inline-cell {
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-entity-logo {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    object-fit: contain;
    background: #0b1219;
    border-radius: 50%;
}

.stats-entity-name,
.stats-player-name,
.stats-team-inline-cell span {
    color: #fff !important;
    font-weight: 900;
    line-height: 1.15;
    text-transform: uppercase;
}

.stats-entity-sub {
    margin-top: 2px;
    color: #8f9daa !important;
    font-size: .62rem;
    font-weight: 800;
}

.stats-link { color: inherit; text-decoration: none; }
.stats-link:hover .stats-entity-name,
.stats-link:hover .stats-player-name { color: #4aa4ff !important; }
.stats-highlight { color: #4aa4ff !important; font-weight: 900; }

.stats-empty-row td {
    height: 90px;
    color: #97a5b3 !important;
    font-style: italic;
    text-align: center !important;
}

.stats-pagination {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 14px 0 0;
}

.stats-page-btn,
.stats-pagination button {
    min-width: 34px;
    min-height: 34px;
    padding: 0 10px;
    color: #e7edf4 !important;
    background: #151f29 !important;
    border: 1px solid #303d49 !important;
    border-radius: 5px;
    font-size: .7rem;
    font-weight: 900;
    cursor: pointer;
}

.stats-page-btn:hover,
.stats-pagination button:hover { border-color: #1688f5 !important; }
.stats-page-btn.active,
.stats-pagination button.active {
    color: #fff !important;
    background: #1688f5 !important;
    border-color: #1688f5 !important;
}

.stats-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    margin-top: 14px;
    padding: 13px 15px;
    color: #8998a7 !important;
    background: #101820;
    border: 1px solid #2a3540;
    border-radius: 7px;
    font-size: .62rem;
    line-height: 1.8;
}

.stats-legend strong {
    width: 100%;
    color: #f5f8fb !important;
    font-size: .65rem;
    text-transform: uppercase;
}

.stats-legend b { color: #dfe7ef !important; }
.stats-page .site-footer { margin-top: 0 !important; }

@media (max-width: 1000px) {
    .leader-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .stats-page-panel { padding: 20px; }
    .stats-panel.active { grid-template-columns: 1fr; }
    .stats-filter-select-row {
        grid-column: 1;
        grid-row: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        position: static;
    }
    .stats-filter-select-row::before { grid-column: 1 / -1; }
    .stats-panel > :not(.stats-filter-select-row) { grid-column: 1; }
}

@media (max-width: 620px) {
    .stats-page-panel {
        width: min(100% - 20px, 1320px);
        margin-top: 18px;
        padding: 15px;
    }
    .stats-main-tab { min-width: 96px; padding-inline: 13px; }
    .stats-filter-select-row { grid-template-columns: 1fr; }
    .stats-filter-select-row::before { grid-column: auto; }
    .leader-card-body { grid-template-columns: 1fr; gap: 14px; }
    .leader-initials { font-size: 3rem; }
    .stats-table-shell { padding: 10px; }
}

.minor-stats-division-nav{display:flex;gap:10px;margin:0 0 20px}.minor-stats-division-nav[hidden]{display:none!important}.minor-stats-division-btn{min-width:100px;padding:11px 18px;border:1px solid #303d49;border-radius:5px;background:#151f29;color:#dce5ee;font:inherit;font-weight:900;cursor:pointer}.minor-stats-division-btn:hover,.minor-stats-division-btn.active{background:#1688f5;border-color:#1688f5;color:#fff}@media(max-width:640px){.minor-stats-division-nav{display:grid;grid-template-columns:repeat(3,1fr)}.minor-stats-division-btn{min-width:0;padding:10px}}

/* Minor division selector is never visible on Adult Statistics. */
.minor-division-filter[hidden]{display:none!important}
