/* ── Canvas เศษแสง + พลุ ── */
.celebrateCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* บังคับเล่นเสมอ ไม่สนโหมดลดการเคลื่อนไหวของเครื่อง */
@media all {

    /* ─────────────────────
       1) ตัวละคร ลอยเบาๆ
    ───────────────────── */
    /* ตัวละครหลัก: ลอย + หายใจ + แสงเรืองรอบตัว */
    .newyearLpCharacter {
        animation: lpAura 5s ease-in-out infinite !important;
    }

    .newyearLpCharacter img {
        transform-origin: 50% 100%;
        animation:
            lpFloat 6s ease-in-out infinite,
            lpBreathe 4s ease-in-out infinite,
            lpLean 8s ease-in-out infinite !important;
        will-change: translate, scale, rotate;
    }

    /* ประกายที่ปลายพลุมือถือ (ปรับตำแหน่งด้วย --spark-x / --spark-y) */
    .newyearLpCharacter::after {
        content: "";
        position: absolute;
        left: var(--spark-x, 24.5%);
        bottom: var(--spark-y, 800px);
        width: 84px;
        height: 84px;
        margin: -42px 0 -42px -42px;
        pointer-events: none;
        background:
            linear-gradient(90deg, transparent, rgba(255, 255, 255, .95), transparent) center / 100% 2px no-repeat,
            linear-gradient(0deg, transparent, rgba(255, 255, 255, .95), transparent) center / 2px 100% no-repeat,
            radial-gradient(circle, rgba(255, 255, 255, .95) 0, rgba(255, 190, 240, .45) 22%, transparent 60%);
        animation:
            lpFloat 6s ease-in-out infinite,
            lpTwinkle 1.8s ease-in-out infinite !important;
    }

    /* มาสคอตตัวเล็ก: โยก + กระโดดเบาๆ */
    .newyearLpCharacter_2 img {
        transform-origin: 50% 90%;
        animation:
            lpHop 3.8s cubic-bezier(.4, 0, .3, 1) infinite,
            lpSway 5.4s ease-in-out infinite !important;
        will-change: translate, rotate;
    }

    /* ประกายที่กล่องของขวัญ */
    .newyearLpCharacter_2::after {
        content: "";
        position: absolute;
        left: 24%;
        top: 52%;
        width: 36px;
        height: 36px;
        margin: -18px 0 0 -18px;
        pointer-events: none;
        background:
            linear-gradient(90deg, transparent, rgba(255, 240, 200, .95), transparent) center / 100% 1.5px no-repeat,
            linear-gradient(0deg, transparent, rgba(255, 240, 200, .95), transparent) center / 1.5px 100% no-repeat,
            radial-gradient(circle, rgba(255, 240, 200, .9) 0, rgba(255, 210, 120, .35) 25%, transparent 60%);
        animation: lpTwinkle 2.4s ease-in-out -.8s infinite !important;
    }

    @keyframes lpBreathe {

        0%,
        100% {
            scale: 1;
        }

        50% {
            scale: 1.014;
        }
    }

    @keyframes lpLean {

        0%,
        100% {
            rotate: -.5deg;
        }

        50% {
            rotate: .5deg;
        }
    }

    @keyframes lpAura {

        0%,
        100% {
            filter: drop-shadow(0 0 8px rgba(255, 170, 230, .15));
        }

        50% {
            filter: drop-shadow(0 0 22px rgba(160, 200, 255, .4));
        }
    }

    @keyframes lpTwinkle {

        0%,
        100% {
            opacity: .15;
            transform: scale(.45) rotate(0deg);
        }

        50% {
            opacity: 1;
            transform: scale(1) rotate(45deg);
        }
    }

    /* กระโดดเด้งทุกๆ ช่วง แล้วนิ่งสักพัก */
    @keyframes lpHop {

        0%,
        55%,
        100% {
            translate: 0 0;
        }

        65% {
            translate: 0 -16px;
        }

        75% {
            translate: 0 0;
        }

        82% {
            translate: 0 -6px;
        }

        90% {
            translate: 0 0;
        }
    }

    @keyframes lpFloat {

        0%,
        100% {
            translate: 0 0;
        }

        50% {
            translate: 0 -12px;
        }
    }

    @keyframes lpSway {

        0%,
        100% {
            rotate: -2.5deg;
        }

        50% {
            rotate: 2.5deg;
        }
    }

    /* ─────────────────────
       2) โลโก้ แสงเรืองหายใจ
    ───────────────────── */
    .newyearLpLogo img {
        animation: lpGlowSoft 5s ease-in-out infinite !important;
    }

    .newyearLpLogoEvent img {
        animation:
            lpFloat 7s ease-in-out -2s infinite,
            lpGlow 3.6s ease-in-out infinite !important;
    }

    @keyframes lpGlow {

        0%,
        100% {
            filter: drop-shadow(0 0 6px rgba(255, 190, 240, .35)) drop-shadow(0 0 0 rgba(150, 200, 255, 0));
        }

        50% {
            filter: drop-shadow(0 0 14px rgba(255, 190, 240, .65)) drop-shadow(0 0 28px rgba(150, 200, 255, .45));
        }
    }

    @keyframes lpGlowSoft {

        0%,
        100% {
            filter: drop-shadow(0 0 3px rgba(200, 220, 255, .25));
        }

        50% {
            filter: drop-shadow(0 0 12px rgba(200, 220, 255, .6));
        }
    }

    /* ─────────────────────
       3) ปุ่มหลัก แสงวิ่งผ่านทีละปุ่ม
    ───────────────────── */
    .newyearLpBtn {
        overflow: hidden;
    }

    .newyearLpBtn::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 40%;
        height: 100%;
        background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
        transform: translateX(-160%) skewX(-20deg);
        animation: lpShine 5s ease-in-out infinite !important;
        pointer-events: none;
    }

    #buttonLP>div:nth-child(1) .newyearLpBtn:nth-child(1)::after {
        animation-delay: 1.2s !important;
    }

    #buttonLP>div:nth-child(1) .newyearLpBtn:nth-child(2)::after {
        animation-delay: 1.6s !important;
    }

    #buttonLP>div:nth-child(2) .newyearLpBtn:nth-child(1)::after {
        animation-delay: 2.0s !important;
    }

    #buttonLP>div:nth-child(2) .newyearLpBtn:nth-child(2)::after {
        animation-delay: 2.4s !important;
    }

    @keyframes lpShine {
        0% {
            transform: translateX(-160%) skewX(-20deg);
        }

        30%,
        100% {
            transform: translateX(420%) skewX(-20deg);
        }
    }

    /* hover: ยกขึ้นนิดๆ */
    .newyearLpBtn:hover {
        transform: translateY(-3px);
    }

    .newyearLpBtn:active {
        transform: translateY(0) scale(.98);
    }

    /* ─────────────────────
       4) ปุ่มเมนูกลม ลอย + วงแหวนแสง
    ───────────────────── */
    .newyearLpNavBtn {
        animation: lpFloatSm 4s ease-in-out infinite !important;
    }

    .newyearLpNavBtn:nth-child(2) {
        animation-delay: -1.3s !important;
    }

    .newyearLpNavBtn:nth-child(3) {
        animation-delay: -2.6s !important;
    }

    .newyearLpNavBtn:hover {
        animation-play-state: paused !important;
    }

    @keyframes lpFloatSm {

        0%,
        100% {
            translate: 0 0;
        }

        50% {
            translate: 0 -5px;
        }
    }

    /* ─────────────────────
       5) คลื่นด้านล่าง ขยับช้าๆ
    ───────────────────── */
    .wave__layer--dark {
        animation: lpWave 9s ease-in-out infinite !important;
    }

    .wave__layer--purple {
        animation: lpWave 7s ease-in-out -3s infinite !important;
    }

    @keyframes lpWave {

        0%,
        100% {
            translate: 0 0;
        }

        50% {
            translate: 0 10px;
        }
    }
}