.fx-gradient {
    background: linear-gradient(90deg, #ff5a4f, #ffd166, #4cc9f0, #ff5a4f);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: fx-gradient 4s linear infinite
}

@keyframes fx-gradient {
    to {
        background-position: 300% 0
    }
}


.fx-typewriter {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    border-right: 2px solid currentColor;
    width: 0;
    animation: fx-type 3s steps(18) infinite alternate, fx-caret .7s step-end infinite
}

@keyframes fx-type {
    to {
        width: 18ch
    }
}

@keyframes fx-caret {
    50% {
        border-color: transparent
    }
}


.fx-glitch {
    position: relative;
    display: inline-block
}

.fx-glitch::before,
.fx-glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0
}

.fx-glitch::before {
    color: #ff5a4f;
    clip-path: inset(0 0 55% 0);
    animation: fx-glitch 2s linear infinite alternate-reverse
}

.fx-glitch::after {
    color: #4cc9f0;
    clip-path: inset(55% 0 0 0);
    animation: fx-glitch 2.6s linear infinite alternate
}

@keyframes fx-glitch {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-3px, 1px)
    }

    40% {
        transform: translate(3px, -1px)
    }

    60% {
        transform: translate(-2px, -1px)
    }

    80% {
        transform: translate(2px, 1px)
    }

    100% {
        transform: translate(0)
    }
}


.fx-neon {
    color: #fff;
    text-shadow: 0 0 4px #fff, 0 0 12px #2b59ff, 0 0 28px #2b59ff, 0 0 56px #2b59ff;
    animation: fx-neon 2.5s infinite
}

@keyframes fx-neon {

    0%,
    18%,
    22%,
    60%,
    100% {
        opacity: 1
    }

    20%,
    62% {
        opacity: .55
    }
}


.fx-underline {
    color: inherit;
    text-decoration: none;
    padding-bottom: 4px;
    background: linear-gradient(currentColor, currentColor) 0 100%/0 2px no-repeat;
    transition: background-size .35s ease
}

.fx-underline:hover,
.fx-underline:focus-visible {
    background-size: 100% 2px
}


.fx-outline {
    color: transparent;
    -webkit-text-stroke: 1.5px #fff;
    background: linear-gradient(#fff, #fff) 0 0/0 100% no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    transition: background-size .5s ease
}

.fx-outline:hover {
    background-size: 100% 100%
}


.fx-blur-in {
    display: inline-block;
    animation: fx-blur-in 3.2s ease-out infinite
}

@keyframes fx-blur-in {
    0% {
        filter: blur(12px);
        opacity: 0;
        letter-spacing: .3em
    }

    40%,
    100% {
        filter: none;
        opacity: 1;
        letter-spacing: .02em
    }
}


/* JS: tách chữ thành <span style="--i:N"> cho từng ký tự */
.fx-wave span {
    display: inline-block;
    animation: fx-wave 1.2s ease-in-out infinite;
    animation-delay: calc(var(--i) * .07s)
}

@keyframes fx-wave {

    0%,
    60%,
    100% {
        transform: translateY(0)
    }

    30% {
        transform: translateY(-.4em)
    }
}


.fx-bounce {
    animation: fx-bounce 1s ease-in-out infinite
}

@keyframes fx-bounce {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-28px)
    }
}


.fx-pulse {
    animation: fx-pulse 1.6s ease-out infinite
}

@keyframes fx-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(43, 89, 255, .7)
    }

    100% {
        box-shadow: 0 0 0 22px rgba(43, 89, 255, 0)
    }
}


.fx-shake {
    animation: fx-shake 2.4s infinite
}

@keyframes fx-shake {

    0%,
    20%,
    100% {
        transform: translateX(0)
    }

    4%,
    12% {
        transform: translateX(-8px)
    }

    8%,
    16% {
        transform: translateX(8px)
    }
}


.fx-float {
    animation: fx-float 3.2s ease-in-out infinite
}

@keyframes fx-float {

    0%,
    100% {
        transform: translateY(0) rotate(0)
    }

    50% {
        transform: translateY(-14px) rotate(3deg)
    }
}


.fx-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fx-spin .8s linear infinite
}

@keyframes fx-spin {
    to {
        transform: rotate(360deg)
    }
}


.fx-btn {
    position: relative;
    overflow: hidden;
    padding: .8em 1.6em;
    border: 0;
    border-radius: 999px;
    background: #2b59ff;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform .25s, box-shadow .25s
}

.fx-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%);
    transform: translateX(-100%);
    transition: transform .6s
}

.fx-btn:hover,
.fx-btn:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(43, 89, 255, .5)
}

.fx-btn:hover::after,
.fx-btn:focus-visible::after {
    transform: translateX(100%)
}


.fx-flip {
    width: 150px;
    height: 96px;
    perspective: 600px
}

.fx-flip>div {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform .7s;
    transform-style: preserve-3d
}

.fx-flip:hover>div,
.fx-flip:focus-within>div {
    transform: rotateY(180deg)
}

.fx-flip b {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #2b59ff;
    backface-visibility: hidden
}

.fx-flip b:last-child {
    background: #ff5a4f;
    transform: rotateY(180deg)
}


.fx-skeleton {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, #2a3a5a 25%, #3d527d 50%, #2a3a5a 75%) 0 0/200% 100%;
    animation: fx-skel 1.4s linear infinite
}

@keyframes fx-skel {
    to {
        background-position: -200% 0
    }
}


/* Thanh tiến độ chạy theo cuộn trang (không cần JS) */
.fx-progress {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    right: 0;
    height: 4px;
    background: #ff5a4f;
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 10
}

@supports (animation-timeline:scroll()) {
    .fx-progress {
        animation: fx-progress linear both;
        animation-timeline: scroll()
    }
}

@keyframes fx-progress {
    to {
        transform: scaleX(1)
    }
}


/* Hiện dần khi phần tử cuộn vào màn hình (không cần JS) */
@supports (animation-timeline:view()) {
    .fx-reveal {
        animation: fx-reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 80%
    }
}

@keyframes fx-reveal {
    from {
        opacity: 0;
        transform: translateY(40px)
    }
}

@keyframes fx-ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Hiệu ứng rơi tự do: sao rơi, lá rơi, tuyết rơi */
@keyframes fx-fall {
    0% { transform: translateY(-8vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(108vh) rotate(360deg); opacity: 0; }
}
.fx-fall { position: absolute; top: -6vh; pointer-events: none; animation: fx-fall 8s linear infinite; }

/* Hiệu ứng đung đưa nhẹ: cờ, lá cây, đèn lồng */
@keyframes fx-sway {
    0%, 100% { transform: rotate(-4deg); }
    50% { transform: rotate(4deg); }
}
.fx-sway { animation: fx-sway 3.2s ease-in-out infinite; transform-origin: top center; }

/* Hiệu ứng lấp lánh: ngôi sao, ánh đèn */
@keyframes fx-twinkle {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}
.fx-twinkle { animation: fx-twinkle 2s ease-in-out infinite; }

/* Xoay tròn liên tục: đĩa nhạc, icon loading */
@keyframes fx-spin-slow {
    to { transform: rotate(360deg); }
}
.fx-spin-slow { animation: fx-spin-slow 6s linear infinite; }

/* Loại bỏ nền trắng ảnh (xuyên thấu nền) */
.fx-remove-bg, .fx-blend-multiply {
    mix-blend-mode: multiply;
}