/* ===== PIXEL DECORATIONS & ANIMATIONS ===== */

/* Floating stars animation */
@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Pixel stars scattered */
.stars {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--highlight);
    animation: twinkle 2s infinite;
}

.star:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.star:nth-child(2) { top: 20%; left: 85%; animation-delay: 0.5s; }
.star:nth-child(3) { top: 30%; left: 25%; animation-delay: 1s; }
.star:nth-child(4) { top: 15%; left: 75%; animation-delay: 1.5s; }
.star:nth-child(5) { top: 40%; left: 90%; animation-delay: 0.3s; }

/* Decorative pixel blocks */
.pixel-block {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 2px;
    border: 1px solid currentColor;
}

.pixel-block.filled {
    background: currentColor;
}

.pixel-block.gradient-1 {
    background: linear-gradient(135deg, var(--dark), var(--secondary));
}

.pixel-block.gradient-2 {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
}

/* Pixel bars animation */
.pixel-bar {
    display: flex;
    gap: 2px;
    align-items: center;
    justify-content: center;
}

.pixel-bar-item {
    width: 2px;
    height: 20px;
    background: linear-gradient(to top, var(--secondary), var(--dark));
    animation: wave 0.6s ease-in-out infinite;
}

.pixel-bar-item:nth-child(1) { animation-delay: 0s; height: 15px; }
.pixel-bar-item:nth-child(2) { animation-delay: 0.1s; height: 25px; }
.pixel-bar-item:nth-child(3) { animation-delay: 0.2s; height: 20px; }
.pixel-bar-item:nth-child(4) { animation-delay: 0.3s; height: 30px; }
.pixel-bar-item:nth-child(5) { animation-delay: 0.4s; height: 18px; }

@keyframes wave {
    0%, 100% { height: 20px; }
    50% { height: 10px; }
}

/* Corner ornaments */
.corner-ornament {
    position: absolute;
    width: 16px;
    height: 16px;
    background: repeating-linear-gradient(
        90deg,
        var(--accent) 0px,
        var(--accent) 4px,
        var(--dark) 4px,
        var(--dark) 8px
    );
    border: 2px solid var(--secondary);
}

.corner-ornament.top-left {
    top: -8px;
    left: -8px;
}

.corner-ornament.top-right {
    top: -8px;
    right: -8px;
    background: repeating-linear-gradient(
        90deg,
        var(--dark) 0px,
        var(--dark) 4px,
        var(--accent) 4px,
        var(--accent) 8px
    );
}

.corner-ornament.bottom-left {
    bottom: -8px;
    left: -8px;
    background: repeating-linear-gradient(
        90deg,
        var(--secondary) 0px,
        var(--secondary) 4px,
        var(--accent) 4px,
        var(--accent) 8px
    );
}

.corner-ornament.bottom-right {
    bottom: -8px;
    right: -8px;
    background: repeating-linear-gradient(
        90deg,
        var(--accent) 0px,
        var(--accent) 4px,
        var(--secondary) 4px,
        var(--secondary) 8px
    );
}

/* Pixel pulse effect */
@keyframes pixel-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--secondary) 70%, transparent),
                    inset 0 0 0 0 color-mix(in srgb, var(--dark) 30%, transparent);
    }
    50% {
        box-shadow: 0 0 0 8px color-mix(in srgb, var(--secondary) 0%, transparent),
                    inset 0 0 0 2px color-mix(in srgb, var(--dark) 60%, transparent);
    }
}

.has-pulse {
    animation: pixel-pulse 2s infinite;
}

/* Glitch effect */
@keyframes glitch {
    0% {
        text-shadow: 2px 0 #ff00de, -2px -2px #00ffff;
    }
    20% {
        text-shadow: -2px -2px #ff00de, 2px 2px #00ffff;
    }
    40% {
        text-shadow: -2px 2px #ff00de, 2px -2px #00ffff;
    }
    60% {
        text-shadow: 2px 2px #ff00de, -2px 2px #00ffff;
    }
    80% {
        text-shadow: 2px -2px #ff00de, -2px -2px #00ffff;
    }
    100% {
        text-shadow: -2px 2px #ff00de, 2px 2px #00ffff;
    }
}

.glitch-text {
    position: relative;
    animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

/* Scanline effect */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.015),
        rgba(255, 255, 255, 0.015) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 98;
}

/* Rainbow gradient text */
.rainbow-text {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-shift 3s linear infinite;
}

@keyframes rainbow-shift {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

/* Pixel block animation */
.pixel-blocks-animation {
    display: inline-flex;
    gap: 2px;
}

.pba-item {
    width: 4px;
    height: 4px;
    background: #ffd700;
    animation: bounce-pixel 1s ease-in-out infinite;
}

.pba-item:nth-child(1) { animation-delay: 0s; }
.pba-item:nth-child(2) { animation-delay: 0.2s; }
.pba-item:nth-child(3) { animation-delay: 0.4s; }
.pba-item:nth-child(4) { animation-delay: 0.6s; }

@keyframes bounce-pixel {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(-8px);
        opacity: 0.5;
    }
}
