/* ===========================
   PARTY MODE
   =========================== */

   body.party {
    overflow-x: hidden;
    animation: partyBackground 2s linear infinite;
}

/* ===========================
   LUCIÉRNAGAS DISCO (::before)
   =========================== */

body.party::before {
    content: "";
    position: fixed;
    inset: -50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;

    background:
        radial-gradient(circle, rgba(255,0,0,.7) 0%, transparent 25%),
        radial-gradient(circle, rgba(0,255,255,.7) 0%, transparent 25%),
        radial-gradient(circle, rgba(255,255,0,.7) 0%, transparent 25%),
        radial-gradient(circle, rgba(255,0,255,.7) 0%, transparent 25%);

    background-size: 40vw 40vw;

    animation:
        discoLights1 6s linear infinite,
        rotateParty 12s linear infinite;
}

/* ===========================
   GIF CENTRAL (::after)
   =========================== */

body.party::after {
    content: "";
    position: fixed;

    left: 50%;
    top: 50%;

    width: 400px;
    height: 400px;

    transform: translate(-50%, -50%);

    background: url("./dancing.gif") center / contain no-repeat;

    pointer-events: none;
    z-index: 100000;

    animation:
        dancingSpin 3s linear infinite,
        dancingBeat 1s ease-in-out infinite;
}

/* ===========================
   MAIN BEAT (suavizado)
   =========================== */

body.party main {
    transform-origin: center;
    animation: beatDrop 1.2s ease-in-out infinite;
}

/* ===========================
   ANIMACIONES
   =========================== */

@keyframes beatDrop {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.03); }
    50% { transform: scale(1.05); }
    75% { transform: scale(1.02); }
}

@keyframes discoLights1 {
    from {
        background-position:
            0 0,
            100vw 0,
            0 100vh,
            100vw 100vh;
    }
    to {
        background-position:
            100vw 100vh,
            0 100vh,
            100vw 0,
            0 0;
    }
}

@keyframes rotateParty {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes dancingSpin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes dancingBeat {
    0%, 100% { scale: 1; }
    50% { scale: 1.12; }
}

@keyframes partyBackground {
    0%   { background-color: #ff0000; }
    16%  { background-color: #ff8800; }
    33%  { background-color: #ffff00; }
    50%  { background-color: #00ff00; }
    66%  { background-color: #00ffff; }
    83%  { background-color: #ff00ff; }
    100% { background-color: #ff0000; }
}