/* ==========================================================================
   Pagina de Ranking (Premium Design)
   ========================================================================== */

.ranking-page {
    background: var(--bg);
    color: var(--text-primary);
    padding: 100px 20px 80px;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ---- Background animado ---- */
.ranking-page__bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ranking-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: blobFloat 18s ease-in-out infinite alternate;
}

.ranking-blob--1 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(138, 5, 190, 0.5), transparent 70%);
    top: -10%;
    left: -8%;
    animation-duration: 20s;
}

.ranking-blob--2 {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3), transparent 70%);
    top: 40%;
    right: -6%;
    animation-duration: 24s;
    animation-delay: -6s;
}

.ranking-blob--3 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(111, 11, 156, 0.4), transparent 70%);
    bottom: -5%;
    left: 30%;
    animation-duration: 22s;
    animation-delay: -10s;
}

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
    100% { transform: translate(10px, -10px) scale(1.02); }
}

/* ---- Container ---- */
.ranking-page__container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ---- Header ---- */
.ranking-page__header {
    text-align: center;
    margin-bottom: 48px;
}

.ranking-page__badge {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(138, 5, 190, 0.25), rgba(212, 175, 55, 0.15));
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(138, 5, 190, 0.2), 0 0 60px rgba(212, 175, 55, 0.08);
    animation: badgePulse 4s ease-in-out infinite;
}

.ranking-page__badge .material-symbols-rounded {
    font-size: 36px;
    color: var(--gold);
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(138, 5, 190, 0.2), 0 0 60px rgba(212, 175, 55, 0.08); }
    50% { box-shadow: 0 8px 32px rgba(138, 5, 190, 0.3), 0 0 80px rgba(212, 175, 55, 0.15); }
}

.ranking-page__header h1 {
    font-family: 'Sora', 'Manrope', sans-serif;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, #d4af37 50%, #8a05be 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ranking-page__header p {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---- Abas ---- */
.ranking-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(22, 13, 36, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 6px;
}

.ranking-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s var(--ease);
    cursor: pointer;
}

.ranking-tab .material-symbols-rounded {
    font-size: 20px;
}

.ranking-tab:hover {
    color: var(--text-secondary);
    background: rgba(138, 5, 190, 0.08);
}

.ranking-tab--active {
    background: linear-gradient(135deg, rgba(138, 5, 190, 0.2), rgba(138, 5, 190, 0.1));
    color: var(--text-primary);
    box-shadow: 0 2px 12px rgba(138, 5, 190, 0.15);
    border: 1px solid rgba(138, 5, 190, 0.2);
}

.ranking-tab--active .material-symbols-rounded {
    color: var(--gold);
}

/* ---- Filtros ---- */
.ranking-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.ranking-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ranking-filter-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.ranking-filter-pills {
    display: flex;
    gap: 4px;
    background: rgba(22, 13, 36, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
}

.ranking-pill {
    padding: 6px 16px;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.25s var(--ease);
    cursor: pointer;
}

.ranking-pill:hover {
    color: var(--text-secondary);
}

.ranking-pill--active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(138, 5, 190, 0.3);
}

.ranking-select {
    height: 36px;
    padding: 0 32px 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(22, 13, 36, 0.6);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239a86b1' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 5.5l6.5 6.5 6.5-6.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    transition: border-color 0.2s var(--ease);
}

.ranking-select:hover,
.ranking-select:focus {
    border-color: var(--border-strong);
    outline: none;
}

/* ---- Pódio Top 3 ---- */
.ranking-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.podium-card {
    background: rgba(13, 8, 20, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 28px 20px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.podium-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
}

/* Posição 1 - Ouro */
.podium-card--1 {
    border-color: rgba(212, 175, 55, 0.4);
    grid-row: 1;
    transform: scale(1.05);
    padding-top: 20px;
}

.podium-card--1::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.podium-card--1:hover {
    transform: scale(1.05) translateY(-8px);
    box-shadow: 0 20px 48px rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.7);
}

.podium-card--1 .podium-badge {
    background: linear-gradient(135deg, #d4af37, #fef4cd, #d4af37);
    color: #140d05;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}

/* Posição 2 - Prata */
.podium-card--2 {
    border-color: rgba(148, 163, 184, 0.3);
}

.podium-card--2::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.podium-card--2:hover {
    border-color: rgba(148, 163, 184, 0.5);
    box-shadow: 0 20px 48px rgba(148, 163, 184, 0.1);
}

.podium-card--2 .podium-badge {
    background: linear-gradient(135deg, #94a3b8, #cbd5e1, #94a3b8);
    color: #1e293b;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.3);
}

/* Posição 3 - Bronze */
.podium-card--3 {
    border-color: rgba(196, 133, 92, 0.3);
}

.podium-card--3::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(196, 133, 92, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.podium-card--3:hover {
    border-color: rgba(196, 133, 92, 0.5);
    box-shadow: 0 20px 48px rgba(196, 133, 92, 0.1);
}

.podium-card--3 .podium-badge {
    background: linear-gradient(135deg, #c4855c, #e0b08a, #c4855c);
    color: #2a1a0f;
    box-shadow: 0 4px 12px rgba(196, 133, 92, 0.3);
}

/* Badge de posição */
.podium-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Sora', 'Manrope', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 16px;
}

/* Avatar */
.podium-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    border: 3px solid var(--border);
    background: var(--surface-soft);
    transition: border-color 0.3s var(--ease);
}

.podium-card--1 .podium-avatar {
    width: 84px;
    height: 84px;
    border-color: rgba(212, 175, 55, 0.5);
}

.podium-card:hover .podium-avatar {
    border-color: var(--accent);
}

.podium-card--1:hover .podium-avatar {
    border-color: var(--gold);
}

.podium-name {
    font-family: 'Sora', 'Manrope', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podium-card--1 .podium-name {
    font-size: 1.1rem;
}

.podium-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 6px;
}

.podium-rating .material-symbols-rounded {
    font-size: 16px;
}

.podium-stat {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- Lista de ranking ---- */
.ranking-list {
    display: grid;
    gap: 8px;
    margin-bottom: 32px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 44px 44px 1fr auto;
    align-items: center;
    gap: 12px;
    background: rgba(13, 8, 20, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px;
    transition: all 0.25s var(--ease);
}

.ranking-item:hover {
    background: rgba(22, 13, 36, 0.7);
    border-color: var(--border-strong);
    transform: translateX(4px);
    box-shadow: var(--shadow-xs);
}

.ranking-pos {
    font-family: 'Sora', 'Manrope', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
}

.ranking-item__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    background: var(--surface-soft);
}

.ranking-item__info {
    min-width: 0;
}

.ranking-item__name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-item__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.ranking-item__rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--gold);
    font-weight: 700;
}

.ranking-item__rating .material-symbols-rounded {
    font-size: 14px;
}

.ranking-item__stats {
    text-align: right;
}

.ranking-item__score {
    font-family: 'Sora', 'Manrope', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold), #fef4cd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ranking-item__label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ---- Regras ---- */
.ranking-rules {
    background: rgba(13, 8, 20, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.ranking-rules__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s var(--ease);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.ranking-rules__header:hover {
    background: rgba(138, 5, 190, 0.06);
}

.ranking-rules__header .material-symbols-rounded {
    font-size: 20px;
    color: var(--text-muted);
}

.ranking-rules__arrow {
    margin-left: auto;
    transition: transform 0.3s var(--ease);
}

.ranking-rules__header--open .ranking-rules__arrow {
    transform: rotate(180deg);
}

.ranking-rules__body {
    padding: 0 20px 20px;
}

.ranking-rules__body ul {
    list-style: none;
    display: grid;
    gap: 10px;
}

.ranking-rules__body li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
}

.ranking-rules__body li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.6;
}

.ranking-rules__body li strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* ==========================================================================
   Modal de Avaliação
   ========================================================================== */

.review-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.review-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
}

.review-modal__card {
    position: relative;
    width: min(480px, 100%);
    background: rgba(22, 13, 36, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: modalIn 0.35s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.review-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.review-modal__head h3 {
    font-family: 'Sora', 'Manrope', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.review-modal__close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease);
}

.review-modal__close:hover {
    background: rgba(255, 255, 255, 0.06);
}

.review-modal__close .material-symbols-rounded {
    font-size: 20px;
    color: var(--text-muted);
}

.review-modal__body {
    padding: 24px;
    display: grid;
    gap: 20px;
}

/* Estrelas */
.review-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.review-star {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    transition: all 0.2s var(--ease);
    cursor: pointer;
}

.review-star .material-symbols-rounded {
    font-size: 28px;
    color: var(--text-muted);
    transition: color 0.2s var(--ease);
}

.review-star:hover,
.review-star--active {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.4);
}

.review-star:hover .material-symbols-rounded,
.review-star--active .material-symbols-rounded {
    color: var(--gold);
}

.review-stars-label {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: -8px;
}

/* Critérios */
.review-criteria {
    display: grid;
    gap: 12px;
}

.review-criterion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.review-criterion__label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.review-criterion__stars {
    display: flex;
    gap: 4px;
}

.review-criterion__star {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    cursor: pointer;
    transition: transform 0.15s var(--ease);
}

.review-criterion__star:hover {
    transform: scale(1.15);
}

.review-criterion__star .material-symbols-rounded {
    font-size: 20px;
    color: var(--text-muted);
    transition: color 0.15s var(--ease);
}

.review-criterion__star--active .material-symbols-rounded {
    color: var(--gold);
}

/* Comentário */
.review-comment label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.review-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(7, 3, 13, 0.5);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s var(--ease);
}

.review-textarea::placeholder {
    color: var(--text-muted);
}

.review-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(138, 5, 190, 0.15);
}

/* Footer do modal */
.review-modal__foot {
    padding: 16px 24px 24px;
}

.review-submit {
    width: 100%;
    height: 52px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 800;
    color: #140d05;
    background: linear-gradient(135deg, #d4af37, #fef4cd, #d4af37);
    background-size: 200% auto;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transition: all 0.3s var(--ease);
}

.review-submit:hover:not(:disabled) {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.review-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================================================
   Estado vazio
   ========================================================================== */

.ranking-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.ranking-empty .material-symbols-rounded {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.ranking-empty p {
    font-size: 0.95rem;
    font-weight: 600;
}

/* ==========================================================================
   Animação de entrada dos itens
   ========================================================================== */

.ranking-item,
.podium-card {
    animation: itemFadeIn 0.4s var(--ease) both;
}

.podium-card--2 { animation-delay: 0.08s; }
.podium-card--1 { animation-delay: 0.16s; }
.podium-card--3 { animation-delay: 0.24s; }

.ranking-item:nth-child(1) { animation-delay: 0.05s; }
.ranking-item:nth-child(2) { animation-delay: 0.1s; }
.ranking-item:nth-child(3) { animation-delay: 0.15s; }
.ranking-item:nth-child(4) { animation-delay: 0.2s; }
.ranking-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes itemFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Shimmer de loading
   ========================================================================== */

.ranking-skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-soft) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 14px;
    height: 72px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   Responsivo
   ========================================================================== */

@media (max-width: 700px) {
    .ranking-page {
        padding: 90px 14px 80px;
    }

    .ranking-podium {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .podium-card--1 {
        transform: none;
        order: -1;
    }

    .podium-card--1:hover {
        transform: translateY(-8px);
    }

    .ranking-filters {
        flex-direction: column;
        gap: 12px;
    }

    .ranking-filter-group {
        flex-wrap: wrap;
    }

    .ranking-item {
        grid-template-columns: 36px 36px 1fr auto;
        gap: 8px;
        padding: 10px 12px;
    }

    .ranking-item__avatar {
        width: 34px;
        height: 34px;
    }

    .podium-avatar {
        width: 60px;
        height: 60px;
    }

    .podium-card--1 .podium-avatar {
        width: 68px;
        height: 68px;
    }

    .review-star {
        width: 42px;
        height: 42px;
    }

    .review-star .material-symbols-rounded {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .ranking-tabs {
        flex-direction: column;
    }

    .ranking-tab {
        height: 44px;
    }
}
