/* Kryvania · Efectos de firma del duelo (app-duel-fx-signature.js). Solo presentación. */

/* ------------------------------------------------------------------ capa de efectos */
.fx-sig-layer {
    position: fixed;
    inset: 0;
    z-index: 2147483199;
    pointer-events: none;
    overflow: visible;
}
.fx-sig-layer > * { position: fixed; pointer-events: none; }
/* Las copias de cartas de estos efectos se ubican exactamente sobre la carta original
   (la regla de cartas del tablero las dejaría en posición relativa). */
body.duel-playing .board-main.combat-visual-ghost-layer > .game-card.combat-visual-ghost.fx-sig-ghost,
body.duel-playing .board-main.combat-visual-ghost-layer > .combat-visual-ghost.fx-sig-ghost {
    position: fixed !important;
}

/* ------------------------------------------------------------------ ataque al entrar */
body.duel-playing .combat-visual-ghost.fx-sig-pounce-source {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .9), 0 0 34px rgba(220, 38, 38, .6), 0 22px 46px rgba(0, 0, 0, .55) !important;
    z-index: 2147483201 !important;
}
body.duel-playing .combat-visual-ghost.fx-sig-pounce-target {
    box-shadow: 0 0 0 2px rgba(251, 191, 36, .55), 0 18px 40px rgba(0, 0, 0, .5) !important;
}
.fx-sig-wound {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 45%, rgba(239, 68, 68, .55), rgba(127, 29, 29, .5) 70%);
    mix-blend-mode: multiply;
    animation: fxSigWound .5s ease-out both;
    pointer-events: none;
    z-index: 5;
}
@keyframes fxSigWound { from { opacity: 0; } 35% { opacity: 1; } to { opacity: .75; } }

.fx-sig-claws i {
    position: absolute;
    left: 6%;
    width: 92%;
    height: 6px;
    border-radius: 6px;
    background: linear-gradient(90deg, transparent, #fff 18%, #fecaca 45%, #ef4444 78%, transparent);
    box-shadow: 0 0 12px rgba(239, 68, 68, .95), 0 0 2px #fff;
    transform-origin: 0 50%;
    transform: rotate(-38deg) scaleX(0);
    animation: fxSigClaw .5s cubic-bezier(.2, .9, .3, 1) forwards;
}
.fx-sig-claws i:nth-child(1) { top: 58%; }
.fx-sig-claws i:nth-child(2) { top: 72%; animation-delay: 55ms; }
.fx-sig-claws i:nth-child(3) { top: 86%; animation-delay: 110ms; }
@keyframes fxSigClaw {
    0% { transform: rotate(-38deg) scaleX(0); opacity: 1; }
    45% { transform: rotate(-38deg) scaleX(1); opacity: 1; }
    100% { transform: rotate(-38deg) scaleX(1); opacity: 0; }
}
.fx-sig-impact-flash {
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(254, 202, 202, .7) 22%, rgba(239, 68, 68, .35) 45%, transparent 70%);
    animation: fxSigFlash .45s ease-out forwards;
}
@keyframes fxSigFlash { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }

/* ------------------------------------------------------------------ captura con cadenas */
.fx-sig-chain {
    height: 14px;
    transform-origin: 0 50%;
    background:
        radial-gradient(ellipse 6px 4px at 50% 50%, transparent 52%, #e2e8f0 60%, #64748b 82%, transparent 92%) 0 50% / 13px 14px repeat-x,
        linear-gradient(180deg, transparent 5px, #94a3b8 5px, #475569 9px, transparent 9px);
    filter: drop-shadow(0 0 6px rgba(167, 139, 250, .85)) drop-shadow(0 2px 2px rgba(0, 0, 0, .6));
}
body.duel-playing .fx-sig-captor-cast {
    animation: fxSigCaptorCast .5s ease-out both;
}
@keyframes fxSigCaptorCast {
    0% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); }
    50% { box-shadow: 0 0 0 4px rgba(167, 139, 250, .85), 0 0 28px rgba(139, 92, 246, .7); }
    100% { box-shadow: 0 0 0 2px rgba(167, 139, 250, .5), 0 0 16px rgba(139, 92, 246, .45); }
}
body.duel-playing .combat-visual-ghost.fx-sig-bound {
    box-shadow: 0 0 0 3px rgba(167, 139, 250, .9), 0 0 26px rgba(139, 92, 246, .65) !important;
}

/* ------------------------------------------------------------------ barajar */
body.duel-playing .fx-sig-deck-riffle {
    animation: fxSigDeckRiffle .6s ease-in-out both;
}
@keyframes fxSigDeckRiffle {
    0%, 100% { transform: translateX(0) rotate(0); filter: brightness(1); }
    20% { transform: translateX(-3px) rotate(-2deg); filter: brightness(1.4); }
    40% { transform: translateX(3px) rotate(2deg); }
    60% { transform: translateX(-2px) rotate(-1deg); filter: brightness(1.25); }
    80% { transform: translateX(2px) rotate(1deg); }
}
.fx-sig-riffle i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34%;
    height: 56%;
    margin: -28% 0 0 -17%;
    border-radius: 6px;
    border: 1px solid rgba(253, 224, 138, .75);
    background: repeating-linear-gradient(45deg, #3b2412 0 6px, #5b3a1c 6px 12px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, .5);
    animation: fxSigRiffle .55s ease-in-out both;
}
.fx-sig-riffle i:nth-child(2) { animation-delay: .08s; --dir: -1; }
.fx-sig-riffle i:nth-child(3) { animation-delay: .16s; }
.fx-sig-riffle i:nth-child(4) { animation-delay: .24s; --dir: -1; }
@keyframes fxSigRiffle {
    0% { transform: translate(0, 0) rotate(0); opacity: 0; }
    35% { transform: translate(calc(var(--dir, 1) * 26px), -18px) rotate(calc(var(--dir, 1) * 14deg)); opacity: 1; }
    100% { transform: translate(0, 0) rotate(0); opacity: 0; }
}

/* ------------------------------------------------------------------ sacrificio */
.fx-sig-blast {
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(226, 232, 240, .7) 18%, rgba(148, 163, 184, .45) 38%, rgba(71, 85, 105, .2) 56%, transparent 70%);
    animation: fxSigBlast .5s ease-out forwards;
}
.fx-sig-blast i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    margin: -4.5px;
    border-radius: 2px;
    background: #cbd5e1;
    box-shadow: 0 0 8px rgba(255, 255, 255, .9);
    transform: rotate(var(--a)) translateX(0);
    animation: fxSigSpark .5s ease-out forwards;
}
@keyframes fxSigBlast { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
@keyframes fxSigSpark { to { transform: rotate(var(--a)) translateX(120px) rotate(160deg) scale(.4); opacity: 0; } }

/* ------------------------------------------------------------------ revivir: emerge de la tierra */
.fx-sig-portal {
    border-radius: 50%;
    background:
        conic-gradient(from 0deg, rgba(34, 197, 94, .0), rgba(74, 222, 128, .55), rgba(20, 83, 45, .2), rgba(134, 239, 172, .6), rgba(34, 197, 94, 0)),
        radial-gradient(ellipse at center, rgba(2, 10, 4, .95) 35%, rgba(22, 101, 52, .55) 60%, transparent 72%);
    box-shadow: 0 0 34px rgba(74, 222, 128, .55);
    animation: fxSigPortalOpen .45s cubic-bezier(.2, .9, .3, 1.1) both, fxSigPortalSpin 1.6s linear infinite;
    mix-blend-mode: screen;
}
.fx-sig-portal--abyss {
    background:
        conic-gradient(from 0deg, rgba(168, 85, 247, 0), rgba(192, 132, 252, .6), rgba(59, 7, 100, .2), rgba(216, 180, 254, .6), rgba(168, 85, 247, 0)),
        radial-gradient(ellipse at center, rgba(5, 2, 12, .95) 35%, rgba(88, 28, 135, .6) 60%, transparent 72%);
    box-shadow: 0 0 34px rgba(168, 85, 247, .6);
}
.fx-sig-portal.is-closing { animation: fxSigPortalClose .38s ease-in forwards; }
@keyframes fxSigPortalOpen { from { transform: scaleX(.1) scaleY(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fxSigPortalSpin { to { filter: hue-rotate(40deg); } }
@keyframes fxSigPortalClose { to { transform: scaleX(.2) scaleY(.1); opacity: 0; } }
.fx-sig-soil i {
    position: absolute;
    left: 50%;
    bottom: 40%;
    width: 9px;
    height: 7px;
    border-radius: 45% 55% 40% 60%;
    background: #5b3a1c;
    box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .35);
    animation: fxSigClod .8s cubic-bezier(.2, .7, .4, 1) var(--d, 0ms) both;
}
@keyframes fxSigClod {
    0% { transform: translate(0, 0) scale(.6); opacity: 0; }
    20% { opacity: 1; }
    55% { transform: translate(var(--x), -46px) rotate(120deg); }
    100% { transform: translate(calc(var(--x) * 1.5), 6px) rotate(240deg); opacity: 0; }
}

/* ------------------------------------------------------------------ desde el Limbo: cae del cielo */
.fx-sig-clouds i {
    position: absolute;
    top: 20%;
    width: 38%;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 60%, rgba(241, 245, 249, .95), rgba(203, 213, 225, .8) 45%, rgba(148, 163, 184, .35) 70%, transparent 74%);
    filter: blur(1px) drop-shadow(0 8px 14px rgba(15, 23, 42, .5));
    animation: fxSigCloudIn .5s ease-out both;
}
.fx-sig-clouds i:nth-child(1) { left: 0; animation-delay: 0ms; }
.fx-sig-clouds i:nth-child(2) { left: 16%; top: 4%; animation-delay: 70ms; }
.fx-sig-clouds i:nth-child(3) { left: 32%; top: 0; width: 42%; animation-delay: 140ms; }
.fx-sig-clouds i:nth-child(4) { left: 50%; top: 8%; animation-delay: 90ms; }
.fx-sig-clouds i:nth-child(5) { left: 64%; top: 22%; animation-delay: 30ms; }
.fx-sig-clouds::after {
    content: "";
    position: absolute;
    left: 34%;
    top: 55%;
    width: 32%;
    height: 520%;
    background: linear-gradient(180deg, rgba(224, 242, 254, .7), rgba(186, 230, 253, .18) 60%, transparent);
    filter: blur(4px);
    opacity: 0;
    transition: opacity .25s ease;
}
.fx-sig-clouds.is-open::after { opacity: 1; }
.fx-sig-clouds.is-closing { transition: opacity .5s ease; opacity: 0; }
@keyframes fxSigCloudIn { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fx-sig-dust {
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(226, 232, 240, .55), rgba(148, 163, 184, .3) 45%, transparent 70%);
    animation: fxSigDust .6s ease-out forwards;
}
.fx-sig-dust--heavy {
    background: radial-gradient(ellipse at center, rgba(214, 211, 209, .7), rgba(120, 113, 108, .4) 45%, transparent 70%);
    animation-duration: .85s;
}
@keyframes fxSigDust { from { transform: scale(.3, .5); opacity: 1; } to { transform: scale(1.35, 1); opacity: 0; } }

/* ------------------------------------------------------------------ entrada épica (coste 6+) */
.fx-sig-shockwave {
    border-radius: 50%;
    border: 4px solid rgba(253, 230, 138, .85);
    box-shadow: 0 0 30px rgba(251, 191, 36, .55), inset 0 0 26px rgba(251, 191, 36, .35);
    animation: fxSigShock .7s cubic-bezier(.15, .8, .3, 1) forwards;
}
@keyframes fxSigShock { from { transform: scale(.15); opacity: 1; } to { transform: scale(1); opacity: 0; } }
.fx-sig-crack { transition: opacity .7s ease; }
.fx-sig-crack.is-fading { opacity: 0; }
.fx-sig-crack svg { width: 100%; height: 100%; overflow: visible; }
.fx-sig-crack path {
    fill: none;
    stroke: rgba(12, 8, 4, .9);
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: var(--len);
    stroke-dashoffset: var(--len);
    filter: drop-shadow(0 0 3px rgba(251, 146, 60, .75)) drop-shadow(0 1px 0 rgba(255, 237, 213, .35));
    animation: fxSigCrack .42s ease-out forwards;
}
@keyframes fxSigCrack { to { stroke-dashoffset: 0; } }
body.duel-playing #gameBoard .battlefield.fx-sig-quake {
    animation: fxSigQuake .48s cubic-bezier(.36, .07, .19, .97) both;
}
@keyframes fxSigQuake {
    0%, 100% { transform: translate(0, 0); }
    15% { transform: translate(-5px, 3px); }
    30% { transform: translate(5px, -3px); }
    45% { transform: translate(-4px, 2px); }
    60% { transform: translate(3px, -1px); }
    80% { transform: translate(-1px, 1px); }
}

/* ------------------------------------------------------------------ Dominio Global: Jungla pantanosa */
body.duel-playing .global-domain-row.has-fx-swamp { isolation: isolate; }
body.duel-playing .global-domain-row.has-fx-swamp > :not(.fx-swamp) { position: relative; z-index: 1; }
.fx-swamp {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 70% at 20% 100%, rgba(20, 83, 45, .55), transparent 70%),
        radial-gradient(ellipse 50% 60% at 85% 100%, rgba(13, 64, 46, .55), transparent 70%),
        linear-gradient(180deg, #03140b 0%, #082516 38%, #0d3220 66%, #072019 100%);
}
.fx-swamp__canopy {
    position: absolute;
    inset: 0 0 auto 0;
    height: 60%;
    background:
        radial-gradient(ellipse 70px 26px at 6% 0, rgba(22, 101, 52, .75), transparent 72%),
        radial-gradient(ellipse 90px 30px at 28% 0, rgba(21, 128, 61, .6), transparent 72%),
        radial-gradient(ellipse 80px 24px at 55% 0, rgba(22, 101, 52, .7), transparent 72%),
        radial-gradient(ellipse 100px 32px at 82% 0, rgba(20, 83, 45, .75), transparent 72%),
        repeating-linear-gradient(90deg, transparent 0 37px, rgba(34, 197, 94, .28) 37px 39px, transparent 39px 83px, rgba(21, 128, 61, .32) 83px 84px, transparent 84px 131px);
    -webkit-mask: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .7) 45%, transparent 100%);
    mask: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .7) 45%, transparent 100%);
    animation: fxSwampSway 9s ease-in-out infinite alternate;
    transform-origin: 50% 0;
}
.fx-swamp__fog {
    position: absolute;
    left: 0;
    width: 200%;
    height: 55%;
    background:
        radial-gradient(ellipse 18% 60% at 10% 50%, rgba(187, 247, 208, .2), transparent 70%),
        radial-gradient(ellipse 22% 55% at 35% 55%, rgba(209, 250, 229, .16), transparent 70%),
        radial-gradient(ellipse 16% 60% at 60% 45%, rgba(187, 247, 208, .2), transparent 70%),
        radial-gradient(ellipse 24% 50% at 85% 55%, rgba(209, 250, 229, .14), transparent 70%);
    filter: blur(3px);
    animation: fxSwampFog 46s linear infinite;
}
.fx-swamp__fog--a { top: 30%; }
.fx-swamp__fog--b { top: 52%; opacity: .8; animation-duration: 64s; animation-direction: reverse; }
.fx-swamp__water {
    position: absolute;
    inset: auto 0 0 0;
    height: 30%;
    background:
        repeating-linear-gradient(180deg, transparent 0 6px, rgba(167, 243, 208, .07) 6px 7px),
        linear-gradient(180deg, rgba(6, 78, 59, .55), rgba(2, 44, 34, .85));
    box-shadow: inset 0 2px 6px rgba(110, 231, 183, .12);
}
.fx-swamp__reeds {
    position: absolute;
    inset: auto 0 0 0;
    height: 46%;
    background:
        repeating-linear-gradient(98deg, transparent 0 13px, rgba(2, 20, 10, .85) 13px 15px, transparent 15px 31px),
        repeating-linear-gradient(82deg, transparent 0 21px, rgba(4, 30, 16, .8) 21px 23px, transparent 23px 47px);
    -webkit-mask: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, .8) 35%, transparent 80%);
    mask: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, .8) 35%, transparent 80%);
    opacity: .85;
}
.fx-swamp__firefly {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ecfccb;
    box-shadow: 0 0 6px 2px rgba(190, 242, 100, .85), 0 0 14px rgba(163, 230, 53, .6);
    animation: fxSwampFirefly 6.5s ease-in-out calc(var(--i) * -.9s) infinite;
}
.fx-swamp__ripple {
    position: absolute;
    width: 46px;
    height: 10px;
    margin: -5px 0 0 -23px;
    border-radius: 50%;
    border: 1px solid rgba(167, 243, 208, .45);
    animation: fxSwampRipple 4.2s ease-out calc(var(--i) * -1.4s) infinite;
}
@keyframes fxSwampSway { from { transform: skewX(-1.5deg); } to { transform: skewX(1.5deg); } }
@keyframes fxSwampFog { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes fxSwampFirefly {
    0%, 100% { transform: translate(0, 0); opacity: .15; }
    25% { transform: translate(10px, -8px); opacity: 1; }
    50% { transform: translate(-6px, -14px); opacity: .3; }
    75% { transform: translate(8px, -4px); opacity: .9; }
}
@keyframes fxSwampRipple { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

/* Vapor vivo: las nieblas respiran (densidad variable) y columnas de vapor suben del agua. */
.fx-swamp__fog {
    animation: fxSwampFog 46s linear infinite, fxSwampFogBreath 11s ease-in-out infinite alternate;
}
.fx-swamp__fog--b {
    animation: fxSwampFog 64s linear infinite reverse, fxSwampFogBreath 14s ease-in-out -5s infinite alternate;
}
.fx-swamp__vapor {
    position: absolute;
    bottom: 12%;
    width: 15%;
    height: 72%;
    margin-left: -7.5%;
    border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
    background:
        radial-gradient(ellipse 46% 30% at 50% 80%, rgba(220, 252, 231, .34), transparent 72%),
        radial-gradient(ellipse 38% 26% at 42% 50%, rgba(209, 250, 229, .22), transparent 72%),
        radial-gradient(ellipse 32% 22% at 58% 22%, rgba(187, 247, 208, .14), transparent 72%);
    filter: blur(6px);
    opacity: 0;
    transform-origin: 50% 100%;
    mix-blend-mode: screen;
    animation: fxSwampVaporRise calc(7.5s + var(--i) * .7s) ease-out calc(var(--i) * -1.9s) infinite;
}
@keyframes fxSwampFogBreath {
    0% { opacity: .55; filter: blur(3px); }
    50% { opacity: 1; filter: blur(4px); }
    100% { opacity: .7; filter: blur(5px); }
}
@keyframes fxSwampVaporRise {
    0% { opacity: 0; transform: translate(0, 18%) scale(calc(.45 * var(--s, 1)), .45); }
    18% { opacity: .85; }
    55% { opacity: .55; transform: translate(-8%, -12%) scale(calc(.85 * var(--s, 1)), .9) skewX(-4deg); }
    100% { opacity: 0; transform: translate(10%, -42%) scale(calc(1.25 * var(--s, 1)), 1.15) skewX(5deg); }
}

/* Las casillas de Jungla dejan ver el pantano. */
body.duel-playing .global-domain-row.has-fx-swamp .jungle-card {
    border-color: rgba(134, 239, 172, .34);
    background: linear-gradient(180deg, rgba(5, 32, 18, .3), rgba(3, 18, 12, .55));
    box-shadow: inset 0 1px 0 rgba(187, 247, 208, .08), 0 8px 18px rgba(0, 0, 0, .3);
}
body.duel-playing .global-domain-row.has-fx-swamp #jungleBossZone {
    border-color: rgba(251, 191, 36, .5);
    background:
        radial-gradient(circle at 50% 8%, rgba(251, 191, 36, .22), transparent 62%),
        linear-gradient(180deg, rgba(42, 30, 8, .18), rgba(4, 20, 12, .4));
}

/* ------------------------------------------------------------------ Clima: cielo según la hora */
body.duel-playing .climate-zone.has-fx-sky { position: relative; isolation: isolate; }
body.duel-playing .climate-zone.has-fx-sky > :not(.fx-sky) { position: relative; z-index: 1; }
body.duel-playing .climate-zone.has-fx-sky > #globalClimateZone {
    border-color: rgba(186, 230, 253, .45);
    background: linear-gradient(180deg, rgba(2, 6, 23, .02), rgba(2, 6, 23, .32));
    text-shadow: 0 1px 3px rgba(0, 0, 0, .85), 0 0 12px rgba(2, 6, 23, .8);
}
.fx-sky {
    --sky: linear-gradient(180deg, #020617 0%, #0b1033 55%, #1e1b4b 100%);
    --sun-color: #fde68a;
    --stars: 1;
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 14px;
    overflow: hidden;
    pointer-events: none;
    background: var(--sky);
    transition: background 1.5s ease;
}
.fx-sky[data-phase="dawn"] { --sky: linear-gradient(180deg, #1e1b4b 0%, #6d28d9 28%, #f472b6 55%, #fb923c 78%, #fde68a 100%); --sun-color: #fdba74; --stars: .35; }
.fx-sky[data-phase="day"] { --sky: linear-gradient(180deg, #0369a1 0%, #0ea5e9 35%, #7dd3fc 72%, #e0f2fe 100%); --sun-color: #fef9c3; --stars: 0; }
.fx-sky[data-phase="dusk"] { --sky: linear-gradient(180deg, #1e3a8a 0%, #7c3aed 28%, #ec4899 52%, #f97316 76%, #fbbf24 100%); --sun-color: #fb923c; --stars: .25; }
.fx-sky__stars {
    position: absolute;
    inset: 0 0 30% 0;
    opacity: var(--stars);
    background-image:
        radial-gradient(1px 1px at 12% 22%, #fff, transparent),
        radial-gradient(1px 1px at 28% 58%, #e0f2fe, transparent),
        radial-gradient(1.5px 1.5px at 41% 14%, #fff, transparent),
        radial-gradient(1px 1px at 57% 40%, #fff, transparent),
        radial-gradient(1px 1px at 69% 18%, #fef9c3, transparent),
        radial-gradient(1.5px 1.5px at 83% 46%, #fff, transparent),
        radial-gradient(1px 1px at 92% 12%, #e0f2fe, transparent),
        radial-gradient(1px 1px at 7% 70%, #fff, transparent),
        radial-gradient(1px 1px at 50% 72%, #fff, transparent);
    transition: opacity 1.5s ease;
    animation: fxSkyTwinkle 4s ease-in-out infinite alternate;
}
.fx-sky__sun, .fx-sky__moon {
    position: absolute;
    left: var(--sun-x, 50%);
    top: var(--sun-y, 104%);
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 50%;
    transition: left 1.5s ease, top 1.5s ease, opacity 1.5s ease;
}
.fx-sky__sun {
    background: radial-gradient(circle, #fff 0%, var(--sun-color) 45%, rgba(251, 146, 60, .9) 70%);
    box-shadow: 0 0 22px 8px color-mix(in srgb, var(--sun-color) 55%, transparent), 0 0 60px 20px color-mix(in srgb, var(--sun-color) 25%, transparent);
}
.fx-sky[data-phase="night"] .fx-sky__sun { opacity: 0; }
.fx-sky__moon {
    left: var(--moon-x, 50%);
    top: var(--moon-y, 104%);
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    background: transparent;
    box-shadow: inset -6px 3px 0 0 #f1f5f9, 0 0 16px rgba(226, 232, 240, .35);
    opacity: 0;
}
.fx-sky[data-phase="night"] .fx-sky__moon { opacity: 1; }
.fx-sky__cloud {
    position: absolute;
    width: 46%;
    height: 22%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 60%, rgba(255, 255, 255, .85), rgba(255, 255, 255, .45) 50%, transparent 72%);
    filter: blur(1.5px);
    animation: fxSkyCloud 70s linear infinite;
}
.fx-sky__cloud--a { top: 16%; left: -50%; }
.fx-sky__cloud--b { top: 38%; left: -50%; width: 36%; opacity: .75; animation-duration: 95s; animation-delay: -40s; }
.fx-sky[data-phase="night"] .fx-sky__cloud { background: radial-gradient(ellipse at 50% 60%, rgba(100, 116, 139, .5), rgba(51, 65, 85, .3) 50%, transparent 72%); }
.fx-sky[data-phase="dusk"] .fx-sky__cloud,
.fx-sky[data-phase="dawn"] .fx-sky__cloud { background: radial-gradient(ellipse at 50% 60%, rgba(254, 205, 211, .85), rgba(251, 146, 60, .35) 50%, transparent 72%); }
.fx-sky__glow {
    position: absolute;
    inset: auto 0 0 0;
    height: 55%;
    background: radial-gradient(ellipse 70% 100% at var(--sun-x, 50%) 100%, color-mix(in srgb, var(--sun-color) 45%, transparent), transparent 70%);
    opacity: .7;
}
.fx-sky[data-phase="night"] .fx-sky__glow { opacity: .15; }
.fx-sky__hills {
    position: absolute;
    inset: auto 0 0 0;
    height: 26%;
    background: linear-gradient(180deg, rgba(15, 23, 42, .85), rgba(2, 6, 23, .95));
    clip-path: polygon(0 55%, 9% 30%, 18% 52%, 30% 18%, 42% 50%, 53% 28%, 64% 56%, 76% 22%, 88% 48%, 100% 30%, 100% 100%, 0 100%);
}
.fx-sky__label {
    position: absolute;
    right: 8px;
    bottom: 5px;
    z-index: 1;
    color: rgba(241, 245, 249, .85);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}
@keyframes fxSkyTwinkle { from { filter: brightness(.7); } to { filter: brightness(1.3); } }
@keyframes fxSkyCloud { from { transform: translateX(0); } to { transform: translateX(330%); } }

/* ------------------------------------------------------------------ movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .fx-swamp *, .fx-sky *, .fx-sky, .fx-sig-layer *, body.duel-playing .fx-sig-quake,
    body.duel-playing .fx-sig-deck-riffle, body.duel-playing .fx-sig-captor-cast {
        animation: none !important;
        transition: none !important;
    }
}

/* ------------------------------------------------------------------ entrada gratis / desde el Limbo */
body.duel-playing #gameBoard .game-card.fx-sig-waiting { opacity: 0 !important; }
body.duel-playing .combat-visual-ghost.fx-sig-jump-ghost,
body.duel-playing .combat-visual-ghost.fx-sig-sky-ghost {
    box-shadow: 0 0 0 2px rgba(253, 230, 138, .75), 0 0 26px rgba(251, 191, 36, .45), 0 24px 44px rgba(0, 0, 0, .55) !important;
}
body.duel-playing .fx-sig-launch { animation: fxSigLaunch .45s ease-out both; }
@keyframes fxSigLaunch {
    0% { filter: brightness(1); }
    35% { filter: brightness(1.6); box-shadow: 0 0 0 3px rgba(253, 230, 138, .7), 0 0 24px rgba(251, 191, 36, .55); }
    100% { filter: brightness(1); }
}

/* ------------------------------------------------------------------ Devorador de Legión: tentáculos */
.fx-sig-maw {
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(3, 0, 8, .95) 30%, rgba(76, 29, 149, .65) 55%, rgba(124, 58, 237, .25) 70%, transparent 74%);
    box-shadow: 0 0 40px rgba(124, 58, 237, .6);
    animation: fxSigMaw .4s cubic-bezier(.2, .9, .3, 1.1) both;
}
@keyframes fxSigMaw { from { transform: scale(.1); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fx-sig-tentacles svg { overflow: visible; }
.fx-sig-tentacle {
    fill: none;
    stroke: #2e1065;
    stroke-width: 15;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, .8)) drop-shadow(0 6px 6px rgba(0, 0, 0, .6));
}
.fx-sig-tentacle-suckers {
    fill: none;
    stroke: #c4b5fd;
    stroke-width: 5;
    stroke-linecap: round;
    opacity: 0;
}
body.duel-playing .combat-visual-ghost.fx-sig-crushed {
    transform-origin: 50% 100% !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .85), 0 0 24px rgba(91, 33, 182, .7) !important;
}
.fx-sig-splat {
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(46, 16, 101, .9), rgba(76, 29, 149, .5) 50%, transparent 72%);
    animation: fxSigSplat .5s ease-out forwards;
}
@keyframes fxSigSplat { from { transform: scale(.3, .5); opacity: 1; } to { transform: scale(1.3, 1); opacity: 0; } }

/* ------------------------------------------------------------------ Heraldo del Décimo Sello: meteoritos */
.fx-sig-meteor {
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #fff 0%, #fef08a 22%, #f97316 55%, #7c2d12 80%);
    box-shadow: 0 0 18px 6px rgba(249, 115, 22, .8), 0 0 40px rgba(239, 68, 68, .55);
}
.fx-sig-meteor::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 150px;
    height: 16px;
    margin-top: -8px;
    border-radius: 16px;
    transform-origin: 0 50%;
    transform: rotate(-60deg);
    background: linear-gradient(90deg, rgba(254, 240, 138, .9), rgba(249, 115, 22, .6) 35%, rgba(127, 29, 29, .25) 70%, transparent);
    filter: blur(2px);
}
.fx-sig-meteor-impact {
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, .95) 0%, rgba(254, 215, 170, .85) 16%, rgba(249, 115, 22, .6) 36%, rgba(127, 29, 29, .35) 55%, transparent 68%);
    animation: fxSigMeteorImpact .65s ease-out forwards;
}
.fx-sig-meteor-impact::after {
    content: "";
    position: absolute;
    inset: 30%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 10, 4, .85), rgba(68, 25, 8, .5) 60%, transparent 72%);
}
@keyframes fxSigMeteorImpact { 0% { transform: scale(.2); opacity: 1; } 60% { opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
body.duel-playing .combat-visual-ghost.fx-sig-doomed {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .6), 0 0 18px rgba(220, 38, 38, .4) !important;
}
body.duel-playing .combat-visual-ghost.fx-sig-heated {
    animation: fxSigHeated .46s ease-in forwards;
}
@keyframes fxSigHeated {
    0% { filter: brightness(1); }
    60% { filter: brightness(1.5) sepia(1) hue-rotate(-25deg) saturate(4); transform: translate(-2px, 1px); }
    100% { filter: brightness(2.6) sepia(1) hue-rotate(-20deg) saturate(5); transform: translate(2px, -1px) scale(1.05); }
}
body.duel-playing .fx-sig-herald {
    animation: fxSigHerald 1.2s ease-in-out infinite alternate;
}
@keyframes fxSigHerald {
    from { box-shadow: 0 0 0 2px rgba(239, 68, 68, .7), 0 0 22px rgba(220, 38, 38, .55); }
    to { box-shadow: 0 0 0 4px rgba(251, 146, 60, .9), 0 0 44px rgba(239, 68, 68, .85); }
}
.fx-sig-blast--fire {
    background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(254, 215, 170, .85) 16%, rgba(249, 115, 22, .6) 36%, rgba(185, 28, 28, .35) 55%, transparent 70%);
}
.fx-sig-blast--fire i { background: #fdba74; box-shadow: 0 0 10px rgba(249, 115, 22, .95); }

@media (prefers-reduced-motion: reduce) {
    body.duel-playing .fx-sig-launch, body.duel-playing .fx-sig-herald, body.duel-playing .combat-visual-ghost.fx-sig-heated {
        animation: none !important;
    }
}

/* Regla de mazo vacío: aviso de último turno en los datos de la partida. */
body.duel-playing #turnText.final-turn-no-deck {
    color: #ffd0c4 !important;
    text-shadow: 0 0 10px rgba(255, 80, 50, .75);
    animation: fx-final-turn-pulse 1.6s ease-in-out infinite;
}
@keyframes fx-final-turn-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .62; }
}
@media (prefers-reduced-motion: reduce) {
    body.duel-playing #turnText.final-turn-no-deck { animation: none; }
}
