/* css/background.css - P5R Style Background FX */

.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background-color: #1a1a1a;
}

/* 1. 流动的斜条纹 (The Phantom Stripes) */
.bg-stripes {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 20px,
            rgba(30, 30, 30, 0.4) 20px,
            rgba(30, 30, 30, 0.4) 40px);
    animation: stripe-move 60s linear infinite;
    transform: rotate(-10deg);
}

@keyframes stripe-move {
    0% {
        transform: translate(0, 0) rotate(-10deg);
    }

    100% {
        transform: translate(-100px, 100px) rotate(-10deg);
    }
}

/* 2. 半调波点底纹 (Halftone Pattern) */
.bg-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.6;
}

/* 3. 漂浮的几何形状 (Floating Shapes) */
.shape {
    position: absolute;
    opacity: 0.8;
    filter: drop-shadow(5px 5px 0 rgba(0, 0, 0, 0.5));
    animation: float-anim 10s ease-in-out infinite alternate;
}

/* 星星 */
.shape-star {
    color: var(--p5-white);
    font-size: 2rem;
    font-family: sans-serif;
    /* 确保星星符号显示正常 */
    animation: spin-anim 12s linear infinite;
}

/* 红色碎片 */
.shape-shard {
    background: var(--p5-red);
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    animation: float-up 15s linear infinite;
    opacity: 0.4;
}

/* 黄色闪电/锯齿 */
.shape-jagged {
    background: var(--p5-yellow);
    width: 80px;
    height: 80px;
    clip-path: polygon(40% 0%, 40% 20%, 100% 20%, 100% 80%, 40% 80%, 40% 100%, 0% 50%);
    animation: pulse-anim 2s infinite;
    opacity: 0.8;
}

/* 动画定义 */
@keyframes spin-anim {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes float-up {
    0% {
        transform: translateY(110vh) rotate(0deg) scale(0.5);
        opacity: 0;
    }

    10% {
        opacity: 0.4;
    }

    90% {
        opacity: 0.4;
    }

    100% {
        transform: translateY(-10vh) rotate(720deg) scale(1.2);
        opacity: 0;
    }
}

@keyframes pulse-anim {
    0% {
        transform: scale(1) rotate(-5deg);
    }

    50% {
        transform: scale(1.1) rotate(5deg);
    }

    100% {
        transform: scale(1) rotate(-5deg);
    }
}