.podium-container {
    background: linear-gradient(180deg, white, var(--gray-50));
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.podium-item {
    text-align: center;
    position: relative;
    flex: 1;
}

.podium-item.first {
    order: 2;
    transform: translateY(-20px);
}

.podium-item.second {
    order: 1;
}

.podium-item.third {
    order: 3;
}

.podium-crown {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    animation: float-crown 3s ease-in-out infinite;
}

@keyframes float-crown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

.podium-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
    font-weight: 700;
    border: 4px solid white;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
}

.podium-item.first .podium-avatar {
    width: 140px;
    height: 140px;
    font-size: 3rem;
    border-color: #fbbf24;
    box-shadow: 0 20px 40px rgba(251, 191, 36, 0.3);
}

.podium-item.second .podium-avatar {
    border-color: #94a3b8;
}

.podium-item.third .podium-avatar {
    border-color: #b45309;
}

.podium-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
}

.podium-item.first .podium-name {
    font-size: 1.3rem;
    font-weight: 700;
}

.podium-institution {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.podium-score {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.4rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-block;
    box-shadow: var(--shadow-md);
}

.podium-item.first .podium-score {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    font-size: 1.3rem;
    padding: 0.5rem 2rem;
}

/* Filtros do ranking */
.ranking-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-full);
    background: white;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: var(--gray-600);
}

.filter-tab:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.filter-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.3rem 0.3rem 0.3rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--gray-200);
}

.filter-search input {
    border: none;
    outline: none;
    padding: 0.5rem 0;
    width: 200px;
}

.filter-search button {
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-search button:hover {
    background: var(--secondary);
}

/* Tabela do ranking */
.ranking-table {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.ranking-table table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table th {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 1.2rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ranking-table td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-600);
}

.ranking-table tbody tr {
    transition: all 0.2s;
}

.ranking-table tbody tr:hover {
    background: var(--gray-50);
}

.ranking-table tbody tr.current-user {
    background: #e0f2fe;
    border-left: 4px solid var(--secondary);
}

.ranking-position-badge {
    width: 35px;
    height: 35px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--gray-600);
}

.ranking-position-badge.top-1 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.ranking-position-badge.top-2 {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
}

.ranking-position-badge.top-3 {
    background: linear-gradient(135deg, #b45309, #92400e);
    color: white;
}

.user-highlight {
    background: #e0f2fe;
    font-weight: 600;
}

.user-highlight td:first-child {
    border-left: 4px solid var(--secondary);
}

/* Player info na tabela */
.player-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.player-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.player-details {
    display: flex;
    flex-direction: column;
}

.player-full-name {
    font-weight: 600;
    color: var(--gray-800);
}

.player-institution {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Progress bars */
.progress-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar-small {
    width: 80px;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill-small {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
    border-radius: var(--radius-full);
}

/* Pódio */
.ranking-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    padding: 2.5rem 2rem;
    background: linear-gradient(180deg, white, var(--gray-50));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    flex-wrap: nowrap;
    min-height: 220px;
}
.podium-item { text-align:center; position:relative; flex:1; min-width:0; }
.podium-item.first  { order:2; }
.podium-item.second { order:1; }
.podium-item.third  { order:3; }
.podium-avatar {
    width:90px; height:90px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius:50%; display:flex; align-items:center; justify-content:center;
    margin:0 auto 0.8rem; font-size:1.8rem; color:white; font-weight:700;
    border:4px solid white; box-shadow:var(--shadow-lg);
}
.podium-item.first .podium-avatar { width:120px; height:120px; font-size:2.5rem; border-color:gold; transform:translateY(-16px); }
.podium-crown { position:absolute; top:-30px; left:50%; transform:translateX(-50%); font-size:2rem; }
.podium-name { font-size:0.95rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; font-weight:600; }
.podium-score { background:var(--primary); color:white; padding:0.3rem 1rem; border-radius:var(--radius-full); margin-top:0.5rem; font-size:0.9rem; display:inline-block; }
.podium-item.first .podium-score { background:linear-gradient(135deg,#fbbf24,#f59e0b); }

/* Filtros */
.filter-tabs { display:flex; gap:0.5rem; flex-wrap:wrap; margin-bottom:1rem; }
.filter-tab { padding:0.5rem 1.1rem; border-radius:var(--radius-full); background:white; border:1px solid var(--gray-200); cursor:pointer; transition:all 0.2s; font-size:0.88rem; white-space:nowrap; }
.filter-tab.active { background:var(--primary); color:white; border-color:var(--primary); }
.filter-tab:hover:not(.active) { background:var(--gray-100); }

/* Dropdown customizado de matérias */
#disc-dropdown-wrapper { position:relative; display:inline-block; }

#disc-dropdown-btn {
    display:inline-flex; align-items:center; gap:0.5rem;
    font-family:inherit; font-size:0.88rem; cursor:pointer;
}
#disc-dropdown-btn .disc-label { flex:1; }
#disc-chevron { transition:transform 0.2s; font-size:0.65rem; color:#64748b; }

#disc-dropdown-panel {
    display:none;
    position:absolute;
    top:calc(100% + 8px);
    left:0;
    min-width:230px;
    background:white;
    border-radius:14px;
    border:1px solid #e2e8f0;
    box-shadow:0 12px 32px rgba(0,0,0,0.13);
    z-index:200;
    overflow:hidden;
    max-height:300px;
    overflow-y:auto;
}

#disc-dropdown-panel::-webkit-scrollbar { width:4px; }
#disc-dropdown-panel::-webkit-scrollbar-thumb { background:#e2e8f0; border-radius:4px; }

.disc-option {
    display:flex; align-items:center; gap:0.7rem;
    padding:0.65rem 1rem; cursor:pointer;
    font-size:0.88rem; color:#334155;
    transition:background 0.15s, color 0.15s;
    border-bottom:1px solid #f8fafc;
}
.disc-option:last-child { border-bottom:none; }
.disc-option:hover { background:#eff6ff; color:#3b82f6; }
.disc-option.active { background:#eff6ff; color:#3b82f6; font-weight:600; }
.disc-dot {
    width:7px; height:7px; border-radius:50%;
    background:#3b82f6; flex-shrink:0;
    transition:background 0.15s;
}
.disc-option:hover .disc-dot { background:#3b82f6; }
.disc-option.active .disc-dot { background:#3b82f6; }

/* Tabela */
.ranking-position-badge {
    width:32px; height:32px; background:var(--gray-100); border-radius:50%;
    display:inline-flex; align-items:center; justify-content:center;
    font-weight:700; color:var(--gray-600); font-size:0.85rem;
}
.ranking-position-badge.top-1 { background:linear-gradient(135deg,#fbbf24,#f59e0b); color:white; }
.ranking-position-badge.top-2 { background:linear-gradient(135deg,#94a3b8,#64748b); color:white; }
.ranking-position-badge.top-3 { background:linear-gradient(135deg,#b45309,#92400e); color:white; }
.user-highlight { background:#eff6ff !important; font-weight:600; }
.user-highlight td:first-child { border-left:4px solid var(--primary); }

@media (max-width: 768px) {
    .ranking-podium { flex-direction:column; align-items:center; gap:1.5rem; padding:1.5rem 1rem; }
    .podium-item { width:100%; max-width:240px; }
    .podium-item.first { order:1; }
    .podium-item.second { order:2; }
    .podium-item.third { order:3; }
    .podium-item.first .podium-avatar { transform:translateY(0); }
}
@media (max-width: 480px) {
    .filter-tab { padding:0.4rem 0.8rem; font-size:0.8rem; }
}

@media (max-width: 1024px) {
    .podium {
        gap: 1rem;
    }

    .podium-item.first .podium-avatar {
        width: 110px;
        height: 110px;
        font-size: 2.5rem;
    }

    .podium-avatar {
        width: 80px;
        height: 80px;
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .podium {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .podium-item {
        width: 100%;
        max-width: 300px;
    }

    .podium-item.first {
        order: 1;
        transform: translateY(0);
    }

    .ranking-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search {
        width: 100%;
    }

    .filter-search input {
        width: 100%;
    }

    .ranking-table {
        overflow-x: auto;
    }

    .ranking-table table {
        min-width: 800px;
    }
}

@media (max-width: 480px) {
    .podium-container {
        padding: 2rem 1rem;
    }

    .filter-tabs {
        justify-content: center;
    }

    .filter-tab {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

/* ── Sistema de Ligas ──────────────────────────────────────────── */

.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.3px;
    border: 1.5px solid transparent;
}

/* Bronze */
.rank-bronze {
    background: linear-gradient(135deg, #fde8cc, #f5c899);
    color: #7c3a0a;
    border-color: #e0a060;
}
/* Silver */
.rank-silver {
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
    color: #334155;
    border-color: #94a3b8;
}
/* Gold */
.rank-gold {
    background: linear-gradient(135deg, #fefce8, #fde68a);
    color: #713f12;
    border-color: #f59e0b;
}
/* Phoenix — vermelho-laranja de fogo */
.rank-phoenix {
    background: linear-gradient(135deg, #fff1f2, #fca5a5);
    color: #7f1d1d;
    border-color: #ef4444;
}
/* Ranger — verde floresta */
.rank-ranger {
    background: linear-gradient(135deg, #f0fdf4, #86efac);
    color: #14532d;
    border-color: #22c55e;
}
/* Champion — roxo */
.rank-champion {
    background: linear-gradient(135deg, #f5f3ff, #c4b5fd);
    color: #3b0764;
    border-color: #8b5cf6;
}
/* Master — azul profundo */
.rank-master {
    background: linear-gradient(135deg, #eff6ff, #93c5fd);
    color: #1e3a5f;
    border-color: #3b82f6;
}
/* Elite — ciano/gelo */
.rank-elite {
    background: linear-gradient(135deg, #ecfeff, #67e8f9);
    color: #164e63;
    border-color: #06b6d4;
}
/* The Legend — gradiente dourado especial */
.rank-legend {
    background: linear-gradient(135deg, #fef3c7, #fbbf24, #f59e0b);
    color: #451a03;
    border-color: #d97706;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
    animation: legend-glow 2.5s ease-in-out infinite;
}
@keyframes legend-glow {
    0%, 100% { box-shadow: 0 0 6px rgba(251,191,36,0.4); }
    50%       { box-shadow: 0 0 14px rgba(251,191,36,0.9); }
}

/* Badge maior no pódio */
.rank-badge-podium {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.9rem;
    font-size: 0.82rem;
    margin: 0.3rem auto 0.5rem;
}

/* Card de liga no dashboard (ver dashboard.js) */
.liga-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.liga-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}
.liga-card-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}
.liga-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 0.6rem;
}
.liga-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
}

/* ══════════════════════════════════════════════
   DARK MODE — ranking.css
   ══════════════════════════════════════════════ */
[data-theme="dark"] .podium-container {
    background: linear-gradient(180deg, #111d2e, #19273a);
    border-color: #1e3550;
    box-shadow: none;
}

[data-theme="dark"] .ranking-podium {
    background: linear-gradient(180deg, #111d2e, #19273a);
    border-color: #1e3550;
    box-shadow: none;
}

[data-theme="dark"] .podium-avatar {
    border-color: #1e3550;
}

[data-theme="dark"] .podium-item.first .podium-avatar {
    border-color: #fbbf24;
}

[data-theme="dark"] .podium-item.second .podium-avatar {
    border-color: #94a3b8;
}

[data-theme="dark"] .podium-item.third .podium-avatar {
    border-color: #b45309;
}

[data-theme="dark"] .podium-name {
    color: #e2e8f0;
}

[data-theme="dark"] .podium-institution {
    color: #94a3b8;
}

[data-theme="dark"] .filter-tab {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}

[data-theme="dark"] .filter-tab:hover:not(.active) {
    background: #1f3145;
    color: #e2e8f0;
}

[data-theme="dark"] .filter-tab.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

[data-theme="dark"] .filter-search {
    background: #19273a;
    border-color: #1e3550;
}

[data-theme="dark"] .filter-search input {
    background: #19273a;
    color: #e2e8f0;
}

[data-theme="dark"] .filter-search input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .ranking-table {
    background: #111d2e;
    box-shadow: none;
}

[data-theme="dark"] .ranking-table th {
    background: #19273a;
    color: #94a3b8;
    border-bottom: 1px solid #1e3550;
}

[data-theme="dark"] .ranking-table td {
    border-bottom: 1px solid #1e3550;
    color: #94a3b8;
}

[data-theme="dark"] .ranking-table tbody tr:hover {
    background: #1f3145;
}

[data-theme="dark"] .ranking-table tbody tr.current-user {
    background: #19273a;
    border-left-color: #3b82f6;
}

[data-theme="dark"] .ranking-position-badge {
    background: #19273a;
    color: #94a3b8;
}

[data-theme="dark"] .user-highlight {
    background: #19273a !important;
}

[data-theme="dark"] .user-highlight td:first-child {
    border-left-color: #3b82f6;
}

[data-theme="dark"] .player-full-name {
    color: #e2e8f0;
}

[data-theme="dark"] .player-institution {
    color: #94a3b8;
}

[data-theme="dark"] .progress-bar-small {
    background: #1e3550;
}

[data-theme="dark"] #disc-dropdown-panel {
    background: #19273a;
    border-color: #1e3550;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] #disc-dropdown-panel::-webkit-scrollbar-thumb {
    background: #1e3550;
}

[data-theme="dark"] .disc-option {
    color: #94a3b8;
    border-bottom-color: #1e3550;
}

[data-theme="dark"] .disc-option:hover {
    background: #1f3145;
    color: #3b82f6;
}

[data-theme="dark"] .disc-option.active {
    background: #1f3145;
    color: #3b82f6;
}

/* Liga card */
[data-theme="dark"] .liga-card {
    background: #111d2e;
    border-color: #1e3550;
    box-shadow: none;
}

[data-theme="dark"] .liga-card-title {
    color: #64748b;
}

[data-theme="dark"] .liga-progress-bar {
    background: #1e3550;
}

/* Rank badges — ajuste dark sutil para manter legibilidade */
[data-theme="dark"] .rank-silver {
    background: linear-gradient(135deg, #334155, #475569);
    color: #e2e8f0;
    border-color: #64748b;
}

[data-theme="dark"] .rank-gold {
    background: linear-gradient(135deg, #422006, #713f12);
    color: #fde68a;
    border-color: #f59e0b;
}

[data-theme="dark"] .rank-bronze {
    background: linear-gradient(135deg, #431407, #7c3a0a);
    color: #fde8cc;
    border-color: #e0a060;
}

[data-theme="dark"] .rank-phoenix {
    background: linear-gradient(135deg, #450a0a, #7f1d1d);
    color: #fca5a5;
    border-color: #ef4444;
}

[data-theme="dark"] .rank-ranger {
    background: linear-gradient(135deg, #052e16, #14532d);
    color: #86efac;
    border-color: #22c55e;
}

[data-theme="dark"] .rank-champion {
    background: linear-gradient(135deg, #2e1065, #3b0764);
    color: #c4b5fd;
    border-color: #8b5cf6;
}

[data-theme="dark"] .rank-master {
    background: linear-gradient(135deg, #1e3a5f, #1e40af);
    color: #93c5fd;
    border-color: #3b82f6;
}

[data-theme="dark"] .rank-elite {
    background: linear-gradient(135deg, #083344, #164e63);
    color: #67e8f9;
    border-color: #06b6d4;
}