/* Global Click Effects */
.click-ripple {
    position: fixed;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    width: 20px;
    height: 20px;
    background-color: transparent;
    border: 2px solid var(--accent-primary);
    animation: ripple-anim 0.6s linear forwards;
    z-index: 9999;
}

@keyframes ripple-anim {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }

    100% {
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}

.click-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background-color: var(--accent-green);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: particle-anim 0.6s ease-out forwards;
    z-index: 9999;
}

@keyframes particle-anim {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
        opacity: 0;
    }
}

/* ===== Newly Purchased Unit Shine ===== */
.unit-card.unit-shine {
    animation: unit-purchase-shine 0.85s ease-out forwards !important;
    z-index: 100 !important;
    position: relative;
    overflow: hidden;
}

.unit-card.unit-shine::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 20%,
        rgba(255, 240, 120, 0.75) 45%,
        rgba(255, 255, 255, 0.55) 50%,
        rgba(255, 240, 120, 0.75) 55%,
        transparent 80%
    );
    animation: shine-sweep 0.85s ease-out forwards;
    pointer-events: none;
    z-index: 30;
}

@keyframes unit-purchase-shine {
    0%   { filter: brightness(1)   drop-shadow(0 0 0px  rgba(255, 215, 0, 0));   transform: scale(1);    }
    20%  { filter: brightness(1.9) drop-shadow(0 0 22px rgba(255, 215, 0, 1));   transform: scale(1.13); }
    55%  { filter: brightness(1.3) drop-shadow(0 0 12px rgba(255, 190, 0, 0.6)); transform: scale(1.05); }
    100% { filter: brightness(1)   drop-shadow(0 0 0px  rgba(255, 215, 0, 0));   transform: scale(1);    }
}

@keyframes shine-sweep {
    0%   { transform: translateX(-120%); opacity: 1; }
    100% { transform: translateX(220%);  opacity: 0; }
}