/* ===================================================================
   FLASHCARD QUIZ — GAMIFICATION DESIGN SYSTEM
   Sistema de XP, Níveis, Combos, Conquistas, Feedback Tátil e Efeitos
   =================================================================== */

:root {
    --xp-gold: #F59E0B;
    --xp-gold-light: #FEF3C7;
    --xp-gold-dark: #B45309;
    --xp-glow: rgba(245, 158, 11, 0.35);
    --streak-fire: #EF4444;
    --combo-purple: #8B5CF6;
    --combo-purple-light: #EDE9FE;
    --gamify-bg: #FFFFFF;
    --gamify-border: #E2E8F0;
    --gamify-radius: 16px;
}



/* ===================================================================
   2. QUIZ HUD (Barra Compacta nos Simulados - Testes/...)
   =================================================================== */
.gamify-quiz-hud {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 6px 14px 2px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: none;
}

.gamify-quiz-hud-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.gamify-mini-badge {
    font-size: 18px;
    line-height: 1;
}

.gamify-hud-level-text {
    font-size: 12px;
    font-weight: 800;
    color: #1E293B;
    white-space: nowrap;
}

.gamify-hud-xp-track {
    display: none;
}

.gamify-hud-xp-fill {
    display: none;
}

.gamify-quiz-hud-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Indicador de Combo Dinâmico */
.gamify-combo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: #F1F5F9;
    color: #64748B;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gamify-combo-badge.active {
    background: linear-gradient(135deg, #EF4444 0%, #F97316 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
    animation: gamifyComboPop 0.3s ease-out;
}

.gamify-sound-toggle {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 6px;
    color: #64748B;
    transition: background 0.2s;
}

.gamify-sound-toggle:hover {
    background: #F1F5F9;
}

/* ===================================================================
   3. ANIMAÇÃO DE TEXTO FLUTUANTE DE XP (+14 XP!)
   =================================================================== */
.gamify-float-xp {
    position: fixed;
    pointer-events: none;
    font-size: 18px;
    font-weight: 900;
    color: #F59E0B;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), 0 0 10px rgba(245, 158, 11, 0.4);
    z-index: 99999;
    animation: gamifyFloatUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    letter-spacing: -0.02em;
}

.gamify-float-xp.combo-bonus {
    color: #EC4899;
    font-size: 20px;
    text-shadow: 0 2px 8px rgba(236, 72, 153, 0.4);
}

/* ===================================================================
   4. CARD DE RESUMO DE XP NA TELA DE RESULTADO
   =================================================================== */
.gamify-result-box {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border: 1.5px solid #FDE68A;
    border-radius: 14px;
    padding: 16px;
    margin: 16px 0 20px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}

.gamify-result-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #B45309;
    margin-bottom: 6px;
}

.gamify-result-xp-val {
    font-size: 28px;
    font-weight: 900;
    color: #D97706;
    line-height: 1;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.gamify-result-sub {
    font-size: 12px;
    color: #78350F;
    font-weight: 600;
}

/* ===================================================================
   5. MODAL DE LEVEL UP & CONQUISTAS
   =================================================================== */
.gamify-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: gamifyFadeIn 0.25s ease;
}

.gamify-modal {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 28px 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: center;
    animation: gamifyModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.gamify-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #F1F5F9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    color: #64748B;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.gamify-modal-close:hover {
    background: #E2E8F0;
    color: #0F172A;
}

/* Estilo do Level Up */
.gamify-levelup-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 12px;
    animation: gamifyBounce 1s infinite alternate ease-in-out;
}

.gamify-levelup-title {
    font-size: 24px;
    font-weight: 900;
    color: #D97706;
    margin-bottom: 4px;
}

.gamify-levelup-role {
    font-size: 18px;
    font-weight: 800;
    color: #1E293B;
    margin-bottom: 12px;
}

.gamify-levelup-desc {
    font-size: 14px;
    color: #64748B;
    line-height: 1.5;
    margin-bottom: 22px;
}

.gamify-btn-primary {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 999px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.gamify-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.4);
}

/* Grade de Conquistas no Modal */
.gamify-achieve-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: left;
    margin: 18px 0;
}

.gamify-achieve-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    transition: transform 0.2s;
}

.gamify-achieve-item.unlocked {
    background: #FFFBEB;
    border-color: #FDE68A;
}

.gamify-achieve-icon {
    font-size: 26px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.gamify-achieve-item.unlocked .gamify-achieve-icon {
    border-color: #F59E0B;
    background: #FEF3C7;
}

.gamify-achieve-item.locked {
    opacity: 0.55;
    filter: grayscale(1);
}

.gamify-achieve-info h4 {
    font-size: 13px;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 2px 0;
}

.gamify-achieve-info p {
    font-size: 11px;
    color: #64748B;
    margin: 0;
    line-height: 1.3;
}

/* Toast de Notificação de Conquista */
.gamify-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #0F172A;
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: 999px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100001;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.gamify-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===================================================================
   6. ANIMAÇÕES
   =================================================================== */
@keyframes gamifyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@keyframes gamifyComboPop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes gamifyFloatUp {
    0% { opacity: 0; transform: translateY(0) scale(0.7); }
    20% { opacity: 1; transform: translateY(-16px) scale(1.15); }
    70% { opacity: 1; transform: translateY(-40px) scale(1); }
    100% { opacity: 0; transform: translateY(-64px) scale(0.9); }
}

@keyframes gamifyFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes gamifyModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes gamifyBounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

/* Canvas de Confete */
#gamifyConfettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999999;
}

/* ===================================================================
   7. RESPONSIVIDADE MOBILE
   =================================================================== */
@media (max-width: 600px) {
    .gamify-dashboard-card {
        padding: 16px;
    }

    .gamify-dash-header {
        gap: 12px;
    }

    .gamify-dash-actions {
        width: 100%;
        justify-content: space-between;
    }

    .gamify-level-badge {
        width: 42px;
        height: 42px;
        font-size: 22px;
    }

    .gamify-level-title {
        font-size: 14px;
    }

    .gamify-quiz-hud {
        padding: 6px 10px;
    }
}
