@import url('./design-tokens.css');
/**
 * Leaderboard UI Styles
 * Full-page leaderboard with glassmorphism design
 *
 * @version 1.0.0
 * @lastUpdate 2026-01-19
 */

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

#leaderboard-window {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    max-width: 95vw;
    max-height: 85vh;
    flex-direction: column;

    background: rgba(20, 20, 35, 0.92);
    backdrop-filter: blur(var(--glass-blur-md));
    -webkit-backdrop-filter: blur(var(--glass-blur-md));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;

    z-index: 1500;
    overflow: hidden;
}

#leaderboard-window.fullscreen {
    top: 0;
    left: 0;
    transform: none;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
}

/* ============================================================================
   CONTENT
   ============================================================================ */

.lb-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
    gap: var(--spacing-md);
}

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

.lb-tabs {
    display: flex;
    gap: var(--spacing-sm);
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
}

.lb-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;

    background: transparent;
    border: none;
    border-radius: var(--radius-md);

    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lb-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: var(--glass-bg-light);
}

.lb-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.lb-tab-icon {
    font-size: 14px;
}

/* ============================================================================
   PODIUM
   ============================================================================ */

.lb-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 20px 10px 0;
    margin-bottom: 8px;
}

.lb-podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: transform 0.3s ease;
}

.lb-podium-place:hover {
    transform: translateY(-4px);
}

.lb-podium-place.lb-podium-me {
    transform: scale(1.05);
}

.lb-podium-place.lb-podium-me .lb-podium-pedestal {
    border-color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

/* Crown */
.lb-podium-crown {
    font-size: 24px;
    margin-bottom: 4px;
    animation: crown-bounce 2s ease-in-out infinite;
}

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

/* Avatar */
.lb-podium-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-bottom: 8px;
}

.lb-podium-place.first .lb-podium-avatar {
    width: 56px;
    height: 56px;
    font-size: 38px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.lb-podium-place.second .lb-podium-avatar {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.lb-podium-place.third .lb-podium-avatar {
    background: linear-gradient(135deg, #cd7f32 0%, #a0522d 100%);
}

/* Name & XP */
.lb-podium-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-podium-xp {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

/* Pedestal */
.lb-podium-pedestal {
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md) 8px 0 0;
}

.lb-podium-place.first .lb-podium-pedestal {
    height: 80px;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.15) 0%, rgba(251, 191, 36, 0.05) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.lb-podium-place.second .lb-podium-pedestal {
    height: 60px;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.15) 0%, rgba(148, 163, 184, 0.05) 100%);
    border-color: rgba(148, 163, 184, 0.3);
}

.lb-podium-place.third .lb-podium-pedestal {
    height: 45px;
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.15) 0%, rgba(205, 127, 50, 0.05) 100%);
    border-color: rgba(205, 127, 50, 0.3);
}

/* Empty podium */
.lb-podium-place.lb-podium-empty {
    opacity: 0.4;
}

/* ============================================================================
   MY POSITION CARD
   ============================================================================ */

.lb-my-position {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px 16px;

    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
}

.lb-my-rank {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 10px;
}

.lb-rank-number {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.lb-my-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lb-my-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.lb-my-xp {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.lb-my-gap {
    text-align: right;
}

.lb-gap-text {
    font-size: 11px;
    color: #22c55e;
}

/* ============================================================================
   LEADERBOARD LIST
   ============================================================================ */

.lb-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lb-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;

    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lb-entry:hover {
    background: var(--glass-bg-light);
    border-color: var(--glass-border);
}

.lb-entry.lb-entry-me {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.lb-entry-rank {
    width: 28px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.lb-entry-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.lb-entry-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.lb-entry-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-entry-level {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.lb-entry-xp {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.lb-entry-streak {
    font-size: 12px;
    padding: 2px 6px;
    background: rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-xs);
    color: #fbbf24;
}

.lb-list-empty {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

/* ============================================================================
   LOADING & EMPTY STATES
   ============================================================================ */

.lb-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.lb-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: lb-spin 1s linear infinite;
}

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

.lb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 40px 20px;
    text-align: center;
}

.lb-empty-icon {
    font-size: 48px;
    opacity: 0.5;
}

.lb-empty-text {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
}

.lb-empty-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.lb-error {
    color: #f87171;
    font-size: 14px;
}

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

@media (max-width: 520px) {
    #leaderboard-window {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }

    .lb-podium-place {
        transform: scale(0.9);
    }

    .lb-tab {
        padding: 8px 6px;
        font-size: 12px;
    }

    .lb-tab-icon {
        display: none;
    }
}






