/* ── Input ── */
.input-group { margin-bottom: 2rem; }

#username-input {
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    padding: 1rem 1.5rem;
    border-radius: 30px;
    color: white;
    font-size: 1.1rem;
    font-family: inherit;
    width: 100%;
    max-width: 400px;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
}
#username-input:focus {
    background: rgba(255, 255, 255, 0.11);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(75, 123, 255, 0.15);
}
#username-input::placeholder { color: rgba(255, 255, 255, 0.35); }

/* ── Leaderboard Container ── */
.leaderboard-section {
    margin-top: 2.5rem;
    text-align: left;
    background: rgba(0, 0, 0, 0.25);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.leaderboard-section h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
}

/* ── Tabs ── */
.leaderboard-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    position: relative;
}
.leaderboard-tabs::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.45rem 1rem 0.6rem;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color 0.2s, background 0.2s;
    position: relative;
    z-index: 1;
    font-family: inherit;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    transform: scaleX(0);
    transition: transform 0.25s ease;
    border-radius: 2px;
}
.tab-btn:hover { color: white; background: rgba(255, 255, 255, 0.04); }
.tab-btn.active { color: white; }
.tab-btn.active::after { transform: scaleX(1); }

/* ── Score List ── */
.leaderboard-content {
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.mode-leaderboard-group { margin-bottom: 1.5rem; }
.mode-header {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.92rem;
    transition: background 0.15s;
    animation: rowIn 0.3s ease both;
}
@keyframes rowIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.score-row:last-child { border-bottom: none; }
.score-row:hover { background: rgba(255, 255, 255, 0.04); }

.score-rank {
    width: 28px;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* Medal colours */
.rank-1 { color: #f1c40f; }   /* gold */
.rank-2 { color: #bdc3c7; }   /* silver */
.rank-3 { color: #cd7f32; }   /* bronze */

.score-user {
    flex: 1;
    text-align: left;
    padding-left: 0.5rem;
    color: white;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-points {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 0.9rem;
}

/* Top-1 highlight */
.score-row:first-child {
    background: rgba(241, 196, 15, 0.06);
    border-radius: 8px;
}

.score-row.highlighted {
    background: rgba(75, 123, 255, 0.12) !important;
    border: 1px solid rgba(75, 123, 255, 0.25) !important;
    border-radius: 8px;
}

/* ── Misc ── */
.empty-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem 0.5rem;
    text-align: center;
}

.loading-text {
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .leaderboard-section {
        margin-top: 1.5rem;
        padding: 1rem;
    }
    .leaderboard-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    .tab-btn {
        flex: 1 1 auto;
        text-align: center;
        font-size: 0.82rem;
        padding: 0.4rem 0.6rem 0.5rem;
    }
    #username-input {
        width: 100%;
        max-width: 100%;
        font-size: 1rem;
        padding: 0.8rem;
    }
    .score-row { padding: 0.5rem; font-size: 0.85rem; }
    .score-user { padding-left: 0.4rem; }
}
