/* IRONWAKE signature motifs, menu layer (src/motifs.js). Every rule needs an element motifs.js adds, and it only adds them
   when menu-fx.js says an effect is on: a clean save, Menu effects OFF, and flight add nothing. No layout: every element is
   absolute and pointer-events:none. No rule touches the card or its border art. */
/* THE EYE: one canvas per eye, behind the copy; outside the card on a desktop home screen, inside it in dialogs and on phones. */
.mey{position:absolute;inset:-1px;border-radius:18px;pointer-events:none;z-index:-1}
.mey.mey-card{inset:0;border-radius:17px;overflow:hidden}
.mey canvas{position:absolute;display:block;pointer-events:none;opacity:1}
.mey canvas.mey-in{opacity:.82}
.mey canvas.mey-scar{opacity:0;transition:opacity 10s linear}

/* THE VOIDS (DARK MATTER, k >= 1.7), built by motifs.js inside menu-fx.js's .mfx-void layer (behind the copy, clipped to the
   card). Few, torn, never in sync: each .mvd has its own shudder (one of three), its own period (--d) and its own place in
   the cycle (--o); between shudders it is still. Lightning (.mvd-bolt) is drawn by timers; nothing here pulses together. */
.mvd{left:0;top:0;width:0;height:0;animation:mvd-a var(--d,27s) ease-in-out infinite var(--o,0s)}
.mfx.mfx-void .mfx-spill2{animation-duration:13s} /* the left pool outside the card swells on its own period: the two pools never beat together */
.mvd.mvd-k2{animation-name:mvd-b}.mvd.mvd-k3{animation-name:mvd-c}
@keyframes mvd-a{0%,44%,60%,100%{transform:none}49%{transform:scale(1.04) rotate(1deg)}54%{transform:scale(.985) rotate(-.4deg)}}
@keyframes mvd-b{0%,16%,29%,70%,83%,100%{transform:none}22%{transform:scale(1.025) rotate(-.8deg)}76%{transform:scale(1.045) rotate(.6deg)}}
@keyframes mvd-c{0%,57%,70%,100%{transform:none}62%{transform:scale(.972)}66%{transform:scale(1.035) rotate(1.2deg)}}
.mvd .mvd-svg{position:absolute;display:block;overflow:visible;pointer-events:none}
/* the rift's own recipe: a dark gap (violet deep inside), a thin red rim, a violet glow */
.mvd-gl{filter:drop-shadow(0 0 1.5px #ff3a3a) drop-shadow(0 0 3px #ff1f2e) drop-shadow(0 0 11px #8a4dffcc)}
.mvd-debris{fill:#05000b}
.mvd-lip{fill:none;stroke:#6a3fd0;stroke-linejoin:round;opacity:.3}
.mvd-rim{fill:none;stroke:#ff3b3b;stroke-width:1px;stroke-linejoin:miter;opacity:.55}
.mvd-rimh{fill:none;stroke:#ffd3c4;stroke-width:1.1px;stroke-linejoin:miter;stroke-linecap:round;opacity:.85}
.mvd-cracks{fill:none;stroke:#ff4a3a;stroke-width:.9px;stroke-linecap:round;stroke-linejoin:round;opacity:.6;filter:drop-shadow(0 0 2px #ff1f2e)}
.mvd-specks{fill:#d9c8ff}
.mvd-shade{opacity:0}
.mvd-shade.on{animation:mvd-shade 3.6s ease-in-out 1 both}
.mvd-shade.mvd-hold{opacity:1;transform:translateX(-12%)}
@keyframes mvd-shade{0%{opacity:0;transform:translateX(calc(var(--tx,80px)*-1))}16%,84%{opacity:1}100%{opacity:0;transform:translateX(var(--tx,80px))}}
.mvd-glints{opacity:0;fill:#ff3b2e;filter:drop-shadow(0 0 2px #ff1f2e) drop-shadow(0 0 5px #ff1f2eaa);transform-box:fill-box;transform-origin:50% 50%}
.mvd-glints.on{animation:mvd-glints 1.3s ease-out 1 both}
.mvd-glints.mvd-hold{opacity:1}
@keyframes mvd-glints{0%{opacity:0;transform:scaleY(.05)}12%{opacity:1;transform:scaleY(1)}40%{transform:scaleY(1)}46%{transform:scaleY(.15)}52%{transform:scaleY(1)}76%{opacity:1;transform:scaleY(1)}88%{opacity:.9;transform:scaleY(.08)}100%{opacity:0;transform:scaleY(.05)}}
.mvd-bolts{position:absolute;inset:0;width:100%;height:100%;overflow:visible;fill:none;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.mvd-bolts .mvd-bg{stroke:#a070ff;stroke-width:3.2px;opacity:.42}
.mvd-bolts .mvd-bc{stroke:#efe2ff;stroke-width:1px;opacity:.95}
.mvd-bolts .mvd-after{stroke:#e9d8ff;stroke-width:1.7px;opacity:0;filter:drop-shadow(0 0 3px #a070ff);animation:mvd-after 1.2s ease-out 1 both}
.mvd-bolts .mvd-after.mvd-hold{animation:none;opacity:.9}
@keyframes mvd-after{0%{opacity:.95}100%{opacity:0}}
.mvd-flash{position:absolute;width:28px;height:28px;margin:-14px 0 0 -14px;border-radius:50%;pointer-events:none;background:radial-gradient(closest-side,#fff 0,#e6d4ffcc 28%,#a070ff55 58%,transparent);opacity:0;animation:mvd-flash .3s ease-out 1 both}
.mvd-flash.mvd-hold{animation:none;opacity:1}
@keyframes mvd-flash{0%{opacity:1;transform:scale(.6)}100%{opacity:0;transform:scale(1.5)}}
.mfx-seams .mfx-node.mvd-hit{animation:none;opacity:1;transform:scale(1.9);background:#fff;box-shadow:0 0 9px 3px #d9c2ff}
@media (prefers-reduced-motion:reduce){.mvd,.mvd *,.mvd-bolts *,.mvd-flash{animation:none!important}}

/* THE EMBER EDGE on real saves (k >= 0.40): the warm line on the card's low edge, the same stretch recipe as EMBER ROT
   (rust line, hot core, glow behind the copy, a bright node), one continuous line whose lit length (--el), strength (--eo)
   and node count grow with k. Each node drifts slowly along its own lane and lights the line where it is. */
.mtf-edge .mtf-clip{left:0;right:0;bottom:-8px;height:80px;overflow:hidden}
.mtf-edge .mtf-line{bottom:8px;height:2px;opacity:var(--eo,1);background:linear-gradient(90deg,transparent,#7a2a12aa 6%,#d8561e 18%,#f07a30 50%,#d8561e 82%,#7a2a12aa 94%,transparent);filter:drop-shadow(0 0 2px #ff6a2a) drop-shadow(0 0 5px #ff4a1a99)}
.mtf-edge .mtf-heat{inset:0;border-radius:inherit;opacity:calc(.55*var(--eo,1));background:radial-gradient(calc(56%*var(--el,1)) 24px at 50% 100%,#ff5a1f50,transparent 80%);animation:mtf-heat 11s ease-in-out infinite}
.mtf-edge .mtf-side{bottom:25px;width:2px;height:calc(46px*var(--es,0));opacity:calc(.9*var(--es,0));background:linear-gradient(0deg,#ff8a3a,#d8561e 40%,#7a2a12aa 80%,transparent);filter:drop-shadow(0 0 2px #ff6a2a) drop-shadow(0 0 5px #ff4a1a99)}
.mtf-edge .mtf-sr{right:0}.mtf-edge .mtf-sl{left:0;height:calc(30px*var(--es,0))}
.mtf-edge .mtf-lane{bottom:8px;height:0;animation:mtf-drift var(--d,31s) ease-in-out infinite alternate var(--o,0s)}
.mtf-edge .mtf-node{left:0;bottom:0;width:0;height:0;opacity:var(--eo,1);animation:mtf-flare var(--fd,7s) ease-in-out infinite var(--fo,0s)}
.mtf-edge .mtf-glow{left:-52px;bottom:2px;width:104px;height:calc(10px + 6px*var(--el,1));background:radial-gradient(50% 100% at 50% 100%,#ff6a2a66,#ff5a1f26 55%,transparent)}
.mtf-edge .mtf-hot{left:-36px;bottom:0;width:72px;height:2px;background:linear-gradient(90deg,transparent,#ff8a3a 28%,#ffd59a 50%,#ff8a3a 72%,transparent);filter:drop-shadow(0 0 2px #ff6a2a) drop-shadow(0 0 5px #ff4a1a99)}
.mtf-edge .mtf-pt{left:-1.5px;bottom:-1px;width:3px;height:3px;border-radius:1px;background:#ffeac4;box-shadow:0 0 3px 1px #ff7a2ae0,0 0 10px 2px #ff4a1a66}
.mtf-edge .mtf-fleck{left:-1px;bottom:3px;width:2px;height:2px;background:#ffc88a;box-shadow:0 0 3px 1px #ff6a2ae0;opacity:0;animation:mfx-fleck var(--d,11s) linear infinite var(--o,0s)}
@keyframes mtf-drift{from{transform:translateX(0)}to{transform:translateX(100%)}}
@keyframes mtf-flare{0%,100%{opacity:calc(.62*var(--eo,1))}50%{opacity:var(--eo,1)}}
@keyframes mtf-heat{0%,100%{opacity:calc(.4*var(--eo,1))}50%{opacity:calc(.7*var(--eo,1))}}
.mfx-still .mtf-edge .mtf-node{opacity:calc(.9*var(--eo,1))}.mfx-still .mtf-edge .mtf-lane{transform:translateX(50%)}.mfx-still .mtf-edge .mtf-fleck{display:none}
@media (max-width:600px){.mtf-edge .mtf-glow{left:-36px;width:72px}.mtf-edge .mtf-hot{left:-26px;width:52px}}

/* THE RIFT on real saves (k >= 0.80): ?fx=final's rift (menu-fx.css .mfx-rg / .mfx-gap), cut at its necks into five
   diamonds that open one by one as k rises. Same gap, same thin red rim and violet glow, same 9 s tide (--pa scales it:
   still below 1.0, the full tide from 1.85). --do = how far a diamond is open (a closed seam is a hairline). On the frame
   band only, like the rift it grows into. */
.mfx-top.mtf-rift{overflow:visible}
.mtf-rift .mtf-rg{filter:drop-shadow(0 0 1.5px #ff3a3a) drop-shadow(0 0 3px #ff1f2e) drop-shadow(0 0 12px #8a4dffcc);animation:mtf-rift 9s ease-in-out infinite}
.mtf-rift .mtf-rl{animation-delay:-3s}
.mtf-rift .mtf-dia{inset:0;background:radial-gradient(60% 50% at 50% 50%,#2a0f52,#05000b 70%);transform:scaleX(var(--do,1))}
.mtf-rift .mtf-dia.mtf-seam{background:#ff3a3a}
.mtf-rift .mtf-dia.mtf-new{animation:mtf-crack .95s cubic-bezier(.2,.9,.3,1) var(--nd,0s) 1 both}
@keyframes mtf-rift{0%,100%{scale:calc(1 - .06*var(--pa,1)) calc(1 - .03*var(--pa,1))}50%{scale:calc(1 + .12*var(--pa,1)) calc(1 + .03*var(--pa,1))}}
@keyframes mtf-crack{0%{transform:scaleX(.03);filter:brightness(1)}18%{transform:scaleX(.08);filter:brightness(3.2)}46%{transform:scaleX(calc(var(--do,1)*1.4));filter:brightness(2.2)}70%{transform:scaleX(calc(var(--do,1)*.9))}100%{transform:scaleX(var(--do,1));filter:brightness(1)}}
.mfx-still .mtf-rift *{animation:none!important}
@media (prefers-reduced-motion:reduce){.mtf-rift *{animation:none!important}}
