.leaderboard-section {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-medium) 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.3), var(--shadow-lg);
    border: 2px solid var(--primary-color);
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.leaderboard-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-color));
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.leaderboard-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.leaderboard-header .season-select {
    margin-left: auto;
}

.leaderboard-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0 0;
    font-style: italic;
}

/* Clan Search Styles */
.clan-search-results {
    position: fixed;
    background: var(--bg-dark);
    border: 2px solid var(--bg-light);
    border-radius: calc(var(--border-radius) / 2);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 999999;
    margin-top: 0.25rem;
}

.clan-search-results-list {
    padding: 0.5rem 0;
}

.clan-search-result-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bg-light);
    transition: background-color 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.clan-search-result-item:last-child {
    border-bottom: none;
}

.clan-search-result-item:hover {
    background: var(--bg-medium);
    text-decoration: none;
    color: inherit;
}

.clan-search-result-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.clan-search-result-name strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.clan-badge {
    font-size: 1rem;
    opacity: 0.8;
    text-align: left;
}

.clan-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

.clan-search-loading,
.clan-search-error,
.clan-search-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.clan-search-error {
    color: var(--error-color);
}

.clan-search-empty {
    color: var(--text-muted);
}

/* Clan Page Styles */
.clan-name-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.clan-name-display h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.clan-tag-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
}

.clan-member-card {
    background: var(--bg-medium);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.clan-member-card::after {
    content: '';
    position: absolute;
    top: 65%;
    right: 1rem;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-image: url('../images/Icons/Item/Equipment/Headgear/Item_Head_G_00_Lv3_C.png');
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.15;
    pointer-events: none;
}

.clan-member-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.clan-member-info {
    margin-bottom: 0.5rem;
}

.clan-member-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
}

.clan-member-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.clan-member-adr,
.clan-member-bot-adr,
.clan-member-player-adr,
.clan-member-win-rate,
.clan-member-kd,
.clan-member-adr-label,
.clan-member-adr-value,
.clan-member-adr-breakdown {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.clan-member-adr {
    color: var(--accent-color);
}

.clan-member-bot-adr {
    color: #ff9800;
}

.clan-member-player-adr {
    color: #2196F3;
}

.clan-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.clan-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.clan-tag {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    display: inline-block;
}

/* Clan Leaderboard Table Styles */
#clan-leaderboard .leaderboard-table {
    margin-top: 0;
}

#clan-leaderboard .leaderboard-table th {
    text-align: center;
}

#clan-leaderboard .clan-badge {
    margin: 0;
}

#clan-leaderboard .leaderboard-table td {
    text-align: center;
}

/* Left-align the clan name column */
#clan-leaderboard .leaderboard-table td:nth-child(1) {
    text-align: left;
}

#clan-leaderboard .leaderboard-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.season-info {
    text-align: center;
    margin-bottom: 1rem;
}

.season-info #clan-season-display {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: inline-block;
}

.clan-member-adr-label {
    color: var(--accent-color);
    font-weight: 500;
}

.clan-member-adr-value {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
}

.clan-member-adr-breakdown {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-style: italic;
}

.clan-member-win-rate {
    color: #4CAF50;
}

.clan-member-kd {
    color: var(--text-secondary);
}

.clan-members-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: .5rem;
    justify-content: space-between;
}

.clan-members-controls label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.clan-sort-select {
    background: var(--bg-dark);
    border: 1px solid var(--bg-light);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-width: 140px;
}

.clan-sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.clan-sort-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.leaderboard-tabs-second-row {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.leaderboard-section-header {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.leaderboard-section-header:first-child {
    margin-top: 0;
}

.leaderboard-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    min-width: 200px;
    max-width: 100%;
    box-sizing: border-box;
}

.leaderboard-tab {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--bg-medium);
    color: var(--text-secondary);
    border: 2px solid var(--bg-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.leaderboard-tab:hover {
    background: var(--bg-light);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.leaderboard-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.leaderboard-tab .dsp-tab-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 0.5rem;
    display: inline-block;
}

.dsp-badge-small {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 0.5rem;
    display: inline-block;
}

.leaderboard-content {
    position: relative;
    min-height: 200px;
    view-transition-name: leaderboard-content;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.leaderboard-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.leaderboard-section .content-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 300px;
    /* Allow flex shrinking */
    overflow-x: auto;
    overflow-y: hidden;
    /* Allow horizontal scrolling for wide tables */
    position: relative;
}

.leaderboard-section .content-container.empty-state {
    display: block;
    justify-content: unset;
}

.leaderboard-section .content-container .loading {
    overflow: visible;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: auto;
    z-index: 1;
}

/* Empty state styling for content container */
.leaderboard-section .content-container.empty-state .loading {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    text-align: center;
    padding: 2rem;
}

.leaderboard-section .content-container.empty-state .loading>div {
    max-width: 600px;
    margin: 0 auto;
}

.leaderboard-section .content-container.empty-state .loading>div>div:first-child {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.leaderboard-section .content-container.empty-state .loading>div>div:nth-child(2) {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.load-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    gap: 1.5rem;
    width: 100%;
    min-height: 200px;
}

.load-prompt-note {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.8;
}

.leaderboard-table-wrapper,
.leaderboard-table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.leaderboard-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    display: table;
    margin: 0 auto;
    table-layout: auto;
}

.leaderboard-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    position: sticky;
    top: 0;
}

.leaderboard-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
    padding-right: 2rem;
}

.leaderboard-table th.sortable:hover {
    background-color: var(--bg-light);
}

.leaderboard-table th.sortable.active {
    background: #1a4f7a;
    color: white !important;
    font-weight: 600;
    border: 1px dashed white;
}

.leaderboard-table th {
    padding: 1rem;
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    vertical-align: middle;
    line-height: 1.5;
    display: table-cell;
}

.leaderboard-table th .sort-indicator {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 0.8em;
    line-height: 1;
}

.leaderboard-table th.kill-count {
    color: white !important;
}

.leaderboard-table th.damage {
    text-align: center;
}

.leaderboard-table th.weapons-looted-header {
    text-align: center;
}

.leaderboard-table th.rank {
    color: white !important;
    text-align: center;
    width: 60px;
    vertical-align: middle;
    line-height: 1.5;
    display: table-cell;
    padding-right: 2rem;
}

.leaderboard-table th:not(.rank):not(.kill-count):not(.damage):not(.games):not(.weapons-looted-header) {
    text-align: left !important;
}

.leaderboard-table td.rank {
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    width: 60px;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s ease;
}

.leaderboard-table tbody tr:hover {
    background: rgba(74, 144, 226, 0.2);
}

.leaderboard-table td {
    padding: 1rem;
    color: var(--text-primary);
}

.leaderboard-table td.rank {
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    width: 60px;
}

.leaderboard-table .kill-count {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--warning-color);
    text-align: center;
}

.leaderboard-table .damage {
    text-align: center;
    font-weight: 500;
}

.leaderboard-table .top-victim {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 200px;
}

.leaderboard-table .stat-value {
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.leaderboard-table .top-weapon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.leaderboard-table .top-weapon .weapon-icon-small {
    width: 28px;
    height: 28px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.dsp-badge-small {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 0.5rem;
    display: inline-block;
}

.player-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.victim-stats-blurbs {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.victim-blurb {
    display: flex;
    justify-content: center;
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex: 1;
    max-width: 500px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.victim-blurb .blurb-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    width: 100%;
}

.victim-blurb .blurb-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.victim-blurb .blurb-title strong {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.victim-blurb .victim-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.victim-blurb .victim-name:hover {
    color: var(--primary-color);
}

.victim-blurb .main-stat {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.victim-blurb:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.victim-blurb .emoji {
    font-size: 1.5rem;
    margin-right: 0.25rem;
    flex-shrink: 0;
}

.victim-blurb .blurb-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.victim-blurb strong {
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

.victim-blurb .victim-name {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.victim-blurb .victim-name:hover {
    color: var(--primary-color);
}

.victim-blurb .main-stat {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.victim-blurb .stat-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.victim-blurb .stat-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0.75rem;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    min-width: 80px;
    min-height: 70px;
}

.victim-blurb .stat-badge.weapon-badge {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
}

.victim-blurb .stat-badge.category-badge {
    background: rgba(255, 217, 61, 0.1);
    border-color: rgba(255, 217, 61, 0.3);
}

.victim-blurb .badge-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 0.5rem;
}

.victim-blurb .badge-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 40px;
}

.victim-blurb .badge-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-bottom: 0.25rem;
    flex-shrink: 0;
}

.victim-blurb .badge-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    word-break: break-word;
    text-align: center;
}

.tk-blurb {
    border-left-color: #ff6b6b;
}

.ff-blurb {
    border-left-color: #ffd93d;
}

@media (max-width: 768px) {
    .victim-stats-blurbs {
        flex-direction: column;
        align-items: center;
        padding: 1rem;
        margin-bottom: 1.5rem;
        gap: 0.75rem;
    }

    .victim-blurb {
        padding: 0.75rem 1rem;
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }

    .victim-blurb .blurb-content {
        gap: 0.25rem;
    }

    .victim-blurb .blurb-title {
        margin-bottom: 0.125rem;
    }

    .victim-blurb .blurb-title strong {
        font-size: 1rem;
        white-space: normal;
        word-break: break-word;
    }

    .victim-blurb .victim-name {
        font-size: 1.1rem;
        white-space: normal;
        word-break: break-word;
    }

    .victim-blurb .main-stat {
        font-size: 0.85rem;
        white-space: normal;
        word-break: break-word;
    }

    .victim-blurb .stat-badges {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
    }

    .victim-blurb .stat-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
        min-width: 70px;
        min-height: 60px;
    }

    .victim-blurb .badge-label {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }

    .victim-blurb .badge-content {
        min-height: 35px;
    }

    .victim-blurb .badge-icon {
        width: 20px;
        height: 20px;
        margin-bottom: 0.2rem;
    }

    .victim-blurb .badge-name {
        font-size: 0.75rem;
    }
}


.bot-leaderboard-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.bot-leaderboard-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    display: table;
    margin: 0 auto;
    table-layout: auto;
}

.bot-leaderboard-table thead {
    background: linear-gradient(135deg, #64c8ff, #96d9ff);
    position: sticky;
    top: 0;
}

.bot-leaderboard-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
    padding-right: 2rem;
}

.bot-leaderboard-table th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.bot-leaderboard-table th {
    padding: 1rem;
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    vertical-align: middle;
    line-height: 1.5;
    display: table-cell;
}

.bot-leaderboard-table th .sort-indicator {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 0.8em;
    line-height: 1;
}

.bot-leaderboard-table th.rank {
    color: white !important;
    text-align: center;
    width: 60px;
    vertical-align: middle;
    line-height: 1.5;
    display: table-cell;
    padding-right: 2rem;
}

.bot-leaderboard-table th.damage {
    text-align: center;
}

.bot-leaderboard-table th.games {
    text-align: center;
}

.bot-leaderboard-table th:not(.rank):not(.kill-count):not(.damage):not(.games) {
    text-align: left !important;
}

.bot-leaderboard-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s ease;
}

.bot-leaderboard-table tbody tr:hover {
    background: rgba(100, 200, 255, 0.2);
}

.bot-leaderboard-table td {
    padding: 1rem;
    color: var(--text-primary);
}

.bot-leaderboard-table td.rank {
    font-weight: bold;
    color: #64c8ff;
    text-align: center;
    width: 60px;
}

.bot-leaderboard-table .kill-count {
    font-weight: bold;
    font-size: 1.2rem;
    color: #64c8ff;
    text-align: center;
}

.bot-leaderboard-table .damage {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

.bot-leaderboard-table .games {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Clan Leaderboard Mobile Cards */
.clan-leaderboard-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.clan-card-mobile {
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.clan-card-mobile:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.clan-card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bg-light);
    text-align: center;
    position: relative;
}

.clan-card-header .clan-badge {
    margin: 0;
    text-align: center;
    display: block;
}

.clan-card-header .clan-badge-link {
    text-align: center;
    display: block;
}

.clan-card-header .clan-name {
    display: inline;
}

.clan-card-header .clan-tag {
    display: inline;
}

.clan-member-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-weight: 500;
}

.clan-member-count.highlighted-metric {
    color: var(--primary-color);
    font-weight: 600;
}

.clan-stat-item.highlighted-metric {
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
}

.clan-stat-item.highlighted-metric .clan-stat-value {
    color: var(--primary-color);
    font-weight: 600;
}

.clan-rank-mobile {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    min-width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-sort-controls {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--bg-medium);
}

.mobile-sort-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-sort-header label {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.mobile-sort-header .season-select {
    flex: 1;
    max-width: 200px;
}

/* Members column styling for desktop table */
.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
    text-align: center;
    min-width: 80px;
}

.clan-card-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.clan-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 0.5rem;
}

.clan-stat-row:nth-child(1),
.clan-stat-row:nth-child(2),
.clan-stat-row:nth-child(3) {
    grid-template-columns: repeat(3, 1fr);
}

.clan-player-stats {
    margin-top: 0.5rem;
}

.clan-bot-stats {
    margin-top: 0.5rem;
}

.clan-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: calc(var(--border-radius) / 2);
}

.clan-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.clan-stat-value {
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Desktop: hide mobile cards, show table */
@media (min-width: 769px) {
    #clan-leaderboard-desktop {
        display: block !important;
    }

    #clan-leaderboard-mobile {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .leaderboard-section {
        padding: 1rem 0.75rem;
        margin-bottom: 1.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        /* Prevent card from overflowing */
    }

    /* Hide desktop table and show mobile cards on mobile */
    #clan-leaderboard-desktop {
        display: none !important;
    }

    #clan-leaderboard-mobile {
        display: block !important;
        width: 100%;
    }

    .clan-stat-row:nth-child(1),
    .clan-stat-row:nth-child(2),
    .clan-stat-row:nth-child(3) {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.2rem;
    }

    .clan-stat-item {
        padding: 0.4rem;
    }

    .clan-player-stats {
        margin-top: 0.25rem;
    }

    .clan-bot-stats {
        margin-top: 0.25rem;
    }

    .clan-stat-item {
        padding: 0.4rem;
    }

    .clan-stat-label {
        font-size: 0.7rem;
    }

    .clan-stat-value {
        font-size: 0.9rem;
    }

    .leaderboard-header {
        justify-content: center;
        margin-bottom: 0.75rem;
    }

    .leaderboard-header .season-select {
        width: fit-content;
    }

    .leaderboard-tabs {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .leaderboard-tab {
        width: 100%;
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
        box-sizing: border-box;
    }

    .leaderboard-content {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        /* Prevent content from overflowing */
        box-sizing: border-box;
    }

    .leaderboard-table-wrapper,
    .leaderboard-table-container,
    .bot-leaderboard-table-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        /* Prevent horizontal scroll from affecting parent */
        position: relative;
        /* Ensure wrapper doesn't expand beyond container */
        min-width: 0;
        /* Contain layout to prevent expansion */
        contain: layout style;
    }

    .leaderboard-table,
    .bot-leaderboard-table {
        font-size: 0.75rem;
        min-width: 480px;
        /* Minimum width for table content */
        width: auto;
        display: table;
        /* Prevent table from forcing parent to expand */
        table-layout: auto;
        box-sizing: border-box;
    }

    .leaderboard-table th,
    .leaderboard-table td,
    .bot-leaderboard-table th,
    .bot-leaderboard-table td {
        padding: 0.5rem 0.4rem;
    }

    .leaderboard-table th,
    .bot-leaderboard-table th {
        font-size: 0.65rem;
        letter-spacing: 0.5px;
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100px;
    }

    .leaderboard-table .rank,
    .bot-leaderboard-table .rank {
        width: 40px;
    }

    .leaderboard-table .kill-count,
    .bot-leaderboard-table .kill-count {
        font-size: 1rem;
    }

    .leaderboard-table .top-victim {
        max-width: 150px;
        font-size: 0.85rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .player-name {
        font-size: 0.95rem;
    }

    .leaderboard-table .rank-column,
    .leaderboard-table .player-column,
    .leaderboard-table .games-column,
    .leaderboard-table .per-game-column,
    .leaderboard-table .damage-column {
        font-size: 0.85rem;
    }

    .leaderboard-table .top-weapon {
        font-size: 0.8rem;
    }

    .leaderboard-table .top-weapon .weapon-icon-small {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {

    .leaderboard-table th,
    .bot-leaderboard-table th {
        font-size: 0.6rem;
        letter-spacing: 0.3px;
        padding: 0.4rem 0.25rem;
        max-width: 80px;
    }

    .leaderboard-table td,
    .bot-leaderboard-table td {
        padding: 0.4rem 0.25rem;
        font-size: 0.85rem;
    }

    .leaderboard-table,
    .bot-leaderboard-table {
        min-width: 400px;
        font-size: 0.8rem;
    }

    .leaderboard-table .rank-column,
    .leaderboard-table .player-column,
    .leaderboard-table .games-column,
    .leaderboard-table .per-game-column,
    .leaderboard-table .damage-column {
        font-size: 0.75rem;
        padding: 0.35rem 0.2rem;
    }

    .leaderboard-table .top-weapon {
        font-size: 0.75rem;
    }

    .leaderboard-table .top-weapon .weapon-icon-small {
        width: 18px;
        height: 18px;
    }

    .leaderboard-tab {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* Clan cards on very small screens */
    .clan-stat-row:nth-child(1),
    .clan-stat-row:nth-child(2),
    .clan-stat-row:nth-child(3) {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.2rem;
    }

    .clan-stat-item {
        padding: 0.3rem;
    }

    .clan-stat-label {
        font-size: 0.65rem;
    }

    .clan-stat-value {
        font-size: 0.8rem;
    }

    .clan-player-stats {
        margin-top: 0.25rem;
    }

    .clan-bot-stats {
        margin-top: 0.25rem;
    }
}

/* Weapon Selection Interface */
.weapon-selection {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-medium) 50%, var(--bg-light) 100%);
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.weapon-selection h3 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.weapon-selector {
    background: var(--bg-light);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--primary-color);
    max-width: 400px;
    margin: 0 auto;
}

.weapon-selector .weapon-filter {
    padding: 0.75rem 2rem 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-light);
    color: var(--text-primary);
    font-size: 1rem;
    min-width: 250px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;

    /* 2025-2026 CSS: Customizable Select styling */
    appearance: base-select;

    /* Style the picker/dropdown */
    &::picker(select) {
        background: var(--bg-medium);
        border: 2px solid var(--primary-color);
        border-radius: var(--border-radius-sm);
        box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
        transition: display allow-discrete 1s, opacity 1s, overlay 1s allow-discrete;
        opacity: 0;
    }

    /* Show picker when open */
    &:open::picker(select) {
        opacity: 1;

        @starting-style {
            opacity: 0;
        }
    }

    /* Hide picker when not open */
    &:not(:open)::picker(select) {
        opacity: 0;
    }

    /* Style the button/chevron */
    &::button {
        background: none;
        border: none;
        cursor: pointer;
        width: 1.5rem;
        height: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Custom chevron using CSS */
    &::button::after {
        content: '';
        width: 0;
        height: 0;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 6px solid var(--text-primary);
        transition: transform 0.2s ease;
    }

    /* Rotate chevron when open */
    &:open::button::after {
        transform: rotate(180deg);
    }
}

.weapon-selector .weapon-filter:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-medium);
}

.weapon-selector .weapon-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* Weapon option icons in dropdown */
.weapon-option-icon {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    vertical-align: middle;
    object-fit: contain;
}

/* 2025-2026 CSS: Style individual options in the picker */
.weapon-selector .weapon-filter::picker(select) option {
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.weapon-selector .weapon-filter::picker(select) option:hover {
    background: var(--bg-medium);
}

.weapon-selector .weapon-filter::picker(select) option:checked {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Style selected option in the button */
.weapon-selector .weapon-filter::selectedoption {
    color: var(--text-primary);
    font-weight: 500;
}

/* Map Stats Modal */
.map-stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.map-stats-modal-content {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 0;
    max-width: 1200px;
    max-height: 90vh;
    width: 100%;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-stats-modal-header {
    padding: 2rem 3rem 1rem 3rem;
    flex-shrink: 0;
    border-bottom: 1px solid var(--bg-medium);
    background: var(--bg-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-stats-modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.map-stats-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
}

.map-stats-modal-close:hover {
    background: var(--bg-medium);
    color: var(--primary-color);
}

.map-stats-modal-body {
    overflow-y: auto;
    padding: 2rem 3rem;
    max-height: calc(90vh - 120px);
}

@media (max-width: 768px) {
    .map-stats-modal {
        padding: 0;
        align-items: stretch;
        justify-content: flex-start;
    }

    .map-stats-modal-content {
        padding: 0;
        margin: 0;
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .map-stats-modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }

    .map-stats-modal-body {
        padding: 1.5rem;
        max-height: calc(100vh - 100px);
    }
}