:root {
    --bg: #0e0f13;
    --bg-card: #1a1c23;
    --bg-card-hover: #21242c;
    --border: #2a2d37;
    --text: #e8e9ec;
    --text-muted: #8b8d97;
    --accent: #5865f2;
    --gold: #f1c40f;
    --red: #e74c3c;
    --green: #2ecc71;
    --radius: 10px;
}

* { box-sizing: border-box; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; }

/* Header */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand:hover { text-decoration: none; }
.main-nav { display: flex; gap: 24px; }
.main-nav a { color: var(--text-muted); font-weight: 700; font-size: 0.95rem; }
.main-nav a:hover { color: var(--text); text-decoration: none; }
.login-btn {
    background: var(--accent);
    color: white !important;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 700;
}
.login-btn:hover { background: #4752c4; text-decoration: none !important; }

/* Layout */
.page { max-width: 1000px; margin: 0 auto; padding: 32px 24px 64px; }

/* Hero (home page) */
.hero { text-align: center; padding: 40px 0 20px; }
.hero h1 { font-size: 2.4rem; margin-bottom: 8px; }
.hero-sub { color: var(--text-muted); font-size: 1.1rem; margin: 0; }

.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 28px;
}
@media (max-width: 700px) { .preview-grid { grid-template-columns: 1fr; } }

.preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.preview-card h2 { margin: 0 0 8px; font-size: 1.05rem; }
.preview-list { list-style: none; padding: 0; margin: 12px 0; counter-reset: rank; }
.preview-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    counter-increment: rank;
}
.preview-list li::before {
    content: counter(rank) ".";
    color: var(--text-muted);
    margin-right: 10px;
    font-weight: 700;
    font-size: 0.85rem;
}
.preview-list li:last-child { border-bottom: none; }
.rating { color: var(--gold); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.view-all { display: inline-block; margin-top: 10px; font-size: 0.9rem; font-weight: 600; }

/* Size tabs */
.size-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.size-tab {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
}
.size-tab:hover { text-decoration: none; background: var(--bg-card-hover); color: var(--text); }
.size-tab.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Tables */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.stats-table th, .stats-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.stats-table th {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.stats-table tbody tr:last-child td { border-bottom: none; }
.stats-table tbody tr:hover { background: var(--bg-card-hover); }
.rating-cell { font-weight: 800; color: var(--gold); }
.top-rank.rank-1 { background: rgba(241, 196, 15, 0.07); }
.top-rank.rank-2 { background: rgba(200, 200, 210, 0.05); }
.top-rank.rank-3 { background: rgba(205, 127, 50, 0.06); }

.tier-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

/* Size stat cards (player + clan pages) */
.size-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 16px 0 32px;
}
.size-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 12px;
    text-align: center;
}
.size-card h3 { margin: 0 0 6px; color: var(--text-muted); font-size: 0.85rem; font-weight: 700; }
.big-rating { font-size: 1.7rem; font-weight: 800; color: var(--gold); margin: 4px 0; }
.muted { color: var(--text-muted); font-size: 0.82rem; margin: 2px 0 0; }

/* Match history */
.match-list { list-style: none; padding: 0; }
.match-row {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 11px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.match-row.win { border-left: 3px solid var(--green); }
.match-row.loss { border-left: 3px solid var(--red); }
.match-size { color: var(--text-muted); }
.match-map { color: var(--text-muted); margin-left: auto; }

/* Clan roster */
.roster-list { list-style: none; padding: 0; }
.roster-list li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.roster-list li:last-child { border-bottom: none; }
.tag { color: var(--text-muted); font-weight: 400; }

.empty { color: var(--text-muted); font-style: italic; }
.ign { color: var(--text-muted); margin-top: -8px; }

/* 404 */
.not-found { text-align: center; padding: 60px 0; }
.not-found h1 { font-size: 4rem; margin-bottom: 0; color: var(--text-muted); }

/* Footer */
.site-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}
