/* Cosmic UFO Game - Enhanced Visual Effects */

/* Enhanced UFO styling */
#ufo {
    font-size: 3rem;
    transition: all 0.1s ease-out;
    z-index: 10;
    position: relative;
}

#ufo::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: ufo-glow 2s ease-in-out infinite;
}

/* UFO glow animation */
@keyframes ufo-glow {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

/* Enhanced abduction beam */
#abduction-beam {
    background: linear-gradient(to bottom, 
        rgba(59, 130, 246, 0.8) 0%,
        rgba(59, 130, 246, 0.6) 30%,
        rgba(59, 130, 246, 0.4) 60%,
        rgba(59, 130, 246, 0.2) 80%,
        transparent 100%);
    border-radius: 0 0 50% 50%;
    box-shadow: 
        0 0 20px rgba(59, 130, 246, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    animation: beam-pulse 0.5s ease-in-out infinite;
}

@keyframes beam-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Enhanced particle effects */
.particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    animation: particle-float 2s ease-out forwards;
}

@keyframes particle-float {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.3) translateY(-100px) rotate(360deg);
    }
}

/* Collectible glow effects */
.collectible-glow {
    animation: collectible-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px currentColor);
}

@keyframes collectible-pulse {
    0%, 100% { 
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 10px currentColor);
    }
    50% { 
        transform: scale(1.1) translateY(-5px);
        filter: drop-shadow(0 0 15px currentColor);
    }
}

/* Obstacle warning effect */
.obstacle-warning {
    animation: warning-flash 1s ease-in-out infinite;
}

@keyframes warning-flash {
    0%, 100% { 
        filter: drop-shadow(0 0 8px #EF4444);
        transform: scale(1);
    }
    50% { 
        filter: drop-shadow(0 0 15px #EF4444);
        transform: scale(1.05);
    }
}

/* Power-up special effects */
.powerup-special {
    animation: powerup-rainbow 3s linear infinite;
    filter: drop-shadow(0 0 12px #EC4899);
}

@keyframes powerup-rainbow {
    0% { filter: drop-shadow(0 0 12px #EC4899) hue-rotate(0deg); }
    25% { filter: drop-shadow(0 0 12px #3B82F6) hue-rotate(90deg); }
    50% { filter: drop-shadow(0 0 12px #10B981) hue-rotate(180deg); }
    75% { filter: drop-shadow(0 0 12px #F59E0B) hue-rotate(270deg); }
    100% { filter: drop-shadow(0 0 12px #EC4899) hue-rotate(360deg); }
}

/* Enhanced star field */
.star-large {
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #fff, #3B82F6);
    border-radius: 50%;
    animation: star-twinkle 3s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.star-medium {
    width: 3px;
    height: 3px;
    background: linear-gradient(45deg, #fff, #10B981);
    border-radius: 50%;
    animation: star-twinkle 2.5s ease-in-out infinite;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
}

.star-small {
    width: 2px;
    height: 2px;
    background: linear-gradient(45deg, #fff, #EC4899);
    border-radius: 50%;
    animation: star-twinkle 2s ease-in-out infinite;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.4);
}

@keyframes star-twinkle {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Screen shake effect */
@keyframes screen-shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-2px) translateY(1px); }
    20% { transform: translateX(2px) translateY(-1px); }
    30% { transform: translateX(-1px) translateY(2px); }
    40% { transform: translateX(1px) translateY(-2px); }
    50% { transform: translateX(-2px) translateY(1px); }
    60% { transform: translateX(2px) translateY(-1px); }
    70% { transform: translateX(-1px) translateY(2px); }
    80% { transform: translateX(1px) translateY(-2px); }
    90% { transform: translateX(-1px) translateY(1px); }
}

/* Score animation */
.score-pop {
    animation: score-bounce 0.3s ease-out;
}

@keyframes score-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Life lost animation */
.life-lost {
    animation: life-fade 0.5s ease-out;
}

@keyframes life-fade {
    0% { 
        transform: scale(1);
        filter: none;
    }
    50% { 
        transform: scale(1.2);
        filter: brightness(2);
    }
    100% { 
        transform: scale(0.8);
        filter: grayscale(100%) brightness(0.5);
    }
}

/* Background nebula effect */
.nebula-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(147, 51, 234, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    animation: nebula-drift 20s linear infinite;
    z-index: -2;
}

@keyframes nebula-drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Floating UI elements */
.ui-float {
    animation: ui-gentle-float 4s ease-in-out infinite;
}

@keyframes ui-gentle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Button press effect enhancement */
.tamagotchi-btn:active {
    transform: translateY(3px) scale(0.95);
    box-shadow: 
        inset 3px 3px 8px rgba(0,0,0,0.4),
        inset -2px -2px 5px rgba(255,255,255,0.6),
        0 1px 2px rgba(0,0,0,0.2);
}

/* Notification animations */
.notification-enter {
    animation: notification-slide-in 0.3s ease-out;
}

.notification-exit {
    animation: notification-slide-out 0.3s ease-in;
}

@keyframes notification-slide-in {
    0% {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes notification-slide-out {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
}

/* Game over screen effects */
.gameover-enter {
    animation: gameover-zoom-in 0.8s ease-out;
}

@keyframes gameover-zoom-in {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    60% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Leaderboard entry animations */
.leaderboard-entry {
    animation: leaderboard-slide 0.5s ease-out;
}

@keyframes leaderboard-slide {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile touch feedback */
@media (max-width: 768px) {
    .touch-feedback:active {
        background-color: rgba(255, 255, 255, 0.1);
        transform: scale(0.98);
    }
    
    /* Larger touch targets for mobile */
    .mobile-touch-target {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .star {
        background: white;
        box-shadow: 0 0 4px white;
    }
    
    #ufo {
        filter: drop-shadow(0 0 4px white);
    }
    
    .tamagotchi-btn {
        border-width: 4px;
        border-color: white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .star {
        animation: none;
    }
    
    #ufo {
        animation: none;
    }
}

/* Print styles (hide game elements) */
@media print {
    .game-area,
    .tamagotchi-btn,
    .star {
        display: none !important;
    }
}

