/* =====================================================
   ExcelQuest – Ranking (Leaderboard)
   ===================================================== */

.ranking-page {
    background: radial-gradient(ellipse at top, #1a1000 0%, var(--bg) 60%);
    min-height: 100vh;
}

.ranking-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* ---- Hero ---- */
.ranking-hero {
    text-align: center;
    margin-bottom: 32px;
    animation: slideDown 0.4s ease;
}

.ranking-hero h2 {
    font-size: 2rem;
    margin-bottom: 6px;
}

.ranking-hero p {
    color: var(--text-muted);
}

/* ---- Pódio ---- */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
    animation: slideUp 0.4s ease 0.1s both;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 180px;
}

.podium-crown {
    font-size: 1.8rem;
    margin-bottom: 4px;
    animation: bounce 2s ease infinite;
}

.podium-avatar {
    font-size: 2.5rem;
    margin-bottom: 6px;
}

.podium-name {
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    margin-bottom: 4px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-xp {
    font-size: 0.8rem;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 8px;
}

.podium-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: 1.3rem;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.6);
}

.podium-block-1 {
    height: 120px;
    background: linear-gradient(180deg, var(--gold), #b8960a);
    box-shadow: 0 -4px 20px rgba(255, 217, 0, 0.3);
}

.podium-block-2 {
    height: 90px;
    background: linear-gradient(180deg, #c0c0c0, #888);
}

.podium-block-3 {
    height: 70px;
    background: linear-gradient(180deg, #cd7f32, #8a4a0a);
}

/* ---- Minha posição ---- */
.my-position-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(135deg, var(--card), var(--card-2));
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    margin-bottom: 24px;
    animation: slideDown 0.4s ease;
}

.my-pos-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.my-pos-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--blue);
    min-width: 50px;
    text-align: center;
}

.my-pos-xp {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
}

/* ---- Tabela de Ranking ---- */
.ranking-table-container {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slideUp 0.4s ease 0.2s both;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table thead th {
    background: var(--card-2);
    padding: 14px 20px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.ranking-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.ranking-table tbody tr:last-child {
    border-bottom: none;
}

.ranking-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ranking-table tbody tr.my-row {
    background: rgba(28, 176, 246, 0.05);
    border-color: var(--blue);
}

.ranking-table td {
    padding: 14px 20px;
    vertical-align: middle;
}

/* Posição */
.rank-pos {
    font-size: 1rem;
    font-weight: 900;
    color: var(--text-dim);
    width: 50px;
}

.rank-pos.top1 {
    color: var(--gold);
}

.rank-pos.top2 {
    color: #c0c0c0;
}

.rank-pos.top3 {
    color: #cd7f32;
}

/* Jogador */
.rank-player {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-avatar {
    font-size: 1.4rem;
}

.rank-name {
    font-weight: 700;
    font-size: 0.95rem;
}

/* XP */
.rank-xp {
    font-weight: 800;
    color: var(--gold);
    font-size: 0.95rem;
}

/* Liga */
.league-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.loading-row {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
    font-size: 1rem;
}

@media (max-width: 600px) {
    .podium {
        gap: 6px;
    }

    .podium-avatar {
        font-size: 1.8rem;
    }

    .podium-name {
        font-size: 0.75rem;
    }

    .ranking-table thead th {
        padding: 12px 12px;
    }

    .ranking-table td {
        padding: 12px 12px;
    }
}