/* ============================================
   TOAST DE COGNITS
   ============================================ */

.cognit-toast {
    position: fixed;
    top: 80px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: toast-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cognit-toast.hiding {
    animation: toast-slide-out 0.3s ease-in forwards;
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.cognit-icon-animated {
    width: 40px;
    height: 40px;
    animation: cognit-spin 0.6s ease-out;
}

@keyframes cognit-spin {
    from {
        transform: rotate(0deg) scale(0.5);
    }

    to {
        transform: rotate(360deg) scale(1);
    }
}

.cognit-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cognit-amount-toast {
    font-size: 24px;
    font-weight: 800;
    background: var(--cognit-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.cognit-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

@media (max-width: 640px) {
    .cognit-toast {
        right: 16px;
        left: 16px;
    }
}

/* ============================================
   CELEBRATION OVERLAY (Acertos)
   ============================================ */

.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    /* Z-index máximo */
    padding: 20px;
    box-sizing: border-box;
    animation: overlay-fade-in 0.3s ease-out;
}

/* Fallback para centralização se flex falhar */
@supports not (display: flex) {
    .celebration-overlay {
        display: block;
        text-align: center;
    }

    .celebration-content {
        margin: 20vh auto;
    }
}

@keyframes overlay-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.celebration-overlay.hiding {
    animation: overlay-fade-out 0.3s ease-in forwards;
}

@keyframes overlay-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.celebration-content {
    background: white;
    border-radius: 24px;
    padding: 48px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    /* Garante que não estoure em mobile */

    /* Centralização ABSOLUTA e FORÇADA */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;

    z-index: 100002;
    /* Acima do confetti */

    /* Animação */
    animation: celebration-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), content-pulse 2s infinite ease-in-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes content-pulse {
    0% {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        box-shadow: 0 25px 70px rgba(124, 58, 237, 0.4);
        transform: translate(-50%, -50%) scale(1.02);
    }

    100% {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes celebration-pop {
    from {
        transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

.celebration-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: icon-bounce 0.6s ease-out 0.3s;
}

@keyframes icon-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.celebration-title {
    font-size: 32px;
    font-weight: 800;
    background: var(--cognit-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 16px 0;
}

.celebration-cognits {
    font-size: 48px;
    font-weight: 900;
    background: var(--cognit-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 8px 0;
    animation: cognits-pulse 0.8s ease-out 0.5s;
}

@keyframes cognits-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.celebration-message {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
}

.celebration-btn {
    background: var(--cognit-gradient);
    color: white;
    border: none;
    padding: 16px 48px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.celebration-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(41, 82, 204, 0.3);
}

.celebration-btn:active {
    transform: translateY(0);
}