/*
 * Styles für die globale Bestenliste (leaderboard.html).
 * Header/Footer/Auth-Modal-Optik kommt aus main.css - hier nur Seitenlayout,
 * Tabs, "Dein Rang"-Karte und die Ranglisten-Zeilen. Reine .stats-row/
 * .stats-summary-item-Wiederverwendung wo möglich (css/stats.css), eigene
 * Klassen nur für das, was auf dieser Seite wirklich neu ist (Rang-Badge,
 * Avatar, Metrik-Wert).
 */
/* css/leaderboard.css */

body.leaderboard-page {
    align-items: stretch; /* Override base.css centering */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.leaderboard-main {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    /* Platz für den fixierten Auth-Header oben rechts + eventuelle Top-Banner */
    padding: calc(90px + var(--top-banner-height, 0px)) 24px 60px;
    flex: 1;
}

/* ─── Kopfbereich ────────────────────────────────────────────────── */
.leaderboard-head {
    text-align: center;
    margin-bottom: 28px;
}

.leaderboard-head h1 {
    font-size: 2.6rem;
    font-weight: 800;
    margin: 0 0 10px;
    color: var(--text-main);
}

.leaderboard-intro {
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto;
}

/* ─── Tabs (gleiche Optik wie .stats-tabs, eigenständige Datei -> eigene
   Deklaration statt Cross-File-Abhängigkeit auf stats.css) ─────────── */
.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-tab {
    padding: 8px 4px 12px;
    margin: 0 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s;
}

.leaderboard-tab:hover {
    color: var(--text-main);
}

.leaderboard-tab.active {
    color: var(--text-main);
    border-bottom-color: var(--accent-color);
}

/* ─── "Dein Rang"-Karte ──────────────────────────────────────────── */
.leaderboard-your-rank-card {
    display: flex;
    justify-content: center;
    gap: 32px;
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.leaderboard-your-rank-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92em;
}

.leaderboard-your-rank-card.leaderboard-cta {
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.leaderboard-cta-btn {
    display: inline-block;
    padding: 8px 18px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.leaderboard-cta-btn:hover {
    background: var(--accent-hover);
}

/* ─── Wiederverwendete "stats.css"-Bausteine ─────────────────────────
   leaderboard.html laedt css/stats.css bewusst nicht mit (eigenstaendige
   Seite, siehe main.css-Konvention) - dieselben Klassennamen werden hier
   daher lokal neu deklariert statt eine Cross-File-Abhaengigkeit einzugehen. */
.stats-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.stats-summary-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
}

.stats-summary-label {
    font-size: 0.78em;
    color: var(--text-muted);
}

.stats-list-loading,
.stats-list-empty {
    color: var(--text-muted);
    font-size: 0.88em;
    padding: 6px 0 10px;
    text-align: center;
}

.stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-hover);
    border-radius: 10px;
}

.stats-row-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.stats-row-title {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Ranglisten-Zeilen ──────────────────────────────────────────── */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-row {
    gap: 12px;
}

.leaderboard-rank-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-body);
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 700;
}

.leaderboard-rank-badge.leaderboard-rank-top {
    color: #fff;
}

.leaderboard-rank-badge.leaderboard-rank-1 { background: #d4af37; }
.leaderboard-rank-badge.leaderboard-rank-2 { background: #a8a9ad; }
.leaderboard-rank-badge.leaderboard-rank-3 { background: #b56a34; }

.leaderboard-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.leaderboard-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: #fff;
    font-weight: 700;
    font-size: 0.9em;
}

.leaderboard-metric {
    flex-shrink: 0;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .leaderboard-tab {
        margin: 0 8px;
        font-size: 0.92rem;
    }

    .leaderboard-your-rank-card {
        gap: 20px;
    }
}
