.stats-section {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.stats-section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.8rem;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat-value {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: bold;
}

.stat-meta {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.player-stats-section {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    position: relative;
    z-index: 1;
}

#player-stats-container {
    width: 100%;
}

#player-stats-container .content-container {
    width: 100%;
}

.player-stats-section h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.6rem;
    text-align: center;
}

.player-stats-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.player-stats-tab {
    background: var(--bg-light);
    border: 2px solid var(--bg-light);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-stats-tab:hover {
    background: var(--bg-light);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.player-stats-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.player-stats-panel {
    width: 100%;
    display: none;
}

/* Show DSP Players panel by default (it's the active tab on load) */
#dsp-players-panel {
    display: block;
}

/* Selector panels should use block display */
#other-players-panel,
#add-player-panel {
    display: none;
}

#dsp-players-panel[style*="display: block"],
#dsp-players-panel[style*="display:block"] {
    display: block !important;
}

#other-players-panel[style*="display: block"],
#other-players-panel[style*="display:block"] {
    display: block !important;
}

#add-player-panel[style*="display: block"],
#add-player-panel[style*="display:block"] {
    display: block !important;
}

/* Content panels (inside player cards) should use grid display */
#player-stats-overview-panel,
#player-stats-weapons-panel,
#player-stats-drop-spots-panel,
#player-stats-previous-names-panel {
    display: none;
}

#player-stats-overview-panel[style*="display: grid"],
#player-stats-overview-panel[style*="display:block"] {
    display: grid !important;
}

#player-stats-weapons-panel[style*="display: grid"],
#player-stats-weapons-panel[style*="display:block"] {
    display: grid !important;
}

#player-stats-drop-spots-panel[style*="display: grid"],
#player-stats-drop-spots-panel[style*="display:block"],
#player-stats-previous-names-panel[style*="display: grid"],
#player-stats-previous-names-panel[style*="display:block"] {
    display: grid !important;
}

#player-stats-overview-panel {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
}

#player-stats-weapons-panel,
#player-stats-drop-spots-panel,
#player-stats-previous-names-panel {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
}

@media (max-width: 768px) {
    #player-stats-overview-panel {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

.player-stats-controls {
    display: flex;
    justify-content: center;
    margin-bottom: .5rem;
}

.player-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 1200px;
    margin-top: 1rem;
}

.player-selector-grid:has(.loading) {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.player-selector-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid transparent;
    background: var(--bg-medium);
    box-shadow: var(--shadow);
    contain: layout;
}

.player-selector-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* Removed selected style - the moving avatar makes it obvious which player is selected */

.player-card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.player-selector-card:hover .player-card-background {
    opacity: 0.8;
}

.player-selector-card.selected .player-card-background {
    opacity: 0.9;
}

.player-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
}

.player-card-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
    gap: 0.25rem;
}

.ban-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ban-badge-temp {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.ban-badge-permanent {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.4);
}

.player-card-name {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    word-break: break-word;
    line-height: 1.3;
    text-align: center;
}

.player-card-badges {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-top: 2px;
    min-height: 8px;
}

.player-card-badges .season-award-badge .bot-hunter-badge {
    width: 28px;
    height: 28px;
}

.player-card-badges .season-award-badge .season-overlay {
    font-size: 7px;
    padding: 0px 2px;
}

/* Hide text when avatar is in stats card */
.player-header-avatar .player-card-content,
.player-header-avatar .player-card-name {
    display: none;
}

@media (max-width: 768px) {
    .player-selector-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .player-card-name {
        font-size: 0.8rem;
    }

    .player-card-badges .season-award-badge .bot-hunter-badge {
        width: 24px;
        height: 24px;
    }

    .player-card-badges .season-award-badge .season-overlay {
        font-size: 6px;
        padding: 0px 1px;
    }
}

.player-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}

.player-stat-card {
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    contain: layout;
    position: relative;
}


.player-stat-header {
    border-bottom: 1px solid var(--bg-light);
    padding-bottom: 0.35rem;
    margin-bottom: 0.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: center;
}

.player-header-section {
    display: flex;
    flex-direction: column;
}

.player-header-info {
    min-width: 0;
}

.player-header-graphs {
    min-width: 0;
}

.player-header-graphs-row {
    border-bottom: 1px solid var(--bg-light);
    padding-bottom: 0.75rem;
    margin-top: 3rem;
    margin-bottom: 0.5rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.player-header-stats {
    min-width: 0;
}

.player-header-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow);
    aspect-ratio: 1;
    contain: layout;
}

/* Slow down view transition animation for avatar movement */
::view-transition-group(player-avatar-*) {
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

::view-transition-old(player-avatar-*),
::view-transition-new(player-avatar-*) {
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* When avatar is in header, hide text content */
.player-header-avatar .player-card-content,
.player-header-avatar .player-card-name {
    display: none !important;
}

/* When avatar is in header, reduce overlay opacity */
.player-header-avatar .player-card-overlay {
    opacity: 0.2;
}

.player-header-left {
    flex: 1;
}

/* Distribution charts */
.distribution-charts-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.distribution-chart-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    flex: 1;
    max-width: 100%;
    overflow: visible;
}

.distribution-chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0;
    line-height: 1.1;
    padding-bottom: 0;
}

.distribution-chart-note {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 0;
    line-height: 1.1;
    padding-bottom: 0;
    margin-top: 0;
}

.distribution-chart-x-axis-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

.distribution-chart {
    min-height: 150px;
    height: 150px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-medium);
    border-radius: calc(var(--border-radius) / 2);
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: 1rem;
}

.distribution-chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.15rem;
    width: 100%;
    height: 100%;
    min-width: fit-content;
}

.distribution-chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 2rem;
    max-width: 4rem;
    height: 100%;
    position: relative;
    cursor: pointer;
    padding: 0 0.1rem;
}

.distribution-chart-bar-container {
    position: absolute;
    bottom: 3.5rem;
    left: 0;
    right: 0;
    height: calc(100% - 3.5rem);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.distribution-chart-labels-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0.5rem;
}

.distribution-chart-bar {
    width: 100%;
    background: var(--primary-color);
    border-radius: 2px 2px 0 0;
    transition: opacity 0.2s;
    min-height: 2px;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.distribution-chart-bar-wrapper:hover .distribution-chart-bar {
    opacity: 0.8;
}

.distribution-chart-label {
    font-size: 0.65rem;
    color: var(--text-primary);
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    overflow: visible;
    width: 100%;
    line-height: 1.2;
    min-height: 1.5em;
    display: block;
    margin-bottom: 0.15rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.distribution-chart-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    backdrop-filter: blur(4px);
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.distribution-chart-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 1rem;
}

.distribution-chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    height: 100%;
}

.distribution-chart-loading .loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.player-name-container {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.2;
}

.player-name-container .clan-badge {
    margin-top: 0.5rem;
    display: inline-block;
}

.player-stats-modal .clan-badge {
    font-size: 1rem;
    margin-top: 0.25rem;
}

.player-stats-modal .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;
}

.player-awards-above-name {
    display: flex;
    justify-content: start;
    margin-bottom: 0.5rem;
}

.player-header-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    align-items: flex-start;
}

/* Ensure modal player stats also use grid layout */
.player-stats-modal .player-header-stats {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.5rem !important;
    align-items: flex-start !important;
    max-width: 600px !important;
    margin-right: 2rem;
}

.header-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.header-stat:nth-child(3),
.header-stat:nth-child(4) {
    border-bottom: 1px solid var(--bg-light);
    padding-bottom: 0.25rem;
}

.header-stat-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.15rem;
    line-height: 1.1;
}

.header-stat-value {
    color: #ff5757;
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1.2;
}

.header-stat-small {
    font-size: 1.5rem;
}

.header-stat-row {
    display: contents;
}

.header-stat-row>.vs-players-label {
    grid-column: 2 / 2;
    align-self: center;
    text-align: right;
    padding-top: .25rem;
}

.header-stat-row>.vs-bots-label {
    grid-column: 2 / 2;
    align-self: center;
    text-align: right;
    padding-top: .25rem;
}

.header-stat-row>.vs-bots-value {
    color: #ffffff;
}

.header-stat-row>.header-stat-value:nth-child(2) {
    grid-column: 3 / 4;
    align-self: center;
    text-align: right;
}

.header-stat-row>.header-stat-value:nth-child(3) {
    grid-column: 4 / 5;
    align-self: center;
    text-align: right;
}

@media (max-width: 768px) {

    .header-stat-row>.header-stat-value:nth-child(2),
    .header-stat-row>.header-stat-value:nth-child(3) {
        text-align: center;
    }
}

.vs-players-label {
    font-size: 0.65rem;
    color: #4a9eff;
    font-weight: 500;
    min-width: fit-content;
}

.header-stat-row .header-stat-value {
    color: #4a9eff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .player-stat-header {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .player-header-avatar {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }

    .player-header-left,
    .player-header-info {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .distribution-charts-container {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .distribution-chart-wrapper {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .player-header-graphs-row {
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
        width: 100%;
        max-width: 100%;
    }

    .distribution-chart {
        min-height: 120px;
        height: 120px;
        width: 100%;
        max-width: 100%;
        padding: 0.5rem 0.15rem;
    }

    .distribution-chart-bar-wrapper {
        min-width: 1.5rem;
        max-width: 3rem;
        padding: 0 0.05rem;
    }

    .player-header-stats {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
        flex-wrap: wrap;
        min-width: 0;
        margin-top: 0;
    }

    .header-stat {
        align-items: center;
        text-align: center;
        flex: 1;
        min-width: 0;
    }

    .header-stat-label {
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .header-stat-value {
        font-size: 1.2rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    #player-stats-container .player-name-container,
    .player-stat-card .player-name-container {
        display: flex;
        flex-direction: column;
        align-items: center !important;
    }

    #player-stats-container .player-season,
    .player-stat-card .player-season {
        text-align: center !important;
    }

    #player-stats-container .player-last-updated,
    .player-stat-card .player-last-updated {
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .player-stat-header {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .player-header-avatar {
        width: 50px;
        height: 50px;
    }

    .player-header-left,
    .player-header-info {
        width: 100%;
    }

    .distribution-chart {
        min-height: 100px;
        height: 100px;
        width: 100%;
        max-width: 100%;
        padding: 0.5rem 0.1rem;
    }

    .distribution-chart-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .distribution-chart-bar-wrapper {
        min-width: 1.25rem;
        max-width: 2.5rem;
        padding: 0 0.05rem;
    }

    .distribution-chart-label {
        font-size: 0.6rem;
        white-space: normal;
        word-wrap: break-word;
        overflow: visible;
    }

    .distribution-chart-value {
        font-size: 0.65rem;
    }

    .distribution-charts-container {
        gap: 0.75rem;
    }

    .player-header-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        width: 100%;
        margin-top: 0;
    }

    .header-stat {
        width: 100%;
        text-align: center;
        margin-top: 0;
    }

    .header-stat-label {
        font-size: 0.65rem;
    }

    .header-stat-value {
        font-size: 1.2rem;
    }

    #player-stats-container .player-name-container,
    .player-stat-card .player-name-container {
        display: flex;
        flex-direction: column;
        align-items: center !important;
    }

    #player-stats-container .player-season,
    .player-stat-card .player-season {
        text-align: center !important;
    }

    #player-stats-container .player-last-updated,
    .player-stat-card .player-last-updated {
        justify-content: center !important;
    }
}

.player-name {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.1rem;
}

/* Larger player name on player stats page - only the main player name in the header */
#player-stats-container .player-stat-card .player-header-section.player-header-info .player-name-container .player-name,
#player-stats-container .player-stat-card .player-header-section.player-header-info .player-name-container span.player-name {
    font-size: 2rem !important;
}

.player-season {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.player-last-updated {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.refresh-stats-btn-small {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.refresh-stats-btn-small:hover:not(:disabled) {
    background: var(--accent-color-hover, #4a9eff);
    opacity: 0.9;
}

.refresh-stats-btn-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.refresh-stats-btn-small:disabled svg {
    animation: spin 1s linear infinite;
}

.refresh-stats-btn-small svg.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.player-stat-body {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    align-items: unset !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.stat-row {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
}

.stat-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    align-items: start;
    justify-items: center;
}

/* Add border between rows - add to all items except those in the last row (last 2 items) */
.stat-group>.stat-item:not(:nth-last-child(-n+2)) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Override for bot stats with charts - no borders between items */
.bot-stats-with-charts>.stat-item-with-chart>.stat-item {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    text-align: center;
    width: 100%;
    min-height: 60px;
    justify-content: center;
}

.stat-item.compact {
    padding: 0.25rem 0.15rem;
}


.stat-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.15rem;
}

.stat-value {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.2;
}

.stat-value-small {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: bold;
    word-break: break-word;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    line-height: 1.2;
}

.stat-meta {
    color: var(--text-secondary);
    font-size: 0.65rem;
    margin-top: 0.1rem;
    line-height: 1.1;
}

.stat-divider {
    height: 1px;
    background: var(--bg-light);
    margin: 0.2rem 0;
}

.stat-divider-large {
    margin: 0.5rem 0;
}

.stat-section {
    margin-bottom: 0;
    background: var(--bg-dark);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.stat-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.75rem;
}

.stat-section-title {
    color: var(--text-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    font-weight: 600;
    padding-bottom: 0.5rem;
}

.weapon-icon-small {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
}

.weapon-icon-header {
    text-align: center;
    margin-bottom: 1rem;
}

.weapon-name-display {
    margin-top: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.weapon-icon-large {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.5rem;
}

.weapon-icon-xlarge {
    width: 96px;
    height: 96px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.5rem;
}

.weapon-icon-medium {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.25rem;
}

.stat-item-weapon {
    padding: 0.5rem;
}

.weapons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.weapons-grid:has(.weapons-loading) {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.weapons-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.weapons-grid .weapon-icon-medium {
    width: 48px;
    height: 48px;
}

@media (max-width: 768px) {
    .weapon-filters-container {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .weapon-perspective-container {
        grid-column: 1;
    }

    .weapons-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .weapons-grid .weapon-column {
        padding: 0.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .weapons-grid .weapon-icon-medium {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .weapons-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .weapons-grid .weapon-column {
        padding: 0.4rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .weapons-grid .weapon-icon-medium {
        width: 40px;
        height: 40px;
    }
}

.weapon-column {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
}

.stat-weapon-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.weapon-damage-percentage {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.125rem;
}

.weapon-damage-stats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
}

.weapon-damage-total,
.weapon-damage-bot,
.weapon-damage-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
}

.weapon-damage-total {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 0.25rem;
    padding-bottom: 0.5rem;
}

.weapon-damage-player:last-child {
    border-bottom: none;
}

.weapon-damage-breakdown-container {
    margin: 0;
    padding: 0.5rem;
    background: var(--bg-medium);
    border-radius: 4px;
}

.weapon-damage-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.damage-reason-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.damage-reason-item:last-child {
    border-bottom: none;
}

/* Side-by-side layout for damage breakdown and weapon contributions */
.weapon-breakdown-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0.5rem 0;
}

@media (max-width: 768px) {
    .weapon-breakdown-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

.damage-reason-label {
    color: var(--text-secondary);
    text-transform: capitalize;
}

.damage-reason-value {
    color: var(--primary-color);
    font-weight: 600;
}

/* Body Silhouette Visualization */
.weapon-body-silhouette-container {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--bg-medium);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.weapon-type-pie-chart-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
}

.weapon-type-pie-chart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.weapon-type-pie-chart-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.weapon-type-pie-chart-loading .spinner[data-js-animation="true"] {
    animation: none !important;
    will-change: transform;
}

.weapon-type-pie-chart-loading p {
    margin: 0;
    font-size: 0.9rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.weapon-type-pie-chart-wrapper {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.weapon-type-pie-chart {
    flex-shrink: 0;
}

.weapon-type-pie-chart .pie-segment {
    cursor: pointer;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.weapon-type-pie-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.weapon-type-legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-medium);
    border-radius: calc(var(--border-radius) / 2);
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.weapon-type-legend-item:hover {
    background: var(--bg-light);
    transform: scale(1.02);
}

.weapon-type-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.weapon-type-legend-label {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.weapon-type-legend-value {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.weapon-filters-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.weapon-selector-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weapon-perspective-container {
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
}

.weapon-perspective-selector {
    background: var(--bg-light);
    border: 2px solid var(--primary-color);
    font-weight: 600;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.3);
}

.weapon-perspective-selector:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.5);
}

.weapon-selector-label {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-align: center;
}

.weapon-selector {
    padding: 0.5rem;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.weapon-selector:focus {
    outline: none;
    border-color: var(--primary-color);
}

.weapon-selector option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.selected-weapon-stats {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.selected-weapon-stats .loading {
    padding: 1rem;
    margin: 0;
}

.selected-weapon-column {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

.weapon-stats-error {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 1rem;
}

.weapon-contributions-container {
    margin: 0;
    padding: 0.5rem;
    background: var(--bg-medium);
    border-radius: 4px;
}

.weapon-contributions-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.weapon-contribution-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.weapon-contribution-item:last-child {
    border-bottom: none;
}

.weapon-contribution-name {
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.weapon-contribution-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.weapon-contribution-value {
    color: var(--primary-color);
    font-weight: 600;
}

.body-silhouette-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.body-silhouette-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.body-silhouette-image {
    width: 100%;
    height: auto;
    display: block;
    max-width: 150px;
}

.body-silhouette-fallback {
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border-radius: 4px;
}

.body-part-badge {
    position: absolute;
    transform: translate(-50%, -50%);
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

.badge-percentage {
    display: block;
    line-height: 1.2;
}

.body-silhouette-placeholder {
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-align: center;
    padding: 0.5rem;
}

/* Drop Spots Section */
.stat-section-full-width {
    grid-column: 1 / -1;
}

.drop-spots-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.drop-spots-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.drop-spots-controls label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.drop-spots-map-select {
    background: var(--bg-medium);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 200px;
}

.drop-spots-map-select:hover {
    border-color: var(--primary-color);
}

.drop-spots-map-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.drop-spots-map-container {
    min-height: 800px;
    background: var(--bg-dark);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Desktop: Reduce drop spots map size by 40% (60% of original) */
@media (min-width: 769px) {
    .drop-spots-map-container {
        min-height: 480px;
    }
}

/* When no map is selected, use fit-content height */
.drop-spots-map-container:not(:has(.drop-spots-map-wrapper)) {
    min-height: fit-content;
    height: fit-content;
}

/* Smaller map for inline player stats cards (not in modal) - doubled size */
.player-stats-section:not(.player-stats-modal) .drop-spots-map-container {
    min-height: 1000px;
    max-height: 1200px;
}

/* Desktop: Reduce drop spots map size by 40% (60% of original) */
@media (min-width: 769px) {
    .player-stats-section:not(.player-stats-modal) .drop-spots-map-container {
        min-height: 600px;
        max-height: 720px;
    }
}

.player-stats-section:not(.player-stats-modal) .drop-spots-map-container:not(:has(.drop-spots-map-wrapper)) {
    min-height: fit-content;
    max-height: fit-content;
    height: fit-content;
}

.player-stats-section:not(.player-stats-modal) .drop-spots-map-wrapper {
    max-height: 1100px;
}

/* Desktop: Reduce drop spots map size by 40% (60% of original) */
@media (min-width: 769px) {
    .player-stats-section:not(.player-stats-modal) .drop-spots-map-wrapper {
        max-height: 660px;
    }
}

.drop-spots-map-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Allow flex child to shrink */
    /* Prevent scrolling when content loads */
    scroll-margin: 0;
    scroll-padding: 0;
}

.drop-spots-info {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    z-index: 10;
}

.drop-spots-legend {
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--bg-light);
}

.drop-spots-legend-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.drop-spots-legend-items {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.drop-spots-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.drop-spots-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.drop-spots-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 100;
    border-radius: var(--border-radius);
}

.drop-spots-loading-overlay .loading {
    gap: 1rem;
}

.drop-spots-loading-overlay .loading>div:not(.loading-spinner) {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.drop-spots-map-overlay {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    /* Allow flex child to shrink */
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.drop-spots-map-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.drop-spots-heatmap {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    /* SVG will be sized dynamically to match the displayed image */
}

.drop-spots-loading,
.drop-spots-empty,
.drop-spots-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    gap: 1rem;
}

.drop-spots-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.drop-spots-error {
    color: var(--error-color);
}

@media (max-width: 768px) {
    .drop-spots-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .drop-spots-map-select {
        width: 100%;
        min-width: unset;
    }

    .drop-spots-map-container {
        min-height: 300px;
    }
}

.stat-value-weapon {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-section {
        padding: 1rem;
    }

    .player-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .player-stats-section {
        padding: 1rem;
    }

    .stat-group {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
    }

    .stat-item {
        min-height: 50px;
    }

    /* Map stats table mobile responsiveness */
    .map-stats-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .map-stats-header,
    .map-stats-row {
        min-width: 600px;
        /* Ensure minimum width for readability */
        gap: 0.5rem;
        padding: 0.75rem 0.5rem;
    }

    .map-stats-header {
        font-size: 0.8rem;
        padding: 0.75rem 0.5rem;
    }
}

.bot-stats-with-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
}

.stat-item-with-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.pie-chart-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.pie-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.pie-chart-svg {
    width: 100px;
    height: 100px;
    max-width: 100%;
}

.pie-chart-svg .pie-segment {
    cursor: pointer;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.pie-chart-legend .legend-item {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.pie-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .bot-stats-with-charts {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .pie-chart-svg {
        width: 120px;
        height: 120px;
    }
}

.other-players-controls {
    width: 100%;
}

.add-player-section {
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.add-player-section h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.add-player-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.player-search-input,
.player-platform-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--bg-light);
    border-radius: calc(var(--border-radius) / 2);
    background: var(--bg-medium);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.player-search-input:focus,
.player-platform-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.player-platform-select {
    min-width: 150px;
}

.player-search-results {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bg-light);
}

.search-result-item {
    display: flex;
    width: fit-content;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.search-result-item .player-info {
    width: 100%;
}

.search-result-item .player-name {
    color: var(--primary-color);
    font-weight: 600;
}

.search-result-item .btn-primary {
    width: 100%;
}

.already-tracked-note {
    width: 100%;
    padding: 0.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    background: var(--bg-medium);
    border-radius: calc(var(--border-radius) / 2);
}

/* Team Kills History Modal */
.team-kills-history-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.team-kills-history-modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.team-kills-history-modal.active {
    display: flex;
}

.team-kills-history-content {
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.team-kills-history-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    z-index: 1;
}

.team-kills-history-close:hover {
    background: var(--bg-medium);
}

.team-kills-history-content h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.team-kills-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.team-kills-summary-card {
    background: var(--bg-medium);
    border-radius: calc(var(--border-radius) / 2);
    padding: 1rem;
    border: 1px solid var(--bg-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.summary-value.positive {
    color: #4caf50;
}

.summary-value.negative {
    color: #f44336;
}

.team-kills-history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.team-kill-history-item {
    background: var(--bg-medium);
    border-radius: calc(var(--border-radius) / 2);
    padding: 1rem;
    border: 1px solid var(--bg-light);
}

.team-kill-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bg-light);
}

.team-kill-history-victim {
    font-size: 1.1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.team-kill-history-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.team-kill-history-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.team-kill-history-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-kills-history-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.team-kills-history-loading .loading {
    gap: 1rem;
}

.recent-matches-loading,
.most-teamed-with-loading,
.previous-names-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
    color: var(--text-secondary);
}

.recent-matches-loading .loading,
.most-teamed-with-loading .loading,
.previous-names-loading .loading,
.distribution-chart-loading .loading {
    padding: 1rem;
    margin: 0;
}

.recent-matches-loading .loading>div:not(.loading-spinner),
.most-teamed-with-loading .loading>div:not(.loading-spinner),
.previous-names-loading .loading>div:not(.loading-spinner),
.distribution-chart-loading .loading>div:not(.loading-spinner) {
    color: var(--text-secondary);
    font-size: 1rem;
}

.other-player-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
    color: var(--text-secondary);
}

.other-player-search-loading>div:not(.loading-spinner) {
    color: var(--text-secondary);
    font-size: 1rem;
}

.other-players-list-container {
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.other-players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.other-player-item {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
}

.other-player-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.other-player-name {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.other-.player-search-card:hover {
    background-color: var(--grey-800);
}

.player-search-name {
    color: var(--text-primary);
    font-weight: 600;
}

.player-search-platform {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Cheaters Tab Styles */
.cheaters-table-container {
    overflow-x: auto;
    width: 100%;
}

.cheaters-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.cheaters-table th,
.cheaters-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--grey-800);
}

.cheaters-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    background-color: var(--grey-900);
}

.cheaters-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.cheaters-disclaimer {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.cheaters-disclaimer-icon {
    font-size: 1.25rem;
}

.cheaters-disclaimer-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cheater-name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cheater-stats-cell {
    font-variant-numeric: tabular-nums;
}

.kill-interaction {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.kill-interaction span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.active-warning {
    color: var(--danger);
    font-weight: 600;
    font-size: 0.85rem;
}

.inactive-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.other-player-search-section {
    margin-bottom: 2rem;
}

.other-player-search-wrapper {
    position: relative;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.add-player-controls {
    padding: 1rem 0;
}

.add-player-search-section {
    margin-bottom: 2rem;
}

.add-player-search-section h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.add-player-search-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.add-player-note {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

.add-player-search-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.other-player-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-medium);
    border: 2px solid var(--bg-light);
    border-radius: calc(var(--border-radius) / 2);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.other-player-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.other-player-search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-dark);
    border: 2px solid var(--bg-light);
    border-radius: calc(var(--border-radius) / 2);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0.25rem;
}

.other-player-search-results-list {
    padding: 0.5rem 0;
}

.other-player-search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bg-light);
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.other-player-search-result-item:last-child {
    border-bottom: none;
}

.other-player-search-result-item:hover {
    background: var(--bg-medium);
}

.other-player-search-result-name {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dsp-badge-inline {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 600;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: rgba(74, 144, 226, 0.2);
    color: var(--primary-color);
}

.player-historical-names {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-style: italic;
}

.api-result {
    border-left: 3px solid var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

.api-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 600;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--primary-color);
    color: white;
    margin-left: 0.5rem;
}

.player-api-info {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-top: 0.25rem;
    font-weight: 500;
    border: 1px solid rgba(74, 144, 226, 0.4);
}

.other-player-search-empty,
.other-player-search-error {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.other-player-search-error {
    color: var(--error-color);
}

.recent-players-section {
    margin-bottom: 1.5rem;
}

.recent-players-section h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.recent-players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recent-player-item {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: var(--bg-medium);
    border: 1px solid var(--bg-light);
    border-radius: calc(var(--border-radius) / 2);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-player-item:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.player-name-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
}

.player-name-badges {
    display: flex;
    justify-content: center;
    gap: 1px;
    min-height: 6px;
    /* Ensure consistent spacing even when empty */
}

.dsp-badge-small {
    width: 16px;
    height: 16px;
    vertical-align: baseline;
    margin-left: 0.25rem;
    display: inline-block;
}

/* Fix alignment in flex containers (like teammates list) */
.player-stats-teammates-list .dsp-badge-small {
    vertical-align: baseline;
    align-self: center;
    margin-left: 0;
    margin-right: 0.25rem;
}

.other-player-stats-container {
    margin-top: 2rem;
}

.player-stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    pointer-events: auto;
    flex-direction: column;
    z-index: 10001;
}

/* Base popover styles */
.player-stats-modal[popover] {
    display: none;
    opacity: 0;
    transition:
        opacity 0.15s ease,
        display 0.15s allow-discrete,
        overlay 0.15s allow-discrete;
    pointer-events: none;
}

/* Entry state (when popover is open) */
.player-stats-modal[popover]:popover-open {
    display: flex;
    opacity: 1;
    align-items: flex-start;
    padding: 0;
    padding-top: max(4rem, calc(2rem + env(safe-area-inset-top)));
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 2rem;
    overflow-y: auto;
    pointer-events: auto;
}

/* Starting style for entry animation */
@starting-style {
    .player-stats-modal[popover]:popover-open {
        opacity: 0;
    }
}

/* Backdrop styling */
.player-stats-modal::backdrop {
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
}

/* Exit state for backdrop */
.player-stats-modal[popover]::backdrop {
    opacity: 0;
    transition:
        opacity 0.15s ease,
        display 0.15s allow-discrete;
}

/* Entry state for backdrop */
.player-stats-modal[popover]:popover-open::backdrop {
    opacity: 1;
}

/* Starting style for backdrop entry animation */
@starting-style {
    .player-stats-modal[popover]:popover-open::backdrop {
        opacity: 0;
    }
}

/* Fallback for browsers that don't support popover API */
.player-stats-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    padding-top: max(4rem, calc(2rem + env(safe-area-inset-top)));
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 2rem;
    overflow-y: auto;
}

.player-stats-modal-content {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    margin-top: 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.player-stats-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.player-stats-modal-close:hover {
    background: var(--bg-medium);
    color: var(--primary-color);
}

/* Center loading content in player stats modal */
.player-stats-modal .player-stat-card-loading {
    align-self: center;
    margin: auto;
    max-width: 600px;
}

.player-stats-modal .player-stat-card .loading,
.player-stats-modal .player-stat-card .error {
    justify-content: center;
    min-height: 200px;
}

@media (max-width: 768px) {
    .player-stats-tabs {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
        margin-bottom: 1rem;
    }

    .player-stats-tab {
        width: 100%;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        background: var(--bg-medium);
        border: 2px solid var(--bg-light);
        border-radius: var(--border-radius);
        color: var(--text-secondary);
        transition: all 0.3s ease;
    }

    .player-stats-tab:hover {
        background: var(--bg-light);
        color: var(--text-primary);
        border-color: var(--primary-color);
    }

    .player-stats-tab.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

    .add-player-form {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
    }

    .other-players-list {
        grid-template-columns: 1fr;
    }

    .player-stats-modal[popover]:popover-open,
    .player-stats-modal.active {
        padding: 0;
        padding-top: max(3rem, calc(1rem + env(safe-area-inset-top)));
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0;
        align-items: stretch;
        justify-content: flex-start;
    }

    .player-stats-modal-content {
        padding: 1.5rem;
        margin: 0;
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: calc(100vh - max(3rem, calc(1rem + env(safe-area-inset-top))));
        overflow-y: auto;
        border-radius: 0;
        box-sizing: border-box;
    }

    .team-kills-summary-cards {
        grid-template-columns: 1fr;
    }
}

/* Weapon rank badges for top 6 weapons */
.weapon-rank-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 28px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.4);
    border: 2px solid var(--bg-dark);
    z-index: 1;
    letter-spacing: 0.5px;
}

.weapon-rank-medal {
    position: absolute;
    top: -8px;
    left: -8px;
    font-size: 1.5rem;
    line-height: 1;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Weapon Stats Tab */
.weapon-stats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.weapon-stat-card {
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.weapon-stat-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.weapon-stat-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 3rem;
    text-align: center;
}

.weapon-stat-info {
    flex: 1;
}

.weapon-stat-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.weapon-stat-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.weapon-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weapon-stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.weapon-stat-value {
    color: var(--primary-color);
    font-weight: bold;
}

/* Weapon Stats Tab in Season Stats Modal */
.weapon-stats-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.weapon-stats-section {
    margin-bottom: 2rem;
}

.weapon-stats-section h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.weapon-stats-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.weapon-stats-summary {
    margin-bottom: 1.5rem;
}

.weapon-stats-summary h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.weapon-stats-summary p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.weapon-stats-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.weapon-stats-table thead {
    background: var(--bg-dark);
}

.weapon-stats-table th,
.weapon-stats-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.weapon-stats-table th {
    color: var(--text-primary);
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weapon-stats-table td {
    color: var(--text-primary);
}

.weapon-stats-table tbody tr:hover {
    background: var(--bg-dark);
}

.weapon-stats-table .rank-column {
    width: 50px;
    text-align: center;
    font-weight: bold;
    color: var(--primary-color);
    padding: 1rem 0.75rem;
}

.weapon-stats-table .weapon-column {
    padding: 1rem 0.75rem;
}

/* Add border and border-radius back for player stats modal weapon columns in weapons grid */
.weapons-grid .weapon-column {
    border: 1px solid var(--bg-dark);
    border-radius: var(--border-radius);
    background: var(--bg-light);
}

.weapon-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weapon-stats-table .damage-column,
.weapon-stats-table .games-column,
.weapon-stats-table .per-game-column,
.weapon-stats-table .percentage-column {
    text-align: right;
    font-size: 0.9rem;
    padding: 1rem 0.75rem;
}

/* Alternating row striping */
.weapon-stats-table tbody tr:nth-child(even) {
    background: var(--bg-dark);
}

.weapon-stats-table tbody tr:nth-child(odd) {
    background: var(--bg-medium);
}

.weapon-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
}

.stats-tab-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
}

/* Clan Stats Styles */
.clan-stats-section {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.clan-stats-content {
    color: var(--text-primary);
}

.clan-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.clan-stats-overview .stat-card {
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.clan-stats-overview .stat-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.clan-stats-overview .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.clan-stats-overview .stat-value {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: bold;
}

.clan-map-stats {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.map-stats-header-section {
    margin-bottom: 1rem;
}

.map-stats-header-section h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.stats-explanation {
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.clan-map-stats h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* Make performance overview card look like map stats card */
.stat-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.stat-section .comparison-header {
    margin-bottom: 1rem;
}

.stat-section .comparison-title {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.map-stats-table {
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-stats-header,
.map-stats-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    align-items: center;
}

.map-stats-header {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    font-size: 0.9rem;
    letter-spacing: 1px;
    position: relative;
    z-index: 3;
}

.map-stats-header>* {
    position: relative;
    z-index: 2;
    color: white !important;
    text-shadow: none !important;
}

/* Clan Stats Container */
.clan-stats-content {
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Clan Stats Grid Layout */
.clan-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* Clan Stats Sections */
.stat-section {
    background: var(--bg-dark);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

/* Map Stats Container */
.map-stats-container {
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.no-map-stats {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.stat-section-title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-group {
    flex: 1;
    min-width: 160px;
}

.stat-item {
    background: var(--bg-light);
    padding: 0.75rem;
    border-radius: calc(var(--border-radius) / 2);
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    height: 100%;
}

.stat-item.compact {
    padding: 0.5rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-primary);
}

.stat-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Comparison Header */
.comparison-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.comparison-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.total-matches {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.total-matches-value {
    color: var(--text-primary);
    font-weight: bold;
    font-size: 1.1rem;
}

/* Comparison Stats with Pie Charts */
.stat-comparison {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-light);
    padding: 1rem;
    border-radius: calc(var(--border-radius) / 2);
}

.comparison-values {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    place-items: center;
    padding: 0.75rem;
    background: var(--bg-medium);
    border-radius: calc(var(--border-radius) / 2);
    gap: 0.25rem;
}

.comparison-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-value {
    font-size: 1.125rem;
    font-weight: bold;
    color: var(--text-primary);
}

.comparison-subvalue {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.comparison-charts {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.chart-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.chart-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-container {
    display: flex;
    justify-content: center;
}

/* Pie Chart Styles */
.pie-chart {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pie-chart-svg {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.pie-chart-svg .pie-segment {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.pie-chart-svg .pie-segment:hover {
    opacity: 0.8;
}

.pie-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-label {
    color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .clan-stats-grid {
        display: block;
        gap: 1rem;
        overflow-x: hidden;
    }

    .stat-section {
        padding: 0.75rem;
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
    }

    .stat-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .stat-group {
        min-width: 140px;
    }

    .stat-comparison {
        gap: 1rem;
        padding: 0.75rem;
    }

    .comparison-values {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }


    .chart-group {
        flex: 1;
        max-width: 30%;
    }

    .pie-chart {
        justify-content: center;
    }

    .pie-chart-svg {
        width: 50px;
        height: 50px;
    }

    .pie-chart-legend {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Clan page comparison charts stack vertically on mobile */
    .comparison-charts {
        flex-direction: column !important;
        gap: 1.5rem !important;
        align-items: center !important;
    }

    .comparison-charts .pie-chart {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .legend-item {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .stat-section {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .stat-section-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .stat-row {
        gap: 0.5rem;
    }

    .stat-group {
        min-width: 120px;
        flex-basis: 0;
        flex-grow: 1;
    }

    .comparison-values {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.5rem;
        margin-bottom: 0.25rem;
        min-height: 45px;
    }

    .stat-value {
        font-size: 1.125rem;
    }

    .comparison-item {
        padding: 0.75rem;
        gap: 0.25rem;
    }

    .comparison-value {
        font-size: 1rem;
    }

    .comparison-subvalue {
        font-size: 0.75rem;
    }

    .stat-comparison {
        padding: 0.5rem;
        gap: 0.75rem;
        overflow-x: hidden;
    }

    .comparison-charts {
        flex-direction: column !important;
        gap: 0.75rem;
    }

    .chart-title {
        font-size: 0.8rem;
    }

    /* Map stats table mobile optimization */
    .map-stats-header,
    .map-stats-row {
        min-width: 500px;
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .map-stats-header {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .stat-section {
        padding: 0.375rem;
        margin-bottom: 0.375rem;
    }

    .stat-row {
        gap: 0.375rem;
    }

    .stat-group {
        min-width: 100px;
    }

    .stat-item {
        padding: 0.375rem;
        margin-bottom: 0.125rem;
        min-height: 40px;
    }

    .stat-value {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .comparison-values {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .comparison-item {
        padding: 0.375rem;
        gap: 0.25rem;
    }

    .comparison-value {
        font-size: 0.9rem;
    }

    .comparison-subvalue {
        font-size: 0.7rem;
    }

    .comparison-label {
        font-size: 0.8rem;
    }

    .pie-chart-svg {
        width: 40px;
        height: 40px;
    }

    .chart-title {
        font-size: 0.75rem;
    }

    .stat-comparison {
        padding: 0.375rem;
        gap: 0.5rem;
    }

    .comparison-charts {
        flex-direction: column;
        gap: 0.75rem;
    }

    .chart-group {
        width: 100%;
        max-width: none;
    }
}

.clan-map-stats .map-stats-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: background-color 0.2s ease;
    position: relative;
    min-height: 60px;
}

.clan-map-stats .map-stats-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.clan-map-stats .map-stats-row:hover::before {
    background: rgba(0, 0, 0, 0.5);
}

/* Removed brightness filter for clan page map stats only - hover effect removed */

.clan-map-stats .map-stats-row>* {
    position: relative;
    z-index: 2;
    color: white;
    font-weight: 500;
}

.clan-map-stats .map-stats-row:last-child {
    border-bottom: none;
}

.clan-map-stats .map-stats-row .map-name {
    font-weight: 500;
}

.clan-map-stats .map-stats-row .map-games,
.clan-map-stats .map-stats-row .map-wins,
.clan-map-stats .map-stats-row .map-win-pct,
.clan-map-stats .map-stats-row .map-avg-kills,
.clan-map-stats .map-stats-row .map-avg-damage {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* Clan Member ADR Breakdown */
.clan-member-adr-breakdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

/* Mobile Map Stats Cards */
.map-stats-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map-stats-card {
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    min-height: 160px;
}

.map-card-header {
    background: rgba(0, 0, 0, 0.7);
    padding: 0.75rem;
    position: relative;
    z-index: 2;
}

.map-card-header {
    background: rgba(0, 0, 0, 0.6);
}

.map-card-name {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.map-card-stats {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.map-stat-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    align-items: stretch;
}

.map-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.6rem 0.4rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 0;
    height: 100%;
    min-height: 65px;
}

.map-stat-label {
    font-size: 0.65rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.map-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.clan-member-adr-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: normal;
}

.clan-member-adr-detail::before {
    content: "vs ";
}

/* Clan Members Averages */
.clan-members-averages {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.clan-averages-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.clan-average-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 100px;
}

.clan-average-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.clan-average-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

/* Clan Members Summary */
.clan-members-summary {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: calc(var(--border-radius) / 2);
    text-align: center;
    border: 1px solid var(--border-color);
}

.clan-members-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.clan-members-count span {
    color: var(--text-primary);
    font-weight: bold;
}

/* Mobile responsive styles for clan averages */
@media (max-width: 768px) {
    .clan-members-averages {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .clan-averages-stats {
        gap: 1rem;
    }

    .clan-average-item {
        min-width: 80px;
    }

    .clan-average-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .clan-members-averages {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .clan-averages-stats {
        gap: 0.75rem;
    }

    .clan-average-item {
        min-width: 70px;
    }

    .clan-average-value {
        font-size: 1.125rem;
    }

    .clan-average-label {
        font-size: 0.8rem;
    }
}

/* Rivals Section */
.rivals-section-group {
    margin-top: 2rem;
}

.rivals-section-group:first-child {
    margin-top: 0;
}

.rivals-section-title {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-medium);
}

.rivals-list {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.rival-card {
    flex: 1;
    min-width: 250px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    cursor: default;
    transition: all 0.2s;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
    position: relative;
}

/* Removed hover effect - cards are not clickable, only the player name link opens stats */

.rival-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.rival-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.rivals-matches-info {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.rivals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.rivals-table thead tr {
    border-bottom: 1px solid var(--bg-light);
}

.rivals-table th {
    text-align: left;
    padding: 0.5rem 0.25rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
}

.rivals-table th:first-child {
    text-align: left;
}

.rivals-table th:not(:first-child) {
    text-align: center;
}

.rivals-table tbody tr {
    border-bottom: 1px solid var(--bg-light);
}

.rivals-table tbody tr:last-child {
    border-bottom: none;
}

.rivals-table td {
    padding: 0.5rem 0.25rem;
    color: var(--text-secondary);
}

.rivals-table td:first-child {
    text-align: left;
}

.rivals-table td:not(:first-child) {
    text-align: center;
}

.rivals-table td:nth-child(2) {
    background-color: rgba(74, 144, 226, 0.1);
}

.rivals-table td:nth-child(3) {
    background-color: rgba(74, 144, 226, 0.05);
}

.rivals-table .rival-stat-value-primary {
    color: var(--primary-color);
    font-weight: 600;
}

.rivals-table .rival-stat-value {
    color: var(--text-primary);
    font-weight: 500;
}

.rivals-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.rivals-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Most Teamed With Section */
.most-teamed-with-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.most-teamed-with-card {
    display: flex;
    justify-content: center;
    place-items: center;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.2s;
    cursor: default;
}

.most-teamed-with-card[data-player-id] {
    cursor: default;
}

.teammate-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
}

.teammate-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
}

.teammate-name a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.teammate-name a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.teammate-game-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.most-teamed-with-empty,
.most-teamed-with-error {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.most-teamed-with-error {
    color: var(--error-color, #f44336);
}

@media (max-width: 768px) {
    .most-teamed-with-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .most-teamed-with-card {
        padding: 0.75rem;
    }

    .teammate-name {
        font-size: 0.9rem;
    }

    .teammate-game-count {
        font-size: 0.8rem;
    }

    /* Mobile search improvements */
    .other-player-search-wrapper {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .other-player-search-wrapper>input {
        width: 100% !important;
        flex: none !important;
    }

    .other-player-search-wrapper>button {
        width: 100% !important;
        flex: none !important;
    }

    /* Make recent players smaller on mobile */
    .recent-players-section {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 0.75rem !important;
    }

    .recent-players-list {
        width: 100% !important;
        max-width: 100% !important;
        gap: 0.375rem !important;
        overflow-x: hidden !important;
        justify-content: center !important;
        align-items: flex-start !important;
    }

    .recent-player-item {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.4rem !important;
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: fit-content !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .recent-player-item .player-name {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }

    .recent-player-item .dsp-badge-small {
        width: 12px !important;
        height: 12px !important;
        flex-shrink: 0 !important;
        margin-right: 0.25rem !important;
    }

    /* Ensure the search wrapper container doesn't overflow on mobile */
    .main-content-full>div:first-child {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 1rem !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        margin: 0 auto !important;
    }

    /* Prevent horizontal scrolling */
    .recent-players-section {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}