/* ============================================================
   GHZ FX VARIABLES — CSS variables + animation keyframes cho hệ
   thống hiệu ứng thời tiết. Tách khỏi theme-vars.css để dễ bật/tắt
   và không làm ảnh hưởng đến các theme hiện có.

   File này:
   - Khai báo CSS variables cho FX layer + brand accent.
   - Định nghĩa keyframes cho các hiệu ứng (rain, snow, stars, leaves,
     fireflies, bubbles, embers, confetti, dandelion, hanabi, drizzle).
   - Pause animation khi tab ẩn (Page Visibility).

   Không đụng đến theme-vars.css, theme-engine.js, index.html chỗ
   khác. Chỉ cần include file này 1 lần trong <head>.

   ------------------------------------------------------------
   2026-11-16 — TỐI ƯU HIỆU NĂNG (chống giật / lag)
   Nguyên nhân giật trước đây:
     1. keyframes dùng `width/height` (hanabi flare) ⇒ LAYOUT mỗi frame ⇒
        đây là nguyên nhân giật rõ nhất (reflow toàn trang).
     2. `will-change: transform, opacity` trên TẤT CẢ hạt ⇒ mỗi hạt 1
        compositor layer + 1 texture riêng. Với 240 hạt là 240 draw call
        mỗi frame ⇒ vượt ngưỡng khiến browser phải hạ chất lượng layer
        (Chrome bắt đầu "fallback" về repaint) ⇒ giật.
     3. Nhiều `box-shadow` chồng (dandelion 9, hanabi 4) ⇒ texture layer
        nặng, rasterize tốn.
     4. `translateZ(0)` trên từng hạt ⇒ ép promote thêm 1 lần nữa (thừa).
   Cách sửa:
     - Hanabi flare: animate `width/height` → `transform: scaleY/scaleX`.
       ⇒ KHÔNG còn reflow, chỉ còn composite.
     - `will-change` chỉ khai báo đúng thuộc tính thực sự animate
       (`transform` cho hạt rơi/nổi, `transform, opacity` cho hạt nhấp nháy).
       Bỏ `translateZ(0)` thừa.
     - Dandelion: 9 box-shadow → 1 `repeating-conic-gradient` + mask
       (1 paint thay vì 9 lớp shadow).
     - Hanabi: 4 lớp glow → 2 lớp.
     - Chế độ "nhẹ" `html[data-fx-lite="1"]`: bỏ text-shadow tuyết, bỏ
       flare hanabi, bỏ glow nặng → texture nhỏ hơn, composite rẻ hơn.
   ============================================================ */

/* ============================================================
   ĐĂNG KÝ @property CHO BIẾN LỰC ĐẨY
   ------------------------------------------------------------
   2026-11-16 — MƯỢT: khai báo `--ghz-rx` / `--ghz-ry` bằng @property với
   syntax `<length>`.
   Lợi ích:
     • Browser biết trước kiểu dữ liệu ⇒ không phải re-parse token mỗi
       lần JS ghi ⇒ style recalc nhanh hơn đáng kể.
     • `inherits: false` ⇒ giá trị KHÔNG lan xuống hạt con (mỗi hạt
       là leaf node nên không ảnh hưởng, nhưng đảm bảo an toàn).
     • `initial-value: 0px` ⇒ hạt mới sinh ra mặc định offset = 0,
       không cần JS set thủ công.
   ============================================================ */
@property --ghz-rx {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}
@property --ghz-ry {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}

/* ===== FX LAYER ===== */
#ghz-fx-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    contain: strict;
}
#ghz-fx-layer > * { pointer-events: none; }

/* ============================================================
   REPEL — chế độ "Tránh tay"
   ------------------------------------------------------------
   2026-11-16 — SỬA LỖI "TRÁNH TAY KHÔNG HOẠT ĐỘNG"

   Lỗi cũ (3 nguyên nhân độc lập):
     1. `var(--ghz-rx)` nằm TRONG `@keyframes` ⇒ mỗi lần JS đổi giá trị,
        Chrome phải recompute keyframe và RESET tiến độ animation ⇒ hạt
        nhảy về đầu, hiệu ứng rung rắc. Ngoài ra chỉ 5/11 hiệu ứng có
        đọc `--ghz-rx` (rain, snow, leaf, confetti, drizzle) ⇒ stars,
        fireflies, bubbles, embers, dandelion, hanabi KHÔNG phản ứng.
     2. `--ghz-ry` (lực đẩy DỌC) được JS ghi ra nhưng KHÔNG keyframe nào
        đọc ⇒ hạt chỉ tránh tay theo chiều ngang.
     3. Chỉ nhét lực đẩy vào `transform` ⇒ không thể tách bạch khỏi
        animation rơi/nổi của hạt.

   Cách sửa: dùng CSS property `translate` RIÊNG BIỆT (không phải
   `transform`). Theo spec, `translate` được compose TRƯỚC `transform`:
       final = translate → rotate → scale → transform
   ⇒ lực đẩy luôn nằm trong không gian MÀN HÌNH, không bị xoay theo
   keyframe, và việc đổi giá trị KHÔNG restart animation (vì `translate`
   không nằm trong keyframe).
   Áp dụng cho MỌI hạt trong layer ⇒ mọi hiệu ứng đều tránh tay.
   ============================================================ */
#ghz-fx-layer > * {
    translate: var(--ghz-rx, 0px) var(--ghz-ry, 0px);
}

/* ============================================================
   MƯỢT NHẤT CHO CHẾ ĐỘ "TRÁNH TAY"
   ------------------------------------------------------------
   2026-11-16 — Bổ sung `translate` vào `will-change` cho mọi hạt.
   `translate` là property ĐỘC LẬP (không nằm trong @keyframes) nên khi
   JS đổi `--ghz-rx/--ghz-ry` mỗi frame, trình duyệt chỉ cần composite
   lại layer — KHÔNG style-recalc, KHÔNG layout, KHÔNG repaint texture.
   Nhờ đó chuyển động "tránh tay" chạy mượt ở 60fps kể cả khi có
   100+ hạt đang bị đẩy cùng lúc.
   ------------------------------------------------------------
   PHẢI khai báo `transform, translate` (không chỉ `translate`) vì rule
   này có ID ⇒ đè lên `will-change: transform` của từng class hạt.
   Nếu chỉ khai `translate` sẽ MẤT hint cho `transform` ⇒ animation
   rơi/nổi không còn được composite ⇒ mất mượt.
   Vẫn là 1 compositor layer mỗi hạt (không nhân đôi).
   ============================================================ */
#ghz-fx-layer > * {
    will-change: transform, translate;
}

/* pause animation khi tab ẩn (tiết kiệm pin trên di động) */
html[data-paused="true"] #ghz-fx-layer,
html[data-paused="true"] #ghz-fx-layer * {
    animation-play-state: paused !important;
}

/* reduce-motion: tự tắt animation cho user thiết bị yếu / accessibility */
@media (prefers-reduced-motion: reduce) {
    #ghz-fx-layer,
    #ghz-fx-layer * {
        animation: none !important;
    }
}

/* ============================================================
   CHẾ ĐỘ "NHẸ" (data-fx-lite="1")
   Bật tự động khi: thiết bị yếu, mobile, hoặc FPS thấp.
   Mục tiêu: giảm repaint/paint nhưng vẫn giữ cảm giác hiệu ứng.
   ============================================================ */
html[data-fx-lite="1"] .ghz-fx-snow-flake {
    text-shadow: none !important;
}
html[data-fx-lite="1"] .ghz-fx-star {
    box-shadow: none !important;
}
html[data-fx-lite="1"] .ghz-fx-firefly {
    box-shadow: 0 0 6px rgba(255,224,102,0.7) !important;
}
html[data-fx-lite="1"] .ghz-fx-ember {
    box-shadow: none !important;
}
html[data-fx-lite="1"] .ghz-fx-hanabi {
    box-shadow: 0 0 6px var(--star-color, #fff) !important;
}
html[data-fx-lite="1"] .ghz-fx-hanabi::before,
html[data-fx-lite="1"] .ghz-fx-hanabi::after {
    display: none !important;
}
html[data-fx-lite="1"] .ghz-fx-dandelion::after {
    display: none !important;
}
html[data-fx-lite="1"] .ghz-fx-bubble {
    background: rgba(255,255,255,0.25) !important;
}

/* ===== Rain ===== */
.ghz-fx-rain-drop {
    position: absolute;
    width: 2px;
    height: 18px;
    background: linear-gradient(180deg, rgba(180,210,255,0) 0%, rgba(180,210,255,0.85) 100%);
    border-radius: 2px;
    will-change: transform;
    animation: ghz-fx-rain-fall linear infinite;
}
@keyframes ghz-fx-rain-fall {
    0%   { transform: translate3d(0, -20px, 0); opacity: 0; }
    10%  { transform: translate3d(0, 5vh, 0); opacity: 1; }
    100% { transform: translate3d(0, 105vh, 0); opacity: 0.6; }
}

/* ===== Snow ===== */
.ghz-fx-snow-flake {
    position: absolute;
    color: #fff;
    text-shadow: 0 0 6px rgba(255,255,255,0.5);
    user-select: none;
    will-change: transform;
    animation: ghz-fx-snow-fall linear infinite;
}
@keyframes ghz-fx-snow-fall {
    0%   { transform: translate3d(0, -30px, 0) rotate(0deg); opacity: 0; }
    10%  { transform: translate3d(0, 8vh, 0) rotate(36deg); opacity: 1; }
    50%  { transform: translate3d(20px, 50vh, 0) rotate(180deg); }
    100% { transform: translate3d(-20px, 105vh, 0) rotate(360deg); opacity: 0.7; }
}

/* ===== Fog (slow drifting overlay) — REMOVED 2026-09-28 =====
|.ghz-fx-fog { ... } — đã xóa khỏi picker, không dùng nữa.
*/

/* ===== Stars (twinkling) ===== */
.ghz-fx-star {
    will-change: transform, opacity;
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255,255,255,0.8);
    animation: ghz-fx-star-twink ease-in-out infinite;
}
@keyframes ghz-fx-star-twink {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50%      { opacity: 1;   transform: scale(1.4); }
}

/* ===== Falling leaves ===== */
.ghz-fx-leaf {
    will-change: transform;
    position: absolute;
    font-size: 18px;
    user-select: none;
    animation: ghz-fx-leaf-fall linear infinite;
}
@keyframes ghz-fx-leaf-fall {
    0%   { transform: translate3d(0, -40px, 0) rotate(0deg); opacity: 0; }
    10%  { transform: translate3d(0, 8vh, 0) rotate(36deg); opacity: 1; }
    50%  { transform: translate3d(-30px, 50vh, 0) rotate(180deg); }
    100% { transform: translate3d(30px, 105vh, 0) rotate(360deg); opacity: 0.8; }
}

/* ===== Fireflies (floating glowing dots) ===== */
.ghz-fx-firefly {
    will-change: transform, opacity;
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffe066;
    border-radius: 50%;
    box-shadow:
        0 0 8px #ffe066,
        0 0 16px rgba(255,224,102,0.6);
    animation: ghz-fx-firefly-float ease-in-out infinite;
}
@keyframes ghz-fx-firefly-float {
    0%   { transform: translate(0, 0); opacity: 0; }
    20%  { opacity: 1; }
    50%  { transform: translate(60px, -40px); opacity: 0.8; }
    100% { transform: translate(-40px, 30px); opacity: 0; }
}

/* ===== Bubbles (rising) ===== */
.ghz-fx-bubble {
    will-change: transform, opacity;
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.7), rgba(255,255,255,0.1));
    border: 1px solid rgba(255,255,255,0.4);
    animation: ghz-fx-bubble-rise ease-in infinite;
}
@keyframes ghz-fx-bubble-rise {
    0%   { transform: translateY(0) translateX(0) scale(0.6); opacity: 0; }
    10%  { opacity: 0.8; }
    50%  { transform: translateY(-50vh) translateX(30px) scale(1); }
    100% { transform: translateY(-105vh) translateX(-20px) scale(0.5); opacity: 0; }
}

/* ===== Ember/sparks (rising warm dots) ===== */
.ghz-fx-ember {
    will-change: transform, opacity;
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fb923c;
    box-shadow: 0 0 8px rgba(251,146,60,0.8), 0 0 12px rgba(239,68,68,0.5);
    animation: ghz-fx-ember-rise linear infinite;
}
@keyframes ghz-fx-ember-rise {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translateY(-105vh) translateX(40px); opacity: 0; }
}

/* ============================================================
   FX PICKER UI — chip grid trong tab "Của tôi"
   ============================================================ */
.ghz-fx-picker-wrap {
    margin-top: 14px;
    padding: 16px;
    border-radius: 12px;
    background: var(--ghz-card-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--ghz-card-border, rgba(255,255,255,0.08));
    color: var(--ghz-text-primary, #f7fafc);
}
.ghz-fx-picker-wrap h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ghz-fx-picker-wrap h3::before {
    content: '';
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--ghz-brand-color, #00c37a);
}
.ghz-fx-picker-wrap p {
    font-size: 12px;
    color: var(--ghz-text-muted, #9ca3af);
    margin: 4px 0 12px;
}
.ghz-fx-current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0,195,122,0.12);
    border: 1px solid rgba(0,195,122,0.3);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ghz-brand-color, #00c37a);
}
.ghz-fx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.ghz-fx-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px;
    border-radius: 10px;
    background: var(--ghz-card-glass-bg, rgba(255,255,255,0.05));
    border: 1px solid var(--ghz-card-glass-border, rgba(255,255,255,0.10));
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
    text-align: center;
    color: var(--ghz-text-primary, #e5e7eb);
    font-size: 12px;
    font-weight: 500;
    user-select: none;
}
.ghz-fx-chip:hover {
    transform: translateY(-2px);
    background: var(--ghz-card-glass-bg-hover, rgba(255,255,255,0.10));
}
.ghz-fx-chip.selected {
    border-color: var(--ghz-brand-color, #00c37a);
    background: rgba(255,255,255,0.12);
    color: var(--ghz-text-primary, #f7fafc);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 0 0 4px var(--ghz-brand-color, #00c37a);
}
.ghz-fx-chip .ghz-fx-icon {
    font-size: 22px;
    line-height: 1;
}
.ghz-fx-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.ghz-fx-density {
    flex: 1 1 200px;
    max-width: 320px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}
.ghz-fx-density::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ghz-brand-color, #00c37a);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    cursor: pointer;
}
.ghz-fx-density::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ghz-brand-color, #00c37a);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    cursor: pointer;
}
.ghz-fx-reset {
    padding: 7px 14px;
    background: rgba(255,255,255,0.85) !important;
    border: 2px solid rgba(0,0,0,0.2) !important;
    color: #1f2937 !important;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all .15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.8);
}
.ghz-fx-reset:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.9);
}
.ghz-fx-density-val {
    display: inline-block;
    min-width: 30px;
    text-align: center;
    font-size: 12px;
    color: var(--ghz-text-muted, #9ca3af);
    font-weight: 600;
}
.ghz-fx-toolbar label {
    font-size: 12px;
    color: var(--ghz-text-secondary, #e2e8f0);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 2026-11-16 — Badge số hạt đang chạy */
.ghz-fx-particle-count {
    font-size: 11px;
    color: var(--ghz-text-muted, #9ca3af);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 0;
}

/* Toast thông báo (khi đổi FX) — dùng style riêng để không xung đột với toast hệ thống */
.ghz-fx-toast {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 10px 16px;
    background: rgba(20,20,20,0.92);
    color: #fff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
}
.ghz-fx-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   FX #10 — CONFETTI (pháo giấy màu) — CSS-only
   ============================================================ */
.ghz-fx-confetti {
    will-change: transform;
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 12px;
    background: #ef4444; /* mặc định — bị override inline */
    transform: translate3d(0, 0, 0);
    contain: layout paint style;
    animation: ghz-fx-confetti-fall 5s linear infinite;
}

/* Shapes */
.ghz-fx-confetti.ghz-fx-shape-circle {
    border-radius: 50%;
}
.ghz-fx-confetti.ghz-fx-shape-strip {
    width: 4px;
    height: 18px;
}

/* Foil gradients (≈33% particle) */
.ghz-fx-confetti.ghz-fx-foil-gold {
    background: linear-gradient(135deg,
        #fbbf24 0%, #fde047 50%, #fbbf24 100%);
}
.ghz-fx-confetti.ghz-fx-foil-silver {
    background: linear-gradient(135deg,
        #d1d5db 0%, #fafafa 50%, #d1d5db 100%);
}
.ghz-fx-confetti.ghz-fx-foil-pink {
    background: linear-gradient(135deg,
        #f472b6 0%, #fbcfe8 50%, #f472b6 100%);
}

/* Drift variants (trái / phải) */
.ghz-fx-confetti.ghz-fx-drift-left {
    animation-name: ghz-fx-confetti-fall-left;
}
.ghz-fx-confetti.ghz-fx-drift-right {
    animation-name: ghz-fx-confetti-fall-right;
}

/* Keyframes — chỉ rotate Z + translate để GPU nhẹ
   (lực đẩy "tránh tay" do `translate` property xử lý, KHÔNG nhét vào
   keyframe để tránh reset tiến độ animation) */
@keyframes ghz-fx-confetti-fall {
    0%   { transform: translate3d(0, -10vh, 0) rotate(0deg); }
    100% { transform: translate3d(0, 110vh, 0) rotate(720deg); }
}
@keyframes ghz-fx-confetti-fall-left {
    0%   { transform: translate3d(0, -10vh, 0) rotate(0deg); }
    100% { transform: translate3d(-25vw, 110vh, 0) rotate(720deg); }
}
@keyframes ghz-fx-confetti-fall-right {
    0%   { transform: translate3d(0, -10vh, 0) rotate(0deg); }
    100% { transform: translate3d(25vw, 110vh, 0) rotate(720deg); }
}

/* Pause animation khi tab ẩn */
html[data-paused="true"] .ghz-fx-confetti {
    animation-play-state: paused;
}
/* ============================================================
   DANDELION (#8) — hat bo cong anh troi bay len troi
   Tối ưu: 9 box-shadow (repaint rất nặng) → 1 repeating-conic-gradient
   (1 texture thay vì 9 lớp shadow).
   ============================================================ */
.ghz-fx-dandelion {
    will-change: transform, opacity;
    position: absolute;
    width: 12px;
    height: 12px;
    user-select: none;
    animation: ghz-fx-dandelion-drift linear infinite;
}
.ghz-fx-dandelion::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, #ffffff 0%, #ffffff 30%, transparent 70%);
    border-radius: 50%;
}
.ghz-fx-dandelion::after {
    /* Tia tua trang quanh hat — dùng 1 conic-gradient thay vì 9 box-shadow */
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 11px; height: 11px;
    background: repeating-conic-gradient(
        from 0deg,
        rgba(255,255,255,0.95) 0deg 3deg,
        transparent 3deg 45deg
    );
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    -webkit-mask-image: radial-gradient(circle, transparent 0 22%, #000 30% 50%, transparent 58%);
    mask-image: radial-gradient(circle, transparent 0 22%, #000 30% 50%, transparent 58%);
}
@keyframes ghz-fx-dandelion-drift {
    0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.9; }
    50%  { transform: translateY(-40vh) translateX(50px) rotate(180deg); }
    100% { transform: translateY(-105vh) translateX(-30px) rotate(360deg); opacity: 0.7; }
}
html[data-paused="true"] .ghz-fx-dandelion {
    animation-play-state: paused;
}

/* ============================================================
   HANABI (#12) — sao cross-flare cao cap
   Tối ưu:
     - Flare dùng `scaleY/scaleX` thay vì `height/width` (KHÔNG còn layout
       mỗi frame — đây là nguyên nhân giật rõ nhất của hiệu ứng này).
     - Giảm box-shadow từ 4 lớp xuống 2 lớp.
   ============================================================ */
.ghz-fx-hanabi {
    will-change: transform, opacity;
    position: absolute;
    width: 4px; height: 4px;
    background: var(--star-color, #fff);
    border-radius: 50%;
    animation: ghz-fx-hanabi-twink ease-in-out infinite;
    box-shadow:
        0 0 6px var(--star-color, #fff),
        0 0 16px var(--star-color, #fff);
}
.ghz-fx-hanabi::before,
.ghz-fx-hanabi::after {
    content: '';
    position: absolute;
    background: linear-gradient(0deg, transparent 0%, var(--star-color, #fff) 50%, transparent 100%);
}
.ghz-fx-hanabi::before {
    left: 50%; top: -16px;
    width: 1px; height: 32px;
    transform: translateX(-50%);
    animation: ghz-fx-hanabi-flare-y ease-in-out infinite;
}
.ghz-fx-hanabi::after {
    top: 50%; left: -16px;
    width: 32px; height: 1px;
    transform: translateY(-50%);
    animation: ghz-fx-hanabi-flare-x ease-in-out infinite;
}
/* Flare chỉ animate transform (scale) → GPU friendly, KHÔNG reflow */
@keyframes ghz-fx-hanabi-flare-y {
    0%, 100% { opacity: 0;    transform: translateX(-50%) scaleY(0.18); }
    50%      { opacity: 0.95; transform: translateX(-50%) scaleY(1.2); }
}
@keyframes ghz-fx-hanabi-flare-x {
    0%, 100% { opacity: 0;    transform: translateY(-50%) scaleX(0.18); }
    50%      { opacity: 0.95; transform: translateY(-50%) scaleX(1.2); }
}
@keyframes ghz-fx-hanabi-twink {
    0%, 100% { opacity: 0.15; transform: scale(0.4); }
    50%      { opacity: 1;    transform: scale(1.6); }
}
.ghz-fx-hanabi.major {
    width: 6px; height: 6px;
}
.ghz-fx-hanabi.major::before {
    top: -28px; height: 60px;
    background: linear-gradient(0deg, transparent 0%, var(--star-color, #fff) 50%, transparent 100%);
}
.ghz-fx-hanabi.major::after {
    left: -28px; width: 60px;
    background: linear-gradient(90deg, transparent 0%, var(--star-color, #fff) 50%, transparent 100%);
}
html[data-paused="true"] .ghz-fx-hanabi {
    animation-play-state: paused;
}

/* ============================================================
   LIGHT-RAIN (#13) — mua bui nhe, giot nho day, roi cham
   ============================================================ */
.ghz-fx-drizzle {
    will-change: transform;
    position: absolute;
    width: 1.5px; height: 12px;
    background: linear-gradient(180deg, transparent 0%, rgba(186,230,253,0.85) 100%);
    border-radius: 50%;
    animation: ghz-fx-drizzle-fall linear infinite;
}
@keyframes ghz-fx-drizzle-fall {
    0%   { transform: translate3d(0, -20px, 0); opacity: 0; }
    10%  { transform: translate3d(0, 8vh, 0); opacity: 1; }
    100% { transform: translate3d(10px, 105vh, 0); opacity: 0.6; }
}
html[data-paused="true"] .ghz-fx-drizzle {
    animation-play-state: paused;
}
/* ============================================================
   CONFETTI-LITE (#12) — engine rAF, particle pool
   CSS toi uu: chi translate + rotate, khong transition/opacity
   ============================================================ */
.ghz-fx-confetti-lite {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 12px;
    background: #ef4444; /* mac dinh */
    transform: translate3d(0, 0, 0);
    /* khong co transition/animation -> engine dieu khien qua JS */
}
.ghz-fx-confetti-lite.circle {
    border-radius: 50%;
}
.ghz-fx-confetti-lite.strip {
    width: 4px;
    height: 18px;
}
/* Foil: 4 gradient dinh san (giam gradient dynamic, nhe GPU) */
.ghz-fx-confetti-lite.foil-gold {
    background: linear-gradient(135deg, #fbbf24 0%, #fde047 50%, #fbbf24 100%);
}
.ghz-fx-confetti-lite.foil-silver {
    background: linear-gradient(135deg, #d1d5db 0%, #fafafa 50%, #d1d5db 100%);
}
.ghz-fx-confetti-lite.foil-pink {
    background: linear-gradient(135deg, #f472b6 0%, #fbcfe8 50%, #f472b6 100%);
}
.ghz-fx-confetti-lite.foil-blue {
    background: linear-gradient(135deg, #38bdf8 0%, #bae6fd 50%, #38bdf8 100%);
}
