/* ================= DM Tavern — reworked effects ================= */
.fx .rx { position: absolute; left: 0; top: 0; pointer-events: none; }
.fx .rx svg { width: 100%; height: 100%; display: block; overflow: visible; }
@keyframes rxBlast { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes rxRing { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(4.5); opacity: 0; } }
@keyframes rxSpin { to { transform: rotate(360deg); } }
@keyframes rxSparkPop { 0% { transform: scale(0) rotate(0); opacity: 1; } 40% { transform: scale(1) rotate(45deg); opacity: 1; } 100% { transform: scale(.2) rotate(90deg); opacity: 0; } }
@keyframes rxFireBall { 0% { transform: scale(.3); opacity: 1; filter: brightness(1.6); } 35% { transform: scale(1.15) translateY(-6px); opacity: 1; } 100% { transform: scale(1.5) translateY(-34px); opacity: 0; filter: brightness(.6) saturate(.6); } }
@keyframes rxCool { 0% { opacity: 0; transform: scale(.4); } 8% { opacity: 1; transform: scale(1); } 55% { opacity: 1; filter: none; } 75% { filter: saturate(.15) brightness(.55); } 100% { opacity: 0; filter: saturate(0) brightness(.4); } }

/* Meteor swarm */
.fx .met { width: 0; height: 0; }
.met-rock { position: absolute; left: calc(-9px * var(--s)); top: calc(-9px * var(--s)); width: calc(18px * var(--s)); height: calc(18px * var(--s)); border-radius: 46% 54% 50% 50%;
  background: radial-gradient(circle at 62% 40%, #fff3c0 0 12%, #ffb03a 26%, #8a3a12 52%, #3a1a0c 76%);
  box-shadow: 0 0 calc(12px * var(--s)) calc(5px * var(--s)) rgba(255,150,50,.85), 0 0 calc(30px * var(--s)) calc(12px * var(--s)) rgba(255,80,20,.45); animation: rxSpin .45s linear infinite; }
.met-tail { position: absolute; left: calc(-172px * var(--s)); top: calc(-8px * var(--s)); width: calc(176px * var(--s)); height: calc(16px * var(--s));
  background: linear-gradient(90deg, transparent, rgba(255,70,20,.35) 30%, rgba(255,150,40,.85) 75%, #fff2c0); filter: blur(1.5px); clip-path: polygon(0 46%, 100% 0, 100% 100%, 0 54%); }
.met-smoke { position: absolute; left: calc(-300px * var(--s)); top: calc(-13px * var(--s)); width: calc(292px * var(--s)); height: calc(26px * var(--s));
  background: linear-gradient(90deg, transparent, rgba(80,60,50,.3) 60%, rgba(60,40,30,.55)); filter: blur(5px); clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%); }
.fx .met-hit { width: 0; height: 0; }
.met-hit > * { position: absolute; left: 0; top: 0; }
.met-crater { width: calc(74px * var(--s)); height: calc(28px * var(--s)); margin: calc(-14px * var(--s)) 0 0 calc(-37px * var(--s)); border-radius: 50%;
  background: radial-gradient(ellipse, #160804 0 34%, rgba(255,110,30,.9) 46%, rgba(90,30,10,.7) 60%, transparent 72%); animation: rxCool 3.2s ease-out forwards; }
.met-flash { width: calc(150px * var(--s)); height: calc(150px * var(--s)); margin: calc(-75px * var(--s)); border-radius: 50%; background: radial-gradient(circle, #fff, #ffe08a 25%, rgba(255,140,40,.5) 45%, transparent 70%); animation: rxBlast .5s ease-out forwards; }
.met-ring { width: calc(56px * var(--s)); height: calc(56px * var(--s)); margin: calc(-28px * var(--s)); border-radius: 50%; border: 3px solid rgba(255,210,140,.9); box-shadow: 0 0 12px rgba(255,140,40,.7); animation: rxRing .65s ease-out forwards; }
.met-fire { width: calc(84px * var(--s)); height: calc(84px * var(--s)); margin: calc(-50px * var(--s)) 0 0 calc(-42px * var(--s)); border-radius: 50%;
  background: radial-gradient(circle, #fff6c8 0 10%, #ffb02e 28%, #ff5a1f 50%, rgba(120,30,10,.6) 65%, transparent 72%); animation: rxFireBall .95s ease-out forwards; }
.met-fire.two { margin-left: calc(-10px * var(--s)); width: calc(56px * var(--s)); height: calc(56px * var(--s)); animation-delay: .1s; opacity: 0; }
.met-debris { width: 7px; height: 6px; margin: -3px; background: linear-gradient(135deg, #7a6050, #2a1a10); clip-path: polygon(10% 0, 100% 25%, 80% 100%, 0 70%); }
.met-ember { width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #ffd27a; box-shadow: 0 0 6px 2px rgba(255,120,30,.8); }

/* Gelatinous cube */
.fx .gc { width: 0; height: 0; }
.gc-shadow { position: absolute; left: -70px; top: 52px; width: 140px; height: 22px; border-radius: 50%; background: radial-gradient(ellipse, rgba(20,60,20,.55), transparent 70%); filter: blur(2px); }
.gc-wob { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; perspective: 700px; transform-origin: 50% 100%; }
.gc-3d { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-14deg) rotateY(26deg); }
.gc-3d .f { position: absolute; inset: 0; border-radius: 12px; border: 1.5px solid rgba(210,255,190,.55); background: linear-gradient(135deg, rgba(190,255,170,.28), rgba(70,170,60,.18)); box-shadow: inset 0 0 26px rgba(170,255,140,.35); }
.gc-3d .fr { transform: translateZ(60px); } .gc-3d .bk { transform: rotateY(180deg) translateZ(60px); }
.gc-3d .lf { transform: rotateY(-90deg) translateZ(60px); } .gc-3d .rt { transform: rotateY(90deg) translateZ(60px); }
.gc-3d .tp { transform: rotateX(90deg) translateZ(60px); background: linear-gradient(135deg, rgba(225,255,205,.45), rgba(120,210,100,.25)); }
.gc-3d .bt { transform: rotateX(-90deg) translateZ(60px); background: rgba(40,110,40,.35); }
.gc-3d .fr::after { content: ""; position: absolute; inset: 6px; border-radius: 8px; background: linear-gradient(120deg, rgba(255,255,255,.4) 0 14%, transparent 26%); }
.gc-in { position: absolute; inset: 0; transform: translateZ(0); }
.gc-in > * { position: absolute; }
.gc-skull { left: 26px; top: 56px; width: 30px; height: 30px; transform: rotate(-18deg); opacity: .8; animation: gcFloat 3s ease-in-out infinite; }
.gc-skull svg, .gc-sword svg { width: 100%; height: 100%; display: block; }
.gc-sword { left: 50px; top: 28px; width: 52px; height: 10px; transform: rotate(32deg); opacity: .8; }
.gc-coin { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, #d8a83a 55%, #8a6414); }
.gc-coin.c1 { left: 70px; top: 82px; } .gc-coin.c2 { left: 22px; top: 30px; } .gc-coin.c3 { left: 86px; top: 58px; transform: scaleX(.5); }
.gc-bub { width: 6px; height: 6px; border-radius: 50%; border: 1px solid rgba(225,255,215,.75); animation: gcBub 2.4s ease-in infinite; }
.gc-bub.b1 { left: 40px; top: 96px; } .gc-bub.b2 { left: 76px; top: 100px; animation-delay: .8s; } .gc-bub.b3 { left: 58px; top: 92px; animation-delay: 1.5s; }
@keyframes gcBub { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-80px); opacity: 0; } }
@keyframes gcFloat { 50% { transform: rotate(-10deg) translateY(-4px); } }
.gc-orb { width: 16px; height: 16px; margin: -8px; border-radius: 50%; background: radial-gradient(circle, #fff, #ffe39a 40%, #ffb02e); box-shadow: 0 0 14px 4px rgba(255,210,90,.7); animation: pulse 1s ease-in-out infinite; }
.gc-orb.eaten { animation: gcEaten .35s ease-in forwards; }
@keyframes gcEaten { to { transform: translateY(-20px) scale(.3); opacity: 0; } }
.gc-orb-in { left: 52px; top: 52px; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle, #fff, #ffe39a 40%, #ffb02e); box-shadow: 0 0 14px 4px rgba(255,210,90,.6); opacity: 0; }
.gc.full .gc-orb-in { animation: gcDissolve 2.4s ease forwards; }
@keyframes gcDissolve { 0% { opacity: 1; transform: translateY(10px) scale(.8); } 40% { opacity: 1; transform: translateY(-6px) scale(1); } 100% { opacity: 0; transform: translateY(-14px) scale(.4); filter: hue-rotate(60deg); } }
.gc-slime { left: -170px; top: 52px; width: 340px; height: 14px; border-radius: 50%; background: radial-gradient(ellipse, rgba(170,255,140,.55), rgba(90,200,70,.25) 55%, transparent 72%); opacity: 0; animation: gcSlime 3.9s ease forwards; }
@keyframes gcSlime { 0%, 30% { opacity: 0; } 42% { opacity: .75; } 75% { opacity: .55; } 100% { opacity: 0; } }

/* Starfall */
.fx .sf-star { width: 0; height: 0; }
.sf-tail { position: absolute; left: -130px; top: -1.5px; width: 130px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(180,200,255,.5) 50%, #fff6d8); filter: drop-shadow(0 0 4px rgba(200,220,255,.9)); }
.sf-star.big .sf-tail { left: -200px; width: 200px; height: 5px; top: -2.5px; background: linear-gradient(90deg, transparent, rgba(255,220,140,.5) 50%, #fff6d8); }
.sf-head { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; color: #fffbe8; filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 12px #9fc4ff); animation: rxSpin .6s linear infinite; }
.sf-star.big .sf-head { left: -15px; top: -15px; width: 30px; height: 30px; color: #fff3b0; filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 18px #ffd24a); }
.fx .sf-land { width: 0; height: 0; }
.sf-land > * { position: absolute; left: 0; top: 0; }
.sf-spark { width: 42px; height: 42px; margin: -21px; color: #fffbe0; filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 14px #9fc4ff); animation: rxSparkPop .7s ease-out forwards; }
.sf-spark.big { width: 96px; height: 96px; margin: -48px; color: #fff3b0; filter: drop-shadow(0 0 12px #fff) drop-shadow(0 0 22px #ffd24a); animation-duration: .9s; }
.sf-mini { width: 8px; height: 8px; margin: -4px; color: #e6efff; filter: drop-shadow(0 0 3px #fff); }
.sf-ring { width: 40px; height: 40px; margin: -20px; border-radius: 50%; border: 2px solid rgba(255,240,190,.9); box-shadow: 0 0 14px rgba(255,220,140,.7); animation: rxRing .8s ease-out forwards; }
.sf-glow { width: 150px; height: 150px; margin: -75px; border-radius: 50%; background: radial-gradient(circle, rgba(255,240,190,.55), transparent 65%); animation: rxBlast 1.2s ease-out forwards; }
.sf-twinkle { width: 12px; height: 12px; margin: -6px; color: #fff6d0; filter: drop-shadow(0 0 4px #ffe39a); opacity: 0; animation: sfTwinkle 1.2s ease both; }
@keyframes sfTwinkle { 0% { transform: scale(0); opacity: 1; } 30% { transform: scale(1) rotate(45deg); opacity: 1; } 55% { transform: scale(.4) rotate(60deg); } 75% { transform: scale(1) rotate(90deg); opacity: 1; } 100% { transform: scale(0) rotate(120deg); opacity: 0; } }

/* Dragon's breath */
.db-mouth { width: 90px; height: 90px; margin: -45px; border-radius: 50%; background: radial-gradient(circle, rgba(255,240,180,.9), rgba(255,140,40,.55) 40%, transparent 70%); animation: dbMouth .9s ease-out forwards; }
@keyframes dbMouth { 0% { opacity: 0; transform: scale(.5); } 15% { opacity: 1; transform: scale(1.1); } 70% { opacity: .8; transform: scale(1); } 100% { opacity: 0; } }
.db-puff { width: var(--sz); height: var(--sz); margin: calc(var(--sz) / -2); border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(circle, #fff6c8 0 12%, #ffc23a 30%, #ff6a1f 52%, rgba(200,40,10,.55) 66%, transparent 72%); will-change: transform, opacity; contain: strict; }
.fx .db-hit { width: 0; height: 0; }
.db-hit > * { position: absolute; left: 0; top: 0; }
.db-burst { width: 160px; height: 160px; margin: -96px 0 0 -80px; border-radius: 50%; background: radial-gradient(circle, #fff6c8 0 8%, #ffb02e 26%, #ff5a1f 48%, rgba(120,30,10,.55) 64%, transparent 72%); animation: rxFireBall 1.1s ease-out forwards; }
.db-scorch { width: 120px; height: 42px; margin: -21px 0 0 -60px; border-radius: 50%; background: radial-gradient(ellipse, #140602 0 30%, rgba(255,100,30,.8) 44%, rgba(80,24,8,.6) 58%, transparent 72%); animation: rxCool 2.4s ease-out forwards; }
.db-ember { width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #ffd27a; box-shadow: 0 0 6px 2px rgba(255,120,30,.8); }
.db-smoke { width: 34px; height: 34px; margin: -17px; border-radius: 50%; background: radial-gradient(circle, rgba(70,60,56,.55), transparent 70%); filter: blur(3px); }

/* Magic missile */
.mm-sigil { width: 64px; height: 64px; margin: -32px; filter: drop-shadow(0 0 6px #a070ff) drop-shadow(0 0 12px #6a2aff); animation: mmSigil 1.15s ease-out forwards; }
@keyframes mmSigil { 0% { transform: scale(0) rotate(0); opacity: 0; } 25% { transform: scale(1) rotate(60deg); opacity: 1; } 75% { opacity: 1; } 100% { transform: scale(1.2) rotate(180deg); opacity: 0; } }
.mm-dart { width: 28px; height: 8px; margin: -4px 0 0 -24px; border-radius: 40% 60% 60% 40% / 50%; background: linear-gradient(90deg, rgba(170,120,255,0), #b890ff 40%, #f4ecff 80%, #fff);
  box-shadow: 0 0 10px 3px rgba(170,120,255,.85), 0 0 22px 6px rgba(120,60,255,.45); }
.mm-ghost { width: calc(24px - var(--g) * 3px); height: 6px; margin: -3px 0 0 -20px; border-radius: 50%; background: rgba(185,145,255,.85); filter: blur(calc(var(--g) * .7px)); }
.fx .mm-hit { width: 0; height: 0; }
.mm-hit > * { position: absolute; left: 0; top: 0; }
.mm-ring { width: 22px; height: 22px; margin: -11px; border-radius: 50%; border: 2px solid #d8c0ff; box-shadow: 0 0 10px #a070ff; animation: rxRing .45s ease-out forwards; }
.mm-flash { width: 64px; height: 64px; margin: -32px; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(190,150,255,.7) 35%, transparent 70%); animation: rxBlast .4s ease-out forwards; }
.mm-spark { width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #f0e6ff; box-shadow: 0 0 6px 2px rgba(170,120,255,.9); }

/* Coin flip */
.fx .cf2 { width: 0; height: 0; }
.cf2-shadow { position: absolute; left: -18px; top: 18px; width: 36px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.6); filter: blur(2px); }
.cf2-arc { position: absolute; left: -21px; top: -21px; width: 42px; height: 42px; perspective: 300px; }
.cf2-spin { position: absolute; inset: 0; transform-style: preserve-3d; }
.cf2-face, .cf2-edge { position: absolute; inset: 0; border-radius: 50%; }
.cf2-edge { background: linear-gradient(90deg, #7a5410, #c89a3a 50%, #7a5410); transform: translateZ(var(--z)); }
.cf2-face { backface-visibility: hidden; overflow: hidden; background: radial-gradient(circle at 35% 30%, #fff5c0, #e8be52 45%, #b8862a 75%, #8a6414);
  box-shadow: inset 0 0 0 2px #f6dc8a, inset 0 0 0 3.5px #9a7014, inset -2px -3px 6px rgba(90,50,0,.5); }
.cf2-face.front { transform: translateZ(2.2px); } .cf2-face.back { transform: rotateX(180deg) translateZ(2.2px); }
.cf2-face svg { width: 100%; height: 100%; display: block; }
.cf2-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.75) 48%, transparent 60%) 120% 0 / 250% 100% no-repeat; animation: cfGlint 1s ease 1.45s; }
@keyframes cfGlint { from { background-position: 120% 0; } to { background-position: -40% 0; } }
.cf2-say { position: absolute; left: 0; top: 28px; white-space: nowrap; font: 700 16px var(--display); color: #ffe39a; text-shadow: 0 2px 4px #000, 0 0 10px rgba(255,200,80,.6); opacity: 0; animation: cfSay 1.1s ease 1.5s forwards; }
@keyframes cfSay { 0% { opacity: 0; transform: translate(-50%, 8px); } 20%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }

/* Sacred flame */
.fx .sf2-beam { top: auto; bottom: -6px; left: -38px; width: 76px; height: var(--h); transform-origin: 50% 0; filter: blur(3px);
  background: linear-gradient(180deg, rgba(255,250,220,0), rgba(255,236,160,.55) 35%, rgba(255,245,205,.92)); animation: sfBeam 1.6s ease-out forwards; }
.sf2-beam .core { position: absolute; left: 50%; top: 0; bottom: 0; width: 14px; margin-left: -7px; background: linear-gradient(180deg, transparent, #fff 60%); }
@keyframes sfBeam { 0% { transform: scaleY(0); opacity: 1; } 18% { transform: scaleY(1); } 60% { opacity: 1; transform: scaleY(1) scaleX(1); } 100% { transform: scaleY(1) scaleX(.12); opacity: 0; } }
.sf2-rays { width: 240px; height: 240px; margin: -120px; border-radius: 50%; background: repeating-conic-gradient(rgba(255,235,160,.4) 0 5deg, transparent 5deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 15%, transparent 68%); mask: radial-gradient(circle, #000 15%, transparent 68%); animation: sfRays 2s ease-out forwards; }
@keyframes sfRays { 0% { opacity: 0; transform: rotate(0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: rotate(50deg) scale(1.1); } }
.sf2-ring { width: 140px; height: 140px; margin: -70px; filter: drop-shadow(0 0 6px #ffd24a); animation: sfRing 2s ease-out forwards; }
@keyframes sfRing { 0% { transform: scaleY(.36) rotate(0) scale(.3); opacity: 0; } 15% { transform: scaleY(.36) rotate(20deg) scale(1); opacity: 1; } 75% { opacity: 1; } 100% { transform: scaleY(.36) rotate(100deg) scale(1.1); opacity: 0; } }
.sf2-flash { width: 170px; height: 170px; margin: -85px; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(255,240,180,.6) 30%, transparent 68%); opacity: 0; animation: rxBlast .6s ease-out .16s forwards; }
.sf2-tongue { width: var(--w); height: var(--h); margin: calc(var(--h) * -1) 0 0 calc(var(--w) / -2); border-radius: 50% 50% 40% 40% / 70% 70% 30% 30%; transform-origin: 50% 100%; opacity: 0;
  background: radial-gradient(ellipse at 50% 85%, #fff 0 22%, #ffe48a 45%, rgba(255,190,60,.7) 70%, transparent 76%); animation: sfTongue 1.3s ease-out var(--d) forwards; }
@keyframes sfTongue { 0% { transform: scaleY(0); opacity: 1; } 25% { transform: scaleY(1.1) skewX(6deg); opacity: 1; } 45% { transform: scaleY(.85) skewX(-5deg); } 65% { transform: scaleY(1) skewX(3deg); opacity: .9; } 100% { transform: scaleY(.2) translateY(-10px); opacity: 0; } }
.sf2-mote { width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #fff3c0; box-shadow: 0 0 6px 2px rgba(255,210,90,.8); }

/* Ray of frost */
.fx .rf2 { height: 0; transform-origin: 0 0; }
.rf2 > i { position: absolute; left: 0; width: 100%; transform-origin: 0 50%; animation: rfBeam 1.15s ease-out forwards; }
.rf2-glow { top: -10px; height: 20px; border-radius: 10px; background: linear-gradient(90deg, rgba(120,190,255,.15), rgba(150,215,255,.8)); filter: blur(5px); }
.rf2-swirl { top: -5px; height: 10px; border-radius: 5px; background: repeating-linear-gradient(115deg, transparent 0 10px, rgba(225,247,255,.85) 10px 13px, transparent 13px 22px);
  -webkit-mask: linear-gradient(90deg, transparent, #000 15%); mask: linear-gradient(90deg, transparent, #000 15%); animation: rfBeam 1.15s ease-out forwards, rfSwirl .22s linear infinite !important; }
.rf2-core { top: -1.5px; height: 3px; border-radius: 2px; background: #fff; box-shadow: 0 0 6px #fff, 0 0 14px #9fd4ff; }
@keyframes rfBeam { 0% { transform: scaleX(0); opacity: 1; } 14% { transform: scaleX(1); } 70% { opacity: 1; transform: scaleX(1) scaleY(1); } 100% { opacity: 0; transform: scaleX(1) scaleY(.2); } }
@keyframes rfSwirl { to { background-position: 22px 0; } }
.rf2-src { width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(160,215,255,.7) 35%, transparent 70%); animation: dbMouth 1s ease-out forwards; }
.rf2-mote { width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #eaf8ff; box-shadow: 0 0 5px #9fd4ff; font-size: 10px; line-height: 4px; color: #eaf8ff; }
.fx .rf2-star { width: 0; height: 0; }
.rf2-spike { position: absolute; left: -5px; top: calc(var(--l) * -1); width: 10px; height: var(--l); transform-origin: 50% 100%; transform: rotate(var(--r)) scaleY(0);
  background: linear-gradient(180deg, #fff, #cfeaff 40%, rgba(120,190,255,.75)); clip-path: polygon(50% 0, 100% 62%, 50% 100%, 0 62%); filter: drop-shadow(0 0 4px #9fd4ff); animation: rfSpike .3s ease-out .16s forwards; }
.rf2-spike.small { left: -3.5px; width: 7px; animation-delay: .26s; }
@keyframes rfSpike { to { transform: rotate(var(--r)) scaleY(1); } }
.rf2-star.shatter .rf2-spike { animation: rfShatter .45s ease-in forwards; }
@keyframes rfShatter { from { transform: rotate(var(--r)) scaleY(1); opacity: 1; } to { transform: rotate(var(--r)) translateY(-50px) scaleY(.4); opacity: 0; } }
.rf2-patch { width: 120px; height: 120px; margin: -60px; border-radius: 50%; background: radial-gradient(circle, rgba(235,248,255,.8), rgba(170,220,255,.45) 40%, transparent 68%), repeating-conic-gradient(rgba(255,255,255,.25) 0 4deg, transparent 4deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 40%, transparent 70%); mask: radial-gradient(circle, #000 40%, transparent 70%); animation: rfPatch 1.7s ease-out forwards; }
@keyframes rfPatch { 0%, 8% { transform: scale(0); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 62% { opacity: 1; } 100% { transform: scale(1.15); opacity: 0; } }
.rf2-shard { width: 8px; height: 10px; margin: -5px -4px; background: linear-gradient(180deg, #fff, #9fd4ff); clip-path: polygon(50% 0, 100% 100%, 0 80%); }

/* Thorn whip */
.fx .th2 { width: 0; height: 0; }
.fx .rx.th2 svg { width: 1px; height: 1px; overflow: visible; }
.th2-vine { fill: none; stroke: #2f5a1f; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.th2-shine { fill: none; stroke: #7ab84a; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 10 6; opacity: .85; }
.th2-crack { width: 60px; height: 60px; margin: -30px; color: #eaffd0; filter: drop-shadow(0 0 8px #9aff6a); animation: rxSparkPop .45s ease-out forwards; }
.th2-ring { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px; border-radius: 50%; border: 2px solid #b8ff8a; animation: rxRing .45s ease-out forwards; }
.th2-leaf { width: 12px; height: 7px; margin: -3.5px -6px; border-radius: 0 100% 0 100%; background: linear-gradient(135deg, #8ad85a, #2f7a2a); }

/* the dragon pets */
.pet .pet-body { position: relative; }
.pet.pet-drake { width: 60px; height: 45px; margin: -22px -30px; }
.pet-drake svg .pd-wn, .pet-drake svg .pd-wf, .pet-drake svg .pd-tail { transform-box: view-box; }
.pet-drake .pd-wn { transform-origin: 32px 23px; animation: pdFlap .3s ease-in-out infinite alternate; }
.pet-drake .pd-wf { transform-origin: 30px 22px; animation: pdFlap .3s ease-in-out infinite alternate -.1s; }
@keyframes pdFlap { from { transform: rotate(-8deg) scaleY(1); } to { transform: rotate(12deg) scaleY(-.45); } }
.pet-drake .pd-tail { transform-origin: 20px 34px; animation: pdTail 1.8s ease-in-out infinite; }
@keyframes pdTail { 50% { transform: rotate(-14deg); } }
.pet-drake.idle .pd-wn, .pet-drake.idle .pd-wf { animation-duration: .55s; }
.pet.wander.pet-drake .pd-wn, .pet.wander.pet-drake .pd-wf { animation: none; transform: rotate(-26deg) scaleY(.5); }
.pet.wander.pet-drake.cheer .pd-wn, .pet.wander.pet-drake.cheer .pd-wf { animation: pdFlap .18s ease-in-out infinite alternate; }
.pet-drake .pd-eye-shut { display: none; }
.pet-drake.asleep .pd-eye { display: none; } .pet-drake.asleep .pd-eye-shut { display: inline; }
.pet .pet-fire, .pet .pet-smoke { display: none; }
.pet-drake .pet-fire { display: block; position: absolute; left: 53px; top: 8px; width: 30px; height: 14px; border-radius: 40% 60% 60% 40% / 50%; transform-origin: 0 50%; transform: scaleX(0); opacity: 0;
  background: radial-gradient(ellipse at 0% 50%, #fff6c8, #ffb02e 40%, #ff5a1f 70%, transparent 76%); }
.pet-drake.cheer .pet-fire { animation: petFire .8s ease-out 2; }
@keyframes petFire { 0% { transform: scaleX(0); opacity: 1; } 40% { transform: scaleX(1.2); opacity: 1; } 100% { transform: scaleX(1.5) translateX(6px); opacity: 0; } }
.pet-drake .pet-smoke { display: block; position: absolute; left: 52px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: rgba(210,205,200,.75); opacity: 0; animation: petSmoke 4.6s ease-out infinite; }
.pet-drake .pet-smoke.two { left: 49px; animation-delay: .3s; }
.pet-drake.sad .pet-smoke { animation-duration: 1.4s; }
@keyframes petSmoke { 0%, 80% { opacity: 0; transform: none; } 85% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: translate(10px, -14px) scale(2.6); } }

/* cursor trails */
.tr2 { position: absolute; pointer-events: none; }
.tr2 svg { width: 100%; height: 100%; display: block; }
.tr2-sparks { width: 10px; height: 2px; margin: -1px -5px; border-radius: 2px; background: linear-gradient(90deg, rgba(255,200,90,0), #fff3c0); box-shadow: 0 0 6px 1px rgba(255,190,70,.9); }
.tr2-embers { width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: radial-gradient(circle, #fff3c0, #ff8a1f 55%, #c83a10); box-shadow: 0 0 8px 2px rgba(255,110,30,.7); }
.tr2-smoke { width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: radial-gradient(circle, rgba(150,140,135,.5), transparent 70%); filter: blur(2px); }
.tr2-snow { width: var(--sz); height: var(--sz); margin: calc(var(--sz) / -2); color: #eef8ff; filter: drop-shadow(0 0 3px rgba(160,210,255,.9)); }
.tr2-fairy { width: var(--sz); height: var(--sz); margin: calc(var(--sz) / -2); filter: drop-shadow(0 0 3px currentColor) drop-shadow(0 0 7px currentColor); }

/* Raven post */
.raven-fly { position: absolute; right: 10px; top: -8px; left: auto; width: 60px; height: 44px; pointer-events: none; z-index: 3; animation: rvFly 2.4s cubic-bezier(.3,.1,.5,1) forwards; }
@keyframes rvFly { 0% { transform: translate(200px, -140px) scale(1.2) rotate(-10deg); opacity: 1; } 42% { transform: translate(10px, -34px) scale(1) rotate(6deg); } 55% { transform: translate(0, -40px) rotate(-4deg); opacity: 1; } 100% { transform: translate(-240px, -200px) scale(.7) rotate(-20deg); opacity: 0; } }
.rv-bird { position: absolute; inset: 0; }
.rv-bird svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); }
.rv-bird .rv-wn, .rv-bird .rv-wf { transform-box: view-box; transform-origin: 30px 20px; animation: rvFlap .16s ease-in-out infinite alternate; }
.rv-bird .rv-wf { animation-delay: -.05s; }
@keyframes rvFlap { from { transform: rotate(-4deg) scaleY(1); } to { transform: rotate(16deg) scaleY(-.5); } }
.rv-scroll { position: absolute; left: 28px; top: 34px; width: 22px; height: 9px; border-radius: 4px; background: linear-gradient(180deg, #f0e2c0, #c8aa70); box-shadow: inset 0 0 0 1px #8a6a3a, -3px 0 0 -1px #a8884a, 3px 0 0 -1px #a8884a; animation: rvScroll 2.4s forwards; }
@keyframes rvScroll { 0%, 42% { opacity: 1; transform: none; } 58% { opacity: 1; transform: translate(-20px, 44px) rotate(-30deg); } 64%, 100% { opacity: 0; transform: translate(-22px, 52px) rotate(-36deg); } }
.msg.raven-in .msg-body { animation: rvUnroll .6s ease-out 1.1s both; transform-origin: 50% 0; }
@keyframes rvUnroll { from { clip-path: inset(0 0 100% 0); opacity: .6; transform: scaleY(.7); } to { clip-path: inset(0 0 0 0); opacity: 1; transform: none; } }
.rv-feather { position: absolute; right: 40px; top: -4px; width: 8px; height: 18px; pointer-events: none; opacity: 0; animation: rvFeather 2.6s ease-in-out 1s forwards; }
.rv-feather.f2 { right: 64px; animation-delay: 1.25s; }
.rv-feather svg { width: 100%; height: 100%; display: block; }
@keyframes rvFeather { 0% { opacity: 0; transform: translate(0, -30px) rotate(0); } 10% { opacity: .9; } 40% { transform: translate(-8px, 0) rotate(40deg); } 70% { transform: translate(6px, 24px) rotate(-30deg); } 100% { opacity: 0; transform: translate(-4px, 44px) rotate(20deg); } }

/* Party member down */
.dn-vig { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 32%, rgba(120,0,0,.55) 72%, rgba(60,0,0,.88)); animation: dnBeat 4.8s ease-in-out forwards; }
@keyframes dnBeat { 0% { opacity: 0; } 3% { opacity: 1; } 7% { opacity: .55; } 10% { opacity: .95; } 16% { opacity: .5; } 22% { opacity: 1; } 26% { opacity: .55; } 29% { opacity: .9; } 36% { opacity: .5; } 43% { opacity: .95; } 47% { opacity: .5; } 50% { opacity: .85; } 60% { opacity: .5; } 88% { opacity: .45; } 100% { opacity: 0; } }
body.hero-down #app { filter: grayscale(.85) brightness(.72); transition: filter .5s; }
.dn-splat { position: absolute; width: 36vmin; height: 40vmin; margin: -12vmin 0 0 -12vmin; transform: rotate(var(--r)); animation: dnSplat .35s cubic-bezier(.3,1.6,.5,1) var(--d) both; }
.dn-splat svg { width: 100%; height: 100%; display: block; overflow: visible; }
.dn-splat .drip { animation: dnDrip 2.8s ease-in both; }
@keyframes dnSplat { from { transform: rotate(var(--r)) scale(.2); opacity: 0; } }
@keyframes dnDrip { from { transform: scaleY(0); } }
.dn-card { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; padding: 18px 30px 20px; border: 1px solid rgba(200,40,30,.6); border-radius: 14px;
  background: linear-gradient(180deg, rgba(30,6,6,.94), rgba(12,2,2,.94)); box-shadow: 0 0 60px rgba(160,0,0,.5); animation: dnCard .5s .25s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes dnCard { from { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
.dn-skull { width: 46px; height: 46px; margin: 0 auto 6px; filter: drop-shadow(0 0 10px rgba(255,60,40,.7)); animation: pulse .9s ease-in-out 3; }
.dn-skull svg { width: 100%; height: 100%; }
.dn-name { font: 800 clamp(24px, 5vw, 46px) var(--display); color: #ffd0c8; text-shadow: 0 0 20px #a00000, 0 3px 0 #3a0000; white-space: nowrap; }
.dn-saves { margin-top: 12px; display: grid; gap: 6px; justify-items: center; }
.dn-h { font: 600 12px var(--body); letter-spacing: .14em; text-transform: uppercase; color: #c8a0a0; }
.dn-row { display: flex; align-items: center; gap: 8px; }
.dn-row b { width: 80px; text-align: right; font: 500 13px var(--body); color: #d8c0c0; }
.dn-row i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid; animation: dnPip .3s ease-out both; }
.dn-row.ok i { border-color: #8ad06a; } .dn-row.bad i { border-color: #e0503a; }
.dn-row i:nth-of-type(1) { animation-delay: .7s; } .dn-row i:nth-of-type(2) { animation-delay: .8s; } .dn-row i:nth-of-type(3) { animation-delay: .9s; }
@keyframes dnPip { from { transform: scale(0); } }

/* ---------- dice looks: Blood moon, Planar shift, Abyssal ---------- */
.skin-bloodmoon { --d3-face: radial-gradient(circle at 64% 60%, rgba(30,0,0,.5) 0 8%, transparent 9%), radial-gradient(circle at 30% 66%, rgba(30,0,0,.42) 0 5%, transparent 6%), radial-gradient(circle at 72% 26%, rgba(30,0,0,.38) 0 4%, transparent 5%), radial-gradient(circle at 34% 30%, #ff8a66, #c8281e 30%, #6a0808 65%, #1e0101);
  --d3-edge: linear-gradient(135deg, #ff8a6a, #5a0404 55%, #1a0000); --d3-num: #ffeadc; --d3-glow: rgba(255,50,30,.95); }
.d3.skin-bloodmoon .d3-face span, .die-preview3.skin-bloodmoon .d3-face span { text-shadow: 0 0 6px #ff2a1a, 0 1px 1px #000; }
.d3.skin-bloodmoon .d3-anim, .die-preview3.skin-bloodmoon .d3-anim { filter: drop-shadow(0 0 6px rgba(255,40,20,.55)); animation: bmBeat 1.6s ease-in-out infinite; }
@keyframes bmBeat { 0%, 100% { filter: drop-shadow(0 0 5px rgba(255,40,20,.45)); } 12% { filter: drop-shadow(0 0 14px rgba(255,40,20,.9)); } 24% { filter: drop-shadow(0 0 6px rgba(255,40,20,.5)); } 34% { filter: drop-shadow(0 0 11px rgba(255,40,20,.8)); } }
.d3.skin-bloodmoon::before, .die-preview3.skin-bloodmoon .d3::before { content: ""; position: absolute; left: -50px; top: -44px; width: 100px; height: 100px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, transparent 38%, rgba(200,20,10,.28) 46%, rgba(120,0,0,.12) 60%, transparent 70%); animation: bmHalo 3.2s ease-in-out infinite; }
@keyframes bmHalo { 50% { transform: scale(1.12); opacity: .6; } }
.skin-planar { --d3-face: radial-gradient(1.4px 1.4px at 22% 30%, #fff 50%, transparent), radial-gradient(1px 1px at 68% 22%, #fff 50%, transparent), radial-gradient(1.6px 1.6px at 74% 70%, #fff 50%, transparent), radial-gradient(1px 1px at 36% 76%, #fff 50%, transparent),
    radial-gradient(circle at 30% 30%, rgba(15,240,208,.85), transparent 45%), radial-gradient(circle at 75% 70%, rgba(255,58,217,.8), transparent 50%), linear-gradient(135deg, #1a0a4a, #4a1aaa 50%, #0a0420);
  --d3-edge: linear-gradient(135deg, #0ff0d0, #ffffff 50%, #ff3ad9); --d3-num: #ffffff; --d3-glow: rgba(15,240,208,.9); }
.d3.skin-planar .d3-face span, .die-preview3.skin-planar .d3-face span { text-shadow: -1.5px 0 #0ff0d0, 1.5px 0 #ff3ad9, 0 0 8px #fff; }
.d3.skin-planar .d3-hop { animation: plPhase 3.4s steps(1) infinite; }
@keyframes plPhase { 0%, 88%, 100% { opacity: 1; } 90% { opacity: .35; } 93% { opacity: .85; } 96% { opacity: .5; } }
.d3.skin-planar::before, .die-preview3.skin-planar .d3::before { content: ""; position: absolute; left: -48px; top: -40px; width: 96px; height: 96px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, #0ff0d0, transparent 20%, #ff3ad9 40%, transparent 60%, #6a2aff 80%, #0ff0d0);
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 60%, #000 63%, transparent 67%); mask: radial-gradient(circle, transparent 56%, #000 60%, #000 63%, transparent 67%); animation: rxSpin 2.6s linear infinite; filter: blur(.5px) drop-shadow(0 0 4px #0ff0d0); }
.d3.skin-planar::after, .die-preview3.skin-planar .d3::after { content: ""; position: absolute; left: -40px; top: -32px; width: 80px; height: 80px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 80% 40%, #c8fff4, transparent), radial-gradient(1.5px 1.5px at 40% 85%, #ffc8f4, transparent), radial-gradient(1.5px 1.5px at 70% 15%, #fff, transparent);
  animation: rxSpin 5s linear infinite reverse; }
.skin-abyssal { --d3-face: radial-gradient(circle at 50% 50%, rgba(8,0,16,.85) 0 11%, transparent 12%), repeating-radial-gradient(circle at 50% 50%, transparent 0 5px, rgba(176,108,255,.17) 6px 7px), radial-gradient(circle at 35% 28%, #6a2a8a, #1c0430 55%, #05010a);
  --d3-edge: linear-gradient(135deg, #c08aff, #3a0a5a 55%, #0a0214); --d3-num: #f2e6ff; --d3-glow: rgba(176,108,255,.9); }
.d3.skin-abyssal .d3-face span, .die-preview3.skin-abyssal .d3-face span { text-shadow: 0 0 6px #b06cff, 0 0 12px #6a2aff; }
.d3.skin-abyssal::before, .die-preview3.skin-abyssal .d3::before { content: ""; position: absolute; left: -54px; top: -34px; width: 108px; height: 84px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse, rgba(50,0,90,.6), rgba(30,0,60,.3) 45%, transparent 70%); filter: blur(4px); animation: abPulse 3s ease-in-out infinite; }
.d3.skin-abyssal::after, .die-preview3.skin-abyssal .d3::after { content: ""; position: absolute; left: -46px; top: -38px; width: 92px; height: 92px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 8%, rgba(150,70,220,.55) 12%, transparent 18% 40%, rgba(150,70,220,.45) 46%, transparent 52% 74%, rgba(150,70,220,.5) 80%, transparent 86%);
  -webkit-mask: radial-gradient(circle, transparent 42%, #000 55%, transparent 72%); mask: radial-gradient(circle, transparent 42%, #000 55%, transparent 72%); filter: blur(2px); animation: rxSpin 7s linear infinite; }
@keyframes abPulse { 50% { transform: scale(1.15); opacity: .7; } }
.die-preview3 .d3::before, .die-preview3 .d3::after { transform-origin: center; }
.d3.skin-bloodmoon.nat20 .d3-anim, .d3.skin-bloodmoon.nat1 .d3-anim { animation: none; }
.fx .db-jet { height: 0; transform-origin: 0 0; }
.db-jet i { position: absolute; left: 0; width: 100%; top: -20px; height: 40px; transform-origin: 0 50%; clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%);
  background: linear-gradient(90deg, #fff6d0, #ffd24a 25%, #ff8a1f 60%, rgba(220,60,10,.6) 85%, transparent); filter: blur(6px); mix-blend-mode: screen; animation: dbJet .95s ease-out forwards; }
.db-jet i + i { top: -11px; height: 22px; background: linear-gradient(90deg, #fff, #fff3b0 40%, rgba(255,170,60,.6) 80%, transparent); filter: blur(3px); animation-duration: .85s; }
@keyframes dbJet { 0% { transform: scaleX(0); opacity: 1; } 22% { transform: scaleX(1); opacity: 1; } 35% { transform: scaleX(1) scaleY(1.15); } 50% { transform: scaleX(1) scaleY(.9); opacity: 1; } 70% { transform: scaleX(1) scaleY(1.05); opacity: .9; } 100% { transform: scaleX(1) scaleY(.4); opacity: 0; } }
/* Planar shift stays in its own teal / violet / pink range instead of cycling through every colour */
.d3.skin-planar .d3-anim, .die-preview3.skin-planar .d3-anim { animation: plHue 3.2s ease-in-out infinite alternate; }
@keyframes plHue { 0% { filter: hue-rotate(-35deg) drop-shadow(0 0 6px rgba(15,240,208,.6)); } 100% { filter: hue-rotate(45deg) drop-shadow(0 0 8px rgba(255,58,217,.6)); } }
