:root {
    --bg: #0d0e14;
    --bg-alt: #14161f;
    --surface: #1a1d29;
    --surface-hover: #22263480;
    --border: #2a2e3d;
    --text: #e7e8ee;
    --text-dim: #9498ab;
    --accent: #ff4655;
    --accent-dim: #ff465533;
    --gold: #f2c14e;
    --green: #3ddc97;
    --radius: 10px;
    --max-width: 1180px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    line-height: 1.5;
}

.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

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

img { max-width: 100%; display: block; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(13, 14, 20, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand__mark { color: var(--accent); }

.site-nav { display: flex; gap: 4px; }

.site-nav a {
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.92rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a.is-active { color: var(--accent); background: var(--accent-dim); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); display: block; }

/* Hero */
.hero {
    padding: 64px 0 40px;
    background:
        radial-gradient(ellipse 900px 400px at 20% -10%, var(--accent-dim), transparent),
        radial-gradient(ellipse 700px 400px at 90% -20%, #f2c14e22, transparent);
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.hero p {
    color: var(--text-dim);
    max-width: 640px;
    font-size: 1.05rem;
    margin: 0 0 28px;
}

.hero__stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.stat .stat__value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
}

.stat .stat__label {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

section { padding: 40px 0; }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.section-head h2 { margin: 0; font-size: 1.4rem; }
.section-head .muted { color: var(--text-dim); font-size: 0.9rem; }

/* Leaderboard table */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

thead th {
    color: var(--text-dim);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    background: var(--bg-alt);
}

tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

td.rank { font-weight: 700; color: var(--text-dim); width: 48px; }
tr:nth-child(1) td.rank { color: var(--gold); }
tr:nth-child(2) td.rank { color: #cdd2df; }
tr:nth-child(3) td.rank { color: #cd8a4e; }

td.earnings, th.earnings { text-align: right; }
td.earnings { font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }

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

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7a1f2b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.avatar--lg {
    width: 84px;
    height: 84px;
    font-size: 1.5rem;
}

.player-cell .nickname { font-weight: 600; }
.player-cell .real-name { color: var(--text-dim); font-size: 0.82rem; }

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge--active { background: #3ddc9722; color: var(--green); }
.badge--inactive { background: #9498ab22; color: var(--text-dim); }
.badge--retired { background: #ff465522; color: var(--accent); }

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filters input[type=search],
.filters select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.filters input[type=search] { flex: 1; min-width: 200px; }

/* Cards grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.15s, transform 0.15s;
}

.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.card .muted { color: var(--text-dim); font-size: 0.85rem; }

/* Player profile */
.profile-head {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.profile-head h1 { margin: 0 0 6px; font-size: 2rem; }
.profile-meta { color: var(--text-dim); }

.profile-earnings {
    margin-top: 24px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.profile-earnings .amount { font-size: 2.2rem; font-weight: 800; color: var(--green); }
.profile-earnings .label { color: var(--text-dim); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

.timeline { border-left: 2px solid var(--border); margin-left: 6px; padding-left: 20px; }
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
}
.timeline-item h4 { margin: 0 0 2px; font-size: 1rem; }
.timeline-item .muted { font-size: 0.85rem; }

.breadcrumb { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 16px; }
.breadcrumb a:hover { color: var(--text); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.prose { color: var(--text-dim); max-width: 720px; }
.prose h2 { color: var(--text); margin-top: 32px; }

.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    color: var(--text-dim);
    font-size: 0.85rem;
}
.site-footer__inner p { margin: 4px 0; }
.site-footer__note { font-size: 0.78rem; opacity: 0.75; }

@media (max-width: 720px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-alt);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 8px;
        display: none;
    }
    .site-nav.is-open { display: flex; }
    th.hide-sm, td.hide-sm { display: none; }
}
