/*
 * Holo family xy-break: BREAK (XY).
 *
 * Scope: every `xy-break` print.
 * Cards: the faces js/fam/xy-break.js claims; it adds `fam-xy-break` to them, and every rule below is scoped to it.
 * Specificity: body.fx-holo.fx-holo.fx-holo .tcg.era-xy.(x5).fam-xy-break.(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/xy-break/.
 */


body.fx-holo.fx-holo.fx-holo .tcg.era-xy.era-xy.era-xy.era-xy.era-xy.fam-xy-break.fam-xy-break.fam-xy-break.fam-xy-break {
  /* one cell of the real foil: 3.3% of the card's long side (the scan's height), square; the checker is two cells */
  --brk-cell: 4.6% 3.3%;
  --brk-cell2: 9.2% 6.6%;
  --brk-dx: calc(var(--pointer-from-left) - 0.5);
  --brk-dy: calc(var(--pointer-from-top) - 0.5);
  --brk-a: atan2(var(--brk-dy), var(--brk-dx));
  --brk-co: var(--card-opacity);
  /* the lobes' masks (below, with the layers that use them) */
  --brk-toward: conic-gradient(from calc(var(--brk-a) + 90deg),
    #000 0deg, #000 31deg, transparent 37deg, transparent 323deg, #000 329deg, #000 360deg);
  --brk-away: conic-gradient(from calc(var(--brk-a) + 270deg),
    #000 0deg, #000 31deg, transparent 37deg, transparent 323deg, #000 329deg, #000 360deg);
  --brk-even: repeating-conic-gradient(rgba(0, 0, 0, 0.5) 0% 25%, #000 0% 50%);
  --brk-odd: repeating-conic-gradient(#000 0% 25%, rgba(0, 0, 0, 0.5) 0% 50%);
  --brk-band: linear-gradient(calc(var(--brk-a) + 90deg),
    rgba(0, 0, 0, 0.07) 0%,
    rgba(0, 0, 0, 0.07) calc(50% + var(--pointer-from-center) * 36% - 34%),
    rgba(0, 0, 0, 0.9) calc(50% + var(--pointer-from-center) * 36% - 12%),
    #000 calc(50% + var(--pointer-from-center) * 36%),
    rgba(0, 0, 0, 0.9) calc(50% + var(--pointer-from-center) * 36% + 12%),
    rgba(0, 0, 0, 0.07) calc(50% + var(--pointer-from-center) * 36% + 34%),
    rgba(0, 0, 0, 0.07) 100%);
  --brk-blob: radial-gradient(ellipse 60% 44% at var(--pointer-x) var(--pointer-y),
    rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.32) 40%, rgba(0, 0, 0, 0.03) 100%);
}
/* ---- .foil: the silver cells, painted opaque (the scan's foil zone is a plain glow) ----
   Per cell: four facets (light right and left, dark top and bottom, the real foil's faint X); a two-cell checker
   alternates the cells' tone; a soft white sheen follows the light. The masks and flash zones of the colour lobes
   (the variables above) are used by ::before and ::after below. */
body.fx-holo.fx-holo.fx-holo .tcg.era-xy.era-xy.era-xy.era-xy.era-xy.fam-xy-break.fam-xy-break.fam-xy-break.fam-xy-break .foil {
  background-image:
    radial-gradient(ellipse 62% 44% at var(--pointer-x) var(--pointer-y),
      hsla(0, 0%, 100%, calc(var(--brk-co) * 0.46)) 0%,
      hsla(0, 0%, 100%, calc(var(--brk-co) * 0.2)) 22%,
      hsla(0, 0%, 100%, 0) 60%),
    conic-gradient(from 45deg at 50% 50%,
      hsla(0, 0%, 100%, calc(0.15 + var(--brk-co) * 0.18)) 0deg 88deg,
      hsla(0, 0%, 0%, calc(0.08 + var(--brk-co) * 0.09)) 92deg 178deg,
      hsla(0, 0%, 100%, calc(0.07 + var(--brk-co) * 0.1)) 182deg 268deg,
      hsla(0, 0%, 0%, calc(0.13 + var(--brk-co) * 0.1)) 272deg 358deg,
      hsla(0, 0%, 100%, calc(0.15 + var(--brk-co) * 0.18)) 360deg),
    repeating-conic-gradient(
      hsla(250, 18%, 34%, calc(0.2 + var(--brk-co) * 0.07)) 0% 25%,
      hsla(45, 20%, 96%, calc(0.2 + var(--brk-co) * 0.1)) 25% 50%),
    linear-gradient(hsl(235, 6%, 79%), hsl(235, 6%, 79%));
  background-size: 100% 100%, var(--brk-cell), var(--brk-cell2), 100% 100%;
  background-position: center, 0 0, 0 0, center;
  background-repeat: no-repeat, repeat, repeat, no-repeat;
  background-blend-mode: normal;
  filter: none;
  mix-blend-mode: normal;
  clip-path: none;
  border-radius: 0;
  opacity: calc(0.94 * var(--foil-strength, 1));
}
body.fx-holo.fx-holo.fx-holo .tcg.era-xy.era-xy.era-xy.era-xy.era-xy.fam-xy-break.fam-xy-break.fam-xy-break.fam-xy-break:not(.lit):not(.settling) .foil {
  filter: none;
  opacity: calc(0.94 * var(--foil-strength, 1));
}

body.fx-holo.fx-holo.fx-holo .tcg.era-xy.era-xy.era-xy.era-xy.era-xy.fam-xy-break.fam-xy-break.fam-xy-break.fam-xy-break .foil::before,
body.fx-holo.fx-holo.fx-holo .tcg.era-xy.era-xy.era-xy.era-xy.era-xy.fam-xy-break.fam-xy-break.fam-xy-break.fam-xy-break .foil::after {
  background-image: none;
  background-size: auto;
  background-position: center;
  background-repeat: repeat;
  background-blend-mode: normal;
  mix-blend-mode: normal;
  filter: none;
  -webkit-mask-image: none;
  mask-image: none;
  clip-path: none;
  border-radius: 0;
  transform: none;
  animation: none;
  opacity: 1;
  -webkit-mask-size: var(--brk-cell), var(--brk-cell2), 100% 100%, 100% 100%;
  mask-size: var(--brk-cell), var(--brk-cell2), 100% 100%, 100% 100%;
  -webkit-mask-position: 0 0, 0 0, center, center;
  mask-position: 0 0, 0 0, center, center;
  -webkit-mask-repeat: repeat, repeat, no-repeat, no-repeat;
  mask-repeat: repeat, repeat, no-repeat, no-repeat;
  -webkit-mask-composite: source-in, source-in, source-over, source-over;
  mask-composite: intersect, intersect, add, add;
}

/* ---- The lobes: the rainbow bow-tie through each cell's centre, along the light (one half per pseudo).
   Each half is a crisp conic wedge (a mask repeated at the cell size, its angle from the pointer) over a
   rainbow ring centred on the light: ::before is the half toward the light, ::after the half away from it
   with the ring drawn tighter, so the two halves of a cell flash different colours. A two-cell checker
   weights them oppositely, so neighbouring cells alternate which colour leads, as on the real foil.
   The flash zone is a band across the card (square to the line to the light, through the light) plus a
   broad blob round the light, with a floor, so some foil is always flashing and some is always silver. ---- */
body.fx-holo.fx-holo.fx-holo .tcg.era-xy.era-xy.era-xy.era-xy.era-xy.fam-xy-break.fam-xy-break.fam-xy-break.fam-xy-break .foil::before {
  background-image: radial-gradient(ellipse 100% 72% at var(--pointer-x) var(--pointer-y),
    hsl(205, 100%, 80%) 0%,
    hsl(250, 100%, 66%) 9%,
    hsl(222, 100%, 54%) 19%,
    hsl(190, 100%, 48%) 30%,
    hsl(150, 100%, 44%) 41%,
    hsl(100, 100%, 44%) 51%,
    hsl(56, 100%, 50%) 60%,
    hsl(34, 100%, 52%) 69%,
    hsl(354, 100%, 58%) 78%,
    hsl(318, 100%, 58%) 88%,
    hsl(275, 100%, 62%) 100%);
  -webkit-mask-image: var(--brk-toward), var(--brk-even), var(--brk-band), var(--brk-blob);
  mask-image: var(--brk-toward), var(--brk-even), var(--brk-band), var(--brk-blob);
  opacity: calc(var(--brk-co) * (0.88 + var(--pointer-from-center) * 0.12) * max(1, var(--foil-strength, 1)));
}
body.fx-holo.fx-holo.fx-holo .tcg.era-xy.era-xy.era-xy.era-xy.era-xy.fam-xy-break.fam-xy-break.fam-xy-break.fam-xy-break .foil::after {
  background-image: radial-gradient(ellipse 100% 72% at var(--pointer-x) var(--pointer-y),
    hsl(48, 100%, 78%) 0%,
    hsl(32, 100%, 54%) 9%,
    hsl(352, 100%, 58%) 19%,
    hsl(312, 100%, 56%) 30%,
    hsl(268, 100%, 62%) 41%,
    hsl(226, 100%, 56%) 51%,
    hsl(192, 100%, 46%) 61%,
    hsl(152, 100%, 44%) 71%,
    hsl(98, 100%, 44%) 84%,
    hsl(56, 100%, 50%) 100%);
  -webkit-mask-image: var(--brk-away), var(--brk-odd), var(--brk-band), var(--brk-blob);
  mask-image: var(--brk-away), var(--brk-odd), var(--brk-band), var(--brk-blob);
  opacity: calc(var(--brk-co) * (0.8 + var(--pointer-from-center) * 0.12) * max(1, var(--foil-strength, 1)));
}

/* ---- .glare: the varnish over the whole card ---- */
body.fx-holo.fx-holo.fx-holo .tcg.era-xy.era-xy.era-xy.era-xy.era-xy.fam-xy-break.fam-xy-break.fam-xy-break.fam-xy-break .glare {
  background-image: radial-gradient(farthest-corner circle at var(--pointer-x) var(--pointer-y),
    hsla(0, 0%, 100%, 0.5) 0%, hsla(0, 0%, 100%, 0.1) 30%, hsla(0, 0%, 50%, 0) 70%);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: normal;
  mix-blend-mode: soft-light;
  filter: none;
  opacity: calc(var(--card-opacity) * 0.55);
}
body.fx-holo.fx-holo.fx-holo .tcg.era-xy.era-xy.era-xy.era-xy.era-xy.fam-xy-break.fam-xy-break.fam-xy-break.fam-xy-break .glare::after {
  background: none;
  -webkit-mask-image: none;
  mask-image: none;
  mix-blend-mode: normal;
  filter: none;
  opacity: 1;
}
