/* ==========================================================================
   LEADERBOARD.CSS — МОДУЛЬ «ЗАЛ СЛАВЫ СООБЩЕСТВА» (GOLD CHAMPION UI)
   ========================================================================== */

:root {
    --lb-gold: #ffd700;
    --lb-gold-glow: rgba(255, 215, 0, 0.45);
    --lb-gold-bg: rgba(255, 215, 0, 0.08);
    --lb-gold-border: rgba(255, 215, 0, 0.3);
    --lb-silver: #d1d5db;
    --lb-silver-glow: rgba(209, 213, 219, 0.35);
    --lb-bronze: #cd7f32;
    --lb-bronze-glow: rgba(205, 127, 50, 0.35);
}

/* =========================================================
   0. МОНОЛИТНЫЙ КОРПУС СТРАНИЦЫ ЗАЛА СЛАВЫ
   ========================================================= */
.sk-lb-page-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    background: #0d1117 !important;
    border: 1px solid rgba(255, 215, 0, 0.22) !important;
    border-radius: var(--radius-xl, 16px) !important;
    padding: 24px 28px !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 215, 0, 0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    box-sizing: border-box !important;
    margin-bottom: 30px !important;
}

/* Нейтрализация внешнего page-card если открыто через page.php */
.card.page-card:has(.sk-lb-page-wrapper) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* =========================================================
   1. ЗОЛОТАЯ ШАПКА ЗАЛА СЛАВЫ
   ========================================================= */
.sk-lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 24px !important;
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.95), rgba(13, 17, 23, 0.98)) !important;
    border: 1px solid var(--lb-gold-border) !important;
    border-radius: var(--radius-lg, 12px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.08) !important;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    overflow: hidden;
    margin-bottom: 0 !important; /* Убрали отступ, так как ниже идут табы */
}

.sk-lb-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.sk-lb-header-info {
    flex: 1;
    min-width: 280px;
    position: relative;
    z-index: 1;
}

.sk-lb-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.sk-lb-title {
    margin: 0 !important;
    font-size: 24px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    letter-spacing: 0.5px;
    text-shadow: 0 0 18px var(--lb-gold-glow);
}

.sk-lb-tag {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--lb-gold);
    background: var(--lb-gold-bg);
    border: 1px solid var(--lb-gold-border);
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.sk-lb-desc {
    margin: 0 !important;
    font-size: 13.5px !important;
    color: var(--text-muted, #8b949e) !important;
    line-height: 1.5 !important;
    max-width: 650px;
}

.sk-lb-header-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.sk-lb-user-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid var(--lb-gold-border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.12);
}

.sk-lb-user-status-pill .pill-label {
    color: var(--text-muted, #8b949e);
    font-weight: 600;
}

.sk-lb-user-status-pill .pill-val {
    color: #ffd700;
    font-weight: 900;
}

/* =========================================================
   1.5. ИНТЕРАКТИВНЫЕ ВКЛАДКИ (СЕЗОНЫ)
   ========================================================= */
.sk-lb-tabs-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 5px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}

.sk-lb-tabs-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    min-width: 0;
}

.sk-lb-season-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #8b949e);
}

.sk-lb-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted, #8b949e);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    user-select: none;
    line-height: 1.2;
}

.sk-lb-tab:hover {
    background: var(--lb-gold-bg);
    border-color: var(--lb-gold-border);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

.sk-lb-tab.is-active {
    background: rgba(255, 215, 0, 0.14);
    border-color: var(--lb-gold);
    color: var(--lb-gold);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.3);
}

.sk-lb-tab:focus-visible {
    outline: 2px solid var(--lb-gold);
    outline-offset: 2px;
}

/* Архив «За всё время» — второстепенная, но явно кликабельная кнопка */
.sk-lb-tab--archive {
    color: #e6c34a;
    border-color: var(--lb-gold-border);
    background: var(--lb-gold-bg);
}

.sk-lb-tab--archive .fa-crown {
    color: var(--lb-gold);
}

.sk-lb-tab-arrow {
    font-size: 11px;
    opacity: 0.7;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.sk-lb-tab--archive:hover .sk-lb-tab-arrow {
    transform: translateX(3px);
    opacity: 1;
}

.sk-lb-tab--archive.is-active .sk-lb-tab-arrow {
    display: none;
}

/* =========================================================
   2. КИБЕРПАНК 3D-ПОДИУМ ДЛЯ ТОП-3 ИГРОКОВ
   ========================================================= */
.sk-podium-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.sk-podium-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 16px;
    align-items: flex-end;
    width: 100%;
    box-sizing: border-box;
}

.sk-podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    border-radius: var(--radius-lg, 14px);
    background: linear-gradient(180deg, rgba(22, 27, 34, 0.95) 0%, rgba(13, 17, 23, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 16px 16px 16px;
    text-decoration: none !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
    box-sizing: border-box;
}

.sk-podium-card:hover {
    transform: translateY(-5px);
}

/* 1 МЕСТО (ЗОЛОТО - ПО ЦЕНТРУ) */
.sk-podium-first {
    order: 2;
    min-height: 290px;
    border-color: rgba(255, 215, 0, 0.45);
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.08) 0%, rgba(13, 17, 23, 0.98) 100%);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 215, 0, 0.2);
}

.sk-podium-first:hover {
    border-color: #ffd700;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 35px rgba(255, 215, 0, 0.35);
}

/* 2 МЕСТО (СЕРЕБРО - СЛЕВА) */
.sk-podium-second {
    order: 1;
    min-height: 250px;
    border-color: rgba(209, 213, 219, 0.3);
    background: linear-gradient(180deg, rgba(209, 213, 219, 0.06) 0%, rgba(13, 17, 23, 0.98) 100%);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 18px rgba(209, 213, 219, 0.12);
}

.sk-podium-second:hover {
    border-color: #d1d5db;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(209, 213, 219, 0.25);
}

/* 3 МЕСТО (БРОНЗА - СПРАВА) */
.sk-podium-third {
    order: 3;
    min-height: 230px;
    border-color: rgba(205, 127, 50, 0.3);
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.06) 0%, rgba(13, 17, 23, 0.98) 100%);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 18px rgba(205, 127, 50, 0.12);
}

.sk-podium-third:hover {
    border-color: #cd7f32;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(205, 127, 50, 0.25);
}

/* АВАТАР И ИКОНКИ РАНГА */
.sk-podium-avatar-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 22px;
    margin-top: 0;
    position: relative;
    flex-shrink: 0;
}

.sk-podium-first .sk-podium-avatar-wrap {
    width: 76px !important;
    height: 76px !important;
    margin-top: 28px;
    margin-bottom: 12px;
}

.sk-podium-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid var(--user-color, var(--accent-cyan));
}

.sk-podium-avatar-wrap.has-frame img {
    border: none !important;
}

/* Медали (2 и 3 место) — СНИЗУ */
.sk-podium-rank-icon {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    line-height: 1;
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}

/* Корона (1 место) — СВЕРХУ */
.sk-podium-first .sk-podium-rank-icon {
    font-size: 34px;
    bottom: auto;
    top: -30px;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
    animation: skCrownFloat 2.5s infinite ease-in-out;
}

@keyframes skCrownFloat {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -6px); }
}

.sk-podium-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    justify-content: center;
    max-width: 100%;
}

.sk-podium-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--user-color, #ffffff) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.sk-podium-first .sk-podium-name {
    font-size: 17px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.sk-podium-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.sk-podium-level {
    color: #ffffff;
    font-weight: 700;
}

.sk-podium-xp-box {
    margin-top: auto;
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.sk-podium-xp-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.sk-podium-xp-val {
    font-size: 14px;
    font-weight: 900;
    color: #ffd700;
    font-family: monospace;
}

/* =========================================================
   3. КИБЕР-ТАБЛИЦА ЛИДЕРБОРДА (МЕСТА 4..100)
   ========================================================= */
.sk-lb-table-section {
    width: 100%;
}

.sk-lb-table-card {
    background: rgba(13, 17, 23, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    box-sizing: border-box;
}

.sk-lb-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sk-lb-table-title {
    font-size: 13.5px;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sk-lb-table-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
}

.sk-lb-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.sk-lb-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    box-sizing: border-box;
}

.sk-lb-table thead tr {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sk-lb-table th {
    padding: 12px 18px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.sk-lb-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background-color 0.2s ease, transform 0.2s ease;
    text-decoration: none !important;
}

.sk-lb-row:hover {
    background: rgba(255, 215, 0, 0.04);
}

.sk-lb-table td {
    padding: 12px 18px;
    vertical-align: middle;
}

/* Номер места */
.sk-lb-place-cell {
    font-size: 14px;
    font-weight: 900;
    color: var(--text-muted);
    font-family: monospace;
    width: 50px;
    text-align: center;
}

/* Ячейка игрока */
.sk-lb-player-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sk-lb-avatar-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.sk-lb-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1.5px solid var(--user-color, var(--accent-cyan));
}

.sk-lb-avatar-wrap.has-frame img {
    border: none !important;
}

.sk-lb-player-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sk-lb-player-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sk-lb-player-name {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--user-color, #ffffff) !important;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: text-shadow 0.2s ease;
}

.sk-lb-row:hover .sk-lb-player-name {
    text-shadow: 0 0 8px currentColor;
}

.sk-lb-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.sk-lb-status-dot.online {
    background: #00ff66;
    box-shadow: 0 0 6px #00ff66;
}

.sk-lb-status-dot.offline {
    background: #484f58;
}

/* Ранг и уровень */
.sk-lb-rank-badge {
    font-size: 11px;
    font-weight: 800;
    color: var(--user-color, var(--accent-cyan));
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 9px;
    border-radius: 12px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Статистика публикаций и комментов */
.sk-lb-activity-cell {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.sk-lb-activity-cell b {
    color: #ffffff;
}

/* Total XP */
.sk-lb-xp-cell {
    text-align: right;
    white-space: nowrap;
}

.sk-lb-xp-val {
    font-size: 14px;
    font-weight: 900;
    color: #ffd700;
    font-family: monospace;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.sk-lb-xp-unit {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    margin-left: 2px;
}

/* =========================================================
   4. АДАПТИВНОСТЬ
   ========================================================= */
@media (max-width: 860px) {
    .sk-podium-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        align-items: stretch;
    }
    .sk-podium-first {
        order: 1;
        min-height: auto;
    }
    .sk-podium-second {
        order: 2;
        min-height: auto;
    }
    .sk-podium-third {
        order: 3;
        min-height: auto;
    }
}

@media (max-width: 600px) {
    .sk-lb-page-wrapper {
        padding: 16px 12px !important;
    }
    .sk-lb-header {
        padding: 16px !important;
        flex-direction: column;
        align-items: flex-start;
    }
    .sk-lb-header-stats {
        width: 100%;
        justify-content: space-between;
    }
    .sk-lb-tabs-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .sk-lb-tabs-main {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .sk-lb-tabs-bar .sk-lb-tab {
        justify-content: center;
    }
    .sk-lb-season-meta {
        justify-content: center;
    }
    .sk-lb-table th:nth-child(4),
    .sk-lb-table td:nth-child(4) {
        display: none; /* Скрываем колонку публикаций на смартфонах */
    }
}