/* Leaderboard modal — Telegram-native style. */
.lb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1002;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.lb-overlay.show { display: flex; }

.lb-sheet {
    width: 100%;
    max-width: 520px;
    background: var(--tg-theme-bg-color, #18222d);
    color:      var(--tg-theme-text-color, #fff);
    border-radius: 14px 14px 0 0;
    padding: 16px 16px 24px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
    animation: lbUp 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
@keyframes lbUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.lb-sheet::before {
    content: '';
    display: block;
    width: 36px;
    height: 5px;
    border-radius: 999px;
    background: var(--tg-theme-hint-color, rgba(255,255,255,0.3));
    opacity: 0.5;
    margin: 0 auto 14px;
}

.lb-sheet h2 {
    margin: 0 0 12px;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
}

.lb-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: var(--tg-theme-secondary-bg-color, rgba(255,255,255,0.05));
    border-radius: 10px;
    padding: 4px;
}
.lb-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--tg-theme-hint-color, rgba(255,255,255,0.55));
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.lb-tab:hover  { color: var(--tg-theme-text-color, #fff); }
.lb-tab.active {
    background: var(--tg-theme-bg-color, #18222d);
    color: var(--tg-theme-text-color, #fff);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.lb-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--tg-theme-secondary-bg-color, rgba(255,255,255,0.05));
    border-radius: 12px;
    border: 1px solid transparent;
    transition: background 0.15s;
}
.lb-row.me {
    background: linear-gradient(135deg, rgba(255,215,0,0.20), rgba(255,140,0,0.10));
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.18);
}
.lb-rank {
    font-weight: 700;
    font-size: 15px;
    min-width: 32px;
    text-align: center;
    color: var(--tg-theme-hint-color, rgba(255,255,255,0.55));
}
.lb-row:nth-child(1) .lb-rank { color: #ffd700; font-size: 18px; }
.lb-row:nth-child(2) .lb-rank { color: #c0c0c0; font-size: 17px; }
.lb-row:nth-child(3) .lb-rank { color: #cd7f32; font-size: 17px; }
.lb-medal {
    width: 24px;
    font-size: 16px;
    line-height: 1;
    text-align: center;
}
.lb-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lb-score {
    font-weight: 700;
    font-size: 14px;
    color: var(--tg-theme-link-color, #2ea6ff);
    white-space: nowrap;
}

.lb-empty {
    text-align: center;
    color: var(--tg-theme-hint-color, rgba(255,255,255,0.55));
    padding: 32px 16px;
    font-size: 14px;
}

.lb-my-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--tg-theme-section-separator-color, rgba(255,255,255,0.08));
    text-align: center;
    font-size: 13px;
    color: var(--tg-theme-hint-color, rgba(255,255,255,0.6));
}
.lb-my-footer strong { color: var(--tg-theme-text-color, #fff); }

/* Сезонное правило: обнуление 1-го числа + призы за топ-3 месяца. */
.lb-season {
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--tg-theme-secondary-bg-color, rgba(255,255,255,0.05));
    text-align: center;
    font-size: 12px;
    line-height: 1.35;
    color: var(--tg-theme-hint-color, rgba(255,255,255,0.6));
}
.lb-season strong { color: var(--tg-theme-text-color, #fff); }

.lb-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: var(--tg-theme-hint-color, rgba(255,255,255,0.55));
    font-size: 22px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lb-close:hover {
    background: var(--tg-theme-secondary-bg-color, rgba(255,255,255,0.08));
    color: var(--tg-theme-text-color, #fff);
}

/* Поделиться — крупная CTA внизу шторки */
.lb-share {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2ea6ff, #1c89e0);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(46, 166, 255, 0.32);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.lb-share:active   { transform: scale(0.98); }
.lb-share:hover    { box-shadow: 0 6px 20px rgba(46, 166, 255, 0.42); }
