/*
 * Holo family wotc-neo-destiny: Neo Destiny (neo4) holos.
 *
 * Scope: neo4 Rare Holo including Miracle Energy 16 (the eight Shinings belong to wotc-shining).
 * Cards: the faces js/fam/wotc-neo-destiny.js claims; it adds `fam-wotc-neo-destiny` to them, and every rule below is scoped to it.
 * Specificity: body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.(x5).fam-wotc-neo-destiny.(x4) beats the era sheets
 * (this sheet loads after them); keep the era's :not(.lit):not(.settling) when overriding a rest-state rule.
 * Part of the older-era holo remaster (2026-10-02): the research, photos and review for this family are in
 * /mnt/project-files/holo-remaster/wotc-neo-destiny/.
 *
 * What the real cards do (refs/SOURCES.md there): the cosmos holofoil is the art window's BACKGROUND only; the Pokemon (ink
 * over a white underlay), the evolution badge, the frame and the text stay matte. Away from the lamp the sky shows separate
 * elements (fine specks, small squares and plus shapes, discs, soft orbs), each lit in its own colour. At the lamp's angle the
 * whole background flashes as one sheen (black sky lifts to silver, purple sky to salmon and pink) with the elements inside it.
 * Dark Pokemon have black or deep-purple skies, so (as on Team Rocket) the foil is light ADDED to the print, never a gain on
 * it: a screen group held at a low opacity, with the elements added on top. A stronger wash painted a flat sheet over the art.
 *
 * Maps (per card, js/fam/wotc-neo-destiny.js; drawn from each scan by .claude/skills/card-textures/scripts/fam/wotc-neo-destiny/):
 * `--nd-area` (alpha = the foil area: the window's background, the Pokemon, badge and frame cut out) and `--nd-fleck`
 * (alpha = the elements, RGB = their colours), both the size of the scan, so every mask is 100% 100% at 0 0.
 *
 * Layers:
 * - `.foil`: SCREENED and cut to the foil area. At rest the elements over a faint cool tint; tipped, a soft diffraction spectrum
 *   that slides with the tilt and a silver-warm pool that follows the pointer, at a held low opacity.
 * - `.foil::before` / `::after`: the elements again, added (plus-lighter: light only), each lit by its own band sliding a
 *   different way and by the pointer's pool, hue-turning as the card turns, so the specks wink in turn.
 * - `.glare`: the elements flare (screen) around the pointer.
 * Light only: screen and plus-lighter never darken, so no black speckle. No tile anywhere: every map is the card's own.
 */

/* ---- every state: the foil area is the mask ---------------------------------------------------------------------- */
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny .foil {
  -webkit-mask-image: var(--nd-area);
  mask-image: var(--nd-area);
  -webkit-mask-composite: source-over;
  mask-composite: add;
  mask-mode: alpha;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  clip-path: none;
  border-radius: 0;
  /* lit (top first): a silver pool at the pointer over a slow, muted diffraction spectrum (silver-grey, not a colour sheet) */
  background-image:
    radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y),
      hsla(35, 45%, 90%, 0.75) 0%, hsla(300, 25%, 72%, 0.28) 30%, hsla(260, 20%, 55%, 0) 58%),
    linear-gradient(115deg,
      hsl(188, 40%, 42%) 0%, hsl(232, 36%, 48%) 14%, hsl(300, 32%, 46%) 28%, hsl(18, 42%, 46%) 42%,
      hsl(48, 42%, 44%) 56%, hsl(150, 34%, 40%) 70%, hsl(188, 40%, 42%) 84%, hsl(232, 36%, 48%) 100%);
  background-size: 100% 100%, 300% 300%;
  background-position:
    center,
    calc(50% + (var(--background-x) - 50%) * -3) calc(50% + (var(--background-y) - 50%) * -3);
  background-repeat: no-repeat, no-repeat;
  background-blend-mode: normal, normal;
  filter: none;
  mix-blend-mode: screen;
  opacity: calc((0.06 + var(--card-opacity) * 0.26) * var(--foil-strength, 1));
}

/* ---- rest: the elements in their colours, screened, over a faint cool tint ------------------------------------------ */
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny:not(.lit):not(.settling) .foil {
  background-image:
    var(--nd-fleck),
    linear-gradient(115deg, hsla(200, 80%, 62%, 0.14), hsla(290, 70%, 64%, 0.1) 50%, hsla(40, 90%, 60%, 0.12));
  background-size: 100% 100%, 100% 100%;
  background-position: 0 0, center;
  background-repeat: no-repeat, no-repeat;
  background-blend-mode: normal, normal;
  filter: none;
  opacity: calc(0.5 * var(--foil-strength, 1));
}

/* ---- the pseudo layers and the glare's: clear what the era and the older recipes paint --------------------------------- */
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny .foil::before,
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny .foil::after,
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny .glare::after {
  background-image: none;
  background-size: 100% 100%;
  background-position: 0 0;
  background-repeat: no-repeat;
  background-blend-mode: normal;
  mix-blend-mode: normal;
  filter: none;
  -webkit-mask-image: none;
  mask-image: none;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  clip-path: none;
  border-radius: 0;
  transform: none;
  animation: none;
  opacity: 1;
}

/* ---- the elements, two halves: each lit by its own sliding band and the pointer's pool -------------------------------- */
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny .foil::before,
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny .foil::after {
  background-image: var(--nd-fleck), var(--nd-fleck);
  background-size: 100% 100%, 100% 100%;
  background-position: 0 0, 0 0;
  background-repeat: no-repeat, no-repeat;
  mix-blend-mode: plus-lighter;
  -webkit-mask-image:
    linear-gradient(104deg, rgba(0, 0, 0, 0.18) 8%, #000 20%, #000 27%, rgba(0, 0, 0, 0.18) 40%, rgba(0, 0, 0, 0.18) 56%, #000 68%, #000 74%, rgba(0, 0, 0, 0.18) 88%),
    radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y), #000 0%, rgba(0, 0, 0, 0.8) 35%, rgba(0, 0, 0, 0.5) 90%);
  mask-image:
    linear-gradient(104deg, rgba(0, 0, 0, 0.18) 8%, #000 20%, #000 27%, rgba(0, 0, 0, 0.18) 40%, rgba(0, 0, 0, 0.18) 56%, #000 68%, #000 74%, rgba(0, 0, 0, 0.18) 88%),
    radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y), #000 0%, rgba(0, 0, 0, 0.8) 35%, rgba(0, 0, 0, 0.5) 90%);
  -webkit-mask-composite: source-in, source-over;
  mask-composite: intersect, add;
  mask-mode: alpha, alpha;
  -webkit-mask-size: 300% 300%, 100% 100%;
  mask-size: 300% 300%, 100% 100%;
  -webkit-mask-position: calc(50% + (var(--background-x) - 50%) * 3.5) calc(50% + (var(--background-y) - 50%) * 3.5), center;
  mask-position: calc(50% + (var(--background-x) - 50%) * 3.5) calc(50% + (var(--background-y) - 50%) * 3.5), center;
  filter: hue-rotate(calc(var(--rotate-x) * 9 - var(--rotate-y) * 7)) saturate(1.25);
  opacity: min(1, calc(var(--card-opacity) * 0.85 * max(1, var(--foil-strength, 1))));
}
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny .foil::after {
  -webkit-mask-image:
    linear-gradient(66deg, rgba(0, 0, 0, 0.18) 6%, #000 18%, #000 25%, rgba(0, 0, 0, 0.18) 38%, rgba(0, 0, 0, 0.18) 54%, #000 66%, #000 72%, rgba(0, 0, 0, 0.18) 86%),
    radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y), #000 0%, rgba(0, 0, 0, 0.8) 35%, rgba(0, 0, 0, 0.5) 90%);
  mask-image:
    linear-gradient(66deg, rgba(0, 0, 0, 0.18) 6%, #000 18%, #000 25%, rgba(0, 0, 0, 0.18) 38%, rgba(0, 0, 0, 0.18) 54%, #000 66%, #000 72%, rgba(0, 0, 0, 0.18) 86%),
    radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y), #000 0%, rgba(0, 0, 0, 0.8) 35%, rgba(0, 0, 0, 0.5) 90%);
  -webkit-mask-position: calc(50% + (var(--background-x) - 50%) * -3.5) calc(50% + (var(--background-y) - 50%) * 3.5), center;
  mask-position: calc(50% + (var(--background-x) - 50%) * -3.5) calc(50% + (var(--background-y) - 50%) * 3.5), center;
  filter: hue-rotate(calc(var(--rotate-y) * 9 - var(--rotate-x) * 7 + 140deg)) saturate(1.25);
}

/* ---- .glare: the elements flare around the pointer ------------------------------------------------------------------- */
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny .glare {
  background-image: var(--nd-fleck), var(--nd-fleck);
  background-size: 100% 100%, 100% 100%;
  background-position: 0 0, 0 0;
  background-repeat: no-repeat, no-repeat;
  background-blend-mode: normal;
  mix-blend-mode: screen;
  filter: saturate(1.2);
  clip-path: none;
  border-radius: 0;
  -webkit-mask-image: radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y), #000 0%, rgba(0, 0, 0, 0.6) 34%, rgba(0, 0, 0, 0.12) 80%);
  mask-image: radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y), #000 0%, rgba(0, 0, 0, 0.6) 34%, rgba(0, 0, 0, 0.12) 80%);
  -webkit-mask-composite: source-over;
  mask-composite: add;
  mask-mode: alpha;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  opacity: min(1, calc(var(--card-opacity) * 0.9 * max(1, var(--foil-strength, 1))));
}
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny.fam-wotc-neo-destiny .glare::after {
  display: none;
  opacity: 0;
}
