/* DESKTOP ANIMACJE - MEGA EFEKT */

@keyframes rainbow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

@keyframes floatTitle {
    0%, 100% {
        transform: translate(-50%, -50%) translateZ(0px) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: translate(-50%, -50%) translateZ(80px) rotateX(-8deg) rotateY(5deg);
    }
    50% {
        transform: translate(-50%, -50%) translateZ(120px) rotateX(8deg) rotateY(-10deg);
    }
    75% {
        transform: translate(-50%, -50%) translateZ(80px) rotateX(-5deg) rotateY(8deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1) translateZ(0);
    }
    50% {
        transform: scale(1.08) translateZ(30px);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 0.8;
        transform: scale(1);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    }
}

@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 0 0 40px rgba(255, 0, 128, 0.8), 0 0 80px rgba(255, 0, 0, 0.6);
    }
    20%, 24%, 55% {
        text-shadow: 0 0 20px rgba(255, 0, 128, 0.3), 0 0 30px rgba(255, 0, 0, 0.2);
    }
}

/* FLIP ANIMATION - LICZBY ODLICZANIA */
@keyframes flip-in {
    0% {
        transform: rotateX(90deg) scale(0.8);
        opacity: 0;
    }
    70% {
        transform: rotateX(-15deg) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: rotateX(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes flip-out {
    0% {
        transform: rotateX(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: rotateX(-90deg) scale(0.8);
        opacity: 0;
    }
}

.countdown-number.flip {
    animation: flip-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* PULSOWANIE W OSTATNICH 60 SEKUND */
@keyframes final-countdown-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 0, 128, 0.3), 0 0 40px rgba(255, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 0, 128, 0.8), 0 0 80px rgba(255, 0, 0, 0.6);
    }
}

.countdown-box.final-countdown {
    animation: final-countdown-pulse 0.5s ease-in-out infinite !important;
}

/* AUDIO VISUALIZER */
.audio-visualizer {
    position: relative;
    width: 100%;
    height: 40px;
    margin-top: 1rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
}

.visualizer-bar {
    width: 3px;
    background: linear-gradient(to top, #00d4ff, #ff0080);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    animation: visualizer-bar 0.1s ease-out;
}

@keyframes visualizer-bar {
    from {
        height: 0;
    }
    to {
        height: 100%;
    }
}

/* TRACK PROGRESS BAR */
.track-progress {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 0.8rem;
    overflow: hidden;
}

.track-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #ff0080);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
    transition: width 0.1s linear;
}

/* Desktop Defaults */
.main-title {
    animation: rainbow 8s linear infinite, neon-flicker 4s ease-in-out infinite;
}

.title-container {
    animation: floatTitle 8s ease-in-out infinite;
}

.countdown-box {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== MOBILE ANIMATIONS ===== */

@media (max-width: 768px) {
    .main-title {
        animation: rainbow 10s linear infinite;
    }

    .title-container {
        animation: none;
    }

    .countdown-box {
        animation: none;
    }

    .countdown-box.final-countdown {
        animation: final-countdown-pulse 0.6s ease-in-out infinite !important;
    }

    .audio-visualizer {
        height: 30px;
        gap: 3px;
    }

    .visualizer-bar {
        width: 2px;
    }
}

@media (max-width: 480px) {
    .main-title {
        animation: none;
    }

    .title-container {
        animation: none;
    }

    .countdown-box {
        animation: none;
    }

    .countdown-box.final-countdown {
        animation: final-countdown-pulse 0.6s ease-in-out infinite !important;
    }

    .audio-visualizer {
        height: 20px;
        gap: 2px;
    }

    .visualizer-bar {
        width: 1.5px;
    }
}

/* Redukcja animacji dla osób preferujących mniej ruchu */
@media (prefers-reduced-motion: reduce) {
    .main-title,
    .title-container,
    .countdown-box,
    .countdown-number.flip {
        animation: none !important;
    }

    .visualizer-bar {
        animation: none;
    }
}
