/* ═══════════════════════════════════════════════════════════════
   Earn Popup — gamified RADIOLA reward notification
   Shows "+0.2 RADIOLA earned!" when a play is validated.
   Video-game style: slide up, bounce, glow, auto-dismiss.
   ═══════════════════════════════════════════════════════════════ */

.earn-popup-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.earn-popup {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 1.4rem 0.75rem 1rem;
    background: rgba(20, 16, 8, 0.92);
    border: 1px solid rgba(255, 153, 0, 0.4);
    border-radius: 14px;
    backdrop-filter: blur(16px);
    box-shadow:
        0 0 20px rgba(255, 153, 0, 0.25),
        0 0 60px rgba(255, 153, 0, 0.08),
        0 8px 32px rgba(0, 0, 0, 0.5);
    animation: earnPopupEntry 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-origin: center bottom;
    will-change: transform, opacity;
}

.earn-popup.dismiss {
    animation: earnPopupExit 0.5s ease-in forwards;
}

.earn-popup.no-reward {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
        0 0 10px rgba(255, 255, 255, 0.05),
        0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Logo */
.earn-popup-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255, 153, 0, 0.5));
    animation: earnLogoPulse 1.2s ease-in-out 0.3s 2;
}

/* Text block */
.earn-popup-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.earn-popup-amount {
    font-family: var(--font-primary, 'Inter', sans-serif);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ff9900;
    text-shadow:
        0 0 12px rgba(255, 153, 0, 0.6),
        0 0 30px rgba(255, 153, 0, 0.2);
    animation: earnAmountGlow 1.5s ease-in-out 0.4s 1;
}

.earn-popup.no-reward .earn-popup-amount {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: none;
}

.earn-popup-label {
    font-family: var(--font-primary, 'Inter', sans-serif);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 153, 0, 0.7);
}

.earn-popup.no-reward .earn-popup-label {
    color: rgba(255, 255, 255, 0.4);
}

.earn-popup-split {
    font-family: var(--font-mono, 'SF Mono', monospace);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 153, 0, 0.45);
    margin-top: 0.1rem;
    font-feature-settings: "tnum";
}

/* Sparkle particles */
.earn-popup-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ff9900;
    border-radius: 50%;
    pointer-events: none;
    animation: earnSparkle 0.8s ease-out forwards;
}

/* ── Wallet Alert (red variant) ─────────────────────────────── */

.earn-popup.wallet-alert {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow:
        0 0 20px rgba(239, 68, 68, 0.2),
        0 0 60px rgba(239, 68, 68, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.5);
}

.earn-popup.wallet-alert .earn-popup-amount {
    color: #ef4444;
    font-size: 0.95rem;
    font-weight: 700;
    text-shadow:
        0 0 12px rgba(239, 68, 68, 0.5),
        0 0 30px rgba(239, 68, 68, 0.15);
}

.earn-popup.wallet-alert .earn-popup-label {
    color: rgba(239, 68, 68, 0.6);
}

.earn-popup-alert-icon {
    font-size: 1.5rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
    animation: earnLogoPulse 1.2s ease-in-out 0.3s 2;
}

/* ── Claim Error (amber/orange variant) ────────────────────── */

.earn-popup.claim-error {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow:
        0 0 20px rgba(245, 158, 11, 0.2),
        0 0 60px rgba(245, 158, 11, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.5);
}

.earn-popup.claim-error .earn-popup-alert-icon {
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

.earn-popup.claim-error .earn-popup-amount {
    color: #f59e0b;
    font-size: 0.95rem;
    font-weight: 700;
    text-shadow:
        0 0 12px rgba(245, 158, 11, 0.5),
        0 0 30px rgba(245, 158, 11, 0.15);
}

.earn-popup.claim-error .earn-popup-label {
    color: rgba(245, 158, 11, 0.65);
    font-size: 0.6rem;
    max-width: 240px;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Keyframes ──────────────────────────────────────────────── */

@keyframes earnPopupEntry {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.6);
    }
    50% {
        opacity: 1;
        transform: translateY(-8px) scale(1.05);
    }
    70% {
        transform: translateY(3px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes earnPopupExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
}

@keyframes earnLogoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 14px rgba(255, 153, 0, 0.8)); }
}

@keyframes earnAmountGlow {
    0% { text-shadow: 0 0 12px rgba(255, 153, 0, 0.6), 0 0 30px rgba(255, 153, 0, 0.2); }
    50% { text-shadow: 0 0 20px rgba(255, 153, 0, 0.9), 0 0 50px rgba(255, 153, 0, 0.4), 0 0 80px rgba(255, 153, 0, 0.15); }
    100% { text-shadow: 0 0 12px rgba(255, 153, 0, 0.6), 0 0 30px rgba(255, 153, 0, 0.2); }
}

@keyframes earnSparkle {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--sx, 20px), var(--sy, -30px)) scale(0);
    }
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 480px) {
    .earn-popup-container {
        top: 70px;
        width: 90%;
    }
    .earn-popup {
        padding: 0.6rem 1rem 0.6rem 0.8rem;
    }
    .earn-popup-logo {
        width: 26px;
        height: 26px;
    }
    .earn-popup-amount {
        font-size: 1.1rem;
    }
}
