/* ============================================================
   SECRET NIGHTS — Animationen & Transitions
   ============================================================ */

/* ─── Fade In ────────────────────────────────────────────── */

.sn-fade-in {
    animation: snFadeIn 0.6s var(--sn-ease) forwards;
}

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

/* ─── Fade In Up ─────────────────────────────────────────── */

.sn-fade-in-up {
    animation: snFadeInUp 0.6s var(--sn-ease) forwards;
}

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

/* ─── Fade In Down ───────────────────────────────────────── */

.sn-fade-in-down {
    animation: snFadeInDown 0.5s var(--sn-ease) forwards;
}

@keyframes snFadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Scale In ───────────────────────────────────────────── */

.sn-scale-in {
    animation: snScaleIn 0.4s var(--sn-ease) forwards;
}

@keyframes snScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ─── Slide In Right ─────────────────────────────────────── */

.sn-slide-in-right {
    animation: snSlideInRight 0.5s var(--sn-ease) forwards;
}

@keyframes snSlideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ─── Stagger Children ───────────────────────────────────── */

.sn-stagger > * {
    opacity: 0;
    animation: snFadeInUp 0.5s var(--sn-ease) forwards;
}

.sn-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.sn-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.sn-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.sn-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.sn-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.sn-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.sn-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.sn-stagger > *:nth-child(8) { animation-delay: 0.4s; }
.sn-stagger > *:nth-child(9) { animation-delay: 0.45s; }
.sn-stagger > *:nth-child(10){ animation-delay: 0.5s; }

/* ─── Pulse ──────────────────────────────────────────────── */

.sn-pulse {
    animation: snPulse 2s ease-in-out infinite;
}

@keyframes snPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

/* ─── Shimmer / Skeleton Loading ─────────────────────────── */

.sn-shimmer {
    background: linear-gradient(
        90deg,
        var(--sn-surface-alt) 25%,
        var(--sn-surface-hover) 50%,
        var(--sn-surface-alt) 75%
    );
    background-size: 200% 100%;
    animation: snShimmer 1.5s ease-in-out infinite;
    border-radius: var(--sn-radius-md);
}

@keyframes snShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Shake (für Fehler) ─────────────────────────────────── */

.sn-shake {
    animation: snShake 0.5s var(--sn-ease);
}

@keyframes snShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-8px); }
    40%      { transform: translateX(8px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* ─── Bounce In ──────────────────────────────────────────── */

.sn-bounce-in {
    animation: snBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes snBounceIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ─── Confetti Burst (für Achievements) ──────────────────── */

.sn-confetti-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 9999;
    animation: snConfettiFall 1.5s var(--sn-ease) forwards;
}

@keyframes snConfettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg) scale(0);
    }
}

/* ─── XP Pop ─────────────────────────────────────────────── */

.sn-xp-pop {
    position: fixed;
    font-family: var(--sn-font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--sn-gold);
    text-shadow: 0 0 10px rgba(212, 169, 68, 0.5);
    pointer-events: none;
    z-index: 9999;
    animation: snXpPop 1.2s var(--sn-ease) forwards;
}

@keyframes snXpPop {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.9);
    }
}

/* ─── Reduced Motion ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .sn-bg-orb {
        animation: none !important;
    }
}
