.stats-wrap { padding-top: 120px; padding-bottom: 40px; }

.stats-head { text-align: center; margin-bottom: 30px; }
.stats-head h1 { font-family: var(--head); font-size: clamp(2rem, 5vw, 2.8rem); }
.stats-head .sub { color: var(--muted); max-width: 640px; margin: 12px auto 0; }
.stats-head code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: .9em; }

/* ---------- своя статистика ---------- */
.me-card {
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 26px;
    margin-bottom: 26px;
}

.me-card .me-title { font-family: var(--head); font-weight: 700; color: var(--muted); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }

.me-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 720px) { .me-grid { grid-template-columns: repeat(2, 1fr); } }

.me-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.me-stat .v { display: block; font-family: var(--head); font-weight: 800; font-size: 1.7rem; color: var(--accent-2); }
.me-stat .l { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }

.me-note { color: var(--muted); font-size: .88rem; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.me-note b { color: var(--text); }

.me-card.guest { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: var(--muted); }

/* ---------- топ ---------- */
.top-box { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs .tab {
    font: inherit;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
    transition: .15s;
}
.tabs .tab:hover { color: var(--text); background: var(--surface-2); }
.tabs .tab.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.search input {
    width: 260px;
    max-width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    font: inherit;
}
.search input:focus { outline: none; border-color: var(--accent); }

/* Таблица шире экрана телефона - даём ей горизонтальную прокрутку вместо того, чтобы
   ломать страницу или прятать колонки. */
.table-scroll { overflow-x: auto; }

.top-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.top-table th, .top-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.top-table th { color: var(--muted); font-weight: 500; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
.top-table tbody tr:last-child td { border-bottom: none; }
.top-table tbody tr:hover td { background: var(--surface-2); }

.top-table .n { width: 48px; color: var(--muted); text-align: center; }
.top-table .r { text-align: right; }
.top-table th.r { text-align: right; }
.top-table .p { font-weight: 600; white-space: normal; word-break: break-word; }

/* Первая тройка - как в игровых топах. Только в режиме топа: в результатах поиска места
   не нумеруются, и подсвечивать там первые три строки значило бы врать о местах. */
.top-table.ranked tbody tr:nth-child(1) .n { color: #FFD700; font-weight: 800; }
.top-table.ranked tbody tr:nth-child(2) .n { color: #C0C0C0; font-weight: 800; }
.top-table.ranked tbody tr:nth-child(3) .n { color: #CD7F32; font-weight: 800; }

.empty { color: var(--muted); text-align: center; padding: 34px 10px; }
