/* ═══════════════════════════════════════════
   TLOU Stats — Dark Material Design Theme
   ═══════════════════════════════════════════ */

/* ── Fix: sidebar/profile avatar overflow ── */
.profile-menu .profile-pic,
.profile-menu .profile-pic img {
    max-width: 60px !important;
    max-height: 60px !important;
    object-fit: cover;
}

/* ── Stats page: fix full-window background obscuring content ── */
body.page-stats #content,
body.page-stats #main {
    position: relative;
    z-index: 1;
}
/* Индиго-обёртка страницы статистики — легаси-стиль ДО редизайна "1A
   Cinematic". В новом дизайне у каждого блока свой .tlou-stat-card фон, эта
   рамка на весь #content лишняя (это и был "фиолетовый прямоугольник" вокруг
   всей статистики, включая профиль — .container оборачивает всю страницу).
   Оставлена только для классического режима. */
body.page-stats:not(.tlou-active) #content .container {
    background: rgba(26, 23, 45, 0.95);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ── Last updated timestamp ── */
.stats-last-updated {
    margin-top: 4px;
}
.stats-widget-last-updated {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
}

/* ── Stats Widget: header layout, badge in right corner ── */
.stats-widget-header-enhanced {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.stats-widget-header-enhanced h2 {
    flex: 1;
    min-width: 200px;
}
/* Плашка «новых игроков сегодня» — в правом углу заголовка */
.stats-widget-header-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.stats-widget-new-badge {
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    vertical-align: middle;
}

/* ── Navigation ── */
.stats-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.stats-nav .btn.active {
    pointer-events: none;
}

/* ── Rank Badges ── */
.rank-badge {
    display: inline-block;
    max-width: 100%;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    box-sizing: border-box;
}
.rank-badge-large {
    padding: 4px 16px;
    font-size: 14px;
    border-radius: 16px;
}
.rank-bronze      { background-color: #cd7f32; }
.rank-silver      { background-color: #c0c0c0; }
.rank-gold        { background-color: #ffd700; }
.rank-platinum    { background-color: #e5e4e2; }
.rank-diamond     { background-color: #b9f2ff; }
.rank-master      { background-color: #9b59b6; color: #fff; }
.rank-grandmaster { background-color: #e74c3c; color: #fff; }

/* ── Division Badges ── */
.div-casual {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background-color: #2196F3;
    color: #fff;
}
.div-pro {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background-color: #FFD700;
    color: #1a1a1a;
}
.div-nodmg {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background-color: #e74c3c;
    color: #fff;
}

/* ── Records: карточки по картам (наглядный вывод) ── */
.stats-records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
    padding: 15px;
}
.stats-record-map-card {
    background: #1a172d;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.stats-record-map-card:hover {
    border-color: rgba(33,150,243,0.5);
    box-shadow: 0 8px 25px rgba(33,150,243,0.15), 0 4px 12px rgba(0,0,0,0.3);
    transform: scale(1.02);
}
.stats-record-map-name {
    padding: 12px 15px;
    font-weight: 600;
    font-size: 15px;
    color: #eee;
    background: linear-gradient(318deg, rgba(33,150,243,0.15) 0%, rgba(76,107,255,0.25) 50%, rgba(33,150,243,0.1) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}
.stats-record-map-name i { margin-right: 8px; color: #2196F3; }
.stats-record-divisions {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.stats-record-div-block {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    min-height: 52px;
}
.stats-record-div-block:last-child { border-bottom: none; }
.stats-record-div-block.div-casual { border-left: 4px solid #2196F3; background: rgba(33,150,243,0.03); }
.stats-record-div-block.div-pro { border-left: 4px solid #FFD700; background: rgba(255,215,0,0.03); }
.stats-record-div-block.div-nodmg { border-left: 4px solid #e74c3c; background: rgba(231,76,60,0.03); }
.stats-record-div-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
}
.stats-record-div-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.stats-record-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.stats-record-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.stats-record-player {
    color: #2196F3;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-record-player:hover { color: #42A5F5; text-decoration: underline; }
.stats-record-time {
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    font-family: 'Roboto Mono', monospace;
}
.stats-record-date { font-size: 11px; color: #666; font-style: italic; }
.stats-record-empty { color: #666; font-style: italic; font-size: 14px; }

/* ── View Toggle Buttons ── */
.stats-view-btn { opacity: 0.6; transition: opacity 0.2s; }
.stats-view-btn.active { opacity: 1; background: rgba(33,150,243,0.2); border-color: rgba(33,150,243,0.4); }
.stats-view-btn:hover { opacity: 0.9; }

/* ── Records Table View ── */
.stats-records-table-view { padding: 0 15px 15px; }

/* ── Records Table (legacy, стиль как баны/муты) ── */
.records-table-header {
    background: #1a172d !important;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 600;
    color: #888;
    margin: 5px 0 0;
    padding: 10px;
    display: flex;
    align-items: center;
    font-size: 14px;
    border-radius: 8px 8px 0 0;
}
.records-table-row {
    cursor: default;
    transition: background 0.15s;
    background: #1a172d;
    color: #fff;
    margin: 5px 0;
    padding: 10px;
    display: flex;
    align-items: center;
    font-size: 14px;
    border-radius: 8px;
}
.records-table-row:hover {
    background: rgba(255,255,255,0.08) !important;
}
.records-col-map {
    flex: 0 0 180px;
    min-width: 140px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.records-col-div {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stats-record-avatar-inline {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}
.stats-record-player {
    color: #2196F3;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-record-player:hover { color: #42A5F5; text-decoration: underline; }
.stats-record-time {
    color: #888;
    font-size: 12px;
    flex-shrink: 0;
}
.stats-record-empty { color: #666; font-style: italic; }
.stats-records-legend {
    font-size: 13px;
    color: #888;
}
.stats-records-legend .legend-item {
    margin-right: 15px;
}
.stats-records-legend .stats-record-div-badge {
    margin-right: 4px;
}

/* Profile records & history rows (ban-style like bans/mutes table) */
.stats-profile-record-row,
.stats-profile-history-row {
    cursor: default;
    transition: background 0.15s;
    background: #1a172d;
    color: #fff;
    margin: 5px 0;
    padding: 10px;
    display: flex;
    align-items: center;
    font-size: 14px;
    border-radius: 8px;
    list-style-type: none;
}
.stats-profile-record-row:hover,
.stats-profile-history-row:hover {
    background: rgba(255,255,255,0.08) !important;
}
.stats-profile-record-row .ban-info-player--player,
.stats-profile-history-row .ban-info-player--player {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-profile-record-row .ban-info-player--data,
.stats-profile-history-row .ban-info-player--data {
    flex-shrink: 0;
    margin-left: 10px;
}

/* ── Stats tables container — горизонтальный скролл при переполнении ── */
.card .last-block-banned {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.last-block-players {
    min-width: 0;
}

/* ── Top Players Table — компактные колонки, всё влазит ── */
.stats-table-header-row .blocked-info-player--game,
.stats-table-row .blocked-info-player--game {
    width: 36px !important;
    min-width: 36px;
    margin-right: 6px;
    flex-shrink: 0;
}
.stats-table-header-row .blocked-info-player--player,
.stats-table-row .blocked-info-player--player {
    width: auto !important;
    min-width: 70px;
    max-width: 140px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-table-header-row .block-info-player--data,
.stats-table-row .block-info-player--data {
    width: auto !important;
    min-width: 45px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-table-header-row .block-info-player--data:nth-of-type(2),
.stats-table-row .block-info-player--data:nth-of-type(2) { min-width: 112px; }  /* Ранг — хватает под самый длинный бейдж "GRANDMASTER" */
.stats-table-header-row .block-info-player--data:nth-of-type(3),
.stats-table-row .block-info-player--data:nth-of-type(3) { min-width: 70px; }  /* XP — до 7-8 значного числа с разделителями */
.stats-table-header-row .block-info-player--data:nth-of-type(4),
.stats-table-row .block-info-player--data:nth-of-type(4) { min-width: 64px; }  /* Убийства */
.stats-table-header-row .block-info-player--data:nth-of-type(5),
.stats-table-row .block-info-player--data:nth-of-type(5) { min-width: 54px; }  /* K/D — до 6 знаков (105.14) */
.stats-table-header-row .block-info-player--data:nth-of-type(6),
.stats-table-row .block-info-player--data:nth-of-type(6) { min-width: 58px; }  /* Побеги */
.stats-table-header-row .block-info-player--data:nth-of-type(7),
.stats-table-row .block-info-player--data:nth-of-type(7) { min-width: 72px; }  /* Посл. игра */

/* ── Widget escapes table ── */
.stats-widget-escapes-head,
.stats-widget-escape-row {
    flex-wrap: nowrap;
}
.stats-widget-escapes-head .blocked-info-player--game,
.stats-widget-escape-row .blocked-info-player--game {
    width: 35px !important;
    min-width: 35px;
    margin-right: 8px;
    flex-shrink: 0;
}
.stats-widget-escapes-head .blocked-info-player--player,
.stats-widget-escape-row .blocked-info-player--player {
    width: auto !important;
    min-width: 80px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-widget-escapes-head .block-info-player--data,
.stats-widget-escape-row .block-info-player--data {
    width: auto !important;
    min-width: 50px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-widget-escapes-head .block-info-player--data:first-of-type,
.stats-widget-escape-row .block-info-player--data:first-of-type { min-width: 120px; }  /* Карта */
.stats-widget-escapes-head .block-info-player--data:nth-of-type(2),
.stats-widget-escape-row .block-info-player--data:nth-of-type(2) { min-width: 65px; }  /* Дивизион */
.stats-widget-escapes-head .block-info-player--data:nth-of-type(3),
.stats-widget-escape-row .block-info-player--data:nth-of-type(3) { min-width: 55px; }  /* Время */

/* ── Top Players Table ── */
.stats-table-header-row,
.stats-table-row {
    min-width: 420px;
    flex-wrap: nowrap;
}
.stats-table-header-row {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
}
.stats-table-row {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.15s;
}
.stats-table-row:hover {
    background: rgba(255,255,255,0.05);
}
.stats-table-row:nth-child(even) {
    background: rgba(255,255,255,0.015);
}
.stats-table-row:nth-child(even):hover {
    background: rgba(255,255,255,0.06);
}

.stats-col { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-col-pos    { width: 36px; min-width: 36px; text-align: center; flex-shrink: 0; }
.stats-col-avatar { width: 36px; min-width: 36px; flex-shrink: 0; }
.stats-col-name   { flex: 1; min-width: 70px; max-width: 140px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-col-rank   { width: 65px; min-width: 58px; text-align: center; flex-shrink: 0; font-size: 11px; }
.stats-col-xp     { width: 48px; min-width: 48px; text-align: right; flex-shrink: 0; font-size: 12px; }
.stats-col-kills  { width: 52px; min-width: 52px; text-align: right; flex-shrink: 0; font-size: 12px; }
.stats-col-deaths { width: 52px; min-width: 48px; text-align: right; flex-shrink: 0; font-size: 12px; }
.stats-col-kd     { width: 50px; min-width: 38px; text-align: right; flex-shrink: 0; font-size: 12px; }
.stats-col-wins   { width: 55px; min-width: 50px; text-align: right; flex-shrink: 0; font-size: 12px; }
.stats-col-last   { width: 72px; min-width: 72px; text-align: right; color: #888; font-size: 11px; flex-shrink: 0; }

/* Полная страница "Рейтинг игроков" (page_stats_top.tpl, классический режим)
   переиспользует эти же .stats-col-* классы, что и узкий виджет на главной,
   но подписи здесь длиннее ("Убийства зомби" вместо "Килы") и колонок больше —
   в 48-55px они не помещались и текст визуально наезжал на соседние колонки
   ("ХРУБИЙСТВА ЗОМБИ"). Строки полной таблицы дополнительно помечены классами
   .stats-table-header-row/.stats-table-row — сузили override только до них,
   виджет на главной (без этих классов) не затронут. */
.stats-table-header-row .stats-col-rank,
.stats-table-row .stats-col-rank { width: 110px; min-width: 100px; }
.stats-table-header-row .stats-col-xp,
.stats-table-row .stats-col-xp { width: 90px; min-width: 80px; font-size: 13px; }
.stats-table-header-row .stats-col-kills,
.stats-table-row .stats-col-kills { width: 130px; min-width: 120px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-table-header-row .stats-col-deaths,
.stats-table-row .stats-col-deaths { width: 80px; min-width: 70px; font-size: 13px; }
.stats-table-header-row .stats-col-kd,
.stats-table-row .stats-col-kd { width: 65px; min-width: 55px; font-size: 13px; }
.stats-table-header-row .stats-col-wins,
.stats-table-row .stats-col-wins { width: 90px; min-width: 80px; font-size: 13px; }
.stats-table-header-row .stats-col-last,
.stats-table-row .stats-col-last { width: 90px; min-width: 85px; font-size: 12px; }
.last-block-banned, .last-block-players { overflow-x: auto; }
.stats-table-header-row, .stats-table-row { min-width: max-content; gap: 10px; }

/* Position badges */
.stats-position { font-weight: 600; color: #aaa; }
.stats-position-top1 { color: #ffd700; font-size: 16px; }
.stats-position-top2 { color: #c0c0c0; font-size: 15px; }
.stats-position-top3 { color: #cd7f32; font-size: 14px; }

/* Sort links */
.stats-sort-link { color: #888; text-decoration: none; }
.stats-sort-link:hover { color: #fff; }
.stats-sort-link.active { color: #2196F3; }

/* NoDmg badge next to wins */
.stats-nodmg-badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    padding: 0 4px;
    border-radius: 3px;
    margin-left: 4px;
}

/* Player link */
.stats-player-link { color: #ddd; text-decoration: none; }
.stats-player-link:hover { color: #fff; text-decoration: underline; }

/* ── Avatars ── */
.stats-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.stats-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
}
.stats-avatar-large {
    width: 80px;
    height: 80px;
    max-width: 80px;
    max-height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.1);
}
.stats-avatar-placeholder-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 32px;
    color: #1a1a1a;
    margin: 0 auto;
}

/* ── Pagination ── */
.stats-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
}
.stats-page-select {
    background: #333;
    color: #ccc;
    border: 1px solid #555;
    padding: 4px 10px;
    border-radius: 4px;
}
.stats-page-info {
    color: #888;
    font-size: 13px;
}

/* ── Profile Card ── */
.stats-profile-card .card-header {
    padding-bottom: 20px;
}
.stats-profile-avatar {
    margin: 0 auto;
}
.stats-steam-link {
    color: #888;
    font-size: 13px;
}
.stats-steam-link:hover { color: #2196F3; }

.stats-rank-progress { }
.stats-rank-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}
.stats-rank-xp-label {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}
.stats-max-rank-label {
    color: #e74c3c;
    font-weight: 600;
}
.stats-position-label {
    font-size: 18px;
    font-weight: 600;
    color: #ddd;
}
.stats-profile-dates {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
    margin-top: 10px;
}
.stats-date-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #888;
    padding: 3px 0;
}
.stats-date-row i { margin-right: 5px; }

/* ── Stats Grid (Profile) ── */
.stats-grid {
    margin: -10px;
}
.stats-grid-item {
    text-align: center;
    padding: 15px 10px;
}
.stats-grid-icon {
    font-size: 28px;
    color: #666;
    margin-bottom: 5px;
}
.stats-grid-value {
    font-size: 24px;
    font-weight: 700;
    color: #eee;
}
.stats-grid-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    margin-top: 2px;
}

/* ── Profile font size (from settings) ── */
.stats-profile-font-size {
    font-size: var(--stats-profile-font, 16px);
}
.stats-profile-font-size .stats-grid-value,
.stats-profile-font-size .stats-profile-card h2,
.stats-profile-font-size .stats-date-row,
.stats-profile-font-size .stats-rank-xp-label,
.stats-profile-font-size .stats-position-label {
    font-size: calc(var(--stats-profile-font, 16px) * 1.1);
}
.stats-profile-font-size .stats-grid-label,
.stats-profile-font-size .stats-rank-labels {
    font-size: calc(var(--stats-profile-font, 16px) * 0.75);
}

/* ── Progress bars (wider, animated) ── */
.stats-progress-animated {
    height: 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}
.stats-progress-bar {
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation: statsProgressPulse 2s ease-in-out infinite;
}
@keyframes statsProgressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}
.stats-escape-bar .stats-progress-animated {
    height: 16px;
}

/* ── Escape Bars ── */
.stats-escape-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}
.stats-bar-casual { background: linear-gradient(90deg, #1976D2, #2196F3); }
.stats-bar-pro    { background: linear-gradient(90deg, #F9A825, #FFD700); }
.stats-bar-nodmg  { background: linear-gradient(90deg, #c62828, #e74c3c); }

/* Chart container */
.stats-chart-container {
    max-width: 200px;
    margin: 0 auto;
}

/* ── Weapon Bars (legacy) ── */
.stats-weapon-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
}
.stats-weapon-name {
    width: 140px;
    flex-shrink: 0;
    font-size: 13px;
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-weapon-bar-wrap {
    flex: 1;
    height: 14px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    margin: 0 12px;
    overflow: hidden;
}
.stats-weapon-bar {
    height: 100%;
    background: linear-gradient(90deg, #c62828, #e74c3c);
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation: statsProgressPulse 2s ease-in-out infinite;
}
.stats-weapon-kills {
    width: 50px;
    text-align: right;
    font-size: 13px;
    color: #aaa;
}

/* ── Weapon Cards (профиль — структурированный вывод) ── */
.stats-weapons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.stats-weapon-card {
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.06);
    transition: border-color 0.2s, background 0.2s;
}
.stats-weapon-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}
.stats-weapon-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #eee;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-weapon-card-desc {
    font-size: 11px;
    color: #777;
    margin-bottom: 8px;
    margin-top: -6px;
}
.stats-weapon-card-bar-wrap {
    height: 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}
.stats-weapon-card .stats-weapon-bar {
    height: 12px;
    border-radius: 6px;
}
.stats-weapon-card-kills {
    font-size: 18px;
    font-weight: 700;
    color: #eee;
}
.stats-weapon-card-label {
    font-size: 12px;
    font-weight: 500;
    color: #888;
    margin-left: 4px;
}

/* ── Personal Records Table ── */
.stats-records-header {
    display: flex;
    padding: 8px 15px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
}
.stats-records-row {
    display: flex;
    padding: 8px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stats-records-col-map { flex: 1; }
.stats-records-col-time { width: 80px; text-align: center; }
.stats-records-col-div { width: 80px; text-align: right; }

/* ── History List ── */
.stats-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 13px;
}
.stats-history-date { color: #666; width: 90px; flex-shrink: 0; }
.stats-history-map { flex: 1; color: #ccc; }
.stats-history-time { color: #aaa; width: 50px; text-align: right; }

/* ── World Records ── */
.stats-record-divisions { }
.stats-record-div-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    min-width: 0;
}
.stats-record-div-row:last-child { border-bottom: none; }
.stats-record-div-badge { width: 65px; min-width: 65px; text-align: center; flex-shrink: 0; }
.stats-record-player {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ddd;
    text-decoration: none;
}
.stats-record-player:hover { color: #2196F3; }
.stats-record-time { color: #aaa; font-family: monospace; font-size: 14px; flex-shrink: 0; }
.stats-record-empty { color: #555; }
.stats-record-avatar {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-right: 8px;
}
.stats-record-div-row .stats-avatar-placeholder.stats-record-avatar {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

/* ── Search ── */
.stats-search-wrap { position: relative; }
.stats-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #2b2b2b;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.stats-search-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stats-search-dropdown-item:hover { background: rgba(255,255,255,0.05); }

.stats-search-card {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 15px;
}
.stats-search-card:hover { text-decoration: none; }
.stats-search-card-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.06);
    transition: border-color 0.2s, background 0.2s;
}
.stats-search-card:hover .stats-search-card-inner {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
}
.stats-search-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #eee;
    margin-bottom: 4px;
}
.stats-search-card-stats {
    font-size: 12px;
    color: #888;
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

/* ── Dashboard Widget (Site-native card style) ── */
.stats-widget-dashboard {
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.stats-widget-dashboard .card-header {
    position: relative;
    padding: 20px 25px;
    background: linear-gradient(135deg, rgba(33,150,243,0.25) 0%, rgba(76,107,255,0.35) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.stats-widget-header-enhanced h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.stats-widget-header-enhanced h2 small {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 4px;
}
.stats-widget-dashboard .card-header .pull-right {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Counters row */
.stats-widget-counters {
    margin-bottom: 5px;
}
.stats-widget-counter {
    text-align: center;
    padding: 15px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.3s ease;
}
.stats-widget-counter:hover {
    background: rgba(255,255,255,0.06);
    transform: translateY(-2px);
}
.stats-widget-counter-icon {
    font-size: 28px;
    color: #2196F3;
    margin-bottom: 6px;
}
.stats-widget-counter-icon--red { color: #e74c3c; }
.stats-widget-counter-icon--green { color: #4CAF50; }
.stats-widget-counter-icon--orange { color: #FF9800; }
.stats-widget-counter-value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.stats-widget-counter-label {
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Recent Escapes table (site-native style) */
.stats-widget-escapes-head,
.stats-widget-escape-row {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    font-size: 13px;
}
.stats-widget-escapes-head {
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
}
.stats-widget-escape-row {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: default;
    transition: background 0.15s;
}
.stats-widget-escape-row:hover {
    background: rgba(255,255,255,0.04);
}
.stats-widget-esc-col--pos {
    width: 35px;
    text-align: center;
    font-weight: 700;
    color: #666;
    flex-shrink: 0;
}
.stats-widget-esc-col--name {
    flex: 1;
    min-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-widget-esc-col--name a {
    color: #ccc;
    text-decoration: none;
}
.stats-widget-esc-col--name a:hover { color: #2196F3; }
.stats-widget-esc-col--map {
    width: 180px;
    color: #777;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}
.stats-widget-esc-col--div {
    width: 80px;
    text-align: center;
    flex-shrink: 0;
}
.stats-widget-esc-col--time {
    width: 60px;
    text-align: right;
    color: #aaa;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}

/* ── Animations ── */
@keyframes statsCardFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stats-animate-card {
    opacity: 0;
    animation: statsCardFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes statsRowFadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}
.stats-animate-row {
    opacity: 0;
    animation: statsRowFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes statsCountPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.stats-widget-counter:hover .stats-widget-counter-value {
    animation: statsCountPulse 0.3s ease;
}

/* ── Ban info on profile ── */
.stats-ban-info {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
    margin-top: 10px;
}
.stats-ban-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 4px 0;
}
.stats-ban-row i { margin-right: 5px; }
.stats-ban-count { font-weight: 600; }
.stats-ban-count--active { color: #e74c3c; }
.stats-ban-count--expired { color: #888; }
.stats-ban-count--clean { color: #4CAF50; }

/* ── Responsive ── */
@media (max-width: 991px) {
    .stats-widget-esc-col--map { width: 120px; }
    .stats-table-header-row .block-info-player--data:nth-of-type(7),
    .stats-table-row .block-info-player--data:nth-of-type(7) { min-width: 70px; }
}
@media (max-width: 767px) {
    .stats-table-header-row,
    .stats-table-row {
        min-width: 480px;
        font-size: 13px;
    }
    .stats-table-header-row .blocked-info-player--player,
    .stats-table-row .blocked-info-player--player { min-width: 70px; max-width: 140px; }
    .stats-table-header-row .block-info-player--data:nth-of-type(2),
    .stats-table-row .block-info-player--data:nth-of-type(2) { min-width: 55px; }
    .stats-widget-escapes-head .block-info-player--data:first-of-type,
    .stats-widget-escape-row .block-info-player--data:first-of-type { min-width: 80px; }

    .stats-record-div-row { flex-wrap: wrap; gap: 5px; }
    .stats-record-player { white-space: normal; }

    .stats-history-item { flex-wrap: wrap; }
    .stats-history-date { width: auto; }

    .stats-widget-counter-value { font-size: 20px; }
    .stats-widget-esc-col--map { display: none; }
    .stats-widget-esc-col--div { width: 60px; }
    .stats-div-filters { flex-wrap: wrap; gap: 6px; }
    .stats-div-filter-btn { font-size: 12px; padding: 4px 10px; }
}

/* ═══════════════════════════════════════════
   Division Filters (Records Page)
   ═══════════════════════════════════════════ */
.stats-div-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.stats-div-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: #aaa;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    user-select: none;
}
.stats-div-filter-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.stats-div-filter-btn.active {
    color: #fff;
    border-color: transparent;
}
.stats-div-filter-btn.active[data-div="all"] {
    background: rgba(255,255,255,0.15);
}
.stats-div-filter-btn.active[data-div="casual"] {
    background: rgba(33,150,243,0.3);
    border-color: rgba(33,150,243,0.5);
}
.stats-div-filter-btn.active[data-div="pro"] {
    background: rgba(255,215,0,0.25);
    border-color: rgba(255,215,0,0.5);
    color: #FFD700;
}
.stats-div-filter-btn.active[data-div="nodmg"] {
    background: rgba(231,76,60,0.3);
    border-color: rgba(231,76,60,0.5);
}
/* Ripple on filter buttons */
.stats-div-filter-btn .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: scale(0);
    animation: statsRipple 0.5s ease-out;
    pointer-events: none;
}
@keyframes statsRipple {
    to { transform: scale(3); opacity: 0; }
}

/* ── Division Legend with animated stats bars ── */
.stats-div-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 15px 20px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}
.stats-div-legend-item {
    flex: 1;
    min-width: 140px;
}
.stats-div-legend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.stats-div-legend-count {
    font-size: 14px;
    font-weight: 700;
    color: #eee;
}
.stats-div-legend-bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}
.stats-div-legend-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.stats-div-legend-fill.fill-casual {
    background: linear-gradient(90deg, #1976D2, #42A5F5);
}
.stats-div-legend-fill.fill-pro {
    background: linear-gradient(90deg, #F9A825, #FFD700);
}
.stats-div-legend-fill.fill-nodmg {
    background: linear-gradient(90deg, #c62828, #ef5350);
}

/* ── Medal / Position icons for record cards ── */
.stats-record-medal {
    font-size: 16px;
    flex-shrink: 0;
}

/* ── Record time progress indicator ── */
.stats-record-time-bar {
    height: 3px;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
}
.stats-record-time-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.stats-record-time-fill.fill-casual { background: linear-gradient(90deg, #1976D2, #42A5F5); }
.stats-record-time-fill.fill-pro    { background: linear-gradient(90deg, #F9A825, #FFD700); }
.stats-record-time-fill.fill-nodmg  { background: linear-gradient(90deg, #c62828, #ef5350); }

/* ═══════════════════════════════════════════
   Profile Card Visual Improvements
   ═══════════════════════════════════════════ */
/* Gradient header for profile card */
.stats-profile-card .card-header.ch-alt {
    background: linear-gradient(318deg, rgba(33,150,243,0.12) 0%, rgba(76,107,255,0.2) 50%, rgba(33,150,243,0.08) 100%);
}

/* Avatar glow by rank color */
.stats-avatar-glow {
    box-shadow: 0 0 15px rgba(var(--avatar-glow-rgb, 255,255,255), 0.3);
}

/* Position badge (gold/silver/bronze) */
.stats-position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    margin: 0 auto 8px;
}
.stats-position-badge-1 { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #1a1a1a; box-shadow: 0 0 12px rgba(255,215,0,0.4); }
.stats-position-badge-2 { background: linear-gradient(135deg, #c0c0c0, #e0e0e0); color: #1a1a1a; box-shadow: 0 0 12px rgba(192,192,192,0.4); }
.stats-position-badge-3 { background: linear-gradient(135deg, #cd7f32, #e6a55a); color: #1a1a1a; box-shadow: 0 0 12px rgba(205,127,50,0.4); }

/* Stat grid hover lift */
.stats-grid-item-hover {
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    border-radius: 8px;
}
.stats-grid-item-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    background: rgba(255,255,255,0.04);
}

/* Card headers with gradient (general stats, weapons, etc.) */
.stats-card-gradient .card-header.ch-alt {
    background: linear-gradient(318deg, rgba(33,150,243,0.1) 0%, rgba(76,107,255,0.18) 50%, rgba(33,150,243,0.06) 100%);
}

/* ═══════════════════════════════════════════
   Shimmer / Glow Animations (configurable)
   ═══════════════════════════════════════════ */
@keyframes statsShimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.stats-shimmer .stats-progress-bar,
.stats-shimmer .stats-div-legend-fill,
.stats-shimmer .stats-record-time-fill {
    background-size: 200% 100%;
    animation: statsShimmer 2.5s ease-in-out infinite;
}
.stats-shimmer .stats-bar-casual {
    background: linear-gradient(90deg, #1976D2, #42A5F5, #90CAF9, #42A5F5, #1976D2);
    background-size: 200% 100%;
}
.stats-shimmer .stats-bar-pro {
    background: linear-gradient(90deg, #F9A825, #FFD700, #FFF176, #FFD700, #F9A825);
    background-size: 200% 100%;
}
.stats-shimmer .stats-bar-nodmg {
    background: linear-gradient(90deg, #c62828, #e74c3c, #ef9a9a, #e74c3c, #c62828);
    background-size: 200% 100%;
}

/* Pulse glow on progress bars */
@keyframes statsGlow {
    0%, 100% { box-shadow: 0 0 4px rgba(var(--glow-rgb, 33,150,243), 0.3); }
    50%      { box-shadow: 0 0 12px rgba(var(--glow-rgb, 33,150,243), 0.5); }
}
.stats-glow .stats-progress-bar {
    animation: statsGlow 2s ease-in-out infinite, statsProgressPulse 2s ease-in-out infinite;
}

/* ── Top-3 Row Highlighting ── */
.stats-top1-row { background: linear-gradient(90deg, rgba(255,215,0,0.12) 0%, rgba(255,215,0,0.03) 100%) !important; border-left: 3px solid #ffd700; }
.stats-top2-row { background: linear-gradient(90deg, rgba(192,192,192,0.10) 0%, rgba(192,192,192,0.02) 100%) !important; border-left: 3px solid #c0c0c0; }
.stats-top3-row { background: linear-gradient(90deg, rgba(205,127,50,0.10) 0%, rgba(205,127,50,0.02) 100%) !important; border-left: 3px solid #cd7f32; }
.stats-top1-row:hover { background: linear-gradient(90deg, rgba(255,215,0,0.18) 0%, rgba(255,215,0,0.06) 100%) !important; }
.stats-top2-row:hover { background: linear-gradient(90deg, rgba(192,192,192,0.15) 0%, rgba(192,192,192,0.04) 100%) !important; }
.stats-top3-row:hover { background: linear-gradient(90deg, rgba(205,127,50,0.15) 0%, rgba(205,127,50,0.04) 100%) !important; }

/* ── Hidden admin section in admin panel ── */
.stats-admin-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 10px;
    background: rgba(0,0,0,0.15);
}
.stats-admin-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}
.stats-admin-item:last-child { border-bottom: none; }
.stats-admin-item:hover { background: rgba(255,255,255,0.04); }
.stats-admin-item label { cursor: pointer; flex: 1; color: #ccc; }
