/* ============================================
   LEADERBOARD VIEW — full screen, mafia noir
   ============================================ */

.leaderboard-app {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at top, rgba(216, 48, 48, 0.08) 0%, transparent 50%),
        var(--bg-primary);
    padding-bottom: 100px;
}

/* === Header === */
.lb-header {
    position: relative;
    padding: 32px 20px 24px;
    overflow: hidden;
}

.lb-header-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(212, 175, 55, 0.18) 0%, transparent 60%),
        linear-gradient(180deg,
            rgba(40, 14, 14, 0.4) 0%,
            transparent 100%);
    pointer-events: none;
}

.lb-header-content {
    position: relative;
    text-align: center;
    z-index: 1;
}

.lb-trophy {
    font-size: 56px;
    line-height: 1;
    filter: drop-shadow(0 0 24px rgba(212, 175, 55, 0.7));
    animation: trophyShine 3s ease-in-out infinite;
    margin-bottom: 12px;
}

@keyframes trophyShine {
    0%, 100% { transform: scale(1) rotate(-3deg); }
    50%      { transform: scale(1.08) rotate(3deg); }
}

.lb-title {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(90deg, #fff 0%, var(--accent-gold-bright) 50%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-shadow: 0 0 24px rgba(212, 175, 55, 0.3);
}

.lb-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* === Player list === */
.lb-list {
    padding: 0 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* === Card (default) === */
.lb-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    background: linear-gradient(135deg,
        rgba(28, 28, 40, 0.88) 0%,
        rgba(24, 24, 31, 0.92) 100%);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lb-card:active {
    transform: scale(0.98);
}

.lb-card-rank {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-secondary);
}

/* Rank 1-3 medals — slightly bigger emoji */
.lb-card--rank-1 .lb-card-rank,
.lb-card--rank-2 .lb-card-rank,
.lb-card--rank-3 .lb-card-rank {
    font-size: 26px;
    background: transparent;
    border: none;
}

.lb-card--rank-1 {
    background: linear-gradient(135deg,
        rgba(212, 175, 55, 0.15) 0%,
        rgba(28, 28, 40, 0.92) 100%);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 24px rgba(212, 175, 55, 0.15);
}

.lb-card--rank-2 {
    background: linear-gradient(135deg,
        rgba(192, 192, 208, 0.1) 0%,
        rgba(28, 28, 40, 0.92) 100%);
    border-color: rgba(192, 192, 208, 0.3);
}

.lb-card--rank-3 {
    background: linear-gradient(135deg,
        rgba(205, 127, 50, 0.1) 0%,
        rgba(28, 28, 40, 0.92) 100%);
    border-color: rgba(205, 127, 50, 0.3);
}

.lb-card-body {
    flex: 1;
    min-width: 0;
}

.lb-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.lb-card-name-text {
    color: var(--text-primary);
}

.lb-card-title {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-style: italic;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    text-shadow: 0 0 6px rgba(212, 175, 55, 0.3);
}

.lb-card-stats {
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 0.3px;
}

.lb-card-mmr {
    flex-shrink: 0;
    text-align: right;
}

.lb-card-mmr-value {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-gold);
    line-height: 1;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

.lb-card-mmr-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-tertiary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* "You" marker */
.lb-card--me {
    box-shadow: 0 0 0 1.5px var(--accent-emerald) inset, 0 0 16px rgba(45, 212, 191, 0.2);
}

.lb-me-marker {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 700;
    background: var(--accent-emerald);
    color: var(--bg-primary);
    border-radius: var(--radius-full);
    letter-spacing: 1px;
    text-transform: uppercase;
    vertical-align: middle;
}

/* ============================================
   VIP cards — premium aura
   ============================================ */
.lb-card--vip {
    /* Reserve space for VIP elements */
    padding-right: 56px;  /* ribbon joyini ta'minlash */
}

.lb-card--vip .lb-card-name-text {
    background: linear-gradient(90deg, var(--accent-gold-bright), #fff, var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: vipNameShimmer 4s ease-in-out infinite;
}

@keyframes vipNameShimmer {
    0%, 100% { background-position: 0% center; }
    50%      { background-position: 100% center; }
}

.lb-vip-aura {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: var(--radius-lg);
    z-index: 0;
}

.lb-vip-ribbon {
    position: absolute;
    top: 50%;
    right: -2px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-gold));
    color: var(--bg-primary);
    font-family: 'Cinzel', serif;
    font-size: 9px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    letter-spacing: 1.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* VIP aura color variants */
.lb-card--vip-gold {
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.4),
        0 0 20px rgba(212, 175, 55, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    background: linear-gradient(135deg,
        rgba(50, 28, 12, 0.85) 0%,
        rgba(28, 18, 24, 0.92) 100%);
}

.lb-card--vip-red {
    border-color: rgba(216, 48, 48, 0.6);
    box-shadow:
        0 0 0 1px rgba(216, 48, 48, 0.4),
        0 0 20px rgba(216, 48, 48, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    background: linear-gradient(135deg,
        rgba(60, 14, 14, 0.85) 0%,
        rgba(28, 18, 24, 0.92) 100%);
}

.lb-card--vip-red .lb-vip-ribbon {
    background: linear-gradient(135deg, #ff6060, var(--accent-blood));
    color: white;
}

.lb-card--vip-purple {
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow:
        0 0 0 1px rgba(168, 85, 247, 0.4),
        0 0 20px rgba(168, 85, 247, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    background: linear-gradient(135deg,
        rgba(40, 14, 60, 0.85) 0%,
        rgba(28, 18, 24, 0.92) 100%);
}

.lb-card--vip-purple .lb-vip-ribbon {
    background: linear-gradient(135deg, #c084fc, var(--accent-purple));
    color: white;
}

.lb-card--vip-emerald {
    border-color: rgba(45, 212, 191, 0.6);
    box-shadow:
        0 0 0 1px rgba(45, 212, 191, 0.4),
        0 0 20px rgba(45, 212, 191, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    background: linear-gradient(135deg,
        rgba(12, 50, 44, 0.85) 0%,
        rgba(28, 18, 24, 0.92) 100%);
}

.lb-card--vip-emerald .lb-vip-ribbon {
    background: linear-gradient(135deg, #5eead4, var(--accent-emerald));
    color: var(--bg-primary);
}

/* ============================================
   Footer
   ============================================ */
.lb-footer {
    padding: 24px 20px;
    text-align: center;
}

.lb-close-btn {
    padding: 12px 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    font-family: inherit;
}

.lb-close-btn:active {
    transform: scale(0.96);
}

/* ============================================
   Error state
   ============================================ */
.leaderboard-error {
    text-align: center;
    padding: 48px 24px;
}

.leaderboard-error-icon {
    font-size: 64px;
    margin-bottom: 20px;
    filter: grayscale(0.3);
}

.leaderboard-error-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-blood);
    margin-bottom: 8px;
}

.leaderboard-error-msg {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.leaderboard-error-btn {
    padding: 12px 24px;
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

/* ============================================
   Detail bottom-sheet modal
   ============================================ */
.modal--bottom-sheet .modal-content--sheet {
    max-width: 480px;
    width: 100%;
    margin: auto auto 0 auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px 20px 32px;
    animation: sheetSlideUp 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sheetSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.modal--bottom-sheet .modal-content--sheet::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
}

/* Detail content */
.detail-header {
    text-align: center;
    padding: 16px 0 20px;
    position: relative;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.detail-name {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.detail-title {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-style: italic;
    color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.detail-header.detail--vip .detail-name {
    background: linear-gradient(90deg, var(--accent-gold-bright), #fff, var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-vip-ribbon {
    position: absolute;
    top: 4px;
    right: 0;
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-gold));
    color: var(--bg-primary);
    font-family: 'Cinzel', serif;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    letter-spacing: 1.5px;
}

.detail-section {
    margin-bottom: 16px;
}

.detail-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.detail-magic-word {
    padding: 14px 16px;
    background: linear-gradient(135deg,
        rgba(212, 175, 55, 0.08) 0%,
        rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.55;
    font-style: italic;
    text-align: center;
}

.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}

.detail-stat {
    text-align: center;
    padding: 10px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.detail-stat-value {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-gold);
    line-height: 1;
}

.detail-stat-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

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

.detail-ach {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg,
        rgba(212, 175, 55, 0.06) 0%,
        rgba(24, 24, 31, 0.5) 100%);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-md);
}

.detail-ach-icon {
    font-size: 20px;
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5));
}

.detail-ach-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.lb-detail-loading,
.lb-detail-error {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-tertiary);
}
