/* =========================================================================
   L.U.N.A. Effekt-Baukasten: Belohnungsflug, Funken, Erfolgs-Banner, Wurmloch
   ========================================================================= */

/* Flug in die HUD */
.fx-coin { position: fixed; z-index: 10050; width: 26px; height: 26px; display: grid; place-items: center; pointer-events: none; font-size: 1.15rem; line-height: 1; will-change: transform; }
.fx-coin svg { width: 22px; height: 22px; }
.fx-coin.k-lc { filter: drop-shadow(0 0 8px rgba(245, 166, 35, .9)); }
.fx-coin.k-dust { filter: drop-shadow(0 0 8px rgba(168, 85, 247, .9)); }
.fx-coin.k-shields { filter: drop-shadow(0 0 8px rgba(74, 141, 255, .9)); }
.res-pod.fx-hit { animation: fxPodHit .32s ease-out; }
@keyframes fxPodHit { 0% { transform: scale(1); } 40% { transform: scale(1.12); box-shadow: 0 0 26px currentColor, inset 0 0 12px currentColor; } 100% { transform: scale(1); } }
.fx-spark { position: fixed; z-index: 10049; width: 6px; height: 6px; border-radius: 50%; pointer-events: none; box-shadow: 0 0 8px currentColor; }
.fx-flash { position: fixed; inset: 0; z-index: 10040; pointer-events: none; opacity: 0; mix-blend-mode: screen; }

/* ------------------------------------------------------- Erfolge */
.fx-ach { position: fixed; z-index: 10030; left: 50%; top: calc(var(--hud-h, 64px) + 14px); width: min(470px, calc(100vw - 24px)); transform: translate(-50%, -30px) scale(.92); opacity: 0;
          display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 40px 14px 14px; border-radius: 16px; cursor: pointer; overflow: hidden;
          background: linear-gradient(100deg, color-mix(in srgb, var(--tc) 22%, #0b0f1c), #0b0f1c 55%); border: 1px solid color-mix(in srgb, var(--tc) 60%, transparent);
          box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .8), 0 0 40px -12px var(--tc); transition: transform .5s cubic-bezier(.2, 1.4, .4, 1), opacity .3s; }
.fx-ach.in { transform: translate(-50%, 0) scale(1); opacity: 1; }
.fx-ach.out { transform: translate(-50%, -24px) scale(.96); opacity: 0; transition: transform .35s ease-in, opacity .35s; }
.fx-ach::after { content: ''; position: absolute; inset: -50% -30%; background: linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, .18) 50%, transparent 58%); transform: translateX(-60%); animation: fxSheen 1.6s ease-out .7s both; pointer-events: none; }
@keyframes fxSheen { to { transform: translateX(60%); } }
.fx-ach-rays { position: absolute; left: 44px; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; pointer-events: none; opacity: .35;
               background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tc) 60%, transparent) 0 6deg, transparent 6deg 20deg); border-radius: 50%;
               -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); animation: fxRays 9s linear infinite; }
@keyframes fxRays { to { transform: rotate(360deg); } }
.fx-medal { position: relative; width: 62px; height: 62px; perspective: 400px; }
.fx-coin3d { position: absolute; inset: 0; transform-style: preserve-3d; animation: fxFlip 1.3s cubic-bezier(.2, .7, .3, 1) .15s both; }
@keyframes fxFlip { from { transform: rotateY(-900deg) scale(.4); } 70% { transform: rotateY(12deg) scale(1.08); } to { transform: rotateY(0) scale(1); } }
.fx-coin3d .face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; backface-visibility: hidden;
                   background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--tc) 85%, #fff) 22%, var(--tc) 55%, color-mix(in srgb, var(--tc) 55%, #000));
                   box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 50%, #000) inset, 0 0 0 5px color-mix(in srgb, var(--tc) 80%, #fff) inset, 0 0 22px color-mix(in srgb, var(--tc) 70%, transparent); }
.fx-coin3d .face i { font-style: normal; font-size: 1.7rem; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.fx-coin3d .face.back { transform: rotateY(180deg); }
.fx-coin3d .face.back i { color: rgba(0, 0, 0, .35); font-size: 1.9rem; }
.fx-ach-txt { position: relative; min-width: 0; display: grid; }
.fx-ach-txt small { font-size: .66rem; letter-spacing: 1.6px; text-transform: uppercase; color: var(--tc); font-weight: 600; }
.fx-ach-txt b { font-family: var(--font-display); font-size: 1.25rem; color: #fff; line-height: 1.15; }
.fx-ach-txt span { font-size: .78rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-ach-pts { position: relative; text-align: center; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--tc); line-height: 1; }
.fx-ach-pts small { display: block; font-family: var(--font-body); font-size: .6rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); font-weight: 400; }
.fx-ach-x { position: absolute; right: 8px; top: 8px; width: 24px; height: 24px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .06); color: var(--text-dim); cursor: pointer; font-size: .75rem; }
.fx-ach.tier-platin .fx-coin3d .face { animation: fxPlat 2.4s linear infinite; }
@keyframes fxPlat { 50% { filter: hue-rotate(40deg) brightness(1.2); } }

/* ---------------------------------------------------- Wurmloch */
.fx-wh { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: transparent; transition: background .8s; overflow: hidden; }
.fx-wh.dark { background: rgba(3, 4, 12, .55); }
.fx-wh.tunnel { background: #020209; }
.fx-wh-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-wh::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.fx-wh.white::after { animation: fxWhite .9s ease-out forwards; }
@keyframes fxWhite { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
.fx-wh.tunnel .fx-wh-cv { animation: fxTunnelShake .12s linear infinite; }
@keyframes fxTunnelShake { 25% { translate: 2px -1px; } 50% { translate: -2px 2px; } 75% { translate: 1px 1px; } }
.fx-wh-phase { position: absolute; left: 0; right: 0; bottom: 16%; text-align: center; font-family: var(--font-display); font-size: clamp(1.1rem, 4vw, 1.6rem); letter-spacing: 3px; text-transform: uppercase; color: #e9d5ff; text-shadow: 0 0 20px #a855f7; pointer-events: none; }
.fx-wh-skip { position: absolute; top: 16px; right: 16px; z-index: 2; padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(0, 0, 0, .35); color: #cbd5e1; font: inherit; font-size: .78rem; cursor: pointer; }
.fx-wh-reveal { position: relative; z-index: 1; width: min(640px, calc(100vw - 32px)); text-align: center; opacity: 0; transform: scale(.9); pointer-events: none; transition: opacity .6s .15s, transform .8s cubic-bezier(.2, 1.2, .3, 1) .15s; max-height: 100vh; overflow: auto; padding: 16px 0; }
.fx-wh.revealed .fx-wh-reveal { opacity: 1; transform: none; pointer-events: auto; }
.fx-wh.revealed { background: radial-gradient(circle at 50% 40%, #1c0b3a, #05030e 70%); }
.fx-wh-k { font-size: .8rem; letter-spacing: 4px; text-transform: uppercase; color: #c4b5fd; }
.fx-wh-p { font-family: var(--font-display); font-weight: 700; font-size: clamp(5rem, 22vw, 10rem); line-height: .95; color: #fff;
           background: linear-gradient(180deg, #fff, #e9d5ff 40%, #a855f7); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
           filter: drop-shadow(0 0 30px rgba(168, 85, 247, .8)); }
.fx-wh.revealed .fx-wh-p { animation: fxPIn 1s cubic-bezier(.2, 1.4, .3, 1) .2s both; }
@keyframes fxPIn { from { transform: scale(2.2); opacity: 0; letter-spacing: 30px; } }
.fx-wh-sub { color: var(--text); margin: 4px 0 18px; }
.fx-wh-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.fx-wh-cards .fx-wh-card { flex: 1 1 150px; max-width: 210px; }
.fx-wh-cards .fx-wh-card.big { flex-basis: 100%; max-width: none; }
.fx-wh-card { padding: 12px 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(168, 85, 247, .3); display: grid; gap: 2px; }
.fx-wh-card small { font-size: .66rem; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-dim); }
.fx-wh-card b { font-family: var(--font-display); font-size: 1.35rem; color: #fff; }
.fx-wh-card em { font-style: normal; font-size: .72rem; color: var(--text-dim); }
.fx-wh-card.big { padding: 16px; background: linear-gradient(135deg, rgba(168, 85, 247, .18), rgba(47, 224, 228, .08)); border-color: rgba(168, 85, 247, .6); }
.fx-wh-card.big b { font-size: clamp(2.2rem, 9vw, 3.2rem); color: var(--gold); text-shadow: 0 0 26px rgba(245, 166, 35, .45); font-variant-numeric: tabular-nums; }
.fx-wh-card.big.done { animation: fxCardPop .5s ease-out; }
@keyframes fxCardPop { 40% { transform: scale(1.05); box-shadow: 0 0 40px rgba(168, 85, 247, .6); } }
.fx-wh-note { font-size: .78rem; color: var(--text-dim); margin: 14px auto; max-width: 480px; }
.fx-wh-go { min-width: 240px; }
.fx-wh.out { animation: fxOut .45s ease both; }
@keyframes fxOut { to { opacity: 0; } }

/* Aufträge & Ziel: Balken voll, Stempel */
.ct.fx-fill .ct-seg i { background: rgba(125, 138, 163, .18); box-shadow: none; }
.ct.fx-fill .ct-seg i.fx-on { background: var(--green); box-shadow: 0 0 8px rgba(52, 224, 127, .7); transition: background .08s; }
.ct.fx-fill .ct-stamp { opacity: 0; animation: none; }
.ct.fx-stamped .ct-stamp { animation: ct-stamp .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.hg-card.fx-done .hg-bar i { transition: width .7s cubic-bezier(.3, .8, .3, 1); }
.fx-check { position: absolute; z-index: 5; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; display: grid; place-items: center; pointer-events: none;
            background: radial-gradient(circle, rgba(52, 224, 127, .95), rgba(20, 140, 80, .95)); box-shadow: 0 0 0 6px rgba(52, 224, 127, .25), 0 0 40px rgba(52, 224, 127, .7);
            animation: fxCheck 1.4s cubic-bezier(.2, 1.5, .4, 1) forwards; }
.fx-check svg { width: 46px; height: 46px; }
.fx-check path { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: fxTick .45s ease-out .25s forwards; }
@keyframes fxCheck { 0% { transform: scale(2.4) rotate(-20deg); opacity: 0; } 25% { transform: scale(1) rotate(-8deg); opacity: 1; } 80% { transform: scale(1) rotate(-8deg); opacity: 1; } 100% { transform: scale(.8) rotate(-8deg); opacity: 0; } }
@keyframes fxTick { to { stroke-dashoffset: 0; } }

@media (max-width: 640px) {
  .fx-ach { grid-template-columns: auto 1fr; padding: 12px 36px 12px 12px; gap: 12px; top: calc(var(--hud-h, 56px) + 8px); }
  .fx-ach-pts { display: none; }
  .fx-medal { width: 52px; height: 52px; }
  .fx-ach-txt b { font-size: 1.1rem; }
  .fx-wh-p { font-size: clamp(4.5rem, 30vw, 7rem); }
}
@media (prefers-reduced-motion: reduce) {
  .fx-ach, .fx-ach.in, .fx-ach.out { transition: opacity .2s; }
  .fx-ach-rays, .fx-coin3d, .fx-ach::after, .fx-check, .fx-check path { animation: none !important; }
  .fx-check path { stroke-dashoffset: 0; }
}

/* ------------------------------------------------------- Weltboss */
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wb-hpbar .wb-ghost { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, #fff3c4, #ffe0e6); opacity: .85; transition: width .6s cubic-bezier(.5, 0, .3, 1); }
.wb-hpbar i { z-index: 0; }
.wb-dmg { display: grid; justify-items: center; line-height: 1; }
.wb-dmg small { font-size: .9rem; letter-spacing: 3px; color: #fff; background: #ff4d6a; padding: 3px 8px; border-radius: 6px; margin-bottom: 4px; text-shadow: none; animation: wbCritTag .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.wb-dmg em { font-style: normal; font-size: .85rem; color: #ffe45c; margin-top: 4px; }
.wb-dmg.crit span { font-size: 3.4rem; }
@keyframes wbCritTag { from { transform: scale(2.2) rotate(-8deg); opacity: 0; } to { transform: rotate(-4deg); } }
.wb-arena.crit .wb-stage .bs { animation: wbHit .45s ease-out, wbCritFlash .35s steps(2) 2; }
@keyframes wbCritFlash { 50% { filter: brightness(3) saturate(0); } }
.wb-slash.crit { inset: 10% 5%; filter: drop-shadow(0 0 10px #ffe45c); }
