/* /assets/css/leaderboard.css */
/* Страница рейтинга — таблицы, вкладки, топ-3, пагинация */

.lb-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0 4rem;
}

/* ═══════════════════════════════════════════════════════════
   ЗАГОЛОВОК
   ═══════════════════════════════════════════════════════════ */
.lb-page .page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.lb-page .page-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lb-page .page-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* ═══════════════════════════════════════════════════════════
   ВКЛАДКИ
   ═══════════════════════════════════════════════════════════ */
.lb-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.lb-tab {
    padding: 0.85rem 1.5rem;
    background: rgba(19, 24, 54, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.lb-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(6, 182, 212, 0.1));
    opacity: 0;
    transition: opacity 0.25s;
    z-index: 0;
}

.lb-tab > * { position: relative; z-index: 1; }

.lb-tab:hover {
    color: var(--text-primary);
    border-color: rgba(124, 58, 237, 0.4);
    transform: translateY(-2px);
}

.lb-tab.active {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    border-color: transparent;
    color: #fff;
    box-shadow:
        0 8px 24px rgba(124, 58, 237, 0.4),
        0 0 0 1px rgba(124, 58, 237, 0.3);
}

.lb-tab.active:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 32px rgba(124, 58, 237, 0.5),
        0 0 0 1px rgba(124, 58, 237, 0.4);
}

/* ═══════════════════════════════════════════════════════════
   SELECT КВИЗА
   ═══════════════════════════════════════════════════════════ */
#lb-quiz-wrap {
    margin-bottom: 1.5rem;
}

.lb-map-select {
    width: 100%;
    max-width: 560px;
    padding: 0.85rem 3rem 0.85rem 1.25rem;
    background: rgba(19, 24, 54, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    transition: all 0.2s;
}

.lb-map-select:focus {
    border-color: var(--accent-purple);
    background-color: rgba(124, 58, 237, 0.08);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

.lb-map-select option {
    background: #131836;
    color: #fff;
    padding: 10px;
}

/* ═══════════════════════════════════════════════════════════
   ОБЁРТКА ТАБЛИЦЫ
   ═══════════════════════════════════════════════════════════ */
.lb-card {
    background: linear-gradient(145deg, rgba(20, 24, 54, 0.7), rgba(13, 17, 40, 0.85));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.lb-table-wrap {
    overflow-x: auto;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 640px;
}

.lb-table thead {
    background: rgba(0, 0, 0, 0.25);
}

.lb-table th {
    padding: 1.1rem 1.25rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.lb-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.lb-table tbody tr {
    transition: background 0.15s;
}

.lb-table tbody tr:hover td {
    background: rgba(124, 58, 237, 0.06);
}

.lb-table tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Плашки топ-3 ─── */
.lb-table tbody tr.rank-1 td { background: linear-gradient(90deg, rgba(255, 215, 0, 0.08), transparent 70%); }
.lb-table tbody tr.rank-2 td { background: linear-gradient(90deg, rgba(192, 192, 192, 0.06), transparent 70%); }
.lb-table tbody tr.rank-3 td { background: linear-gradient(90deg, rgba(205, 127, 50, 0.06), transparent 70%); }

.lb-table tbody tr.rank-1:hover td { background: linear-gradient(90deg, rgba(255, 215, 0, 0.14), rgba(124, 58, 237, 0.06) 70%); }
.lb-table tbody tr.rank-2:hover td { background: linear-gradient(90deg, rgba(192, 192, 192, 0.12), rgba(124, 58, 237, 0.06) 70%); }
.lb-table tbody tr.rank-3:hover td { background: linear-gradient(90deg, rgba(205, 127, 50, 0.12), rgba(124, 58, 237, 0.06) 70%); }

/* ═══════════════════════════════════════════════════════════
   РАНГ
   ═══════════════════════════════════════════════════════════ */
.lb-rank {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    width: 70px;
    color: var(--text-muted);
    white-space: nowrap;
}

.lb-rank.gold {
    color: #fbbf24;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.lb-rank.silver {
    color: #cbd5e1;
    text-shadow: 0 0 12px rgba(203, 213, 225, 0.3);
}

.lb-rank.bronze {
    color: #d97706;
    text-shadow: 0 0 12px rgba(217, 119, 6, 0.3);
}

.lb-rank-medal {
    display: inline-block;
    font-size: 1.5rem;
    line-height: 1;
}

/* ═══════════════════════════════════════════════════════════
   ИГРОК (аватар + ник)
   ═══════════════════════════════════════════════════════════ */
.lb-user {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s;
    min-width: 0;
}

.lb-user:hover {
    color: var(--accent-cyan);
}

.lb-user:hover .lb-avatar {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.5);
}

.lb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    transition: all 0.2s;
    overflow: hidden;
}

.lb-avatar.emoji {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.35rem;
}

.lb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lb-username {
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   ЗНАЧЕНИЯ
   ═══════════════════════════════════════════════════════════ */
.lb-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent-amber);
    white-space: nowrap;
}

.lb-value.cyan { color: var(--accent-cyan); }
.lb-value.purple { color: var(--accent-purple); }
.lb-value.green { color: #34d399; }

.lb-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.15rem;
}

/* ═══════════════════════════════════════════════════════════
   ПУСТО / ОШИБКА
   ═══════════════════════════════════════════════════════════ */
.lb-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.lb-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════
   ПАГИНАЦИЯ
   ═══════════════════════════════════════════════════════════ */
.lb-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.lb-pagination button {
    min-width: 42px;
    height: 42px;
    padding: 0 0.85rem;
    background: rgba(19, 24, 54, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.lb-pagination button:hover:not(:disabled) {
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.12);
    transform: translateY(-2px);
}

.lb-pagination button.active {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

.lb-pagination button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.lb-pagination .lb-ellipsis {
    color: var(--text-muted);
    padding: 0 0.25rem;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   ЗАГРУЗКА
   ═══════════════════════════════════════════════════════════ */
.lb-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.lb-loading .loader-spinner {
    margin: 0 auto 1rem;
}

/* ═══════════════════════════════════════════════════════════
   АДАПТИВ
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
    .lb-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .lb-tab {
        width: 100%;
        justify-content: center;
    }

    .lb-table {
        font-size: 0.85rem;
        min-width: 0;
    }

    .lb-table th,
    .lb-table td {
        padding: 0.75rem 0.75rem;
    }

    .lb-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .lb-username {
        font-size: 0.88rem;
    }

    .lb-value {
        font-size: 0.95rem;
    }

    /* Скрываем второстепенные столбцы на мобилке */
    .lb-table .col-hide-mobile {
        display: none;
    }
}

@media (max-width: 480px) {
    .lb-table .col-hide-xs {
        display: none;
    }

    .lb-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
}