/* ============================================
   LEADERBOARD.CSS - Rankings & Player Stats
   ============================================ */

/* ============================================
   LEADERBOARD CONTAINER
   ============================================ */

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

.leaderboard-header {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 32px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.3);
    position: relative;
    overflow: hidden;
}

.leaderboard-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 10s linear infinite;
}

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

.leaderboard-title {
    font-size: 42px;
    font-weight: 900;
    color: white;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.leaderboard-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.95);
    position: relative;
    z-index: 1;
}

/* ============================================
   FILTER TABS
   ============================================ */

.filter-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tab {
    padding: 12px 24px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    border-color: #fbbf24;
    color: #f59e0b;
}

.filter-tab.active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-color: #fbbf24;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

/* ============================================
   PODIUM - TOP 3
   ============================================ */

.podium-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
    align-items: end;
}

.podium-item {
    text-align: center;
    animation: slideUp 0.6s ease-out backwards;
}

.podium-item:nth-child(1) {
    order: 2;
    animation-delay: 0.1s;
}

.podium-item:nth-child(2) {
    order: 1;
    animation-delay: 0.2s;
}

.podium-item:nth-child(3) {
    order: 3;
    animation-delay: 0.3s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.podium-rank-1 {
    transform: scale(1.1);
}

.podium-medal {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 1s ease-in-out infinite;
}

.podium-rank-1 .podium-medal {
    animation-delay: 0s;
}

.podium-rank-2 .podium-medal {
    animation-delay: 0.2s;
}

.podium-rank-3 .podium-medal {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.podium-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.podium-rank-1 .podium-avatar {
    width: 100px;
    height: 100px;
    border-color: #fbbf24;
    border-width: 5px;
}

.podium-rank-2 .podium-avatar {
    border-color: #cbd5e1;
}

.podium-rank-3 .podium-avatar {
    border-color: #fdba74;
}

.podium-rank-badge {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    color: white;
    border: 3px solid white;
}

.podium-rank-1 .podium-rank-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.podium-rank-2 .podium-rank-badge {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
}

.podium-rank-3 .podium-rank-badge {
    background: linear-gradient(135deg, #fdba74 0%, #fb923c 100%);
}

.podium-name {
    font-size: 18px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 8px;
}

.podium-rank-1 .podium-name {
    font-size: 20px;
}

.podium-score {
    font-size: 24px;
    font-weight: 900;
    color: #fbbf24;
    margin-bottom: 4px;
}

.podium-rank-1 .podium-score {
    font-size: 28px;
}

.podium-stats {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

/* ============================================
   RANKINGS LIST
   ============================================ */

.rankings-list {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.ranking-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.ranking-item.current-user {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.rank-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    flex-shrink: 0;
}

.rank-number.top-10 {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.rank-number.top-50 {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    color: white;
}

.rank-number.other {
    background: #e5e7eb;
    color: #6b7280;
}

.rank-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
}

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

.rank-name {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-stats {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.rank-score {
    text-align: right;
    flex-shrink: 0;
}

.rank-points {
    font-size: 24px;
    font-weight: 900;
    color: #fbbf24;
    display: block;
    margin-bottom: 4px;
}

.rank-games {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

/* ============================================
   MY RANK CARD
   ============================================ */

.my-rank-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: sticky;
    top: 20px;
    z-index: 10;
}

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

.my-rank-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.my-rank-info h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
}

.my-rank-position {
    font-size: 14px;
    opacity: 0.9;
}

.my-rank-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 900;
    display: block;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 600;
}

/* ============================================
   LOADING STATES
   ============================================ */

.leaderboard-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 16px;
    color: #6b7280;
    font-weight: 600;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 24px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 12px;
}

.empty-message {
    font-size: 16px;
    color: #6b7280;
}

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

@media (max-width: 768px) {
    .podium-container {
        gap: 8px;
    }
    
    .podium-medal {
        font-size: 48px;
    }
    
    .podium-avatar {
        width: 60px;
        height: 60px;
    }
    
    .podium-rank-1 .podium-avatar {
        width: 70px;
        height: 70px;
    }
    
    .podium-name {
        font-size: 14px;
    }
    
    .podium-rank-1 .podium-name {
        font-size: 16px;
    }
    
    .podium-score {
        font-size: 18px;
    }
    
    .podium-rank-1 .podium-score {
        font-size: 20px;
    }
    
    .podium-stats {
        font-size: 11px;
    }
    
    .ranking-item {
        gap: 12px;
        padding: 12px;
    }
    
    .rank-avatar {
        width: 40px;
        height: 40px;
    }
    
    .rank-name {
        font-size: 14px;
    }
    
    .rank-points {
        font-size: 20px;
    }
    
    .my-rank-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}
