/* 2026-11-08：附魔物品图片表面动效（js/cards.js enchFx）。原版卡面着色器按 _ENCHANTMENTSTATUS_<附魔> 叠加动态效果，
   只作用在每张卡的 _EnchantmentMask（物品轮廓）里；着色器本身无法还原，这里用它的原版贴图做遮罩内的滚动/闪烁叠层。 */
/* 容器不能有遮罩/z-index（否则自成合成组，里面的 screen/multiply 只和透明背景混合，深色底的贴图会变成黑块）；
   遮罩逐层加在 ::before / ::after / b 上，这样每层都直接和物品原画混合。 */
.ench-fx{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.ench-fx::before,.ench-fx::after,.ench-fx>b{-webkit-mask:var(--ench-mask) center/100% 100% no-repeat;mask:var(--ench-mask) center/100% 100% no-repeat;mask-mode:luminance}  /* 与 .card-art 的 object-fit:fill 对齐 */
.ench-fx.no-mask::before,.ench-fx.no-mask::after,.ench-fx.no-mask>b{-webkit-mask:radial-gradient(ellipse at 50% 55%,#000 30%,transparent 72%);mask:radial-gradient(ellipse at 50% 55%,#000 30%,transparent 72%);mask-mode:alpha}
.ench-fx::before,.ench-fx::after,.ench-fx b{content:"";position:absolute;inset:0;display:block}
@keyframes ench-up{to{background-position:0 -100%}}
@keyframes ench-drift{to{background-position:100% 50%}}
@keyframes ench-spin{to{transform:rotate(360deg)}}
@keyframes ench-pulse{50%{opacity:var(--p2,1)}}
@keyframes ench-twinkle{0%,100%{opacity:.15}50%{opacity:1}}
@keyframes ench-flicker{0%,100%{opacity:0}8%{opacity:1}12%{opacity:.2}16%{opacity:.9}24%{opacity:0}}
@keyframes ench-sweep{0%{transform:translateX(-120%) skewX(-18deg)}60%,100%{transform:translateX(160%) skewX(-18deg)}}
/* 冰寒 Icy：冰裂噪声缓移 + 冰晶闪烁，淡蓝 */
.ench-icy::before{background:url(assets/ui2/ench/IcyOverlayNoise.webp) 0 0/90% auto repeat,#7fd2ff;background-blend-mode:multiply;mix-blend-mode:screen;opacity:.55;animation:ench-drift 18s linear infinite}
.ench-icy::after{background:url(assets/ui2/ench/IcyShards_T.webp) 30% 20%/85% auto repeat;mix-blend-mode:screen;animation:ench-twinkle 2.2s ease-in-out infinite}
.ench-icy b{background:#a8e6ff;mix-blend-mode:soft-light;opacity:.45}
/* 黄金 Golden：金色调 + 中心光芒旋转 + 扫光 */
.ench-golden b{background:#ffc94a;mix-blend-mode:color;opacity:.45}
.ench-golden::before{background:url(assets/ui2/ench/Golden_FXFlare.webp) center/90% auto no-repeat;mix-blend-mode:screen;opacity:.55;animation:ench-spin 12s linear infinite}
.ench-golden::after{background:linear-gradient(90deg,transparent,#fff4c066 45%,#ffffffaa 50%,#fff4c066 55%,transparent);mix-blend-mode:screen;animation:ench-sweep 3.2s ease-in-out infinite}
/* 辉耀 Radiant（原版 PRISMATIC）：彩虹流纹 + 彩虹环旋转 */
.ench-radiant::before{background:url(assets/ui2/ench/PrismaticNoise.webp) 0 0/120% auto repeat;mix-blend-mode:color-dodge;opacity:.35;animation:ench-drift 9s linear infinite}
.ench-radiant::after{background:url(assets/ui2/ench/PrismaticRainbow.webp) center/110% auto no-repeat;mix-blend-mode:screen;opacity:.5;animation:ench-spin 7s linear infinite}
.ench-radiant b{background:url(assets/ui2/ench/Prismatic_Flares.webp) center/100% auto no-repeat;mix-blend-mode:screen;animation:ench-twinkle 3s ease-in-out infinite}
/* 闪亮 Shiny（原版 DAZZLING）：流光 + 星光闪烁（GlintsMask 是着色器内部用的遮罩，不直接显示） */
.ench-shiny::before{background:url(assets/ui2/ench/Shiny_Noise.webp) 0 0/140% auto repeat;mix-blend-mode:soft-light;opacity:.45;animation:ench-drift 8s linear infinite}
.ench-shiny::after{background:url(assets/ui2/ench/Stars_Plated_T.webp) 0 0/80% auto repeat;mix-blend-mode:screen;animation:ench-twinkle 1.3s ease-in-out infinite}
.ench-shiny b{background:url(assets/ui2/ench/ShinyStar_T.webp) 70% 25%/45% auto no-repeat;mix-blend-mode:screen;animation:ench-twinkle 2.1s ease-in-out infinite .6s}
/* 剧毒 Toxic：绿色烟雾上卷 */
.ench-toxic::before{background:url(assets/ui2/ench/Shared_Smoke_T.webp) 0 0/90% auto repeat,#4dff3a;background-blend-mode:multiply;mix-blend-mode:screen;opacity:.3;animation:ench-up 5s linear infinite}
.ench-toxic::after{background:url(assets/ui2/ench/FX_Noise_55.webp) 0 0/70% auto repeat,#2fbf1a;background-blend-mode:multiply;mix-blend-mode:screen;opacity:.12;animation:ench-drift 11s linear infinite}
/* 黑曜石 Obsidian：暗紫裂纹覆盖 + 冷光扫过 */
.ench-obsidian b{background:url(assets/ui2/ench/ObsidianOverlay_T.webp) 0 0/90% auto repeat,#3a1f5a;background-blend-mode:multiply;mix-blend-mode:multiply;opacity:.55}
.ench-obsidian::before{background:url(assets/ui2/ench/ObsidianOverlay_T.webp) 0 0/90% auto repeat;mix-blend-mode:screen;opacity:.35;animation:ench-drift 16s linear infinite}
.ench-obsidian::after{background:linear-gradient(90deg,transparent,#c9a8ff88 50%,transparent);mix-blend-mode:screen;animation:ench-sweep 4s ease-in-out infinite}
/* 护盾 Shielded（原版 TEMPERED）：金色菱形晶格 + 扫光 */
.ench-shielded::before{background:url(assets/ui2/ench/FX_ShieldOverlay_T.webp) 0 0/40% auto repeat,#ffd76a;background-blend-mode:multiply;mix-blend-mode:screen;opacity:.1}
.ench-shielded::after{background:linear-gradient(90deg,transparent,#fff1b0aa 50%,transparent);mix-blend-mode:screen;animation:ench-sweep 2.8s ease-in-out infinite}
/* 沉重 Heavy：金属灰调 + 沉缓光泽 */
.ench-heavy b{background:#7a8290;mix-blend-mode:color;opacity:.4}
.ench-heavy::before{background:url(assets/ui2/ench/FX_Noise_59_T.webp) 0 0/80% auto repeat;mix-blend-mode:overlay;opacity:.5;animation:ench-drift 20s linear infinite}
.ench-heavy::after{background:linear-gradient(90deg,transparent,#e8eef8aa 50%,transparent);mix-blend-mode:screen;animation:ench-sweep 5s ease-in-out infinite}
/* 苔藓 Mossy：苔绿纹理 + 外缘绿光 */
.ench-mossy b{background:url(assets/ui2/ench/Mossy_Noise.webp) 0 0/70% auto repeat;mix-blend-mode:overlay;opacity:.55}
.ench-mossy::before{background:url(assets/ui2/ench/Mossy_OuterFlare.webp) center/100% 100% no-repeat,#8dff5a;background-blend-mode:multiply;mix-blend-mode:screen;opacity:.5;animation:ench-pulse 2.4s ease-in-out infinite;--p2:.25}
@media (prefers-reduced-motion:reduce){.ench-fx,.ench-fx::before,.ench-fx::after,.ench-fx b{animation:none!important}}

/* ---------- 2026-11-08 重做：烈焰 / 致命 / 恢复 / 疾速 —— 不再整体染色，保留物品原画，效果集中在轮廓边缘与少量动态点缀 ---------- */
/* 轮廓边光：tools/build_enchant_fx.py 预先算好的轮廓边带（遮罩 − 腐蚀后的遮罩）做遮罩 */
.ench-rim{--rim:#ff8a2a}
.ench-fiery::before,.ench-deadly::before,.ench-restorative::before,.ench-turbo::before{
  background:var(--rim);mix-blend-mode:screen;
  -webkit-mask:var(--ench-rim) center/100% 100% no-repeat;mask:var(--ench-rim) center/100% 100% no-repeat;mask-mode:luminance}
.ench-fx.no-mask::before{-webkit-mask:radial-gradient(ellipse at 50% 55%,transparent 38%,#000 55%,transparent 72%);mask:radial-gradient(ellipse at 50% 55%,transparent 38%,#000 55%,transparent 72%);mask-mode:alpha}
@keyframes ench-breathe{0%,100%{opacity:var(--o1,.35)}50%{opacity:var(--o2,.85)}}
@keyframes ench-rise{0%{transform:translateY(20%);opacity:0}15%{opacity:1}100%{transform:translateY(-70%);opacity:0}}
/* 烈焰 Fiery：橙金边光 + 底部火舌（原版 FireNoise 作遮罩上卷）+ 稀疏火星上浮 */
.ench-fiery::before{--rim:linear-gradient(to top,#ffb347,#ff7a1a 55%,#e8481a);--o1:.35;--o2:.75;animation:ench-breathe 1.8s ease-in-out infinite}
.ench-fiery::after{left:6%;right:6%;top:auto;bottom:-4%;height:42%;background:url(assets/ui2/sockets/fire_3x3.webp) 0 0/300% 300% no-repeat;filter:sepia(1) saturate(5) hue-rotate(-18deg) brightness(1.05);mix-blend-mode:screen;opacity:.9;animation:sk-fire-x .45s steps(3) infinite,sk-fire-y 1.35s steps(3) infinite}
.ench-fiery b::before{content:"";position:absolute;left:-30%;right:52%;bottom:-6%;height:34%;background:url(assets/ui2/sockets/fire_3x3.webp) 0 0/300% 300% no-repeat;filter:sepia(1) saturate(5) hue-rotate(-18deg) brightness(1.05);mix-blend-mode:screen;opacity:.7;animation:sk-fire-x .5s steps(3) infinite .2s,sk-fire-y 1.5s steps(3) infinite .4s}
.ench-fiery b::after{content:"";position:absolute;left:52%;right:-30%;bottom:-6%;height:30%;background:url(assets/ui2/sockets/fire_3x3.webp) 0 0/300% 300% no-repeat;filter:sepia(1) saturate(5) hue-rotate(-18deg) brightness(1.05);mix-blend-mode:screen;opacity:.7;animation:sk-fire-x .55s steps(3) infinite .1s,sk-fire-y 1.65s steps(3) infinite .7s}
@keyframes sk-fire-x{from{background-position-x:0}to{background-position-x:150%}}
@keyframes sk-fire-y{from{background-position-y:0}to{background-position-y:150%}}
.ench-fiery b{background:radial-gradient(circle,#fff3c0 0,#ffb13a 35%,transparent 60%) 22% 92%/7% 5% no-repeat,radial-gradient(circle,#fff3c0 0,#ff9a2a 35%,transparent 60%) 64% 96%/5% 4% no-repeat,radial-gradient(circle,#fff3c0 0,#ffb13a 35%,transparent 60%) 46% 100%/6% 4.5% no-repeat;
  mix-blend-mode:screen;animation:ench-rise 2.4s ease-out infinite}
/* 致命 Deadly（原版 DANGEROUS）：暗红边光心跳式脉动 + 边缘轻微压暗 */
.ench-deadly::before{--rim:#d40c2a;mix-blend-mode:normal;animation:ench-heart 1.6s ease-in-out infinite}
@keyframes ench-heart{0%,100%{opacity:.3}12%{opacity:.8}24%{opacity:.4}36%{opacity:.7}60%{opacity:.3}}
.ench-deadly::after{background:radial-gradient(ellipse at 50% 50%,transparent 55%,#3a0008 100%);mix-blend-mode:multiply;opacity:.45}
/* 恢复 Restorative：柔和绿色边光呼吸 + 三个小治疗十字缓缓上浮淡出（原版 RestorativeHeart） */
.ench-restorative::before{--rim:#4ee87a;--o1:.25;--o2:.6;animation:ench-breathe 2.8s ease-in-out infinite}
.ench-restorative::after,.ench-restorative b{background:url(assets/ui2/ench/RestorativeHeart_T.webp) 22% 82%/26% auto no-repeat,url(assets/ui2/ench/RestorativeHeart_T.webp) 76% 94%/20% auto no-repeat;
  filter:contrast(1.8) hue-rotate(-170deg) saturate(1.3) brightness(1.4);mix-blend-mode:screen;animation:ench-rise 3.2s ease-out infinite}
.ench-restorative b{background:url(assets/ui2/ench/RestorativeHeart_T.webp) 50% 100%/22% auto no-repeat;animation-delay:1.6s}
/* 疾速 Turbo：青色边光快闪 + 细速度线掠过 + 偶尔一道小闪电 */
.ench-turbo::before{--rim:#3cc8ff;--o1:.3;--o2:.7;animation:ench-breathe .9s ease-in-out infinite}
.ench-turbo::after{background:repeating-linear-gradient(115deg,transparent 0 16px,#bff0ff 16px 17px,transparent 17px 40px);mix-blend-mode:screen;opacity:.22;animation:ench-streak .7s linear infinite}
@keyframes ench-streak{to{background-position:-60px 0}}
.ench-turbo b{background:url(assets/ui2/ench/Turbo_Lightning.webp) 60% 40%/70% auto no-repeat;opacity:.6;mix-blend-mode:screen;animation:ench-flicker 2.6s steps(1) infinite}
