/* ==================== GENERAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-page);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== PAGE TITLE ==================== */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin: 30px 0 10px 0;
    color: var(--text-dark);
}

/* ==================== BREADCRUMB NAVIGATION ==================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breadcrumb-item {
    cursor: pointer;
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: var(--danger);
}

.breadcrumb-item.active {
    color: var(--danger);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--border-gray);
}

/* ==================== VIEW CONTAINERS ==================== */
.view-container {
    margin-top: 30px;
}

/* ==================== POOL LIST VIEW (Level 1) ==================== */
.pool-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pool-card {
    background: var(--card-white);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pool-card:hover {
    border-color: var(--danger);
    box-shadow: 0 4px 16px rgba(255, 46, 46, 0.15);
    transform: translateY(-2px);
}

.pool-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

/* Pool image thumbnail replacing the hockey-puck icon */
.pool-card-img {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}
.pool-card-img-placeholder { opacity: 0.5; }

.pool-info {
    flex: 1;
    min-width: 0;
}

.pool-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.pool-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pool-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.pool-badge.type-h2h {
    background: rgba(33, 150, 243, 0.15);
    color: #64B5F6;
}

.pool-badge.type-cumulative {
    background: rgba(156, 39, 176, 0.15);
    color: #CE93D8;
}

.pool-badge.players {
    background: rgba(0, 230, 118, 0.12);
    color: var(--success);
}

.pool-arrow {
    font-size: 1.5rem;
    color: var(--border-gray);
    transition: transform 0.3s ease;
}

.pool-card:hover .pool-arrow {
    transform: translateX(5px);
    color: var(--danger);
}

/* ==================== STANDINGS VIEW (Level 2) ==================== */
.standings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.standing-card {
    background: var(--card-white);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.standing-card:hover {
    border-color: var(--danger);
    box-shadow: 0 4px 16px rgba(255, 46, 46, 0.15);
    transform: translateY(-2px);
}

.standing-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.rank-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--card-white);
    flex-shrink: 0;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, var(--text-light-gray)999 100%);
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.4);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
}

.rank-badge.rank-other {
    background: var(--text-main);
    color: var(--text-secondary);
}

.standing-info {
    flex: 1;
    min-width: 0;
}

.standing-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.standing-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
}

.stats-row-top {
    display: flex;
    gap: 12px;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.stats-row-top span {
    min-width: 35px;
    text-align: center;
}

.stats-row-bottom {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-light-gray);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stats-row-bottom span {
    min-width: 35px;
    text-align: center;
}

.standing-points {
    text-align: center;
    min-width: 80px;
}

.points-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--danger);
    line-height: 1;
}

.points-label {
    font-size: 0.75rem;
    color: var(--text-light-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.standing-arrow {
    font-size: 1.5rem;
    color: var(--border-gray);
    transition: transform 0.3s ease;
}

.standing-card:hover .standing-arrow {
    transform: translateX(5px);
    color: var(--danger);
}

/* ==================== ROSTER VIEW (Level 3) ==================== */
.roster-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roster-card {
    background: var(--card-white);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    border: 2px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.roster-card.clickable {
    cursor: pointer;
}

.roster-card.clickable:hover {
    background: var(--bg-hover);
    border-color: var(--danger);
    box-shadow: 0 4px 12px rgba(255, 46, 46, 0.15);
    transform: translateY(-2px);
}

.pick-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 25px;
    text-align: left;
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-page);
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-avatar .no-photo {
    font-size: 1.2rem;
    color: var(--text-light-gray);
}

.roster-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.player-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.player-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
}

.player-team-abbrev {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(156, 163, 175, 0.1);
    border-radius: 4px;
}

.player-position {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 2px 6px;
    background: rgba(156, 163, 175, 0.1);
    border-radius: 4px;
}

.player-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-stats-grid .stats-row-top {
    display: flex;
    gap: 10px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.player-stats-grid .stats-row-top span {
    min-width: 30px;
    text-align: left;
}

.player-stats-grid .stats-row-bottom {
    display: flex;
    gap: 10px;
    font-size: 0.7rem;
    color: var(--text-light-gray);
}

.player-stats-grid .stats-row-bottom span {
    min-width: 30px;
    text-align: left;
}

.roster-points-section {
    text-align: center;
    min-width: 50px;
}

.pptsa-value,
.ppts-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.pptsa-label,
.ppts-label {
    font-size: 0.65rem;
    color: var(--text-light-gray);
    margin-top: 2px;
}

.roster-arrow {
    font-size: 1.5rem;
    color: var(--border-gray);
    transition: transform 0.3s ease;
}

.roster-card:hover .roster-arrow {
    transform: translateX(3px);
    color: var(--text-light-gray);
}

/* ==================== SKELETON LOADERS ==================== */
.skeleton-loader {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, var(--text-main) 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Pool Card Skeleton */
.pool-card-skeleton {
    background: var(--card-white);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.skeleton-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, var(--text-main) 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-title {
    width: 60%;
    height: 20px;
}

.skeleton-subtitle {
    width: 40%;
    height: 16px;
}

/* Standing Card Skeleton */
.standing-card-skeleton {
    background: var(--card-white);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.skeleton-rank {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, var(--text-main) 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-name {
    width: 50%;
    height: 20px;
}

.skeleton-stats {
    width: 70%;
    height: 16px;
}

.skeleton-points {
    width: 80px;
    height: 40px;
}

/* Roster Card Skeleton */
.roster-card-skeleton {
    background: var(--card-white);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, var(--text-main) 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-player-name {
    width: 50%;
    height: 18px;
}

.skeleton-player-stats {
    width: 60%;
    height: 14px;
}

.skeleton-player-points {
    width: 70px;
    height: 35px;
}

/* ==================== MODAL STYLES ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--card-white);
    margin: 5% auto;
    width: 90%;
    max-width: 1200px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.career-modal {
    max-height: 90vh;
    overflow-y: auto;
}

.career-modal-header {
    background: linear-gradient(160deg, #c0392b 0%, #FF4757 100%);
    color: #fff;
    padding: 22px 24px 20px;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 14px;
    top: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 6px;
    z-index: 2;
}

.close-modal:hover {
    color: #fff;
    background: rgba(0,0,0,0.15);
}

/* Photo + info side by side */
.player-header-top {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.player-headshot-container {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.12);
    flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.player-headshot-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.player-headshot-container .no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

/* Right column: name + bio grid */
.player-header-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 4px;
}

.player-name-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.player-name-section h2 {
    font-size: clamp(1.3rem, 3vw, 2rem);
    margin: 0;
    line-height: 1.1;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-position-team {
    font-size: 0.88rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Bio pills: horizontal wrapping chips next to the photo */
.player-bio-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: flex-start;
}

.bio-pill {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 7px;
    padding: 5px 10px;
}

.bio-pill-lbl {
    font-size: 0.56rem;
    opacity: 0.72;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.bio-pill-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* Draft strip: full width below photo + pills */
.player-draft-strip {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 12px;
    background: rgba(0,0,0,0.20);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    flex-wrap: wrap;
}

.draft-label {
    font-size: 0.56rem;
    opacity: 0.72;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.draft-value {
    font-size: 0.80rem;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    line-height: 1.3;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.career-filters {
    display: flex;
    gap: 20px;
    padding: 20px 30px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--text-main);
    flex-wrap: wrap;
}

.filter-group-career {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group-career label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group-career select {
    padding: 8px 12px;
    border: 2px solid var(--text-main);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--card-white);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-group-career select:hover {
    border-color: var(--danger);
}

.stats-count-badge {
    margin-left: auto;
    padding: 8px 16px;
    background: var(--danger);
    color: var(--card-white);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    align-self: center;
}

#careerStatsTable {
    padding: 0 16px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#careerStatsTable table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    min-width: 480px;
}

#careerStatsTable thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

#careerStatsTable th {
    background-color: #FF4757;
    color: #fff;
    padding: 10px 10px;
    text-align: right;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
}

#careerStatsTable th.season-col { text-align: left; padding-left: 14px; min-width: 80px; }
#careerStatsTable th.league-col { text-align: left; min-width: 48px; }
#careerStatsTable th.team-col   { text-align: center; width: 54px; max-width: 54px; min-width: 54px; }

#careerStatsTable td {
    padding: 9px 10px;
    text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.875rem;
    white-space: nowrap;
}

#careerStatsTable tbody tr:hover {
    background: rgba(255,255,255,0.04);
}

#careerStatsTable .season-col {
    text-align: left;
    padding-left: 14px;
    font-weight: 700;
    color: #fff;
}

#careerStatsTable .league-col {
    text-align: left;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
}

#careerStatsTable .team-col {
    text-align: center;
    padding: 6px 4px;
}

#careerStatsTable td.team-col {
    width: 54px;
    max-width: 54px;
    min-width: 54px;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: break-word;
    font-size: clamp(0.58rem, 1.2vw, 0.72rem);
    line-height: 1.2;
    overflow: hidden;
}

#careerStatsTable .team-col img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    vertical-align: middle;
    display: block;
    margin: 0 auto;
}

#careerStatsTable .career-totals-row {
    background: rgba(255, 71, 87, 0.12);
    border-top: 2px solid rgba(255, 71, 87, 0.4);
}

#careerStatsTable .career-totals-row td {
    font-weight: 800;
    text-align: right;
}

#careerStatsTable .career-totals-label {
    text-align: left !important;
    color: #FF4757;
    padding-left: 14px;
}

.no-stats-message {
    text-align: center;
    padding: 40px;
    color: var(--text-light-gray);
    font-size: 1.1rem;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Bio grid: scale down when viewport narrows before the 768px breakpoint */
@media (max-width: 900px) {
    .player-header-top {
        gap: 14px;
    }

    .player-headshot-container {
        width: 100px;
        height: 100px;
    }

    .player-bio-pills {
        gap: 4px;
    }

    .bio-pill {
        padding: 4px 8px;
    }

    .bio-pill-val {
        font-size: 0.76rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .page-title {
        font-size: 1.6rem;
    }

    .pool-card, .standing-card {
        padding: 16px;
        gap: 15px;
    }

    .pool-icon, .rank-badge {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .pool-name, .standing-name {
        font-size: 1.1rem;
    }

    .stats-row-top {
        gap: 10px;
        font-size: 1rem;
    }

    .stats-row-top span {
        min-width: 30px;
    }

    .stats-row-bottom {
        gap: 10px;
    }

    .stats-row-bottom span {
        min-width: 30px;
    }

    .points-value {
        font-size: 1.6rem;
    }

    .roster-card {
        padding: 10px 12px;
        gap: 10px;
    }

    .pick-number {
        font-size: 1rem;
        min-width: 20px;
    }

    .player-avatar {
        width: 45px;
        height: 45px;
    }

    .player-name {
        font-size: 0.95rem;
    }

    .player-stats-grid .stats-row-top {
        gap: 8px;
        font-size: 0.9rem;
    }

    .player-stats-grid .stats-row-top span {
        min-width: 28px;
    }

    .player-stats-grid .stats-row-bottom {
        gap: 8px;
    }

    .player-stats-grid .stats-row-bottom span {
        min-width: 28px;
    }

    .roster-points-section {
        min-width: 45px;
    }

    .pptsa-value,
    .ppts-value {
        font-size: 1.1rem;
    }

    .career-modal-header {
        padding: 16px;
    }

    .player-header-top {
        gap: 14px;
    }

    .player-headshot-container {
        width: 90px;
        height: 90px;
    }

    .player-bio-pills {
        gap: 4px;
    }

    .bio-pill-val {
        font-size: 0.74rem;
    }

    .career-filters {
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
    }

    .stats-count-badge {
        margin-left: 0;
        text-align: center;
    }

    #careerStatsTable {
        padding: 0 8px 12px;
    }

    #careerStatsTable table {
        font-size: 0.8rem;
    }

    #careerStatsTable th,
    #careerStatsTable td {
        padding: 8px 6px;
    }
}

/* On very small screens, stack photo + info vertically */
@media (max-width: 500px) {
    .player-header-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .player-headshot-container {
        width: 100px;
        height: 100px;
    }
    .player-header-right {
        width: 100%;
        align-items: center;
    }
    .player-name-section {
        align-items: center;
    }
    .player-position-team {
        justify-content: center;
    }
    .player-bio-pills {
        width: 100%;
        justify-content: center;
    }

    .player-draft-strip {
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .pool-meta {
        gap: 8px;
    }

    .pool-badge {
        font-size: 0.75rem;
        padding: 3px 10px;
    }

    .stats-row-top {
        gap: 8px;
        font-size: 0.95rem;
    }

    .stats-row-top span {
        min-width: 28px;
    }

    .stats-row-bottom {
        gap: 8px;
        font-size: 0.7rem;
    }

    .stats-row-bottom span {
        min-width: 28px;
    }

    .roster-card {
        padding: 8px 10px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .pick-number {
        font-size: 0.9rem;
        min-width: 18px;
    }

    .player-avatar {
        width: 40px;
        height: 40px;
    }

    .player-name {
        font-size: 0.9rem;
    }

    .player-team-abbrev,
    .player-position {
        font-size: 0.75rem;
    }

    .player-stats-grid .stats-row-top {
        gap: 6px;
        font-size: 0.85rem;
    }

    .player-stats-grid .stats-row-top span {
        min-width: 24px;
    }

    .player-stats-grid .stats-row-bottom {
        gap: 6px;
        font-size: 0.65rem;
    }

    .player-stats-grid .stats-row-bottom span {
        min-width: 24px;
    }

    .roster-points-section {
        min-width: 40px;
    }

    .pptsa-value,
    .ppts-value {
        font-size: 1rem;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .h2h-player-name {
        max-width: 90px;
    }
}

/* ==================== H2H STYLES ==================== */

/* H2H Tabs */
.h2h-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(15, 15, 40, 0.6);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,0.08);
}

.h2h-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.h2h-tab:hover {
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.05);
}

.h2h-tab.active {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

/* Period filter (Aujourd'hui / Semaine) */
.h2h-period-filter {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
}

.h2h-period-btn {
    padding: 6px 20px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: rgba(255,255,255,0.45);
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.18s ease;
    letter-spacing: 0.3px;
}

.h2h-period-btn:hover {
    color: rgba(255,255,255,0.8);
    border-color: rgba(255,255,255,0.25);
}

.h2h-period-btn.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
    color: #00d4ff;
}

/* Week Header */
.h2h-week-header {
    text-align: center;
    margin-bottom: 20px;
}

.h2h-week-label {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.h2h-week-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.h2h-week-status.status-upcoming {
    background: rgba(156, 39, 176, 0.2);
    color: #CE93D8;
    border: 1px solid rgba(206, 147, 216, 0.3);
}

.h2h-week-status.status-ongoing {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
    animation: pulse-ongoing 2s ease-in-out infinite;
}

.h2h-week-status.status-completed {
    background: rgba(0, 230, 118, 0.2);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.h2h-week-status.status-awaiting {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

@keyframes pulse-ongoing {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.h2h-week-dates {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}

/* Matchup Cards */
.h2h-matchups-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Matchup card — vertical layout */
.h2h-matchup-card {
    background: rgba(20, 20, 48, 0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.h2h-matchup-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
}

/* Scoreboard header */
.h2h-matchup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(0,0,0,0.25);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.h2h-header-team {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.h2h-header-team.right {
    align-items: flex-end;
}

.h2h-header-team-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.h2h-header-team.leading .h2h-header-team-name {
    color: #00e676;
}

.h2h-header-score {
    font-size: 2rem;
    font-weight: 900;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.75);
    line-height: 1.1;
}

.h2h-header-score.leading {
    color: #00e676;
    text-shadow: 0 0 12px rgba(0, 230, 118, 0.35);
}

.h2h-header-vs {
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(255,255,255,0.2);
    letter-spacing: 1px;
    padding: 0 12px;
    flex-shrink: 0;
}

/* Player list */
.h2h-players-list {
    padding: 8px 0 4px;
}

.h2h-players-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    padding: 4px 14px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.25);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 2px;
}

.h2h-players-header span:last-child {
    text-align: right;
}

.h2h-players-header span:nth-child(2) {
    text-align: center;
    padding: 0 8px;
}

.h2h-player-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 5px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}

.h2h-player-row:last-child {
    border-bottom: none;
}

.h2h-player-row:hover {
    background: rgba(255,255,255,0.03);
}

.h2h-player-left,
.h2h-player-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.h2h-player-left {
    flex-direction: row;
}

/* right: photo first in DOM → appears left of text, then justify pushes photo to far right */
.h2h-player-right {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.h2h-player-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}

.h2h-player-photo-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.h2h-player-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.h2h-player-info.right {
    align-items: flex-end;
    text-align: right;
}

.h2h-player-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.h2h-player-sub {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.3);
    white-space: nowrap;
}

.h2h-player-winning .h2h-player-name {
    color: #00e676;
}

.h2h-team-record {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

.h2h-player-pts-block {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    flex-shrink: 0;
}

.h2h-player-pts {
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Bebas Neue', sans-serif;
    color: rgba(255,255,255,0.45);
    min-width: 32px;
    text-align: center;
}

.h2h-pts-leading {
    color: #00e676;
}

.h2h-player-sep {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.15);
}

.h2h-no-players {
    text-align: center;
    padding: 16px;
    color: rgba(255,255,255,0.25);
    font-size: 0.82rem;
}

/* Empty / Loading */
.h2h-loading,
.h2h-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255,255,255,0.4);
    font-size: 0.95rem;
}

/* History */
.h2h-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.h2h-history-week {
    background: rgba(20, 20, 48, 0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
}

.h2h-history-week.collapsed .h2h-history-body {
    display: none;
}

.h2h-history-week.collapsed .h2h-history-chevron {
    transform: rotate(-90deg);
}

.h2h-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.h2h-history-header:hover {
    background: rgba(255,255,255,0.03);
}

.h2h-history-title {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
}

.h2h-history-dates {
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
}

.h2h-history-chevron {
    color: rgba(255,255,255,0.3);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.h2h-history-body {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 12px 18px;
}

.h2h-history-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.h2h-history-matchup:last-child {
    border-bottom: none;
}

.h2h-hist-team {
    flex: 1;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

.h2h-hist-team:last-child {
    text-align: right;
}

.h2h-hist-team.winner {
    color: #00e676;
    font-weight: 700;
}

.h2h-hist-score {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    flex-shrink: 0;
    padding: 0 12px;
}

.h2h-hist-score .winner {
    color: #00e676;
}

.h2h-hist-sep {
    color: rgba(255,255,255,0.2);
}

/* ============================================================ */
/* LIGHT MODE — hardcoded rgba overrides                         */
/* ============================================================ */

/* --- H2H Tabs --- */
html[data-theme="light"] .h2h-tabs {
    background: rgba(224, 229, 248, 0.85);
    border-color: rgba(0,0,0,0.08);
}
html[data-theme="light"] .h2h-tab {
    color: rgba(30,40,100,0.5);
}
html[data-theme="light"] .h2h-tab:hover {
    color: rgba(30,40,100,0.8);
    background: rgba(0,0,0,0.04);
}
html[data-theme="light"] .h2h-tab.active {
    background: rgba(0,136,170,0.15);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(0,136,170,0.1);
}

/* --- H2H Period filter --- */
html[data-theme="light"] .h2h-period-btn {
    border-color: rgba(0,0,0,0.12);
    color: rgba(30,40,100,0.45);
}
html[data-theme="light"] .h2h-period-btn:hover {
    color: rgba(30,40,100,0.8);
    border-color: rgba(0,0,0,0.25);
}
html[data-theme="light"] .h2h-period-btn.active {
    background: rgba(0,136,170,0.12);
    border-color: rgba(0,136,170,0.35);
    color: var(--primary);
}

/* --- H2H Week header --- */
html[data-theme="light"] .h2h-week-label {
    color: var(--text-main);
}
html[data-theme="light"] .h2h-week-dates {
    color: var(--text-secondary);
}

/* --- H2H Matchup cards --- */
html[data-theme="light"] .h2h-matchup-card {
    background: rgba(240, 244, 255, 0.92);
    border-color: rgba(0,0,0,0.08);
}
html[data-theme="light"] .h2h-matchup-card:hover {
    border-color: rgba(0,136,170,0.3);
}
html[data-theme="light"] .h2h-matchup-header {
    background: rgba(0,0,0,0.04);
    border-bottom-color: rgba(0,0,0,0.06);
}
html[data-theme="light"] .h2h-header-team-name {
    color: rgba(30,40,100,0.6);
}
html[data-theme="light"] .h2h-header-score {
    color: rgba(30,40,100,0.8);
}
html[data-theme="light"] .h2h-header-vs {
    color: rgba(30,40,100,0.2);
}

/* --- H2H Player rows --- */
html[data-theme="light"] .h2h-players-header {
    color: rgba(30,40,100,0.35);
    border-bottom-color: rgba(0,0,0,0.05);
}
html[data-theme="light"] .h2h-player-row {
    border-bottom-color: rgba(0,0,0,0.04);
}
html[data-theme="light"] .h2h-player-row:hover {
    background: rgba(0,0,0,0.02);
}
html[data-theme="light"] .h2h-player-name {
    color: rgba(30,40,100,0.8);
}
html[data-theme="light"] .h2h-player-sub,
html[data-theme="light"] .h2h-team-record {
    color: rgba(30,40,100,0.4);
}
html[data-theme="light"] .h2h-player-pts {
    color: rgba(30,40,100,0.5);
}
html[data-theme="light"] .h2h-player-sep {
    color: rgba(30,40,100,0.15);
}
html[data-theme="light"] .h2h-player-photo {
    background: rgba(0,0,0,0.06);
}
html[data-theme="light"] .h2h-player-photo-placeholder {
    background: rgba(0,0,0,0.07);
}
html[data-theme="light"] .h2h-no-players,
html[data-theme="light"] .h2h-loading,
html[data-theme="light"] .h2h-empty {
    color: rgba(30,40,100,0.35);
}

/* --- H2H History --- */
html[data-theme="light"] .h2h-history-week {
    background: rgba(240, 244, 255, 0.92);
    border-color: rgba(0,0,0,0.08);
}
html[data-theme="light"] .h2h-history-header:hover {
    background: rgba(0,0,0,0.025);
}
html[data-theme="light"] .h2h-history-title {
    color: var(--text-main);
}
html[data-theme="light"] .h2h-history-dates,
html[data-theme="light"] .h2h-history-chevron {
    color: rgba(30,40,100,0.4);
}
html[data-theme="light"] .h2h-history-body {
    border-top-color: rgba(0,0,0,0.06);
}
html[data-theme="light"] .h2h-history-matchup {
    border-bottom-color: rgba(0,0,0,0.04);
}
html[data-theme="light"] .h2h-hist-team {
    color: rgba(30,40,100,0.65);
}
html[data-theme="light"] .h2h-hist-score {
    color: rgba(30,40,100,0.55);
}
html[data-theme="light"] .h2h-hist-sep {
    color: rgba(30,40,100,0.2);
}

/* --- Career stats table (classement.css version) --- */
html[data-theme="light"] #careerStatsTable td {
    border-bottom-color: rgba(0,0,0,0.06);
}
html[data-theme="light"] #careerStatsTable tbody tr:hover {
    background: rgba(0,0,0,0.03) !important;
}
html[data-theme="light"] #careerStatsTable .season-col {
    color: var(--text-main);
}
html[data-theme="light"] #careerStatsTable .league-col {
    color: var(--text-secondary);
}

/* --- Skeleton loaders (classement.css) use #f0f0f0 which already works on light bg --- */
/* Fix for dark mode: override to dark-friendly shades */
html[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.10) 50%, rgba(255,255,255,.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
