/* 夢幻氛圍＋互動水波（全站；pointer-events 不阻擋操作） */

#msp-dream-ambient {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 55% at 15% 25%, rgba(130, 90, 160, 0.14) 0%, transparent 52%),
        radial-gradient(ellipse 70% 45% at 88% 18%, rgba(212, 175, 55, 0.1) 0%, transparent 48%),
        radial-gradient(ellipse 65% 50% at 75% 82%, rgba(80, 120, 180, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 100% 70% at 50% 108%, rgba(50, 35, 70, 0.2) 0%, transparent 55%);
    opacity: 0.92;
    animation: msp-dream-drift 22s ease-in-out infinite alternate;
}

#msp-dream-ambient::before {
    content: '';
    position: absolute;
    inset: -15%;
    background:
        radial-gradient(circle at 30% 40%, rgba(255, 230, 200, 0.06) 0%, transparent 42%),
        radial-gradient(circle at 70% 60%, rgba(180, 140, 220, 0.07) 0%, transparent 38%);
    animation: msp-dream-rotate 48s linear infinite;
}

#msp-dream-ambient::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -18deg,
        transparent,
        transparent 22px,
        rgba(255, 255, 255, 0.012) 22px,
        rgba(255, 255, 255, 0.012) 23px
    );
    opacity: 0.55;
    mix-blend-mode: overlay;
}

@keyframes msp-dream-drift {
    0% {
        transform: scale(1) translate(0, 0);
        filter: hue-rotate(0deg) saturate(1);
    }
    100% {
        transform: scale(1.06) translate(1.5%, -1%);
        filter: hue-rotate(12deg) saturate(1.08);
    }
}

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

/* 水波漣漪容器 */
#msp-ripple-host {
    position: fixed;
    inset: 0;
    z-index: 950;
    pointer-events: none;
    overflow: hidden;
}

.msp-ripple-ring {
    position: fixed;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    margin-left: -12px;
    margin-top: -12px;
    border-radius: 50%;
    border: 1.5px solid rgba(243, 229, 171, 0.65);
    box-shadow:
        0 0 32px rgba(212, 175, 55, 0.45),
        0 0 64px rgba(200, 160, 255, 0.2),
        inset 0 0 24px rgba(255, 255, 255, 0.15);
    animation: msp-ripple-expand 1.05s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    pointer-events: none;
    will-change: transform, opacity;
}

.msp-ripple-ring--soft {
    width: 16px;
    height: 16px;
    margin-left: -8px;
    margin-top: -8px;
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
    animation: msp-ripple-expand-soft 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.msp-ripple-ring--echo {
    animation-delay: 0.08s;
    border-color: rgba(180, 150, 220, 0.4);
    box-shadow:
        0 0 40px rgba(160, 130, 220, 0.25),
        inset 0 0 20px rgba(255, 255, 255, 0.08);
}

@keyframes msp-ripple-expand {
    0% {
        transform: scale(0.2);
        opacity: 0.95;
    }
    70% {
        opacity: 0.45;
    }
    100% {
        transform: scale(14);
        opacity: 0;
    }
}

@keyframes msp-ripple-expand-soft {
    0% {
        transform: scale(0.15);
        opacity: 0.55;
    }
    100% {
        transform: scale(8);
        opacity: 0;
    }
}

/* 桌面游標外圈：微呼吸光暈（不覆寫位移，僅陰影） */
@media (pointer: fine) {
    .cursor-outline {
        box-shadow:
            0 0 16px rgba(212, 175, 55, 0.22),
            0 0 40px rgba(180, 140, 220, 0.12),
            inset 0 0 14px rgba(255, 240, 200, 0.06);
        animation: msp-cursor-aura 3.2s ease-in-out infinite;
    }

    .cursor-hover .cursor-outline {
        animation: msp-cursor-aura-strong 2s ease-in-out infinite;
    }

    .cursor-dot {
        box-shadow: 0 0 12px rgba(212, 175, 55, 0.85), 0 0 24px rgba(255, 220, 160, 0.4);
    }
}

@keyframes msp-cursor-aura {
    0%, 100% {
        box-shadow:
            0 0 14px rgba(212, 175, 55, 0.2),
            0 0 36px rgba(160, 130, 200, 0.1),
            inset 0 0 12px rgba(255, 240, 200, 0.05);
    }
    50% {
        box-shadow:
            0 0 26px rgba(212, 175, 55, 0.38),
            0 0 52px rgba(180, 150, 230, 0.18),
            inset 0 0 18px rgba(255, 255, 255, 0.1);
    }
}

@keyframes msp-cursor-aura-strong {
    0%, 100% {
        box-shadow:
            0 0 22px rgba(212, 175, 55, 0.45),
            0 0 48px rgba(200, 170, 255, 0.2),
            inset 0 0 16px rgba(255, 255, 255, 0.08);
    }
    50% {
        box-shadow:
            0 0 36px rgba(212, 175, 55, 0.55),
            0 0 72px rgba(190, 160, 240, 0.28),
            inset 0 0 22px rgba(255, 255, 255, 0.12);
    }
}

/* 按鈕 hover：疊加夢幻光暈（覆寫順序在 site-shell 之後，故提高選擇器權重） */
body .gold-btn:hover {
    box-shadow:
        0 0 34px rgba(212, 175, 55, 0.48),
        0 0 72px rgba(175, 150, 230, 0.22);
}

@media (prefers-reduced-motion: reduce) {
    #msp-dream-ambient,
    #msp-dream-ambient::before {
        animation: none !important;
    }

    #msp-dream-ambient {
        opacity: 0.65;
    }

    .msp-ripple-ring,
    .msp-ripple-ring--soft {
        animation-duration: 0.35s !important;
    }

    @media (pointer: fine) {
        .cursor-outline {
            animation: none !important;
        }
    }
}
