/* Leaderboard View */
.leaderboard-view {
    padding: 20px;
    display: none;
}

.leaderboard-view.active {
    display: block;
}

.leaderboard-header {
    margin-bottom: 30px;
    text-align: center;
}

.leaderboard-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.leaderboard-subtitle {
    font-size: 14px;
    color: #666;
}

.leaderboard-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 0 10px;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 110px;
    animation: slideUp 0.6s ease forwards;
    opacity: 0;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.podium-item::before {
    content: '';
    position: absolute;
    inset: -8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.podium-item.first::before {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
}

.podium-item.second::before {
    background: radial-gradient(circle, rgba(192, 192, 192, 0.3) 0%, transparent 70%);
}

.podium-item.third::before {
    background: radial-gradient(circle, rgba(205, 127, 50, 0.3) 0%, transparent 70%);
}

.podium-item:hover::before {
    opacity: 1;
}

.podium-item:active {
    transform: scale(0.95) translateY(4px);
}

.podium-item.first {
    animation-delay: 0.2s;
}

.podium-item.second {
    animation-delay: 0.1s;
}

.podium-item.third {
    animation-delay: 0.3s;
}

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

.podium-crown {
    font-size: 24px;
    margin-bottom: 4px;
    animation: bounce 1s ease infinite;
}

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

.podium-avatar {
    font-size: 36px;
    margin-bottom: 8px;
    background: white;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s ease;
}

.podium-item:hover .podium-avatar {
    transform: scale(1.1);
}

.podium-item.first .podium-avatar {
    width: 72px;
    height: 72px;
    font-size: 40px;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    border: 3px solid #ffd700;
}

.podium-item.second .podium-avatar {
    box-shadow: 0 4px 16px rgba(192, 192, 192, 0.5);
    border: 3px solid #c0c0c0;
}

.podium-item.third .podium-avatar {
    box-shadow: 0 4px 16px rgba(205, 127, 50, 0.5);
    border: 3px solid #cd7f32;
}

.podium-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.podium-score {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.podium-item.first .podium-score {
    color: #d4af37;
}

.podium-item.second .podium-score {
    color: #9a9a9a;
}

.podium-item.third .podium-score {
    color: #b87333;
}

.podium-stand {
    width: 100%;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.podium-item.first .podium-stand {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffc700 100%);
    padding: 24px 0;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.podium-item.second .podium-stand {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 50%, #b8b8b8 100%);
    padding: 18px 0;
    box-shadow: 0 4px 16px rgba(192, 192, 192, 0.4);
}

.podium-item.third .podium-stand {
    background: linear-gradient(135deg, #cd7f32 0%, #e8a87c 50%, #b86f28 100%);
    padding: 14px 0;
    box-shadow: 0 4px 16px rgba(205, 127, 50, 0.4);
}

.stand-rank {
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.podium-item.first .stand-rank {
    color: #8b6914;
    text-shadow: 0 2px 4px rgba(255,255,255,0.3);
}

.podium-item.second .stand-rank {
    color: #555;
    text-shadow: 0 2px 4px rgba(255,255,255,0.3);
}

.podium-item.third .stand-rank {
    color: #5a3a1a;
    text-shadow: 0 2px 4px rgba(255,255,255,0.3);
}

.leaderboard-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s;
    animation: fadeIn 0.4s ease forwards;
    opacity: 0;
    position: relative;
    cursor: pointer;
}

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

.leaderboard-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.1) 0%, rgba(13, 71, 161, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0;
}

.leaderboard-item:hover::after {
    opacity: 1;
}

.leaderboard-item:active {
    transform: scale(0.98);
}

.leaderboard-item.current-user {
    background: rgba(25, 118, 210, 0.05);
    border-left: 4px solid #1976d2;
}

.rank-badge {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #1976d2;
    flex-shrink: 0;
}

.leaderboard-item.current-user .rank-badge {
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.user-avatar {
    font-size: 28px;
    flex-shrink: 0;
}

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

.user-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.user-level {
    font-size: 12px;
    color: #999;
}

.user-score {
    font-size: 16px;
    font-weight: 600;
    color: #1976d2;
    flex-shrink: 0;
}

/* User Profile Modal */
.user-profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.user-profile-modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.user-profile-modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1;
}

.modal-close:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-close svg {
    stroke: #333;
}

.profile-hero {
    text-align: center;
    padding: 40px 20px 30px;
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    color: white;
    position: relative;
}

.profile-avatar-large {
    font-size: 80px;
    margin-bottom: 16px;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.profile-rank-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-level {
    font-size: 16px;
    opacity: 0.9;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px 20px;
    background: #f9f9f9;
}

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

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

.profile-achievements {
    padding: 24px 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.achievement-card {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement-card:hover {
    border-color: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.2);
}

.achievement-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.achievement-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 12px;
    color: #999;
}

