/* Input Styles */
.input-group {
    margin-bottom: 2rem;
}

#username-input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 1.5rem;
    border-radius: 30px;
    color: white;
    font-size: 1.2rem;
    width: 100%;
    max-width: 400px;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
}

#username-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(75, 123, 255, 0.3);
}

#username-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Leaderboard Styles */
.leaderboard-section {
    margin-top: 3rem;
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.leaderboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 20px;
    /* pill shape */
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: white;
    background: var(--accent-color);
}

.leaderboard-content {
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Grouped Leaderboard Styles */
.mode-leaderboard-group {
    margin-bottom: 1.5rem;
}

.mode-header {
    font-size: 1rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.score-row:last-child {
    border-bottom: none;
}

.score-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.score-rank {
    width: 25px;
    font-weight: bold;
    color: var(--text-muted);
}

.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;
}

.score-points {
    font-weight: 700;
    color: var(--text-main);
}

.empty-message {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.5rem;
}

.loading-text {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

/* Disabled buttons */
.action-btn:disabled {
    opacity: 0.5;
    cursor: default;
    filter: grayscale(1);
    transform: none !important;
    box-shadow: none !important;
}

/* Mobile Leaderboard Tweaks */
@media (max-width: 600px) {
    .leaderboard-section {
        margin-top: 2rem;
        padding: 1rem;
    }

    .leaderboard-tabs {
        flex-wrap: wrap;
        /* Allow wrapping */
        justify-content: center;
    }

    .tab-btn {
        flex: 1 1 auto;
        /* Grow to fill space */
        text-align: center;
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    #username-input {
        width: 100%;
        max-width: 100%;
        font-size: 1.2rem;
        /* Avoid zoom on iOS focus */
        padding: 0.8rem;
    }

    .score-row {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .score-mode-badge {
        width: auto;
        max-width: 100px;
    }

    .score-user {
        padding-left: 0.5rem;
    }
}