/* ============================================
   RANKING.CSS - Premium Redesign
   Responsivo e proporcional (max 6.9")
============================================ */

/* IMPORTS & VARS FROM SETTINGS */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Luckiest+Guy&display=swap');

:root {
    --gold-light: #fef08a;
    --gold-dark: #a16207;
    --wood-depth: #2a1a0c;
}

/* Container Principal - Same as Settings Modal */
.ranking-box {
    width: calc(100% - var(--space-lg) * 2);
    max-width: calc(var(--max-app-width) - var(--space-xl) * 2);
    height: 80dvh;
    max-height: 80dvh;

    /* BACKGROUND IMAGE FUNDO1 */
    background-image: url('../../../assets/images/home/fundo1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #fdf6e3;
    border: 4px solid var(--wood-border);

    border-radius: var(--radius-xl);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- 1. CABEÇALHO (BARRA.PNG) --- */
.ranking-header {
    display: flex;
    flex-direction: column;
    padding: var(--space-md);

    /* HEADER BACKGROUND BARRA REMOVED */
    background-color: transparent;

    border-bottom: none;
    flex-shrink: 0;
    /* Ensure height fits the bar graphic */
    min-height: 110px;
    justify-content: center;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* TITLE STYLE - MATCHES SETTINGS */
/* TITLE STYLE - MATCHES SETTINGS */
.modal-title {
    margin: 0;
    /* THINNER PREMIUM STYLE (Luckiest Guy) */
    font-family: 'Luckiest Guy', cursive;
    /* Updated Font */
    font-weight: 400;
    font-size: clamp(20px, 6vw, 24px);
    /* Slightly smaller to fit "Ranking" */
    letter-spacing: 1px;
    text-transform: uppercase;

    /* White Text on "Black Background" (Shadow) */
    color: #ffffff;
    background: none;
    -webkit-text-fill-color: #ffffff;

    text-shadow:
        0 2px 0 #5d4037,
        0 4px 4px rgba(0, 0, 0, 0.5);
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 1));
}

.refresh-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #fff;
    /* White to match title */
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
    transition: transform 0.3s;
}

.refresh-btn:active {
    transform: rotate(180deg);
}

.ranking-header .close-btn {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, transparent 70%);
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s;
}

.ranking-header .close-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.ranking-header .close-btn:hover {
    transform: scale(1.1);
    background: radial-gradient(circle, rgba(255, 0, 0, 0.5) 0%, transparent 70%);
}

.ranking-header .close-btn:active {
    transform: scale(0.95);
    background: radial-gradient(circle, rgba(255, 0, 0, 0.7) 0%, transparent 70%);
}

/* Abas */
.ranking-tabs {
    display: flex;
    gap: 15px;
    padding-left: 5px;
    margin-top: 5px;
}

.rank-tab {
    background: transparent;
    border: none;
    padding-bottom: 5px;
    font-family: 'Luckiest Guy', cursive;
    /* Fun font for tabs */
    font-size: 0.9rem;
    color: #ffffff;
    /* White text */
    border-bottom: 3px solid transparent;
    cursor: pointer;
    text-shadow:
        1.5px 0 0 #000, -1.5px 0 0 #000, 0 1.5px 0 #000, 0 -1.5px 0 #000,
        1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    letter-spacing: 1px;
}

.rank-tab.active {
    color: #FFD700;
    /* Gold */
    border-bottom-color: #FFD700;
    text-shadow:
        1.5px 0 0 #000, -1.5px 0 0 #000, 0 1.5px 0 #000, 0 -1.5px 0 #000,
        1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

/* --- 3. LISTA (Scroll) --- */
.ranking-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    /* Transparent to show fundo1 */
    background: transparent;
}

.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ITEM STYLE - STANDARD SETTINGS BACKGROUND */
.rank-item {
    display: flex;
    align-items: center;
    /* Settings Background Standard */
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(139, 69, 19, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.rank-pos {
    width: 30px;
    font-family: 'Luckiest Guy', cursive;
    /* Standard Text Stroke */
    color: #ffffff;
    font-size: 1.1rem;
    text-align: center;
    text-shadow:
        1.5px 0 0 #000, -1.5px 0 0 #000, 0 1.5px 0 #000, 0 -1.5px 0 #000,
        1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

.rank-avatar {
    width: 35px;
    height: 35px;
    min-width: 35px;
    background-color: rgba(255, 255, 255, 0.7);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 12px;
    border: 2px solid #e5e7eb;
    font-size: 1.2rem;
    overflow: hidden;
}

.rank-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.r-name {
    font-weight: 800;
    /* Standard Text Stroke */
    color: #ffffff;
    font-size: 0.95rem;
    text-shadow:
        1.5px 0 0 #000, -1.5px 0 0 #000, 0 1.5px 0 #000, 0 -1.5px 0 #000,
        1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

.r-level {
    font-size: 0.7rem;
    /* Standard Text Stroke */
    color: #ffffff;
    font-weight: 700;
    text-shadow:
        1.5px 0 0 #000, -1.5px 0 0 #000, 0 1.5px 0 #000, 0 -1.5px 0 #000,
        1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

.rank-score {
    font-family: 'Luckiest Guy', cursive;
    /* Standard Text Stroke */
    color: #ffffff;
    /* Bronze/Gold */
    font-size: 1rem;
    text-shadow:
        1.5px 0 0 #000, -1.5px 0 0 #000, 0 1.5px 0 #000, 0 -1.5px 0 #000,
        1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

/* TOP 3 STYLES */
.rank-item.top-1 {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.9), rgba(255, 249, 196, 0.9));
    border: 2px solid #FFD700;
}

.rank-item.top-1 .rank-pos {
    color: #F59E0B;
    font-size: 1.4rem;
}

.rank-item.top-1 .rank-avatar {
    border-color: #FFD700;
    background: #FFECB3;
}

.rank-item.top-2 {
    border: 2px solid #C0C0C0;
}

.rank-item.top-2 .rank-pos {
    color: #7F8C8D;
    font-size: 1.2rem;
}

.rank-item.top-3 {
    border: 2px solid #CD7F32;
}

.rank-item.top-3 .rank-pos {
    color: #A0522D;
    font-size: 1.2rem;
}

/* --- 2. BARRA FIXA DO JOGADOR --- */
.my-rank-bar {
    display: flex;
    align-items: center;
    /* Darker wood for contrast at bottom */
    background: rgba(42, 26, 12, 0.95);
    color: white;
    padding: 10px 20px;
    border-top: 2px solid #8B4513;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    z-index: 10;
}

.my-rank-bar .rank-pos {
    color: #FFD700;
}

.my-rank-bar .r-name {
    color: #fff;
}

.my-rank-bar .r-level {
    color: #a1a1aa;
}

.my-rank-bar .rank-score {
    color: #fff;
    text-shadow: none;
}

.my-rank-bar .rank-avatar {
    background: #3f3f46;
    border-color: #52525b;
}

/* --- 5. RODAPÉ --- */
.ranking-footer {
    text-align: center;
    padding: 5px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    /* Light text on dark/image bg */
    background: transparent;
    border-top: none;
    flex-shrink: 0;
    font-weight: 600;
}