/* =====================================================================
   HIỆU ỨNG RƠI THEO CHỦ ĐỀ (đi cùng assets/js/core/effects.js)
   Khung cao 0px nên không che / không chặn bấm vào trang.
   ===================================================================== */
.fx {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 0;
    z-index: 500;            /* dưới header và menu */
    pointer-events: none;
    overflow: visible;
}

.fx-item {
    position: absolute;
    top: 0; left: 0;
    will-change: transform;
    animation: fxFall linear infinite;
}

.fx-item i {
    display: block;
    width: 100%; height: 100%;
    will-change: transform;
    animation: fxSway ease-in-out infinite alternate;
}

/* ---- Hoa anh đào ---- */
.fx-sakura .fx-item i {
    background: linear-gradient(135deg, #ffe4ee 0%, #ffb7d0 60%, #ff9ec0 100%);
    border-radius: 150% 0 150% 0;
    box-shadow: 0 0 4px rgba(255, 182, 210, .6);
}

/* ---- Hoa mai vàng (Tết) ---- */
.fx-mai .fx-item i {
    background: radial-gradient(circle at 50% 50%, #f59e0b 0 22%, #fde047 23% 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 0 6px rgba(250, 204, 21, .6);
}

/* ---- Lá thu ---- */
.fx-leaves .fx-item i {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 55%, #b45309 100%);
    border-radius: 0 100% 0 100%;
    box-shadow: inset -2px -2px 0 rgba(120, 53, 15, .25);
}

/* ---- Tuyết ---- */
.fx-snow .fx-item i {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 255, 255, .9), 0 0 2px rgba(148, 163, 184, .8);
}

/* ---- Bong bóng nắng (bay lên) ---- */
.fx-bubbles .fx-item { animation-name: fxRise; }
.fx-bubbles .fx-item i {
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .95) 0 15%, rgba(125, 211, 252, .35) 40%, rgba(14, 165, 233, .15) 100%);
    border: 1px solid rgba(255, 255, 255, .7);
}

/* ---- Sao lấp lánh (đứng yên, nhấp nháy) ---- */
.fx-stars .fx-item { animation-name: fxTwinkle; animation-timing-function: ease-in-out; }
.fx-stars .fx-item i {
    animation: none;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, .8), 0 0 12px 4px rgba(147, 197, 253, .45);
}
/* Nền sáng: sao màu theo chủ đề cho dễ thấy */
body:not(.theme-dark) .fx-stars .fx-item i {
    background: var(--brand, #8b5cf6);
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, .9);
}

@keyframes fxFall {
    from { transform: translate3d(0, -30px, 0); opacity: 0; }
    8%   { opacity: .9; }
    92%  { opacity: .9; }
    to   { transform: translate3d(0, calc(100vh + 30px), 0); opacity: 0; }
}

@keyframes fxRise {
    from { transform: translate3d(0, calc(100vh + 30px), 0); opacity: 0; }
    10%  { opacity: .85; }
    90%  { opacity: .85; }
    to   { transform: translate3d(0, -30px, 0); opacity: 0; }
}

@keyframes fxSway {
    from { transform: translate3d(-22px, 0, 0) rotate(-35deg) rotateY(0deg); }
    to   { transform: translate3d(22px, 0, 0) rotate(50deg) rotateY(160deg); }
}

@keyframes fxTwinkle {
    0%, 100% { opacity: 0; transform: scale(.4); }
    50%      { opacity: 1; transform: scale(1); }
}

/* Tuyết & bong bóng: lắc nhẹ, không xoay */
.fx-snow .fx-item i, .fx-bubbles .fx-item i { animation-name: fxDrift; }
@keyframes fxDrift {
    from { transform: translate3d(-14px, 0, 0); }
    to   { transform: translate3d(14px, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .fx { display: none; }
}
