/* Ranking Container */
.upv2-rank {
    --upv2-card-shell-top-source: var(--upv2-interacao);
    --upv2-card-shell-bottom-source: var(--upv2-interacao-bottom, #12121b);
    background: linear-gradient(135deg, rgba(17, 17, 26, 0.92), var(--upv2-interacao));
    background: linear-gradient(
        160deg,
        var(--upv2-card-shell-top-rgba, rgba(26, 26, 34, 0.94)) 0%,
        color-mix(in srgb, var(--upv2-card-shell-top-rgba, rgba(26, 26, 34, 0.94)) 54%, var(--upv2-card-shell-bottom-rgba, rgba(18, 18, 27, 0.94)) 46%) 46%,
        var(--upv2-card-shell-bottom-rgba, rgba(18, 18, 27, 0.94)) 100%
    );
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid color-mix(in srgb, var(--upv2-card-shell-top-source) 24%, rgba(255, 255, 255, 0.14) 76%);
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.04) inset,
        0 8px 32px rgba(0, 0, 0, 0.45),
        0 2px 12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 8px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* Header */
.upv2-rank-header {
    text-align: center;
    margin-bottom: 8px;
}

.upv2-rank-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    text-transform: capitalize;
}

.upv2-rank-subtitle {
    font-size: 0.75rem;
    color: #a0a0a0;
    margin: 0;
}

/* Podium Layout */
.upv2-rank-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 120px));
    justify-content: center;
    justify-items: center;
    align-items: end;
    gap: 25px;
    margin-bottom: 12px;
    position: relative;
}

.upv2-rank-podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 120px;
}

/* Posições do Pódio */
.upv2-rank-first {
    order: 2;
    grid-column: 2;
    margin-bottom: 8px;
}

.upv2-rank-second {
    order: 1;
    grid-column: 1;
    margin-bottom: 0;
}

.upv2-rank-third {
    order: 3;
    grid-column: 3;
    margin-bottom: -4px;
}

/* Coroa (1º lugar) */
.upv2-rank-crown {
    position: absolute;
    top: -20px;
    font-size: 1.25rem;
    color: #9b59b6;
    filter: drop-shadow(0 0 8px rgba(155, 89, 182, 0.8));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* Medalhas - centralizadas na parte inferior do avatar */
.upv2-rank-medal {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: #fff;
    z-index: 10;
    border: 2px solid #fff;
}

.upv2-rank-medal-1 {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    bottom: -8px;
}

.upv2-rank-medal-2 {
    background: linear-gradient(135deg, #3498db, #2980b9);
    width: 19px;
    height: 19px;
    font-size: 0.65rem;
    bottom: -7px;
}

.upv2-rank-medal-3 {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    width: 16px;
    height: 16px;
    font-size: 0.55rem;
    bottom: -5px;
}

/* Avatares */
.upv2-rank-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2c2c3e;
    position: relative;
    margin-bottom: 3px;
}

.upv2-rank-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    overflow: hidden;
}

.upv2-rank-avatar i {
    font-size: 0.9rem;
    color: #666;
}

.upv2-rank-podium-item > .upv2-rank-avatar {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
}

/* Tamanhos e bordas dos avatares */
.upv2-rank-avatar-1 {
    width: 55px;
    height: 55px;
    border: 2px solid #9b59b6;
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.6);
}

.upv2-rank-avatar-1 i {
    font-size: 1.4rem;
}

.upv2-rank-avatar-2 {
    width: 45px;
    height: 45px;
    border: 2px solid #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.4);
}

.upv2-rank-avatar-2 i {
    font-size: 1.1rem;
}

.upv2-rank-avatar-3 {
    width: 35px;
    height: 35px;
    border: 2px solid #95a5a6;
    box-shadow: 0 0 5px rgba(149, 165, 166, 0.3);
}

.upv2-rank-avatar-3 i {
    font-size: 0.9rem;
}

/* Nome e Valor */
.upv2-rank-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    text-align: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upv2-rank-first .upv2-rank-name {
    font-size: 0.85rem;
}

.upv2-rank-value {
    font-size: 0.7rem;
    color: #4ade80;
    font-weight: 700;
}

.upv2-rank-first .upv2-rank-value {
    font-size: 0.8rem;
}

/* Lista de outros doadores */
.upv2-rank-list {
    margin-top: 12px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 4px;
}

.upv2-rank-list::-webkit-scrollbar {
    width: 6px;
}

.upv2-rank-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.upv2-rank-list::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.4);
    border-radius: 4px;
}

.upv2-rank-list::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.6);
}

.upv2-rank-list-title {
    font-size: 0.75rem;
    color: #a0a0a0;
    margin-bottom: 8px;
    text-align: center;
}

.upv2-rank-list-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 6px;
    transition: background 0.2s;
}

.upv2-rank-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.upv2-rank-list-position {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    min-width: 30px;
    flex-shrink: 0;
}

.upv2-rank-list-name {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upv2-rank-list-value {
    font-size: 0.7rem;
    color: #4ade80;
    font-weight: 600;
    margin-left: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Empty State */
.upv2-rank-empty {
    text-align: center;
    padding: 40px 20px;
    color: #fff;
    font-size: 0.95rem;
}

/* Responsivo */
@media (max-width: 768px) {
    .upv2-rank-podium {
        gap: 12px;
    }

    .upv2-rank-avatar-1 {
        width: 90px;
        height: 90px;
    }

    .upv2-rank-avatar-2 {
        width: 75px;
        height: 75px;
    }

    .upv2-rank-avatar-3 {
        width: 65px;
        height: 65px;
    }

    .upv2-rank-crown {
        font-size: 1.5rem;
        top: -30px;
    }
}
