/* ============================================
   BR PIX - Avatares + VIP + Perfil
   ============================================ */

/* === Avatar base === */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
    user-select: none;
    overflow: hidden;
    position: relative;
}
/* Avatar com foto carregada */
.avatar.avatar-photo {
    padding: 0;
    background: #222;
}
.avatar.avatar-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}
.avatar-sm { font-size: 14px; }
.avatar-md { font-size: 20px; }
.avatar-lg { font-size: 32px; box-shadow: 0 4px 16px rgba(0,0,0,0.4), inset 0 2px 0 rgba(255,255,255,0.3); }
.avatar-xl {
    font-size: 56px;
    box-shadow:
        0 6px 24px rgba(0,0,0,0.5),
        inset 0 2px 0 rgba(255,255,255,0.3),
        0 0 0 4px rgba(255,255,255,0.05);
}
.avatar-initials {
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
}

/* === Galeria de avatares (página perfil) === */
.avatar-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 8px 0;
}
.avatar-option {
    position: relative;
    cursor: pointer;
    border-radius: 50%;
    padding: 4px;
    background: transparent;
    border: 2px solid transparent;
    transition: all .2s;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-option:hover {
    transform: translateY(-2px);
    background: rgba(45, 212, 255, 0.1);
}
.avatar-option.selected {
    border-color: var(--accent);
    background: rgba(45, 212, 255, 0.15);
}
.avatar-option.selected::after {
    content: '✓';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: #002d3d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.avatar-option .avatar {
    width: 100%;
    aspect-ratio: 1;
    height: auto;
}

/* === VIP Badge === */
.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.4;
}
.vip-badge .vip-icon { font-size: 14px; line-height: 1; }
.vip-badge .vip-name { line-height: 1; }
.vip-badge.vip-lg {
    padding: 6px 14px;
    font-size: 13px;
}
.vip-badge.vip-lg .vip-icon { font-size: 18px; }

.vip-bronze {
    background: linear-gradient(135deg, rgba(184,115,51,0.2), rgba(184,115,51,0.05));
    color: #d4956b;
    border: 1px solid rgba(184,115,51,0.4);
}
.vip-silver {
    background: linear-gradient(135deg, rgba(192,192,192,0.2), rgba(192,192,192,0.05));
    color: #e5e5e5;
    border: 1px solid rgba(192,192,192,0.5);
}
.vip-gold {
    background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,215,0,0.05));
    color: #ffd700;
    border: 1px solid rgba(255,215,0,0.5);
    text-shadow: 0 0 6px rgba(255,215,0,0.4);
}
.vip-platinum {
    background: linear-gradient(135deg, rgba(45,212,255,0.2), rgba(45,212,255,0.05));
    color: #2dd4ff;
    border: 1px solid rgba(45,212,255,0.5);
    text-shadow: 0 0 8px rgba(45,212,255,0.5);
    box-shadow: 0 0 12px rgba(45,212,255,0.2);
}
.vip-diamond {
    background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(168,85,247,0.05));
    color: #c4a5fa;
    border: 1px solid rgba(168,85,247,0.6);
    text-shadow: 0 0 8px rgba(168,85,247,0.6);
    box-shadow: 0 0 14px rgba(168,85,247,0.3);
    animation: diamond-shimmer 3s ease-in-out infinite;
}
@keyframes diamond-shimmer {
    0%, 100% { box-shadow: 0 0 14px rgba(168,85,247,0.3); }
    50% { box-shadow: 0 0 24px rgba(168,85,247,0.6); }
}

/* ============================================
   PÁGINA PERFIL - Hub Central
   ============================================ */
.profile-page {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 100px;
}

/* === Header do perfil (avatar + nome + nível) === */
.profile-header {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.profile-header::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(45,212,255,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.profile-top-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}
.profile-info {
    flex: 1;
    min-width: 0;
}
.profile-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
    word-wrap: break-word;
}
.profile-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: center;
}
.profile-meta-divider { opacity: 0.4; }
.profile-verified {
    color: var(--success);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.profile-edit-avatar-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #002d3d;
    border: 2px solid var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all .2s;
}
.profile-edit-avatar-btn:hover {
    transform: scale(1.1);
    background: #6ee7ff;
}
.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

/* === VIP progress bar === */
.vip-progress {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}
.vip-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}
.vip-progress-label { color: var(--text-muted); }
.vip-progress-value {
    color: var(--text);
    font-weight: 600;
}
.vip-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.vip-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #58d4c6);
    border-radius: 999px;
    transition: width .8s cubic-bezier(.4,0,.2,1);
}
.vip-accumulated {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(255,255,255,0.08);
    font-size: 12px;
}
.vip-accumulated-label {
    color: var(--text-muted);
}
.vip-accumulated-value {
    color: #ffc83d;
    font-weight: 700;
    font-size: 14px;
}

/* === Card de saldo (rich) === */
.profile-balance {
    background: linear-gradient(135deg, #131e3f 0%, #0d1530 100%);
    border: 1px solid rgba(45,212,255,0.2);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.profile-balance::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(45,212,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}
.profile-balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
}
.profile-balance-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.profile-balance-pix-badge {
    width: 22px;
    height: 22px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #002d3d;
    font-weight: 900;
    font-size: 11px;
}
.profile-balance-id {
    font-size: 11px;
    color: var(--text-dim);
    font-family: 'Courier New', monospace;
}
.profile-balance-value {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 14px;
    line-height: 1;
    position: relative;
}
.profile-balance-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: relative;
}
.profile-balance-btn {
    padding: 13px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    transition: all .2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.profile-balance-btn.deposit {
    background: var(--accent);
    color: #002d3d;
}
.profile-balance-btn.deposit:hover {
    background: #6ee7ff;
    transform: translateY(-1px);
}
.profile-balance-btn.withdraw {
    background: #fff;
    color: #002d3d;
}
.profile-balance-btn.withdraw:hover {
    background: #e5e5e5;
    transform: translateY(-1px);
}

/* === Mini-stats grid === */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.profile-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
}
.profile-stat-icon { font-size: 18px; margin-bottom: 4px; }
.profile-stat-value {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 2px;
    line-height: 1;
}
.profile-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* === Menu agrupado === */
.profile-section {
    margin-bottom: 20px;
}
.profile-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 0 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.profile-menu {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text);
    transition: background .15s;
    border-bottom: 1px solid var(--border);
    position: relative;
    cursor: pointer;
}
.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:hover {
    background: rgba(255,255,255,0.03);
}
.profile-menu-item:active {
    background: rgba(255,255,255,0.06);
}
.profile-menu-item.disabled {
    opacity: 0.55;
    cursor: default;
}
.profile-menu-item.disabled:hover { background: transparent; }
.profile-menu-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.profile-menu-text { flex: 1; min-width: 0; }
.profile-menu-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 2px;
}
.profile-menu-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
}
.profile-menu-extra {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.profile-menu-badge {
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.profile-menu-badge.muted {
    background: rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-weight: 600;
}
.profile-menu-badge.success {
    background: rgba(34,197,94,0.15);
    color: var(--success);
}
.profile-menu-badge.warning {
    background: rgba(245,158,11,0.15);
    color: var(--warning);
}
.profile-menu-arrow {
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1;
}

/* Cores dos ícones do menu */
.menu-icon-perfil   { background: linear-gradient(135deg, #4a90e2, #1e3a8a); }
.menu-icon-saldo    { background: linear-gradient(135deg, #22c55e, #14532d); }
.menu-icon-historico{ background: linear-gradient(135deg, #f59e0b, #b45309); }
.menu-icon-extrato  { background: linear-gradient(135deg, #94a3b8, #475569); }
.menu-icon-notif    { background: linear-gradient(135deg, #ef4444, #7f1d1d); }
.menu-icon-premios  { background: linear-gradient(135deg, #ec4899, #831843); }
.menu-icon-roleta   { background: linear-gradient(135deg, #a855f7, #581c87); }
.menu-icon-indique  { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.menu-icon-seguranca{ background: linear-gradient(135deg, #06b6d4, #0e7490); }
.menu-icon-prefs    { background: linear-gradient(135deg, #6366f1, #312e81); }
.menu-icon-ajuda    { background: linear-gradient(135deg, #64748b, #1e293b); }
.menu-icon-sair     { background: linear-gradient(135deg, #ef4444, #991b1b); }

/* === Modal de seleção de avatar === */
.avatar-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9990;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.avatar-modal-backdrop.show {
    display: flex;
    animation: fade-in .2s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.avatar-modal {
    width: 100%;
    max-width: 500px;
    background: var(--bg-card);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 20px 20px 32px;
    transform: translateY(100%);
    animation: slide-up .3s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes slide-up { to { transform: translateY(0); } }

.avatar-modal-handle {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 999px;
    margin: 0 auto 16px;
}
.avatar-modal h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
}
.avatar-modal p {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 20px;
}
.avatar-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}
.avatar-modal-btn {
    padding: 13px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all .15s;
}
.avatar-modal-btn.cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.avatar-modal-btn.save {
    background: var(--accent);
    color: #002d3d;
}
.avatar-modal-btn.save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   CARROSSEL TOP GANHOS (home, animado)
   Card "TOP GANHOS" FIXO + cards de ganhos passando
   ============================================ */
.top-winners-wrap {
    margin: 16px 0;
    position: relative;
    /* Espaço pro card fixo (que fica em position absolute) */
    padding-left: 96px;
}

/* Card "TOP GANHOS" fixo na esquerda */
.top-winners-fixed {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,200,61,0.18), rgba(255,200,61,0.06));
    border: 1px solid rgba(255,200,61,0.35);
    border-radius: 14px;
    z-index: 3;
    flex-direction: column;
    gap: 4px;
    padding: 10px 6px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.top-winners-fixed::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,200,61,0.1), transparent);
    pointer-events: none;
    animation: trophy-shimmer 3s ease-in-out infinite;
}
@keyframes trophy-shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.top-winners-fixed .trophy-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(255,200,61,0.5));
    line-height: 1;
}
.top-winners-fixed .trophy-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 1.5px;
    color: var(--gold);
    text-shadow: 0 0 8px rgba(255,200,61,0.4);
    text-align: center;
}

/* Track dos ganhos (área deslizante) */
.top-winners-scroll {
    overflow: hidden;
    /* Fade nas bordas */
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 30px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 30px), transparent 100%);
}
.top-winners-track {
    display: flex;
    gap: 10px;
    width: max-content;
    animation: tw-scroll var(--tw-speed, 40s) linear infinite;
    padding-left: 10px;
}
.top-winners-scroll:hover .top-winners-track {
    animation-play-state: paused;
}
@keyframes tw-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Card de ganho (limpo, sem badge sobreposto) */
.top-winner-card {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px 14px 8px 8px;
}
.top-winner-info {
    font-size: 13px;
    line-height: 1.3;
    min-width: 0;
}
.top-winner-player {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.top-winner-game {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}
.top-winner-amount {
    color: var(--success);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

@media (max-width: 420px) {
    .top-winners-wrap {
        padding-left: 80px;
    }
    .top-winners-fixed {
        width: 72px;
    }
    .top-winners-fixed .trophy-icon { font-size: 22px; }
    .top-winners-fixed .trophy-text { font-size: 11px; }
    .top-winner-card { padding: 6px 12px 6px 6px; gap: 8px; }
}

/* === Stats no admin === */
@media (max-width: 380px) {
    .profile-stats { grid-template-columns: repeat(2, 1fr); }
    .avatar-gallery { grid-template-columns: repeat(3, 1fr); }
}

/* === Botão "Enviar foto" no modal === */
.avatar-upload-section {
    margin-bottom: 16px;
    padding: 14px;
    background: rgba(45,212,255,0.06);
    border: 1px dashed rgba(45,212,255,0.4);
    border-radius: 12px;
    text-align: center;
}
.avatar-upload-btn {
    width: 100%;
    padding: 11px 16px;
    background: var(--accent);
    color: #002d3d;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.avatar-upload-btn:hover {
    background: #6ee7ff;
    transform: translateY(-1px);
}
.avatar-upload-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.avatar-upload-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 6px;
}
.avatar-upload-preview {
    margin: 10px auto 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent);
    box-shadow: 0 0 16px rgba(45,212,255,0.4);
    display: none;
}
.avatar-upload-preview.show { display: block; }
.avatar-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.avatar-upload-error {
    margin-top: 8px;
    font-size: 12px;
    color: var(--danger);
    display: none;
}
.avatar-upload-error.show { display: block; }

.avatar-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.avatar-divider::before,
.avatar-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
