/* Player Profile Page Styles */

.player-page {
    padding-top: 120px;
    padding-bottom: 40px;
    background-color: var(--bg-secondary);
}

/* Player Header Layout */
.player-header {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

/* Cache Badge */
.cache-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cache-badge .cache-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cache-badge .cache-time svg {
    width: 12px;
    height: 12px;
}

.cache-badge .cache-refresh-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.688rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cache-badge .cache-refresh-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.cache-badge .cache-refresh-btn svg {
    width: 12px;
    height: 12px;
}

.cache-badge .cache-refresh-btn.refreshing svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Sidebar */
.player-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.player-avatar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
}

.player-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 4px solid var(--border-color);
}

.player-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
}

.player-avatar span {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
}

.player-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.btn-refresh-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.813rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    width: 100%;
}

.btn-refresh-name:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.btn-refresh-name svg {
    width: 14px;
    height: 14px;
}

.btn-refresh-name.refreshing svg {
    animation: spin 1s linear infinite;
}

.player-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-elo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 24px;
    font-size: 1rem;
    background: var(--accent-primary);
    color: #fff;
}

.player-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 24px;
    font-size: 1rem;
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: var(--border-color);
}

.btn-action.btn-outline {
    background: transparent;
}

.btn-action svg {
    width: 16px;
    height: 16px;
}

/* Player Info Card */
.player-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.info-value {
    font-size: 0.938rem;
    color: var(--text-primary);
    font-weight: 500;
}

.flag {
    margin-right: 6px;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.social-link:hover {
    background: var(--accent-primary);
    color: white;
}

.social-link svg {
    width: 18px;
    height: 18px;
}

/* Activity Card */
.activity-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--shadow);
}

.activity-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.activity-title {
    font-size: 0.938rem;
    font-weight: 700;
    color: var(--text-primary);
}

.activity-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-calendar-container {
    background: var(--bg-secondary);
    border-radius: 12px;
}

.activity-calendar {
    display: grid;
    grid-template-columns: 35px 1fr;
    grid-template-rows: 20px repeat(7, 1fr);
    gap: 4px;
}

.activity-calendar-months {
    grid-column: 2 / -1;
    grid-row: 1;
    display: grid;
    gap: 4px;
}

.activity-calendar-months span {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-align: center;
}

.activity-calendar-days {
    grid-column: 1;
    grid-row: 2 / -1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
}

.activity-calendar-days span {
    font-size: 0.688rem;
    color: var(--text-muted);
    text-transform: capitalize;
    height: 12px;
    display: flex;
    align-items: center;
}

.activity-calendar-grid {
    grid-column: 2 / -1;
    grid-row: 2 / -1;
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    gap: 4px;
    grid-auto-flow: column;
}

.activity-calendar-cell {
    aspect-ratio: 1;
    background: var(--bg-primary);
    border-radius: 3px;
    min-height: 12px;
    cursor: default;
    position: relative;
}

.activity-calendar-cell.level-0 {
    background: var(--bg-primary);
}

/* Placeholder cells (before the 90-day range) - invisible */
.activity-calendar-cell.placeholder {
    background: transparent;
    pointer-events: none;
    cursor: default;
}

.activity-calendar-cell.level-1 {
    background: rgba(59, 130, 246, 0.3);
}

.activity-calendar-cell.level-2 {
    background: rgba(59, 130, 246, 0.5);
}

.activity-calendar-cell.level-3 {
    background: rgba(59, 130, 246, 0.7);
}

.activity-calendar-cell.level-4 {
    background: rgba(59, 130, 246, 0.95);
}

/* Tooltip for activity calendar cells */
.activity-calendar-cell[data-count]:hover::after {
    content: attr(data-date) ' - ' attr(data-count) ' arenas';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.activity-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.688rem;
    color: var(--text-muted);
}

.activity-legend-items {
    display: flex;
    align-items: center;
    gap: 3px;
}

.activity-legend-items span {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

.activity-stats {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-stats strong {
    color: var(--text-primary);
    font-size: 0.813rem;
}

/* Last Matches Section */
.last-matches-section {
    margin-top: 32px;
}

.matches-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.matches-table {
    width: 100%;
    border-collapse: collapse;
}

.matches-table th {
    background: var(--bg-secondary);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.matches-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
    vertical-align: middle;
    height: 72px;
}

.matches-table tbody tr:last-child td {
    border-bottom: none;
}

.matches-table tbody tr:hover {
    background: var(--bg-secondary);
}

.match-date {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.match-date .date {
    font-weight: 500;
}

.match-date .time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.match-arena {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.match-arena .date {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.match-arena .vs {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.match-elo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.match-elo-result {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 24px;
    font-size: 0.813rem;
}

.match-elo-result.win {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.match-elo-result.loss {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.match-elo-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.match-elo-rating .elo-level {
    width: 20px;
    height: 20px;
    background: rgba(251, 191, 36, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    color: #fbbf24;
    font-weight: 700;
    flex-shrink: 0;
}

.match-elo-rating .elo-value {
    font-weight: normal;
    font-size: 1rem;
    color: var(--text-primary);
}

.match-elo-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.688rem;
    font-weight: 600;
    flex-shrink: 0;
}

.match-elo-change.positive {
    color: #22c55e;
}

.match-elo-change.negative {
    color: #ef4444;
}

.match-map {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.match-map img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

/* ============================================
   Skeleton Loaders
   ============================================ */

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

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Activity Calendar Skeleton */
.skeleton-calendar {
    height: 120px;
    margin-top: 12px;
}

.skeleton-calendar .skeleton-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.skeleton-calendar .skeleton-cell {
    height: 12px;
    flex: 1;
}

/* Elo Graph Skeleton */
.skeleton-elo-graph {
    height: 200px;
    margin-bottom: 16px;
}

.skeleton-elo-legend {
    height: 80px;
}

.skeleton-stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.skeleton-stat-label {
    height: 14px;
    width: 80px;
}

.skeleton-stat-value {
    height: 16px;
    width: 60px;
}

/* Hide skeleton when content is loaded */
.skeleton-hidden {
    display: none !important;
}

/* Player Content */
.player-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Player Tabs */
.player-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px;
    overflow-x: auto;
}

.tab {
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

/* Quick Stats */
.quick-stats {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    box-shadow: var(--shadow);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-spacer {
    border-left: 1px solid var(--border-color);
}

/* Performance Section */
.performance-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.section-title svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Period Selector */
.period-selector {
    display: flex;
    gap: 4px;
    margin-left: auto;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 4px;
}

.period-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.period-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.period-btn.active {
    background: var(--accent-primary);
    color: white;
}

.view-more-link {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.view-more-link:hover {
    color: var(--accent-hover);
}

/* Performance Stats */
.performance-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.perf-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.perf-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.perf-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-note {
    font-size: 0.625rem;
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0.7;
}

/* Elo Graph Container */
.elo-graph-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

#eloChart {
    width: 100%;
    height: 200px;
    max-height: 200px;
}

.elo-graph-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.win-loss-bar {
    display: flex;
    gap: 4px;
}

.wl-win,
.wl-loss {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.wl-win {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.wl-loss {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.elo-range-bar {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 8px 12px;
}

.elo-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.elo-current {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.elo-stats-mini {
    display: flex;
    gap: 24px;
}

.elo-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.elo-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.elo-stat-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.elo-stat-value.positive {
    color: #22c55e;
}

/* Match result cell */
.result-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-badge {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.875rem;
}

.result-badge.win {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.result-badge.loss {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.score {
    font-weight: 700;
}

.score.win {
    color: #22c55e;
}

.score.loss {
    color: #ef4444;
}

/* Skill level cell */
.skill-level-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-level-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

.skill-elo {
    font-weight: 700;
}

.elo-diff {
    font-size: 0.813rem;
    font-weight: 600;
}

.elo-diff.positive {
    color: #22c55e;
}

.elo-diff.negative {
    color: #ef4444;
}

/* Map cell */
.map-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.map-name {
    font-weight: 500;
}

/* Show more button */
.show-more-btn {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

/* Date cell */
.date-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-main {
    font-weight: 600;
}

.date-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Match indicator */
.match-indicator {
    width: 4px;
    height: 100%;
    border-radius: 2px;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
}

.match-indicator.win {
    background: #22c55e;
}

.match-indicator.loss {
    background: #ef4444;
}

.match-row {
    position: relative;
    padding-left: 16px;
}

.match-row .match-indicator {
    left: 0;
    height: 100%;
}

/* Responsive */
@media (max-width: 1100px) {
    .player-header {
        grid-template-columns: 1fr;
    }

    .player-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .player-avatar-card,
    .player-info-card,
    .activity-card {
        flex: 1;
        min-width: 250px;
    }

    .quick-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .performance-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .player-page {
        padding-top: 40px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .player-page .container {
        padding-left: 0;
        padding-right: 0;
    }

    .player-header {
        gap: 16px;
        margin-bottom: 24px;
    }

    .player-sidebar {
        flex-direction: column;
    }

    .player-avatar-card,
    .player-info-card,
    .activity-card,
    .player-tabs,
    .quick-stats,
    .performance-section,
    .match-history-section,
    .player-content {
        width: 100%;
        max-width: 320px;
        margin: 0px 15px;
    }

    .player-avatar-card {
        padding: 20px;
    }

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

    .player-avatar img {
        width: 100px;
        height: 100px;
    }

    .player-name {
        font-size: 1.25rem;
        margin-bottom: 12px;
    }

    .player-elo,
    .player-rank {
        font-size: 0.875rem;
        padding: 8px 12px;
    }

    .player-info-card,
    .activity-card {
        padding: 10px;
    }

    .cache-badge {
        font-size: 0.75rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .cache-badge .cache-refresh-btn {
        font-size: 0.625rem;
    }

    .player-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin: 0;
    }

    .player-tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        padding: 8px 12px;
        font-size: 0.813rem;
        flex-shrink: 0;
    }

    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 16px;
        margin: 0;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.688rem;
    }

    .performance-section {
        margin: 0;
    }

    .match-history-section {
        margin: 0;
    }

    .performance-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
    }

    .perf-stat:nth-child(5) {
        grid-column: 1 / -1;
        justify-self: center;
        width: 100%;
        max-width: 280px;
    }

    .perf-stat {
        padding: 12px;
    }

    .perf-value {
        font-size: 1rem;
    }

    .perf-label {
        font-size: 0.688rem;
    }

    .section-header {
        gap: 8px;
    }

    .section-title {
        font-size: 1rem;
    }

    .section-subtitle {
        font-size: 0.75rem;
    }

    .view-more-link {
        font-size: 0.688rem;
    }

    .elo-graph-container {
        height: 180px;
    }

    #eloChart {
        height: 180px;
    }

    .elo-graph-legend {
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
    }

    .match-history-table th,
    .match-history-table td {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .match-history-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .match-history-table-container::-webkit-scrollbar {
        display: none;
    }

    .match-history-table {
        min-width: 600px;
    }

    .matches-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .matches-table-container::-webkit-scrollbar {
        display: none;
    }

    .matches-table {
        min-width: 600px;
    }

    .matches-table th,
    .matches-table td {
        padding: 8px;
        font-size: 0.75rem;
        height: auto;
    }

    .match-history-table .hide-mobile,
    .matches-table .hide-mobile {
        display: none;
    }

    .match-map img {
        width: 24px;
        height: 24px;
    }

    .match-elo-result {
        font-size: 0.688rem;
        padding: 4px 8px;
    }

    .match-elo-rating .elo-level {
        width: 16px;
        height: 16px;
        font-size: 0.5rem;
    }

    .match-elo-change {
        font-size: 0.625rem;
    }

    .activity-calendar {
        grid-template-columns: 24px repeat(13, 1fr);
    }

    .activity-calendar-months span,
    .activity-calendar-days span {
        font-size: 0.5rem;
    }

    .activity-calendar-cell {
        min-height: 10px;
    }

    .activity-legend {
        font-size: 0.625rem;
    }

    .activity-stats {
        font-size: 0.688rem;
    }

    .social-links {
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
    }

    .social-link {
        width: 32px;
        height: 32px;
    }

    .btn-action {
        padding: 8px 12px;
        font-size: 0.813rem;
    }
}

@media (max-width: 480px) {
    .player-avatar {
        width: 80px;
        height: 80px;
    }

    .player-avatar img {
        width: 80px;
        height: 80px;
    }

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

    .quick-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 12px;
    }

    .stat-value {
        font-size: 1.125rem;
    }

    .performance-stats {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .overview-cards {
        grid-template-columns: 1fr;
    }

    .matches-table td {
        padding: 6px;
    }

    .match-map {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Detailed Statistics Page */
.detailed-stats-section {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Overview Cards */
.overview-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.overview-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}

.overview-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.overview-icon svg {
    width: 24px;
    height: 24px;
}

.overview-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.overview-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.overview-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stats Subsection */
.stats-subsection {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.stats-subtitle {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Weapon Stats Table */
.weapon-stats-section {
    margin-top: 24px;
}

.weapon-stats-container,
.map-stats-container,
.weapons-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.weapon-stats-container,
.map-stats-container {
    overflow-x: auto;
}

.weapons-table,
.weapon-stats-table,
.map-stats-table {
    width: 100%;
    border-collapse: collapse;
}

.weapons-table th,
.weapon-stats-table th,
.map-stats-table th {
    background: var(--bg-secondary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.weapons-table td,
.weapon-stats-table td,
.map-stats-table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.weapons-table tbody tr:hover,
.weapon-stats-table tbody tr:hover,
.map-stats-table tbody tr:hover {
    background: var(--bg-secondary);
}

.weapons-table tbody tr:last-child td,
.weapon-stats-table tbody tr:last-child td,
.map-stats-table tbody tr:last-child td {
    border-bottom: none;
}

/* Weapon info in stats table */
.weapon-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.weapon-info .weapon-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.weapon-info .cs2_weapon {
    flex-shrink: 0;
}

/* Kills and Headshots columns */
.weapons-table td.kills,
.weapons-table td.headshots {
    font-weight: 600;
    white-space: nowrap;
}

.weapons-table th:nth-child(2),
.weapons-table th:nth-child(3) {
    width: 120px;
}

.positive {
    color: #22c55e;
}

.negative {
    color: #ef4444;
}

/* Charts */
.monthly-activity-chart,
.elo-history-chart {
    height: 300px;
    position: relative;
}

/* Responsive for detailed stats */
@media (max-width: 1100px) {
    .overview-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .overview-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .overview-card {
        padding: 16px;
    }

    .overview-icon {
        width: 40px;
        height: 40px;
    }

    .overview-value {
        font-size: 1.25rem;
    }

    .stats-subsection {
        padding: 16px;
    }

    .monthly-activity-chart,
    .elo-history-chart {
        height: 250px;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px;
}

.pagination-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* History Section */
.match-history-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.match-history-table-container {
    overflow-x: auto;
}

.match-history-table {
    width: 100%;
    border-collapse: collapse;
}

.match-history-table th,
.match-history-table td {
    padding: 4px 8px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.match-history-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
}

.match-history-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.match-history-table td {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.match-history-table tbody tr:hover {
    background: var(--bg-secondary);
}

.match-history-table tbody tr:last-child td {
    border-bottom: none;
}

.matches-table th {
    background: var(--bg-secondary);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.matches-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
    vertical-align: middle;
    height: 72px;
}

.matches-table tbody tr:last-child td {
    border-bottom: none;
}

.matches-table tbody tr:hover {
    background: var(--bg-secondary);
}

.match-date-history {
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.match-date-history .date {
    font-weight: 500;
}

.match-date-history .time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.match-elo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.match-elo-result {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 24px;
    font-size: 0.813rem;
}

.match-elo-result.win {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.match-elo-result.loss {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.match-elo-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.match-elo-rating .elo-level {
    width: 20px;
    height: 20px;
    background: rgba(251, 191, 36, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    color: #fbbf24;
    font-weight: 700;
    flex-shrink: 0;
}

.match-elo-rating .elo-value {
    font-weight: normal;
    font-size: 1rem;
    color: var(--text-primary);
}

.match-elo-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.688rem;
    font-weight: 600;
    flex-shrink: 0;
}

.match-elo-change.positive {
    color: #22c55e;
}

.match-elo-change.negative {
    color: #ef4444;
}

.match-map {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.match-map img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

/* ============================================
   Skeleton Loaders
   ============================================ */

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

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Activity Calendar Skeleton */
.skeleton-calendar {
    height: 120px;
    margin-top: 12px;
}

.skeleton-calendar .skeleton-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.skeleton-calendar .skeleton-cell {
    height: 12px;
    flex: 1;
}

/* Elo Graph Skeleton */
.skeleton-elo-graph {
    height: 200px;
    margin-bottom: 16px;
}

.skeleton-elo-legend {
    height: 80px;
}

.skeleton-stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.skeleton-stat-label {
    height: 14px;
    width: 80px;
}

.skeleton-stat-value {
    height: 16px;
    width: 60px;
}

/* Hide skeleton when content is loaded */
.skeleton-hidden {
    display: none !important;
}


/* ============================================
   CS2 Weapons Sprites
   ============================================ */

.cs2_weapon {
  display: inline-block;
  background-image: url("/img/cs2_weapons_white.png");
  background-repeat: no-repeat;
  /* Variables para escalado */
  --scale-x: 1;
  --scale-y: 1;
  --sprite-width: 800px;      /* Ancho total del sprite sheet */
  --sprite-height: 400px;     /* Alto total del sprite sheet */
  --weapon-width: 100px;      /* Ancho base del arma */
  --weapon-height: 100px;     /* Alto base del arma */
  --pos-x: 0;                 /* Posición X del arma en el sprite */
  --pos-y: 0;                 /* Posición Y del arma en el sprite */
  /* Aplicar variables */
  background-size: calc(var(--sprite-width) * var(--scale-x)) calc(var(--sprite-height) * var(--scale-y));
  background-position: calc(var(--pos-x) * var(--scale-x)) calc(var(--pos-y) * var(--scale-y));
  width: calc(var(--weapon-width) * var(--scale-x));
  height: calc(var(--weapon-height) * var(--scale-y));
  position: relative;
}

/* Headshot tooltip */
.headshot {
    display: inline-block;
    position: relative;
    width: 16px;
    height: 16px;
    margin-left: 2px;
    vertical-align: middle;
}

.headshot img {
    width: 100%;
    height: 100%;
    display: block;
}

.headshot:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.cs2_weapon[data-weapon-name]:hover::after {
  content: attr(data-weapon-name);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: capitalize;
}

/* Tamaños predefinidos */
.cs2_weapon.xs {
    --scale-x: 0.34;
    --scale-y: 0.52;
}
.cs2_weapon.sm { --scale-x: 0.55; --scale-y: 0.75; }
.cs2_weapon.lg { --scale-x: 1.5; --scale-y: 1.5; }
.cs2_weapon.xl { --scale-x: 2; --scale-y: 2; }

/* ============================================
   Armas individuales (ajusta coordenadas y tamaños)
   ============================================ */

.cs2_weapon.weapon_deagle {
    --weapon-width: 85px;
    --weapon-height: 32px;
    --pos-x: -19px;
    --pos-y: -5px;
}
.cs2_weapon.weapon_beretas {
    --weapon-width: 110px;
    --weapon-height: 30px;
    --pos-x: -116px;
    --pos-y: -5px;
}
.cs2_weapon.weapon_five_seven {
    --weapon-width: 55px;
    --weapon-height: 30px;
    --pos-x: -274px;
    --pos-y: -5px;
}
.cs2_weapon.weapon_glock {
    --weapon-width: 85px;
    --weapon-height: 30px;
    --pos-x: -358px;
    --pos-y: -5px;
}
.cs2_weapon.weapon_ak47 {
    --weapon-width: 165px;
    --weapon-height: 29px;
    --pos-x: -453px;
    --pos-y: -6px;
}
.cs2_weapon.weapon_aug {
    --weapon-width: 105px;
    --weapon-height: 32px;
    --pos-x: -626px;
    --pos-y: -6px;
}
.cs2_weapon.weapon_awp {
    --weapon-width: 208px;
    --weapon-height: 28px;
    --pos-x: -13px;
    --pos-y: -48px;
}
.cs2_weapon.weapon_famas {
    --weapon-width: 98px;
    --weapon-height: 28px;
    --pos-x: -229px;
    --pos-y: -48px;
}
.cs2_weapon.weapon_scar {
    --weapon-width: 125px;
    --weapon-height: 28px;
    --pos-x: -372px;
    --pos-y: -48px;
}
.cs2_weapon.weapon_galil {
    --weapon-width: 130px;
    --weapon-height: 30px;
    --pos-x: -554px;
    --pos-y: -47px;
}
.cs2_weapon.weapon_m4a1 {
    --weapon-width: 170px;
    --weapon-height: 29px;
    --pos-x: -13px;
    --pos-y: -86px;
}
.cs2_weapon.weapon_m4a1_silencer {
    --weapon-width: 210px;
    --weapon-height: 29px;
    --pos-x: -182px;
    --pos-y: -86px;
}
.cs2_weapon.weapon_mac10 {
    --weapon-width: 55px;
    --weapon-height: 29px;
    --pos-x: -398px;
    --pos-y: -86px;
}
.cs2_weapon.weapon_p2000 {
    --weapon-width: 55px;
    --weapon-height: 29px;
    --pos-x: -479px;
    --pos-y: -86px;
}
.cs2_weapon.weapon_ump {
    --weapon-width: 105px;
    --weapon-height: 29px;
    --pos-x: -562px;
    --pos-y: -86px;
}
.cs2_weapon.weapon_machine_gun {
    --weapon-width: 110px;
    --weapon-height: 29px;
    --pos-x: -472px;
    --pos-y: -126px;
}
.cs2_weapon.weapon_recortada_terror {
    --weapon-width: 85px;
    --weapon-height: 29px;
    --pos-x: -354px;
    --pos-y: -126px;
}
.cs2_weapon.weapon_ppbizon {
    --weapon-width: 115px;
    --weapon-height: 29px;
    --pos-x: -186px;
    --pos-y: -126px;
}
.cs2_weapon.weapon_escopeta {
    --weapon-width: 118px;
    --weapon-height: 29px;
    --pos-x: -13px;
    --pos-y: -126px;
}
.cs2_weapon.recortada {
    --weapon-width: 115px;
    --weapon-height: 29px;
    --pos-x: -628px;
    --pos-y: -126px;
}
.cs2_weapon.weapon_usp_silencer {
    --weapon-width: 150px;
    --weapon-height: 29px;
    --pos-x: -11px;
    --pos-y: -286px;
}
.cs2_weapon.weapon_knife {
    --weapon-width: 132px;
    --weapon-height: 23px;
    --pos-x: -463px;
    --pos-y: -251px;
}