.stats {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 120px 22px 40px;
    text-align: center;
}

.stats h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.6rem, 8vw, 4.4rem);
    line-height: 1;
    margin: 0 0 14px;
    letter-spacing: -1px;
    background: linear-gradient(180deg, #fff 0%, #c9b8ff 60%, var(--brand) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stats .lead {
    color: var(--muted);
    font-size: 1.1rem;
    margin: 0 0 34px;
}

.search {
    display: flex;
    gap: 10px;
    max-width: 480px;
    margin: 0 auto;
}

.search input {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    border-radius: 13px;
    border: 1px solid var(--glass-brd);
    background: rgba(10, 6, 16, 0.6);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.search input::placeholder {
    color: var(--muted);
}

.search input:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

.search button {
    border: none;
    cursor: pointer;
    background: var(--ink);
    color: #0a0610;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 24px;
    border-radius: 13px;
    transition: filter 0.2s ease;
}

.search button:hover {
    filter: brightness(0.92);
}

.result {
    margin-top: 26px;
    min-height: 10px;
}

.coming {
    border: 1px solid var(--glass-brd);
    background: rgba(20, 14, 30, 0.55);
    border-radius: 18px;
    padding: 40px 26px;
}

.coming .tag {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--brand);
    border: 1px solid rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.12);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.coming h2 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.8rem, 6vw, 2.6rem);
    margin: 0 0 10px;
}

.coming p {
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    max-width: 420px;
    margin-inline: auto;
}

.coming .searched {
    color: var(--ink);
    font-weight: 600;
}

.player-head {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 14px;
    image-rendering: pixelated;
    border: 1px solid var(--glass-brd);
    margin: 0 auto 16px;
}

.coming .player-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    margin: 0 0 10px;
    word-break: break-word;
}

.loading {
    color: var(--muted);
    padding: 30px;
}

.hint {
    color: var(--muted);
    font-size: 0.95rem;
    padding: 24px 10px;
}

.stats-card {
    padding: 34px 26px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 4px 0 22px;
}

.meta-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
    padding: 10px 16px;
    border-radius: 13px;
    border: 1px solid var(--glass-brd);
    background: rgba(10, 6, 16, 0.45);
}

.meta-chip .v {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
}

.meta-chip .l {
    font-size: 0.72rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--muted);
}

.modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    text-align: left;
}

.mode-card {
    border: 1px solid var(--glass-brd);
    background: rgba(10, 6, 16, 0.45);
    border-radius: 14px;
    padding: 18px;
}

.mode-card h3 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    margin: 0 0 12px;
    padding-left: 10px;
    border-left: 3px solid var(--brand);
}

.mode-card.accent-void h3 {
    border-left-color: var(--void);
}

.mode-card.accent-bed h3 {
    border-left-color: var(--bed);
}

.mode-card.accent-beta h3 {
    border-left-color: #38bdf8;
}

.mode-card.accent-practice h3 {
    border-left-color: #f59e0b;
}

.mode-breakdown {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.mb-head {
    font-size: 0.66rem !important;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--glass-brd);
}

.mb-head span {
    color: var(--muted) !important;
    font-weight: 600 !important;
}

.mb-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px 52px 78px;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.mb-mode,
.mb-wl,
.mb-wr,
.mb-streak {
    overflow: hidden;
    white-space: nowrap;
}

.mb-mode {
    color: var(--ink);
    font-weight: 600;
}

.mb-wl {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.mb-wr {
    color: var(--muted);
    font-size: 0.82rem;
    text-align: right;
}

.mb-streak {
    color: #f59e0b;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

.stat-cell .v {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ink);
}

.stat-cell .l {
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
}

.leaderboard {
    margin-top: 44px;
}

.leaderboard h2 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin: 0 0 16px;
}

.lb-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.lb-tabs button {
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--muted);
    background: rgba(10, 6, 16, 0.45);
    border: 1px solid var(--glass-brd);
    padding: 9px 18px;
    border-radius: 999px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.lb-tabs button:hover {
    color: var(--ink);
}

.lb-tabs button.active {
    color: var(--ink);
    border-color: rgba(139, 92, 246, 0.55);
    background: rgba(139, 92, 246, 0.12);
}

.lb-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--ink);
    border: 1px solid var(--glass-brd);
    background: rgba(20, 14, 30, 0.55);
    border-radius: 14px;
    padding: 10px 16px;
    transition: border-color 0.2s ease;
}

.lb-row:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.lb-row .rank {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--muted);
    min-width: 34px;
}

.lb-row img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    image-rendering: pixelated;
}

.lb-row .lb-name {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.lb-row .name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-rank {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--brand);
}

.lb-rank[data-rank="owner"],
.lb-rank[data-rank="admin"] {
    color: #f87171;
}

.lb-rank[data-rank="developer"] {
    color: #34d399;
}

.lb-rank[data-rank="yt"],
.lb-rank[data-rank="youtuber"],
.lb-rank[data-rank="youtube"] {
    color: #f472b6;
}

.lb-rank[data-rank="onyx"] {
    color: #a78bfa;
}

.lb-row .value {
    color: var(--muted);
    font-size: 0.92rem;
    white-space: nowrap;
}

.meta-chip.online .v {
    color: var(--grass);
}

.rank-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--brand);
    border: 1px solid rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.14);
    padding: 3px 11px;
    border-radius: 999px;
    white-space: nowrap;
}

.coming .rank-badge {
    margin: 0 0 16px;
}

.lb-row .rank-badge {
    font-size: 0.6rem;
    padding: 2px 8px;
    flex-shrink: 0;
}

.rank-badge[data-rank="onyx"] {
    color: #c4b5fd;
    border-color: rgba(167, 139, 250, 0.5);
    background: rgba(124, 58, 237, 0.2);
}

.rank-badge[data-rank="owner"],
.rank-badge[data-rank="admin"] {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(220, 38, 38, 0.16);
}

.rank-badge[data-rank="yt"],
.rank-badge[data-rank="youtuber"],
.rank-badge[data-rank="youtube"] {
    color: #fda4af;
    border-color: rgba(244, 114, 182, 0.45);
    background: rgba(219, 39, 119, 0.16);
}

.rank-badge[data-rank="developer"] {
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(16, 185, 129, 0.16);
}
