/*
 * Scarlet & Violet 151's own finishes, checked against photos of real cards
 * (.claude/skills/card-textures/reference/151.md). Everything else in the set
 * draws with the shared Scarlet & Violet recipes.
 * The reverse cosmos reuses promos.css's galaxy layers, from pokemon-cards-css
 * by Simon Goellner (@simeydotme), GPL-3.0 (NOTICE.md).
 *
 * Same contract as celebration.css: each recipe rides on a class only these
 * cards get, sets every paint property the older recipes set, paints `.foil`
 * alone at rest and never animates on its own.
 */

/* ---- Reverse cosmos: Costco's mini tin promos ----------------------------------
   The galaxy holo printed where a reverse holo's foil goes (foilLook()'s
   "Reverse Cosmos"): frame, name bar, text box and bottom strip, never the
   art or the silver border. Photos show a dense spray of pinpoint dots with a
   few soft planets and four-point stars, each dot the colour of the ink under
   it, and plainly visible in flat light, where a smooth reverse only shines
   when tilted. So: promos.css's galaxy layers, finer and multiplied onto the
   rainbow so the black between the dots stays clear, dodged onto the ink and
   left well lit at rest. The dark top layer is dropped: on a light frame it
   reads as dirt. */
body.fx-holo.fx-holo.fx-holo .tcg.foil-reverse.foil-cosmos .foil {
  background-image: var(--cosmos-bottom), var(--cosmos-rainbow);
  background-size: 90% 90%, 400% 900%;
  background-position:
    var(--cosmos-pos),
    calc(10% + var(--pointer-from-left) * 80%) calc(10% + var(--pointer-from-top) * 80%);
  background-repeat: repeat;
  background-blend-mode: multiply;
  /* The silver border (about 4% of the width, 2.7% of the height) is plain. */
  clip-path: inset(2.8% 4% 2.6% 4% round 1.2%);
  filter: brightness(1.8) contrast(1.2) saturate(0.9);
  mix-blend-mode: color-dodge;
}
body.fx-holo.fx-holo.fx-holo .tcg.foil-reverse.foil-cosmos .foil::before {
  background-size: 90% 90%, 400% 900%;
}
body.fx-holo.fx-holo.fx-holo .tcg.foil-reverse.foil-cosmos .foil::after {
  background-image: none;
}
body.fx-holo.fx-holo.fx-holo .tcg.foil-reverse.foil-cosmos:not(.lit):not(.settling) .foil {
  opacity: calc(0.6 * var(--foil-strength, 1));
}

/* ---- Metal: the Ultra-Premium Collection's brass Mew ex --------------------------
   A metal card, not a foil print: photos show brass with an engraved swirl
   and a printed pink Mew, one broad reflection that slides across it as it
   tilts, and no glitter or rainbow at all. The scan already carries the
   engraving; the recipe adds the reflection (a wide warm band in overlay, so
   the card darkens away from the light as metal does) and lets the engraved
   lines (the Hyper Rare's etch map, the same swirl) catch it. The foil map
   keeps Mew, whose ink covers the metal, dimmer than the bare brass. */
body.fx-holo.fx-holo.fx-holo .tcg.foil-metal .foil {
  background-image: linear-gradient(115deg,
    hsl(35, 35%, 12%) 0%, hsl(38, 40%, 32%) 30%, hsl(44, 85%, 80%) 45%,
    hsl(48, 100%, 96%) 50%, hsl(44, 85%, 80%) 55%, hsl(38, 40%, 32%) 70%, hsl(35, 35%, 12%) 100%);
  background-size: 300% 300%;
  background-position: calc(100% * var(--pointer-from-left)) calc(100% * var(--pointer-from-top));
  background-repeat: no-repeat;
  background-blend-mode: normal;
  filter: none;
  mix-blend-mode: overlay;
  opacity: calc((0.15 + var(--card-opacity) * 0.75) * var(--foil-strength, 1));
}
body.fx-holo.fx-holo.fx-holo .tcg.foil-metal:not(.lit):not(.settling) .foil {
  opacity: calc(0.15 * var(--foil-strength, 1));
}
body.fx-holo.fx-holo.fx-holo .tcg.foil-metal .foil::before,
body.fx-holo.fx-holo.fx-holo .tcg.foil-metal .foil::after {
  background-image: none;
}
/* A soft gloss, no colour. */
body.fx-holo.fx-holo.fx-holo .tcg.foil-metal .glare {
  background-image: radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y),
    hsla(45, 60%, 96%, 0.55) 0%, hsla(40, 30%, 60%, 0.15) 35%, hsla(0, 0%, 0%, 0) 70%);
  filter: none;
  mix-blend-mode: soft-light;
  opacity: var(--card-opacity);
}
/* The engraving lit under the light, warm rather than celebration.css's white. */
body.fx-holo.fx-holo.fx-holo .tcg.foil-metal.has-etch-map .glare::after {
  background-image: radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y),
    hsla(46, 100%, 88%, 0.85) 0%, hsla(44, 80%, 70%, 0.35) 25%, hsla(0, 0%, 0%, 0) 55%);
  mix-blend-mode: overlay;
  filter: none;
  opacity: calc(var(--card-opacity) * (0.5 + var(--pointer-from-center) * 0.5));
}
