/**
 * home-eggs-animals.css - Animal Combo Animations
 *
 * Cat nap, dog zoomies, frog prince, pack howl combo
 * animations and styling, plus reduced-motion overrides.
 */

/* ========================================
   ANIMAL COMBO - Cat Nap
   ======================================== */

/* Cat tilts on its side */
.cat-nap-tilt {
    transform: rotate(90deg) !important;
    transition: transform 0.5s ease;
    animation: none !important;
}

/* Dark screen overlay */
.cat-nap-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 20, 0.9);
    opacity: 0;
    transition: opacity 1s ease;
    z-index: var(--z-modal);
    pointer-events: none;
}

.cat-nap-overlay.active {
    opacity: 0.7;
}

/* Floating zzz element */
.cat-nap-zzz {
    position: fixed;
    font-size: 1.5rem;
    pointer-events: none;
    z-index: calc(var(--z-modal) + 1);
    animation: floatUpZzz 2s ease-out forwards;
}

@keyframes floatUpZzz {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-100px) scale(1.3); }
}

/* Firefly glowing dot */
.cat-nap-firefly {
    position: fixed;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ffffaa;
    box-shadow: 0 0 6px 2px rgba(255, 255, 170, 0.8), 0 0 12px 4px rgba(255, 255, 170, 0.4);
    pointer-events: none;
    z-index: calc(var(--z-modal) + 1);
    animation: fireflyTwinkle 1.5s ease-in-out infinite;
}

@keyframes fireflyTwinkle {
    0%, 100% { opacity: 0.2; transform: translate(0, 0); }
    50% { opacity: 1; transform: translate(5px, -5px); }
}

/* Alarm emoji pop-in + shake */
.alarm-pop {
    position: fixed;
    font-size: 4rem;
    z-index: calc(var(--z-modal) + 2);
    pointer-events: none;
    animation: popIn 0.3s ease, alarmShake 0.1s ease infinite 0.3s;
}

@keyframes alarmShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-4px, -2px); }
    50% { transform: translate(4px, 2px); }
    75% { transform: translate(-2px, 4px); }
}

/* Alarm text */
.alarm-text {
    position: fixed;
    font-size: 2rem;
    font-weight: bold;
    color: #ff3333;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.8);
    z-index: calc(var(--z-modal) + 2);
    pointer-events: none;
    animation: popIn 0.3s ease;
}

/* Cat bounce when waking up */
.cat-bounce-wake {
    animation: bounceWake 0.5s ease !important;
    transform: rotate(0deg) !important;
}

@keyframes bounceWake {
    0% { transform: rotate(90deg) scale(1); }
    30% { transform: rotate(0deg) scale(1.3); }
    60% { transform: rotate(0deg) scale(0.9); }
    100% { transform: rotate(0deg) scale(1); }
}

/* ========================================
   ANIMAL COMBO - Dog Zoomies
   ======================================== */

/* Afterimage trail element */
.dog-afterimage {
    position: fixed;
    pointer-events: none;
    z-index: var(--z-overlay);
    font-size: var(--font-size-3xl);
    animation: afterimageFade 300ms ease forwards;
}

@keyframes afterimageFade {
    0% { opacity: 0.4; }
    100% { opacity: 0; }
}

/* Animal dodge animation */
.animal-dodge {
    animation: dodgeJump 0.4s ease !important;
}

@keyframes dodgeJump {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

/* Stars circling after crash */
.stars-circle {
    position: fixed;
    pointer-events: none;
    z-index: calc(var(--z-overlay) + 1);
}

.stars-circle .star {
    position: absolute;
    font-size: 1.2rem;
    animation: orbitStars 0.8s linear infinite;
}

@keyframes orbitStars {
    from { transform: rotate(0deg) translateX(25px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(25px) rotate(-360deg); }
}

/* Dog wobble after crash */
.dog-wobble {
    animation: wobbleShake 0.3s ease-in-out infinite !important;
}

@keyframes wobbleShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* Shaking speech bubble variant */
.speech-shake {
    animation: popIn 0.3s ease, alarmShake 0.08s ease infinite 0.3s !important;
}

/* ========================================
   ANIMAL COMBO - Frog Prince
   ======================================== */

/* Sparkle element */
.frog-prince-sparkle {
    position: fixed;
    font-size: 16px;
    pointer-events: none;
    z-index: calc(var(--z-modal) + 1);
    animation: sparkleExplode 0.5s ease-out forwards;
}

@keyframes sparkleExplode {
    0% { transform: translate(0, 0) scale(0); opacity: 1; }
    50% { transform: translate(var(--sparkle-x, 40px), var(--sparkle-y, -40px)) scale(1.5); opacity: 1; }
    100% { transform: translate(var(--sparkle-x, 40px), var(--sparkle-y, -40px)) scale(0); opacity: 0; }
}

/* Frog grows with magical feel */
.frog-prince-grow {
    transform: scale(2) !important;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    animation: none !important;
}

/* Crown descending */
.frog-prince-crown {
    position: fixed;
    font-size: 24px;
    pointer-events: none;
    z-index: calc(var(--z-modal) + 2);
    animation: crownDescend 0.5s ease-out forwards;
}

@keyframes crownDescend {
    0% { transform: translateY(-80px); opacity: 0; }
    70% { transform: translateY(5px); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Crown fly-off on rejection */
.frog-prince-crown-flyoff {
    animation: crownFlyOff 0.6s ease-in forwards !important;
}

@keyframes crownFlyOff {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateX(300px) translateY(-200px) rotate(720deg); opacity: 0; }
}

/* "A Prince!" text */
.frog-prince-text {
    position: fixed;
    font-family: cursive, fantasy, serif;
    font-size: 28px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.3);
    pointer-events: none;
    z-index: calc(var(--z-modal) + 2);
    transform: translateX(-50%);
    animation: textAppearFancy 0.5s ease-out forwards;
}

@keyframes textAppearFancy {
    0% { opacity: 0; transform: translateX(-50%) scale(0.5) rotate(-5deg); }
    70% { opacity: 1; transform: translateX(-50%) scale(1.1) rotate(2deg); }
    100% { opacity: 1; transform: translateX(-50%) scale(1) rotate(0deg); }
}

/* "NOPE" slam text */
.frog-prince-nope {
    position: fixed;
    top: 50%;
    left: 50%;
    font-size: 60px;
    font-weight: bold;
    color: #ff3333;
    text-shadow: 0 0 15px rgba(255, 51, 51, 0.6);
    pointer-events: none;
    z-index: calc(var(--z-modal) + 3);
    animation: slamDown 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slamDown {
    0% { transform: translate(-50%, calc(-50% - 200px)); opacity: 0; }
    60% { transform: translate(-50%, calc(-50% + 10px)); opacity: 1; }
    80% { transform: translate(-50%, calc(-50% - 5px)); }
    100% { transform: translate(-50%, -50%); }
}

/* ========================================
   ANIMAL COMBO - Pack Howl
   ======================================== */

/* Night overlay */
.pack-howl-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(to top, #0a0a2e, #1a1a4e 50%, #0d0d3d);
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 9998;
    pointer-events: none;
}

.pack-howl-overlay.active {
    opacity: 0.85;
}

/* Golden moon */
.pack-howl-moon {
    position: fixed;
    right: 15%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffd700 0%, #ffaa00 40%, transparent 70%);
    z-index: 9999;
    pointer-events: none;
    animation: moonRise 1s ease-out forwards;
}

@keyframes moonRise {
    0% { top: 100vh; }
    100% { top: 10vh; }
}

.pack-howl-moon.moon-set {
    animation: moonSet 0.8s ease-in forwards !important;
}

@keyframes moonSet {
    0% { top: 10vh; }
    100% { top: 100vh; }
}

/* Animal head tilt for howling */
.pack-howl-tilt {
    transform: rotate(-20deg) !important;
    transition: transform 0.5s ease !important;
}

/* Aurora borealis */
.aurora-borealis {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 30vh;
    background:
        linear-gradient(90deg, transparent, rgba(0, 255, 100, 0.3), transparent) 0 0 / 200% 100%,
        linear-gradient(90deg, transparent, rgba(128, 0, 255, 0.2), transparent) 50% 30% / 200% 100%,
        linear-gradient(90deg, transparent, rgba(0, 150, 255, 0.2), transparent) 100% 60% / 200% 100%;
    opacity: 0.6;
    z-index: 9999;
    pointer-events: none;
    animation: auroraFlow 3s ease-in-out infinite;
}

@keyframes auroraFlow {
    0% { background-position: 0% 0%, 50% 30%, 100% 60%; }
    50% { background-position: 100% 0%, 150% 30%, 200% 60%; }
    100% { background-position: 200% 0%, 250% 30%, 300% 60%; }
}

/* Wolf emoji */
.wolf-emoji {
    position: fixed;
    font-size: 40px;
    top: 60%;
    right: -60px;
    z-index: 10000;
    pointer-events: none;
}

.wolf-emoji.wolf-slide-in {
    animation: slideInFromRight 0.5s ease-out forwards;
}

.wolf-emoji.wolf-slide-out {
    animation: slideOutRight 0.5s ease-in forwards;
}

@keyframes slideInFromRight {
    0% { right: -60px; }
    100% { right: 10%; }
}

@keyframes slideOutRight {
    0% { right: 10%; }
    100% { right: -60px; }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .cat-nap-tilt,
    .cat-bounce-wake {
        transition: none;
        animation: none !important;
    }

    .cat-nap-overlay {
        transition: none;
    }

    .cat-nap-zzz,
    .cat-nap-firefly,
    .alarm-pop,
    .alarm-text,
    .dog-afterimage,
    .animal-dodge,
    .stars-circle .star,
    .dog-wobble,
    .speech-shake,
    .frog-prince-sparkle,
    .frog-prince-crown,
    .frog-prince-crown-flyoff,
    .frog-prince-text,
    .frog-prince-nope,
    .pack-howl-moon,
    .aurora-borealis,
    .wolf-emoji.wolf-slide-in,
    .wolf-emoji.wolf-slide-out {
        animation: none !important;
    }

    .frog-prince-grow {
        transition: none !important;
        animation: none !important;
    }

    .pack-howl-overlay {
        transition: none;
    }

    .pack-howl-tilt {
        transition: none !important;
    }

    .cat-nap-zzz {
        opacity: 0.6;
    }

    .cat-nap-firefly {
        opacity: 0.5;
    }

    .dog-afterimage {
        opacity: 0;
    }

    .frog-prince-sparkle {
        opacity: 0;
    }
}
