/*
 * Holo family wotc-shining: Shining Pokémon (Neo Revelation, Neo Destiny).
 *
 * Scope: neo3 65-66 and neo4 106-113 (`wotc-shining`).
 * Cards: the faces js/fam/wotc-shining.js claims; it adds `fam-wotc-shining` to them, and every rule below is scoped to it.
 * Specificity: body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.(x5).fam-wotc-shining.(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-01): the research, photos and review for this family are in
 * /mnt/project-files/holo-remaster/wotc-shining/.
 */
/*
 * What the real cards do (photos in /mnt/project-files/holo-remaster/wotc-shining/refs/, NOTES.md):
 *   Neo Destiny 106-113: the Pokémon FIGURE (and Charizard's flame blast) is the foil; the scene, the glow outline, the frame
 *   and the text are plain print. A metal with a fine sparkle grain: dark gunmetal away from the lamp, a bright silver tinted
 *   by the ink under it (Charizard lavender, Celebi rose, Raichu and Tyranitar gold...), and a spectral band that slides across.
 *   Neo Revelation 65-66: the art window's BACKGROUND is the Neo galaxy foil (dots and discs: dark sky with coloured glints,
 *   a silver-lavender haze near the lamp); the Pokémon (and Gyarados's kayaker) are matte.
 *
 * How it is drawn (maps in assets/foil/fam/wotc-shining/, from each scan by scripts/fam/wotc-shining/make_masks.py and make_maps.py):
 *   `.foil`          one SCREEN group cut to the card's mask (`--ws-mask`): the lit map (`--ws-lit`, how much light each pixel of
 *                    the figure or sky takes back, the drawing's black lines held at 0) multiplied by a tinted pool at the pointer,
 *                    a spectral band that slides with the tilt and a dim ground. Screen only adds light, so the art keeps its colours.
 *   `::before`       the scan's own sparkle grain (`--ws-spark`), plus-lighter, lit by a sliding band and the pointer's pool, its
 *                    hue turning with the tilt.
 *   `::after`        unused.
 *   `.glare`         the era's soft white pool, untouched.
 */


/* The band that slides across the metal. Default: the lamp's own sheen, a soft stripe of the figure's lit tint (photos of Celebi,
   Kabutops, Raichu, Steelix, Tyranitar and Noctowl show silver or gold, never a spectrum). Only Charizard and Mewtwo throw colour
   in tilted photos: .ws-spec is the full spectrum, .ws-spec-lite the part-of-the-figure band of the Mewtwo photo. */
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.ws-mapped {
  --ws-band: linear-gradient(112deg, transparent 0%, transparent 28%, hsla(var(--ws-h), var(--ws-s), 74%, 0.55) 44%, hsla(var(--ws-h), calc(var(--ws-s) * 0.4), 92%, 0.8) 50%, hsla(var(--ws-h), var(--ws-s), 74%, 0.55) 56%, transparent 72%, transparent 100%);
  --ws-spin: 0.6;
  --ws-ground: hsl(var(--ws-h) var(--ws-s) 26%); --ws-pool: hsl(var(--ws-h) var(--ws-s) var(--ws-l));
}
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.ws-mapped.ws-spec {
  --ws-band: linear-gradient(112deg, transparent 0%, transparent 30%, hsla(335, 90%, 62%, 0.85) 38%, hsla(40, 100%, 62%, 0.95) 44%, hsla(130, 80%, 56%, 0.9) 50%, hsla(190, 95%, 62%, 0.95) 56%, hsla(240, 90%, 66%, 0.85) 62%, transparent 70%, transparent 100%);
  --ws-spin: 1.6;
}
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.ws-mapped.ws-spec-lite {
  --ws-band: linear-gradient(112deg, transparent 0%, transparent 34%, hsla(30, 85%, 62%, 0.45) 42%, hsla(60, 80%, 62%, 0.5) 47%, hsla(130, 55%, 58%, 0.35) 52%, transparent 58%, transparent 100%);
  --ws-spin: 1;
}

/* ---- .foil ---------------------------------------------------------------------------------------------------------------- */
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.ws-mapped .foil {
  background-image:
    var(--ws-lit),
    var(--ws-band),
    radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y), var(--ws-pool) 0%, hsla(var(--ws-h), var(--ws-s), var(--ws-l), 0.55) 35%, hsla(var(--ws-h), var(--ws-s), var(--ws-l), 0) 75%),
    linear-gradient(var(--ws-ground), var(--ws-ground));
  background-size: 100% 100%, 260% 260%, 100% 100%, 100% 100%;
  background-position:
    center,
    calc(50% + (var(--background-x) - 50%) * -2.4) calc(50% + (var(--background-y) - 50%) * -1.4),
    center,
    center;
  background-repeat: no-repeat;
  background-blend-mode: multiply, normal, normal, normal;
  mix-blend-mode: screen;
  filter: none;
  clip-path: none;
  border-radius: 0;
  -webkit-mask-image: var(--ws-mask);
  mask-image: var(--ws-mask);
  -webkit-mask-composite: source-over;
  mask-composite: add;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  opacity: calc((0.38 + var(--card-opacity) * 0.5) * var(--foil-strength, 1));
}
/* at rest: the metal's own dim sheen, one soft diagonal highlight, so a binder page still reads as foil */
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.ws-mapped:not(.lit):not(.settling) .foil {
  background-image:
    var(--ws-lit),
    linear-gradient(118deg, hsl(222, 20%, 22%) 0%, hsl(var(--ws-h), var(--ws-s), 40%) 34%, hsl(222, 20%, 20%) 56%, hsl(var(--ws-h), 18%, 26%) 80%, hsl(222, 20%, 18%) 100%);
  background-size: 100% 100%, 100% 100%;
  background-position: center, center;
  background-blend-mode: multiply, normal;
  opacity: calc(0.38 * var(--foil-strength, 1));
}
/* Neo Revelation: the sky takes a cooler, wider haze and the band runs the other way */
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.ws-mapped.ws-bg .foil {
  opacity: calc((0.12 + var(--card-opacity) * 0.3) * var(--foil-strength, 1));
}
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.ws-mapped.ws-bg:not(.lit):not(.settling) .foil {
  opacity: calc(0.12 * var(--foil-strength, 1));
}

/* ---- the sparkle grain: the scan's own specks, plus-lighter ------------------------------------------------------------------ */
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.ws-mapped .foil::before {
  display: block;
  background-image: var(--ws-spark);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: normal;
  mix-blend-mode: plus-lighter;
  filter: hue-rotate(calc((var(--background-x) - 50) * var(--ws-spin, 1) * 1deg));
  clip-path: none;
  border-radius: 0;
  -webkit-mask-image:
    linear-gradient(104deg, rgba(0, 0, 0, 0.25) 8%, #000 22%, #000 30%, rgba(0, 0, 0, 0.25) 44%, rgba(0, 0, 0, 0.25) 58%, #000 72%, #000 78%, rgba(0, 0, 0, 0.25) 92%),
    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.25) 8%, #000 22%, #000 30%, rgba(0, 0, 0, 0.25) 44%, rgba(0, 0, 0, 0.25) 58%, #000 72%, #000 78%, rgba(0, 0, 0, 0.25) 92%),
    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;
  -webkit-mask-mode: alpha, alpha;
  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;
  -webkit-mask-repeat: no-repeat, no-repeat;
  mask-repeat: no-repeat, no-repeat;
  opacity: min(1, calc((0.2 + var(--card-opacity) * 0.8) * 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-shining.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.ws-mapped .foil::after {
  display: none;
  background-image: none;
  opacity: 0;
}

/* ---- .glare: the generic overlay pool (white 0.8) washed the gold figures pale grey. The paper keeps its gloss; the foil's own
   pixels (the card's mask) are left to the foil layers, which light them in the metal's tint. ------------------------------------- */
body.fx-holo.fx-holo.fx-holo .tcg.era-wotc.era-wotc.era-wotc.era-wotc.era-wotc.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.fam-wotc-shining.ws-mapped .glare {
  -webkit-mask-image: linear-gradient(#000, #000), var(--ws-mask);
  mask-image: linear-gradient(#000, #000), var(--ws-mask);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  -webkit-mask-mode: alpha, alpha;
  mask-mode: alpha, alpha;
  -webkit-mask-size: 100% 100%, contain;
  mask-size: 100% 100%, contain;
  -webkit-mask-position: center, center;
  mask-position: center, center;
  -webkit-mask-repeat: no-repeat, no-repeat;
  mask-repeat: no-repeat, no-repeat;
}
