/* Page Classement : podium + liste */

html, body.ranking-page {
    background: var(--dark-bg, #050508);
    color: var(--text-primary, #e2e8f0);
    min-height: 100vh;
}

.ranking-main {
    padding: 7.5rem 0 4rem;
    min-height: 100vh;
}

.ranking-wrap {
    max-width: 860px;
    margin: 0 auto;
}

.ranking-hero {
    text-align: center;
    margin-bottom: 1.75rem;
}

.ranking-hero h1 {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    margin: 0 0 0.4rem;
}

.ranking-hero h1 i {
    color: #ffd76a;
    margin-right: 0.35rem;
}

.ranking-hero p {
    color: var(--text-secondary, #94a3b8);
    margin: 0;
}

.ranking-loading,
.ranking-empty {
    text-align: center;
    color: var(--text-secondary, #94a3b8);
    padding: 2rem 1rem;
}

.ranking-me {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 auto 1.5rem;
    max-width: 520px;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    background: var(--glass-surface, rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(135, 206, 235, 0.28);
}

.ranking-me[hidden] {
    display: none !important;
}

.ranking-me a {
    color: inherit;
    text-decoration: none;
    font-weight: 650;
}

.ranking-me a:hover {
    color: #87ceeb;
}

.ranking-podium {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    align-items: end;
    gap: 0.85rem;
    margin-bottom: 2rem;
    min-height: 12rem;
}

.ranking-podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    padding: 1.1rem 0.7rem 1.2rem;
    border-radius: 18px;
    background: var(--glass-surface, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--glass-border-subtle, rgba(255, 255, 255, 0.08));
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.ranking-podium-card:hover {
    transform: translateY(-3px);
}

.ranking-podium-card.is-gold {
    order: 2;
    padding-top: 1.6rem;
    padding-bottom: 1.55rem;
    border-color: rgba(255, 215, 106, 0.55);
    box-shadow: 0 10px 36px rgba(255, 215, 106, 0.18);
}

.ranking-podium-card.is-silver {
    order: 1;
    border-color: rgba(192, 200, 216, 0.45);
}

.ranking-podium-card.is-bronze {
    order: 3;
    border-color: rgba(205, 127, 50, 0.5);
}

.ranking-podium-place {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.55rem;
}

.ranking-podium-card.is-gold .ranking-podium-place { color: #ffd76a; }
.ranking-podium-card.is-silver .ranking-podium-place { color: #c9d4e3; }
.ranking-podium-card.is-bronze .ranking-podium-place { color: #e0a46a; }

.ranking-podium-card img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid currentColor;
}

.ranking-podium-card.is-gold img {
    width: 92px;
    height: 92px;
    color: #ffd76a;
}

.ranking-podium-card.is-silver img { color: #c9d4e3; }
.ranking-podium-card.is-bronze img { color: #cd7f32; }

.ranking-podium-name {
    margin-top: 0.7rem;
    font-weight: 750;
    font-size: 1.02rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-podium-card.is-gold .ranking-podium-name { font-size: 1.15rem; }

.ranking-podium-points {
    margin-top: 0.2rem;
    color: var(--text-secondary, #94a3b8);
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
}

.ranking-podium-card .certif-badge {
    color: #43b581;
    margin-left: 0.2rem;
    font-size: 0.85rem;
}

.ranking-board {
    border: 1px solid var(--glass-border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    overflow: hidden;
    background: var(--glass-surface, rgba(255, 255, 255, 0.04));
}

.ranking-board-head,
.ranking-row {
    display: grid;
    grid-template-columns: 4.2rem minmax(0, 1fr) 6.5rem;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem 1rem;
}

.ranking-board-head {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary, #94a3b8);
    border-bottom: 1px solid var(--glass-border-subtle, rgba(255, 255, 255, 0.08));
}

.ranking-board-head span:last-child,
.ranking-row-points {
    text-align: right;
}

.ranking-row {
    color: inherit;
    text-decoration: none;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.12s ease;
}

.ranking-row:hover {
    background: rgba(135, 206, 235, 0.08);
}

.ranking-row.is-me {
    background: rgba(135, 206, 235, 0.12);
}

.ranking-row-rank {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--text-secondary, #94a3b8);
}

.ranking-row-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.ranking-row-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ranking-row-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 650;
}

.ranking-row-points {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.ranking-rules {
    margin: 0 0 1.75rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border-subtle, rgba(255, 255, 255, 0.08));
    background: var(--glass-surface, rgba(255, 255, 255, 0.04));
}

.ranking-rules summary {
    cursor: pointer;
    padding: 0.95rem 1.1rem;
    font-weight: 650;
}

.ranking-rules table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 0.4rem;
}

.ranking-rules th,
.ranking-rules td {
    text-align: left;
    padding: 0.55rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.92rem;
}

.ranking-rules th:last-child,
.ranking-rules td:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ranking-rules td:last-child {
    font-weight: 700;
    color: #ffd76a;
}

@media (max-width: 700px) {
    .ranking-podium {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .ranking-podium-card.is-gold,
    .ranking-podium-card.is-silver,
    .ranking-podium-card.is-bronze {
        order: 0;
    }

    .ranking-podium-card.is-gold { order: -1; }

    .ranking-board-head,
    .ranking-row {
        grid-template-columns: 3.2rem minmax(0, 1fr) 5.2rem;
        padding: 0.65rem 0.8rem;
    }
}
