/* Prevent first column from breaking in sort tables */
#player .sort-table th.col-league { min-width: 62px;}
#goaler .sort-table th.col-league { min-width: 62px;}

.table-scroll {
    position: relative;
    overflow: visible;
}

.table-header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    overflow-x: scroll;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: #fff;
    z-index: 25;
    border-bottom: 1px solid #ddd;
    display: none;
}

.table-header-sticky::-webkit-scrollbar {
    display: none;
}

.table-header-sticky table {
    margin-bottom: 0;
    background: #fff;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    box-sizing: border-box;
}

.table-header-sticky th {
    background: #fff;
    white-space: nowrap;
    box-sizing: border-box;
}

.table-header-sticky a {
    color: inherit;
    pointer-events: none;
    text-decoration: none;
}

.scrollbar-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    overflow-x: auto;
    overflow-y: hidden;
    background: #fff;
    z-index: 20;
    border-top: 1px solid #ddd;
    display: none;
}

.scrollbar-sticky-inner {
    height: 1px;
}

.scroll-inner {
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-gutter: stable;

    white-space: nowrap;
    position: relative;
    background: white;
    padding-bottom: 2px;
    z-index: 10;
}

.table-stats {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
}

.table-stats th,
.table-stats td {
    padding: 8px 12px;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.table-stats thead th {
    border-top: 1px solid #ddd;
}

.table-stats th:first-child,
.table-stats td:first-child {
    border-left: 1px solid #ddd;
}

/* Players stats: keep compact columns while allowing readable long labels */
#players .stats-search-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
}

#players .stats-search-table th,
#players .stats-search-table td {
    padding: 5px 6px;
    min-width: 78px;
    box-sizing: border-box;
    overflow: hidden;
    white-space: normal;
    line-height: 1.2;
    font-size: 12px;
    word-break: break-word;
}

#players .stats-search-table th.col-rng,
#players .stats-search-table td.col-rng {
    min-width: 56px;
    text-align: center;
}

#players .stats-search-table th.col-name,
#players .stats-search-table td.col-name {
    min-width: 180px;
}

#players .stats-search-table th.col-team,
#players .stats-search-table td.col-team {
    min-width: 120px;
}

#players .stats-search-table th.col-stat,
#players .stats-search-table td.col-stat {
    min-width: 52px;
    padding: 4px 4px;
    text-align: center;
}

#players .stats-search-table th a,
#players .stats-search-table td a {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.2;
    font-size: 12px;
}

/* Fiche stats tables: compact columns with wider text columns */
#player .table-stats,
#goaler .table-stats {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
}

#player .table-stats th,
#player .table-stats td,
#goaler .table-stats th,
#goaler .table-stats td {
    padding: 5px 6px;
    min-width: 78px;
    box-sizing: border-box;
    overflow: hidden;
    white-space: normal;
    line-height: 1.2;
    font-size: 12px;
    word-break: break-word;
}

#player .table-stats th:nth-child(1),
#player .table-stats td:nth-child(1),
#goaler .table-stats th:nth-child(1),
#goaler .table-stats td:nth-child(1) {
    min-width: 115px;
}

#player .table-stats th:nth-child(2),
#player .table-stats td:nth-child(2),
#goaler .table-stats th:nth-child(2),
#goaler .table-stats td:nth-child(2) {
    min-width: 100px;
}

#player .table-stats th:nth-child(3),
#player .table-stats td:nth-child(3),
#goaler .table-stats th:nth-child(3),
#goaler .table-stats td:nth-child(3) {
    min-width: 90px;
}

#player .table-stats th:nth-child(4),
#player .table-stats td:nth-child(4),
#goaler .table-stats th:nth-child(4),
#goaler .table-stats td:nth-child(4) {
    min-width: 95px;
}

#player .table-stats th:nth-child(5),
#player .table-stats td:nth-child(5),
#goaler .table-stats th:nth-child(5),
#goaler .table-stats td:nth-child(5) {
    min-width: 130px;
}

#player .table-stats th:nth-child(n+6),
#player .table-stats td:nth-child(n+6),
#goaler .table-stats th:nth-child(n+6),
#goaler .table-stats td:nth-child(n+6) {
    min-width: 52px;
    padding: 4px 4px;
    text-align: center;
}

#player .table-stats tfoot td:nth-child(n+2),
#goaler .table-stats tfoot td:nth-child(n+2) {
    min-width: 52px;
    padding: 4px 4px;
    text-align: center;
}

#player .table-stats th.col-season,
#player .table-stats td.col-season,
#goaler .table-stats th.col-season,
#goaler .table-stats td.col-season {
    min-width: 75px;
}

#player .table-stats th.col-league,
#player .table-stats td.col-league,
#goaler .table-stats th.col-league,
#goaler .table-stats td.col-league {
    min-width: 75px;
}

#player .table-stats th.col-caliber,
#player .table-stats td.col-caliber,
#goaler .table-stats th.col-caliber,
#goaler .table-stats td.col-caliber {
    min-width: 65px;
}

#player .table-stats th a,
#player .table-stats td a,
#goaler .table-stats th a,
#goaler .table-stats td a {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.2;
    font-size: 12px;
}

/* Frozen columns are assigned dynamically by JS through .is-frozen-col */
.table-stats .is-frozen-col {
    position: sticky;
    background: #fff;
    background-clip: padding-box;
    box-shadow: 1px 0 0 #ddd;
    isolation: isolate;
}

/* Base z-index for frozen columns - actual values set dynamically by JS */
.table-stats tbody .is-frozen-col {
    z-index: 6;
}

.table-stats thead .is-frozen-col {
    z-index: 9;
}

.table-header-sticky .table-stats thead .is-frozen-col {
    z-index: 30;
}