html, body {
    height: 100%;
}

/* Container */
#leaderboard-container {
    width: 100%;
    max-width: 48rem;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
    box-sizing: border-box;
    text-align: center;
}

/* Title + subtitle */
.leaderboard-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.6rem;
    color: #f9fafb;
}

#rankedinfo {
    margin: 0 0 1.2rem 0;
    color: #e5e7eb;
    font-size: 0.95rem;
    font-style: italic;
}

.empty-message {
    color: #f9fafb;
    margin-top: 1rem;
}

/* Cards wrapper */
#leaderboard-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual player card */
.player-card {
/*    background: #f1f5f9; /* neutral slate */
    background: #ede3d4;
    color: #4a3f35;
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
    display: flex;
    flex-direction: column;
}

.player-card.ranked {
/*    border-left: 6px solid #22c55e; /* green-500 */
    border-left: 6px solid #bba588;
}

.player-card.unranked {
/*    border-left: 6px solid #94a3b8; /* slate-400 */
    border-left: 6px solid #d3c4af;
    opacity: 0.95;
}

.player-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Top row in card */
.player-card-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Left: rank + name */
.player-card-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;                /* ← allows name area to grow */
    min-width: 6rem;        /* ← more breathing room */
}

/* Rank badge */
.player-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background-color: #0f172a;
    color: #f9fafb;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.player-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Single-line stats row */
.player-card-stats {
    margin-left: auto;
    margin-right: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-end;
}

.stat-block {
    display: inline-flex;
    gap: 0.25rem;
    align-items: baseline;
    white-space: nowrap;
}

.stat-label {
    font-size: 0.75rem;
    color: #64748b; /* slate-500 */
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

/* dimmed points for unranked players */
.unranked-points {
    color: #6b7280;
    font-style: italic;
}

/* bullet separator */
.stat-separator {
    color: #94a3b8; /* slate-400 */
    margin: 0 0.15rem;
}

/* Toggle icon on the far right */
.player-card-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
}

.toggle-icon {
    font-size: 1rem;
    color: #6b7280;
    transition: transform 0.15s ease;
}

.player-card.open .toggle-icon {
    transform: rotate(180deg);
}

/* Details panel */
.player-card-details {
    display: none;              /* toggled by JS */
    margin-top: 0.6rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(15,23,42,0.12);
}

.last-game-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.last-game-link:hover {
    color: #2563eb;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.15rem 0;
    font-size: 0.85rem;
}

.detail-label {
    color: #4b5563;
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
}

/* Mobile-first tweaks */
@media (max-width: 600px) {
    #leaderboard-container {
        padding: 0.75rem 0.5rem 1.5rem;
    }

    .player-card-main {
        align-items: flex-start;
    }

    .player-card-stats {
        margin-top: 0.25rem;
        justify-content: flex-start;
    }

    .player-card-left {
        min-width: 4.3rem;
    }

    .player-name {
        font-size: 1.05rem;
    }
}
