/* =====================================================
   SCREW SORT PUZZLE - ANIMATIONS CSS
   Keyframes, Transitions, Motion Effects
   ===================================================== */

/* ===== SCREW ANIMATIONS ===== */
@keyframes screwUnscrew {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-5px) rotate(90deg);
    }

    50% {
        transform: translateY(-10px) rotate(180deg);
    }

    75% {
        transform: translateY(-15px) rotate(270deg);
    }

    100% {
        transform: translateY(-30px) rotate(360deg);
    }
}

@keyframes screwScrew {
    0% {
        transform: translateY(-30px) rotate(0deg);
    }

    25% {
        transform: translateY(-15px) rotate(-90deg);
    }

    50% {
        transform: translateY(-10px) rotate(-180deg);
    }

    75% {
        transform: translateY(-5px) rotate(-270deg);
    }

    100% {
        transform: translateY(0) rotate(-360deg);
    }
}

@keyframes screwFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes screwBounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-15px);
    }

    60% {
        transform: translateY(-8px);
    }
}

@keyframes screwGlow {

    0%,
    100% {
        box-shadow: 0 0 5px currentColor, 0 0 10px currentColor;
    }

    50% {
        box-shadow: 0 0 15px currentColor, 0 0 25px currentColor, 0 0 35px currentColor;
    }
}

/* ===== CONTAINER ANIMATIONS ===== */
@keyframes containerShake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

@keyframes containerPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes containerSuccess {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(0.95);
    }

    75% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== PARTICLE ANIMATIONS ===== */
@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes sparkle {

    0%,
    100% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }
}

@keyframes starBurst {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(2) rotate(180deg);
        opacity: 0;
    }
}

@keyframes ringExpand {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ===== UI ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.8);
        opacity: 0;
    }
}

@keyframes bounce {

    0%,
    20%,
    53%,
    100% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translate3d(0, 0, 0);
    }

    40%,
    43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -20px, 0) scaleY(1.1);
    }

    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -10px, 0) scaleY(1.05);
    }

    80% {
        transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translate3d(0, 0, 0) scaleY(0.95);
    }

    90% {
        transform: translate3d(0, -4px, 0) scaleY(1.02);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes ping {

    75%,
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ===== TUTORIAL ANIMATIONS ===== */
@keyframes fingerTap {

    0%,
    100% {
        transform: scale(1) translateY(0);
    }

    50% {
        transform: scale(0.9) translateY(10px);
    }
}

@keyframes arrowBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes highlightPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.7);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(233, 69, 96, 0);
    }
}

/* ===== STAR ANIMATIONS ===== */
@keyframes starEarn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.3) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes starShine {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.5);
    }
}

/* ===== REWARD ANIMATIONS ===== */
@keyframes coinSpin {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(360deg);
    }
}

@keyframes coinCollect {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }

    100% {
        transform: scale(0.5) translateY(-50px);
        opacity: 0;
    }
}

@keyframes multiplierPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== LOADING ANIMATIONS ===== */
@keyframes loadingDots {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ===== ANIMATION CLASSES ===== */
.animate-fadeIn {
    animation: fadeIn var(--transition-normal) both;
}

.animate-fadeOut {
    animation: fadeOut var(--transition-normal) both;
}

.animate-slideUp {
    animation: slideUp var(--transition-normal) both;
}

.animate-slideDown {
    animation: slideDown var(--transition-normal) both;
}

.animate-scaleIn {
    animation: scaleIn var(--transition-normal) both;
}

.animate-bounce {
    animation: bounce 1s both;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-shake {
    animation: containerShake 0.5s both;
}

.animate-glow {
    animation: screwGlow 1.5s infinite;
}

/* ===== TRANSITION UTILITIES ===== */
.transition-all {
    transition: all var(--transition-normal);
}

.transition-transform {
    transition: transform var(--transition-normal);
}

.transition-opacity {
    transition: opacity var(--transition-normal);
}

.transition-colors {
    transition: background-color var(--transition-normal),
        border-color var(--transition-normal),
        color var(--transition-normal);
}

/* ===== HOVER EFFECTS ===== */
.hover-scale:hover {
    transform: scale(1.05);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}