/* -- Таблица — горизонтальный скролл -- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

.table {
    width: 100%;
    min-width: 1400px; /* минимальная ширина — появится скролл если экран меньше */
    border-collapse: collapse;
    font-size: 13px;
}

/* -- Шапка таблицы -- */
.table thead th {
    white-space: nowrap;
    padding: 10px 8px;
    font-size: 12px;
}

/* -- Ячейки -- */
.table td {
    padding: 8px 6px;
    white-space: nowrap;
}

/* -- Колонка игрока — фиксированная -- */
.th-player,
.td-player {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #1a1a2e; /* цвет фона твоей таблицы */
    min-width: 180px;
    max-width: 220px;
}

/* -- Колонка # — фиксированная -- */
.th-rank,
.td-rank {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #1a1a2e;
    width: 40px;
    text-align: center;
}

/* -- Колонки статистики -- */
.th-stat,
.td-stat {
    text-align: center;
    min-width: 80px;
}

/* -- Рейтинг — чуть шире -- */
.td-rating {
    min-width: 90px;
}

/* -- Скроллбар стилизация -- */
.table-wrap::-webkit-scrollbar {
    height: 6px;
}

.table-wrap::-webkit-scrollbar-track {
    background: #0d0d1a;
    border-radius: 3px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* -- Никнейм — не разрывать -- */
.player__nick {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    display: block;
}

.player__id {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    display: block;
    font-size: 11px;
    opacity: 0.5;
}

/* -- Аватар меньше -- */
.player__avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
}

.player {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* -- На мобилках -- */
@media (max-width: 768px) {
    .table {
        font-size: 12px;
        min-width: 1200px;
    }

    .table thead th {
        font-size: 11px;
        padding: 8px 5px;
    }

    .table td {
        padding: 6px 5px;
    }

    .player__avatar {
        width: 26px;
        height: 26px;
    }
}

/* -- Reset & Base ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #0d0f13;
    --bg2:         #13161c;
    --bg3:         #1a1e27;
    --border:      #2a2f3d;
    --accent:      #e8622a;
    --accent2:     #f0954a;
    --text:        #e2e8f0;
    --text-muted:  #64748b;
    --online:      #22c55e;
    --offline:     #475569;
    --h24:         #f59e0b;
    --gold:        #fbbf24;
    --silver:      #94a3b8;
    --bronze:      #cd7f32;
    --radius:      10px;
    --radius-sm:   6px;
}

html { font-size: 15px; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* -- Wrapper ---------------------------------------- */
.wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

/* -- Header ----------------------------------------- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-icon { font-size: 1.8rem; }

.logo-text em {
    font-style: normal;
    color: var(--accent);
}

.header__meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.header__meta strong { color: var(--text); }

/* -- Filters ---------------------------------------- */
.filters { margin-bottom: 20px; }

.filters__form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filters__search {
    flex: 1;
    min-width: 200px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 9px 14px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.filters__search:focus { border-color: var(--accent); }

.filters__select {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 9px 14px;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filters__select:focus { border-color: var(--accent); }

.filters__btn {
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 9px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.filters__btn:hover { background: var(--accent2); }

.filters__reset {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 9px 10px;
    transition: color 0.2s;
}

.filters__reset:hover { color: var(--text); }

/* -- Table ------------------------------------------ */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg2);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead {
    background: var(--bg3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.table th a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.table th a:hover { color: var(--accent); }

.table__row {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.table__row:last-child { border-bottom: none; }
.table__row:hover { background: var(--bg3); }
.table__row.row--online { background: rgba(34, 197, 94, 0.04); }
.table__row.row--online:hover { background: rgba(34, 197, 94, 0.08); }

.table td { padding: 11px 14px; vertical-align: middle; }

.table__empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
    font-size: 1rem;
}

/* -- Rank ------------------------------------------- */
.td-rank { width: 50px; text-align: center; }

.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
    background: var(--bg3);
    color: var(--text-muted);
}

.rank--gold   { background: rgba(251,191,36,0.15); color: var(--gold);   }
.rank--silver { background: rgba(148,163,184,0.15); color: var(--silver); }
.rank--bronze { background: rgba(205,127,50,0.15);  color: var(--bronze); }

/* -- Player ----------------------------------------- */
.td-player { min-width: 200px; }

.player {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.player__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.player__nick {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.player__id {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* -- Stats ------------------------------------------ */
.td-stat {
    text-align: right;
    white-space: nowrap;
    color: var(--text);
}

.td-stat small.total {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.td-rating { min-width: 100px; }

/* -- Badges ----------------------------------------- */
.badge--rating {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 3px 10px;
    border-radius: 20px;
}

/* -- Status ----------------------------------------- */
.status {
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}

.status--online  { color: var(--online); }
.status--offline { color: var(--offline); }
.status--24h     { color: var(--h24); }

/* -- Pagination ------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination__btn:hover { background: var(--bg3); border-color: var(--accent); }

.pagination__btn--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    pointer-events: none;
}

.pagination__dots {
    color: var(--text-muted);
    padding: 0 4px;
}

/* -- Footer ----------------------------------------- */
.footer {
    text-align: center;
    margin-top: 32px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* -- Responsive ------------------------------------- */
@media (max-width: 768px) {
    .table th:nth-child(n+7),
    .table td:nth-child(n+7) { display: none; }

    .header__logo { font-size: 1.2rem; }
    .filters__search { min-width: 140px; }
}

@media (max-width: 480px) {
    .table th:nth-child(n+5),
    .table td:nth-child(n+5) { display: none; }
}