/* Card effects: 3D tilt and parallax, holo and foil finishes per rarity, the pack
   opener (pkx-), binder pages (tb-) and the hover preview. Driven by the custom
   properties cards-fx.js writes on each .tc: --px --py (-0.5..0.5), --rx --ry (deg) and
   --act (0..1, "being handled"); --mx --my (%), --hyp (0..1) and --bgx --bgy (%) derive from them
   below. Finishes: matte, chrome, reverse, etched, glitter, holo, prizm, facets, cosmos, depth,
   aurora, super (and the older sheen, gold, rainbow, ice, galaxy, goldfoil).
   Textures (--tx-grain, --tx-brushed, --tx-sparkle, --tx-ice, --tx-stars, --tx-etch) are SVG data
   URIs installed on <html> by cards-fx.js.
   Layering approach and texture ideas adapted from FryCards (MIT); see docs/CREDITS.md. */


/* ---- the card in 3D ----------------------------------------------------------------- */
.tc { --px: 0; --py: 0; --act: 0; --rx: 0deg; --ry: 0deg;
	--mx: calc((var(--px) + .5) * 100%); --my: calc((var(--py) + .5) * 100%);
	--bgx: calc(37% + (var(--px) + .5) * 26%); --bgy: calc(33% + (var(--py) + .5) * 34%);
	--hyp: min(1, hypot(var(--px), var(--py)) * 2); }
/* Contact shadow under the card (cheaper than filter: drop-shadow, which re-rasterises the
   whole card every frame while its foil moves); it slides opposite the tilt. */
.tc::before {
	content: ""; position: absolute; inset: 1.5% 2%; z-index: -1; border-radius: 5% / 3.6%; pointer-events: none;
	box-shadow: var(--tc-glow, 0 0 0 transparent), 0 6px 14px rgba(0, 0, 0, .28);
	transform: translate(calc(var(--px) * -10px), calc(var(--py) * -8px + var(--act) * 4px));
}
.tc-sm::before { box-shadow: var(--tc-glow, 0 0 0 transparent), 0 3px 8px rgba(0, 0, 0, .26); }
.tc-lg::before { box-shadow: var(--tc-glow, 0 0 0 transparent), 0 14px 30px rgba(0, 0, 0, .38); }
.tc-hover::before { box-shadow: var(--tc-glow, 0 0 0 transparent), 0 18px 34px rgba(0, 0, 0, .34); }
.tc-ghost::before, .tc-missing::before, .tc-show-empty::before { display: none; }
.tc-tilt { transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) scale(calc((1 + var(--act) * .03) * var(--iz, 1))); }
.tc-hover .tc-tilt { will-change: transform; }
.tc-touch-tilt { touch-action: pan-y pinch-zoom; }
/* parallax: background art drifts against the tilt, the player with it, the frame stays */
.tc-portrait { transform: translate(calc(var(--px) * 3cqw), calc(var(--py) * 2cqw)) scale(calc(1 + var(--act) * .015)); }
.tc-par { transform: translate(calc(var(--px) * -6cqw), calc(var(--py) * -5cqw)); }
.tc-duo-mate .tc-duo-face { transform: none; }
/* a real 3D turn: the card lifts while it flips */
.tc-flipping .tc-tilt { animation: tc-lift .74s cubic-bezier(.3, .7, .2, 1); }
@keyframes tc-lift { 0% { transform: perspective(900px) scale(1); } 45% { transform: perspective(900px) translateZ(40px) scale(1.06); } 100% { transform: perspective(900px) scale(1); } }
.tc-flip { transition: transform .74s cubic-bezier(.3, .7, .2, 1); }
.tc-static .tc-flip { transition: none; }

/* pause every animation inside a card while it is off screen */
.tc-off, .tc-off *, .tc-off *::before, .tc-off *::after { animation-play-state: paused !important; }

/* ---- foil layers --------------------------------------------------------------------
   .tc-foil is a plain container (no z-index, opacity or blend of its own, or its layers
   would blend against nothing); ::before and ::after are the finish's two layers, and an
   optional <i> child is the ring layer (aurora, superfractor). They sit over the art and
   frame and under the plates (z-index 2), so text stays crisp.
   .tc-glare is the specular highlight over everything while the card is handled.

   Art window (measured from .tc-bg / .tc-plate in cards.css): the team surface starts 2.8cqw
   in and the name plate starts at 82cqw, so the window is 94.4cqw x 79.2cqw at (2.8, 2.8).
   Cost rules: masks are static (only etched/glitter move one, on the handled card); no
   `filter` on any layer; at most two blend layers per card; will-change only on the card
   being handled (.tc-hover); loops run only on the handled card or the big dialog card. */
.tc {
	--ax: 2.8cqw; --ay: 2.8cqw; --aw: 94.4cqw; --ah: 134.4cqw;
	--m-face: radial-gradient(32% 23% at 50% 35%, rgba(0, 0, 0, .3) 35%, #000 100%);
}
.tc .tc-foil { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: auto; opacity: 1; mix-blend-mode: normal; background: none; filter: none; animation: none; }
.tc .tc-foil::before, .tc .tc-foil::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1; }
.tc .tc-foil > i { display: none; }
.tc:has(.ux-deco) .tc-front > .tc-foil { z-index: auto; }
.tc:has(.ux-deco) .tc-foil::before, .tc:has(.ux-deco) .tc-foil::after { z-index: 4; }
.tc .tc-glare {
	position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 7; mix-blend-mode: overlay; transition: none;
	opacity: calc(var(--act) * .4);
	background:
		radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .35) 0, rgba(255, 255, 255, 0) 18%),
		radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255, 255, 255, .35) 6%, rgba(255, 255, 255, .08) 35%, rgba(255, 255, 255, 0) 70%);
}
.tc .tc-back > .tc-glare { position: absolute; inset: 0; z-index: 7; opacity: calc(var(--act) * .55); }
/* frame-only ring (2.8cqw) */
.fx-gold .tc-foil::before, .fx-sheen .tc-foil::before, .fx-goldfoil .tc-foil::before, .fx-chrome .tc-foil::before { padding: 2.8cqw; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
/* everything except the art window (reverse holo) */
.fx-reverse .tc-foil::before, .fx-reverse .tc-foil::after {
	-webkit-mask: linear-gradient(#000 0 0), linear-gradient(#000 0 0) var(--ax) var(--ay) / var(--aw) var(--ah) no-repeat; -webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0), linear-gradient(#000 0 0) var(--ax) var(--ay) / var(--aw) var(--ah) no-repeat; mask-composite: exclude;
}
/* art finishes live in the art window only, with a soft hole where the head sits */
:is(.fx-holo, .fx-rainbow, .fx-prizm, .fx-facets, .fx-cosmos, .fx-galaxy, .fx-ice, .fx-goldfoil, .fx-super, .fx-aurora) .tc-foil::after,
:is(.fx-holo, .fx-rainbow, .fx-prizm, .fx-facets, .fx-cosmos, .fx-galaxy, .fx-ice, .fx-super) .tc-foil::before {
	-webkit-mask-image: var(--m-face), linear-gradient(#000 0 0); -webkit-mask-size: auto, var(--aw) var(--ah); -webkit-mask-position: 0 0, var(--ax) var(--ay); -webkit-mask-repeat: no-repeat; -webkit-mask-composite: source-in;
	mask-image: var(--m-face), linear-gradient(#000 0 0); mask-size: auto, var(--aw) var(--ah); mask-position: 0 0, var(--ax) var(--ay); mask-repeat: no-repeat; mask-composite: intersect;
}

/* Common · matte card stock: paper grain, a soft sheen when handled */
.fx-matte .tc-foil::before { background: var(--tx-grain) 0 0 / 160px 160px; mix-blend-mode: overlay; opacity: calc((.16) * var(--fxk, .6)); }
.fx-matte .tc-foil::after { background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .55) 47%, transparent 60%) var(--bgx) var(--bgy) / 250% 250%; mix-blend-mode: soft-light; opacity: calc((var(--act) * .6) * var(--fxk, .6)); }

/* Uncommon · silver: brushed-steel frame and a cool sheen (legacy name; chrome is the new default) */
.fx-sheen .tc-foil::before {
	background: linear-gradient(calc(105deg + var(--px) * 50deg), transparent 15%, rgba(255, 255, 255, .95) 45%, rgba(200, 220, 240, .7) 52%, transparent 80%), var(--tx-brushed) calc(var(--px) * -40px) 0 / 320px 320px;
	background-blend-mode: screen, normal; mix-blend-mode: overlay; opacity: calc((.45 + var(--act) * .4) * var(--fxk, .6));
}
.fx-sheen .tc-foil::after { background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .75) 46%, rgba(215, 232, 255, .45) 51%, transparent 62%) var(--bgx) var(--bgy) / 300% 300%; mix-blend-mode: soft-light; opacity: calc((.28 + var(--act) * .55) * var(--fxk, .6)); }

/* Uncommon · chrome: a mirror-silver frame with a travelling light bar over the art */
.fx-chrome .tc-foil::before {
	background: linear-gradient(calc(105deg + var(--px) * 60deg), #5d6772, #fff 28%, #9ba7b3 48%, #fff 68%, #56606b), var(--tx-brushed) calc(var(--px) * -40px) 0 / 320px 320px;
	background-blend-mode: overlay, normal; opacity: calc((.7 + var(--act) * .25) * var(--fxk, .6));
}
.fx-chrome .tc-foil::after { background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .9) 46%, rgba(205, 225, 255, .5) 52%, transparent 64%) var(--bgx) var(--bgy) / 300% 300%; mix-blend-mode: soft-light; opacity: calc((.28 + var(--act) * .6) * var(--fxk, .6)); }

/* Uncommon / Common · reverse holo: the foil is everywhere except the art window */
.fx-reverse .tc-foil::before { background: var(--tx-grain) 0 0 / 120px 120px, conic-gradient(from calc(var(--px) * 160deg) at var(--mx) var(--my), #9fd8ff, #fff, #ffd6f5, #fff, #b6ffd9, #9fd8ff); background-blend-mode: overlay, normal; mix-blend-mode: overlay; opacity: calc((.55 + var(--act) * .35) * var(--fxk, .6)); }
.fx-reverse .tc-foil::after { background: var(--tx-sparkle) calc(var(--px) * -40px) calc(var(--py) * -40px) / 100px 100px; mix-blend-mode: color-dodge; opacity: calc((.12 + var(--act) * .45) * var(--fxk, .6)); }

/* Rare (legacy name) · gold foil: brushed gold frame catching the light, a warm sheen over the art */
.fx-gold .tc-foil::before {
	background: linear-gradient(calc(105deg + var(--px) * 50deg), transparent 10%, rgba(255, 246, 210, 1) 44%, rgba(255, 214, 120, .8) 52%, transparent 82%), var(--tx-brushed) calc(var(--px) * -40px) 0 / 320px 320px;
	background-blend-mode: screen, normal; mix-blend-mode: overlay; opacity: calc((.55 + var(--act) * .45) * var(--fxk, .6));
}
.fx-gold .tc-foil::after { background: linear-gradient(115deg, transparent 30%, rgba(255, 232, 160, .85) 46%, rgba(255, 255, 255, .5) 50%, transparent 62%) var(--bgx) var(--bgy) / 300% 300%; mix-blend-mode: soft-light; opacity: calc((.3 + var(--act) * .6) * var(--fxk, .6)); }

/* Rare · etched gold: gold shows only through an engraved lattice that slides under the light */
.fx-etched .tc-foil::before {
	background: linear-gradient(calc(110deg + var(--px) * 70deg), #7a5410, #ffe9a3 28%, #d9a42e 48%, #fff2c0 66%, #8a6014) var(--bgx) var(--bgy) / 320% 320%;
	-webkit-mask-image: var(--tx-etch), linear-gradient(#000 0 0); -webkit-mask-size: 46px 46px, var(--aw) var(--ah); -webkit-mask-position: calc(var(--px) * -22px) calc(var(--py) * -22px), var(--ax) var(--ay); -webkit-mask-repeat: repeat, no-repeat; -webkit-mask-composite: source-in;
	mask-image: var(--tx-etch), linear-gradient(#000 0 0); mask-size: 46px 46px, var(--aw) var(--ah); mask-position: calc(var(--px) * -22px) calc(var(--py) * -22px), var(--ax) var(--ay); mask-repeat: repeat, no-repeat; mask-composite: intersect;
	opacity: calc((.5 + var(--act) * .4) * var(--fxk, .6));
}
.fx-etched .tc-foil::after {
	background: linear-gradient(115deg, transparent 30%, rgba(255, 232, 160, .9) 46%, rgba(255, 255, 255, .5) 50%, transparent 62%) var(--bgx) var(--bgy) / 300% 300%; mix-blend-mode: soft-light; opacity: calc((.25 + var(--act) * .6) * var(--fxk, .6));
	-webkit-mask: linear-gradient(#000 0 0) var(--ax) var(--ay) / var(--aw) var(--ah) no-repeat; mask: linear-gradient(#000 0 0) var(--ax) var(--ay) / var(--aw) var(--ah) no-repeat;
}
.par-g.fx-etched .tc-foil::before { opacity: calc((.75 + var(--act) * .25) * var(--fxk, .6)); }

/* Epic · rainbow holo: spectrum bars over the art that slide with the light, plus glitter */
.fx-holo .tc-foil::before, .fx-rainbow .tc-foil::before {
	background-image:
		repeating-linear-gradient(110deg, #ff5f8f 0%, #ffd25f 3.5%, #7dff8a 7%, #5fe6ff 10.5%, #8f7bff 14%, #ff5fd2 17.5%, #ff5f8f 21%),
		radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255, 255, 255, .85) 0%, rgba(150, 150, 150, .15) 32%, #000 92%),
		var(--tx-grain);
	background-size: 260% 260%, 120% 120%, 160px 160px;
	background-position: var(--bgx) var(--bgy), center, 0 0;
	background-blend-mode: overlay, normal, normal;
	mix-blend-mode: color-dodge; opacity: calc((.26 + var(--act) * .36) * var(--fxk, .6));
}
.fx-holo .tc-foil::after, .fx-rainbow .tc-foil::after {
	background: var(--tx-sparkle) calc(var(--px) * -50px) calc(var(--py) * -50px) / 140px 140px;
	mix-blend-mode: color-dodge; opacity: calc((.12 + var(--act) * .36) * var(--fxk, .6));
}

/* Legendary (legacy) / Blue /99 · cracked ice */
.fx-ice { --ice1: #ffb347; --ice2: #fff1b8; --ice3: #ff6a3d; --ice4: #ffe08a; }
.par-p.fx-ice { --ice1: #2f7cff; --ice2: #c4ecff; --ice3: #1b4fd8; --ice4: #6fe3ff; }
.fx-ice .tc-foil::before {
	background-image: var(--tx-ice), linear-gradient(calc(125deg + var(--px) * 70deg), var(--ice1), var(--ice2) 25%, var(--ice3) 50%, var(--ice4) 75%, var(--ice1));
	background-size: 230px 230px, 300% 300%;
	background-position: calc(var(--px) * -24px) calc(var(--py) * -24px), var(--bgx) var(--bgy);
	background-blend-mode: overlay;
	mix-blend-mode: color-dodge; opacity: calc((.22 + var(--act) * .3) * var(--fxk, .6));
}
.fx-ice .tc-foil::after {
	background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .6), transparent 40%), var(--tx-sparkle) calc(var(--px) * 40px) calc(var(--py) * 40px) / 170px 170px;
	background-blend-mode: multiply; mix-blend-mode: color-dodge; opacity: calc((.08 + var(--act) * .4) * var(--fxk, .6));
}

/* Legendary legacy / Mythic legacy · galaxy: a deep star field and nebula with gold glints */
.fx-galaxy { --neb1: rgba(120, 70, 255, .55); --neb2: rgba(40, 160, 255, .45); --neb3: rgba(255, 200, 90, .4); }
.fx-galaxy .tc-foil::before {
	background:
		var(--tx-stars) calc(var(--px) * -30px) calc(var(--py) * -30px) / 260px 260px,
		radial-gradient(45% 35% at calc(30% + var(--px) * 12%) 30%, var(--neb1), transparent 70%),
		radial-gradient(40% 30% at calc(72% - var(--px) * 12%) 52%, var(--neb2), transparent 70%),
		radial-gradient(30% 22% at 50% calc(18% + var(--py) * 10%), var(--neb3), transparent 70%);
	mix-blend-mode: screen; opacity: calc((.38 + var(--act) * .35) * var(--fxk, .6));
}
.fx-galaxy .tc-foil::after {
	background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255, 236, 170, .9) 0%, rgba(255, 255, 255, .1) 30%, #000 85%), var(--tx-stars) calc(var(--px) * 22px + 60px) calc(var(--py) * 22px + 30px) / 180px 180px;
	background-blend-mode: multiply; mix-blend-mode: color-dodge; opacity: calc((.12 + var(--act) * .55) * var(--fxk, .6));
}

/* Legendary · cosmos: two star fields at different depths and a nebula that drifts with the light */
.fx-cosmos .tc-foil::before {
	background: var(--tx-stars) calc(var(--px) * -34px) calc(var(--py) * -34px) / 260px 260px,
		radial-gradient(45% 35% at calc(30% + var(--px) * 14%) 30%, rgba(120, 70, 255, .6), transparent 70%), radial-gradient(40% 30% at calc(72% - var(--px) * 14%) 52%, rgba(40, 160, 255, .5), transparent 70%), radial-gradient(30% 22% at 50% calc(18% + var(--py) * 12%), rgba(255, 200, 90, .45), transparent 70%);
	mix-blend-mode: screen; opacity: calc((.62 + var(--act) * .3) * var(--fxk, .6));
}
.fx-cosmos .tc-foil::after { background: var(--tx-stars) calc(var(--px) * 70px + 60px) calc(var(--py) * 70px + 30px) / 150px 150px; mix-blend-mode: screen; opacity: calc((.3 + var(--act) * .5) * var(--fxk, .6)); }

/* Refractor / Orange /25 · prismatic refractor: a fine line screen, a spectrum swirl at the light */
.fx-prizm { --pz1: #ff6aa8; --pz2: #ffd27a; --pz3: #6affc1; --pz4: #6ad8ff; --pz5: #b28dff; }
.par-o.fx-prizm { --pz1: #ff4d00; --pz2: #ffd08a; --pz3: #ff8a2a; --pz4: #ffe9a8; --pz5: #ff2d55; }
.fx-prizm .tc-foil::before {
	background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .42) 0 .45cqw, transparent .45cqw .9cqw),
		conic-gradient(from calc(var(--px) * 200deg) at var(--mx) var(--my), var(--pz1), var(--pz2), var(--pz3), var(--pz4), var(--pz5), var(--pz1));
	mix-blend-mode: hard-light; opacity: calc((.26 + var(--act) * .3) * var(--fxk, .6));
}
.fx-prizm .tc-foil::after {
	background: repeating-radial-gradient(circle at var(--mx) var(--my), var(--pz1) 0, var(--pz3) 3cqw, var(--pz4) 6cqw, var(--pz5) 9cqw, var(--pz1) 12cqw);
	mix-blend-mode: soft-light; opacity: calc((.06 + var(--act) * .26) * var(--fxk, .6));
}

/* Blue /99 · shattered glass: hard-edged conic facets that flash as the angle changes */
.fx-facets .tc-foil::before {
	background: repeating-conic-gradient(from calc(var(--px) * 130deg) at 25% 18%, rgba(255, 255, 255, 0) 0 7deg, rgba(255, 255, 255, .34) 7deg 11deg, rgba(110, 200, 255, .3) 11deg 19deg, rgba(255, 150, 255, .26) 19deg 24deg, rgba(255, 230, 120, .24) 24deg 29deg),
		repeating-conic-gradient(from calc(var(--py) * -140deg) at 78% 62%, rgba(255, 255, 255, 0) 0 9deg, rgba(255, 255, 255, .3) 9deg 13deg, rgba(150, 255, 200, .26) 13deg 22deg);
	mix-blend-mode: overlay; opacity: calc((.55 + var(--act) * .45) * var(--fxk, .6));
}
.fx-facets .tc-foil::after { background: linear-gradient(calc(120deg + var(--px) * 40deg), transparent 30%, rgba(255, 255, 255, .7) 48%, transparent 52%) var(--bgx) var(--bgy) / 300% 300%; mix-blend-mode: soft-light; opacity: calc((var(--act) * .8) * var(--fxk, .6)); }
.par-p.fx-facets .tc-foil::before { opacity: calc((.7 + var(--act) * .3) * var(--fxk, .6)); }

/* Rare+ · glitter: sparkles that only light near the pointer. Only the handled card moves a mask. */
.fx-glitter .tc-foil::before {
	background: var(--tx-sparkle) calc(var(--px) * -30px) calc(var(--py) * -30px) / 120px 120px; mix-blend-mode: screen;
	-webkit-mask: radial-gradient(circle at var(--mx) var(--my), #000, rgba(0, 0, 0, .15) 40%, transparent 62%) 0 0 / 100% 100%, linear-gradient(#000 0 0) var(--ax) var(--ay) / var(--aw) var(--ah) no-repeat; -webkit-mask-composite: source-in;
	mask: radial-gradient(circle at var(--mx) var(--my), #000, rgba(0, 0, 0, .15) 40%, transparent 62%) 0 0 / 100% 100%, linear-gradient(#000 0 0) var(--ax) var(--ay) / var(--aw) var(--ah) no-repeat; mask-composite: intersect;
	opacity: calc((.4 + var(--act) * .55) * var(--fxk, .6));
}
.fx-glitter .tc-foil::after {
	background: var(--tx-sparkle) calc(var(--px) * 44px) calc(var(--py) * 44px) / 80px 80px; mix-blend-mode: color-dodge; opacity: calc((var(--act) * .5) * var(--fxk, .6));
	-webkit-mask: radial-gradient(circle at var(--mx) var(--my), #000, transparent 50%); mask: radial-gradient(circle at var(--mx) var(--my), #000, transparent 50%);
}
.tc-hover.fx-glitter .tc-foil::before { animation: tc-twinkle 1.6s ease-in-out infinite alternate; }
@keyframes tc-twinkle { to { opacity: 1; } }

/* Mythic · aurora edge: a spinning conic border (transform-spun, never an animated @property)
   plus an inner glow and a star field. The ring is the foil's <i> child. */
.fx-aurora { --tc-glow: 0 0 5cqw .6cqw rgba(110, 255, 220, .4); }
.fx-aurora .tc-foil > i { display: block; position: absolute; inset: 0; border-radius: inherit; padding: 2.2cqw; overflow: hidden; z-index: 3; pointer-events: none; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.fx-aurora .tc-foil > i::before { content: ""; position: absolute; left: -40cqw; top: -20cqw; width: 180cqw; height: 180cqw; background: conic-gradient(from 0deg, #6affc1, #6ad8ff, #b28dff, #ff6aa8, #ffd27a, #6affc1); }
.fx-aurora .tc-foil::before { box-shadow: inset 0 0 7cqw 1cqw rgba(106, 255, 193, .4); mix-blend-mode: screen; opacity: calc((.7 + var(--act) * .3) * var(--fxk, .6)); }
.fx-aurora .tc-foil::after { background: var(--tx-stars) calc(var(--px) * -40px) calc(var(--py) * -40px) / 200px 200px; mix-blend-mode: screen; opacity: calc((.28 + var(--act) * .4) * var(--fxk, .6)); }
:is(.tc-hover, .tc-lg).fx-aurora .tc-foil > i::before, :is(.tc-hover, .tc-lg).fx-super .tc-foil > i::before { animation: tc-rot 7s linear infinite; will-change: transform; }
.tc-hover.fx-aurora .tc-foil > i::before, .tc-hover.fx-super .tc-foil > i::before { animation-duration: 3.5s; }
@keyframes tc-rot { to { transform: rotate(360deg); } }

/* 1/1 · superfractor: a swirling gold conic, a line screen with glints, and a gold ring that spins while handled */
.fx-super { --tc-glow: 0 0 6cqw 1cqw rgba(255, 200, 80, .5); }
.fx-super .tc-foil::before {
	background: conic-gradient(from calc(var(--px) * 200deg) at 50% 42%, #6b4a10, #ffe28a, #c8861e, #fff6c8, #8a5a10, #ffd46a, #6b4a10); mix-blend-mode: overlay; opacity: calc((.5 + var(--act) * .35) * var(--fxk, .6));
}
.fx-super .tc-foil::after {
	background: repeating-linear-gradient(0deg, rgba(255, 230, 150, .55) 0 .35cqw, transparent .35cqw .9cqw), var(--tx-sparkle) calc(var(--px) * -40px) calc(var(--py) * -40px) / 110px 110px;
	mix-blend-mode: color-dodge; opacity: calc((.18 + var(--act) * .5) * var(--fxk, .6));
}
.fx-super .tc-foil > i { display: block; position: absolute; inset: 0; border-radius: inherit; padding: 1.4cqw; overflow: hidden; z-index: 3; pointer-events: none; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.fx-super .tc-foil > i::before { content: ""; position: absolute; left: -40cqw; top: -20cqw; width: 180cqw; height: 180cqw; background: conic-gradient(from 0deg, #fff3b0, #c8861e, #fff3b0, #8a5a10, #fff3b0); }
.par-b.fx-super .tc-foil::before { mix-blend-mode: screen; opacity: calc((.3 + var(--act) * .4) * var(--fxk, .6)); }

/* Legendary · depth stack: the portrait, plate and badges float at real 3D depths (no blend modes: they flatten 3D).
   The depth is on while the card is handled or is the big dialog card; in a grid it rests flat (no extra layers). */
:is(.tc-hover, .tc-lg).fx-depth .tc-front { overflow: visible; transform-style: preserve-3d; }
.fx-depth .tc-plate, .fx-depth .tc-top { transition: transform .22s; }
:is(.tc-hover, .tc-lg).fx-depth .tc-portrait { transform: translateZ(calc(10px + var(--act) * 10px)) translate(calc(var(--px) * 3cqw), calc(var(--py) * 2cqw)) scale(calc(1 + var(--act) * .015)); }
:is(.tc-hover, .tc-lg).fx-depth .tc-plate { transform: translateZ(calc(24px + var(--act) * 16px)); }
:is(.tc-hover, .tc-lg).fx-depth .tc-top { transform: translateZ(calc(32px + var(--act) * 18px)); }
:is(.tc-hover, .tc-lg).fx-depth :is(.tc-water, .tc-water-logo) { transform: translateZ(calc(4px + var(--act) * 6px)) translate(calc(var(--px) * -2cqw), 0); }
:is(.tc-hover, .tc-lg).fx-depth .tc-glare { mix-blend-mode: normal; opacity: calc(var(--act) * .5); transform: translateZ(40px);
	background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .3), transparent 45%); }
.fx-depth .tc-foil::before { background: linear-gradient(calc(110deg + var(--px) * 50deg), transparent 35%, rgba(255, 255, 255, .22) 48%, transparent 60%); opacity: calc((.35 + var(--act) * .4) * var(--fxk, .6)); }
.fx-depth .tc-foil::after { display: none; }
/* the die-cut Silhouette is clipped, which flattens 3D: it gets a travelling acetate glint instead */
.ins-sil.fx-depth .tc-front { overflow: hidden !important; transform-style: flat !important; }
.ins-sil.fx-depth :is(.tc-portrait, .tc-plate, .tc-top, .tc-water, .tc-water-logo, .tc-glare) { transform: none !important; }
.ins-sil.fx-depth .tc-portrait { transform: translate(calc(var(--px) * 4cqw), calc(var(--py) * 3cqw)) !important; }
.ins-sil.fx-depth .tc-foil::before { background: linear-gradient(calc(115deg + var(--px) * 40deg), transparent 30%, rgba(255, 255, 255, .5) 46%, rgba(190, 230, 255, .35) 52%, transparent 66%) var(--bgx) var(--bgy) / 300% 300%; mix-blend-mode: screen; opacity: calc((.3 + var(--act) * .5) * var(--fxk, .6)); }

/* Gold /50 · gold foil: a heavy brushed-gold frame and a gold line screen over the art */
.fx-goldfoil .tc-foil::before {
	background: linear-gradient(calc(105deg + var(--px) * 50deg), transparent 5%, #fff6d2 42%, #ffd36b 52%, transparent 85%), var(--tx-brushed) calc(var(--px) * -40px) 0 / 320px 320px;
	background-blend-mode: screen, normal; mix-blend-mode: overlay; opacity: calc((.7 + var(--act) * .3) * var(--fxk, .6));
}
.fx-goldfoil .tc-foil::after {
	background:
		repeating-linear-gradient(0deg, rgba(255, 220, 130, .5) 0 .35cqw, transparent .35cqw .8cqw),
		linear-gradient(calc(115deg + var(--px) * 40deg), transparent 25%, rgba(255, 236, 170, .95) 45%, transparent 65%) var(--bgx) var(--bgy) / 260% 260%;
	mix-blend-mode: soft-light; opacity: calc((.3 + var(--act) * .55) * var(--fxk, .6));
}
.fx-none .tc-foil::before, .fx-none .tc-foil::after, .fx-none .tc-foil > i { display: none; }

/* Keyboard: the arrow keys move the light on a focused card (cards-fx.js); the ring shows keyboard focus. */
.tc:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.tc[aria-pressed="true"]:focus-visible { outline-color: var(--accent); }

/* ---- "Reduce effects" (html[data-fx-quality="low"]) --------------------------------------
   Auto-on for weak devices (<= 4 cores or <= 4 GB); the Card effects panel overrides it. One
   cheap layer per finish, no loops, no 3D depth, no blurred or blended extras. */
html[data-fx-quality="low"] .tc .tc-foil::after, html[data-fx-quality="low"] .tc .tc-foil > i { display: none; }
html[data-fx-quality="low"] .tc .tc-front, html[data-fx-quality="low"] .tc .tc-front::after, html[data-fx-quality="low"] .tc .tc-foil::before,
html[data-fx-quality="low"] .tc :is(.ux-au-bands, .ux-gal-stars, .ux-zone-rings, .ux-sf-swirl) { animation: none !important; }
html[data-fx-quality="low"] .tc .tc-glare { mix-blend-mode: normal; opacity: calc(var(--act) * .25); }
html[data-fx-quality="low"] .fx-depth .tc-front { overflow: hidden !important; transform-style: flat !important; }
html[data-fx-quality="low"] .fx-depth :is(.tc-portrait, .tc-plate, .tc-top, .tc-water, .tc-water-logo, .tc-glare) { transform: none !important; }
html[data-fx-quality="low"] .fx-glitter .tc-foil::before { -webkit-mask: linear-gradient(#000 0 0) var(--ax) var(--ay) / var(--aw) var(--ah) no-repeat; mask: linear-gradient(#000 0 0) var(--ax) var(--ay) / var(--aw) var(--ah) no-repeat; opacity: calc((.4) * var(--fxk, .6)); }
html[data-fx-quality="low"] .fx-etched .tc-foil::before { -webkit-mask-position: 0 0, var(--ax) var(--ay); mask-position: 0 0, var(--ax) var(--ay); }
html[data-fx-quality="low"] .ins-sil.fx-depth .tc-portrait { transform: none !important; }
html[data-fx-quality="low"] .tc::before { transform: none; }
html[data-fx-quality="low"] .tc-portrait, html[data-fx-quality="low"] .tc-par { transform: none; }
html[data-fx-quality="low"] .pkx-foil, html[data-fx-quality="low"] .pkx-back, html[data-fx-quality="low"] .pkx-pack { animation: none !important; }

/* Idle light on the big card: no loop. The dialog sweeps the light once when it opens (cards-fx.js: sweep). */

/* the insert / parallel light sweep (cards.css) runs only on the handled card or the dialog card */
.tc-sm.ins .tc-front::after, .tc-sm.par .tc-front::after { animation-duration: 9s; }

@media (prefers-reduced-motion: reduce) {
	.tc-tilt { transform: scale(var(--iz, 1)) !important; }
	.tc-portrait, .tc-par, .tc::before { transform: none !important; }
	.tc-flipping .tc-tilt, .tc-lg { animation: none !important; }
	.tc-flip { transition: none !important; }
	.tc .tc-foil > i::before, .tc .tc-front, .tc .tc-front::after, .tc .tc-foil::before { animation: none !important; }
	.fx-depth .tc-front { overflow: hidden !important; transform-style: flat !important; }
	.fx-depth :is(.tc-portrait, .tc-plate, .tc-top, .tc-water, .tc-water-logo, .tc-glare), .ins-sil.fx-depth .tc-portrait { transform: none !important; }
}

/* ---- pack opener ------------------------------------------------------------------- */
.tc-modal-pack .tc-modal-box { background: radial-gradient(120% 90% at 50% 0%, #2a2f45, #0b0d16 70%); color: #eef1f8; position: relative; overflow-x: hidden; }
.tc-modal-pack .tc-modal-head strong { color: #fff; }
.tc-modal-pack .tc-modal-x { color: #fff; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); }
.tc-modal-pack .muted { color: #b9c0d4; }
.tc-modal-pack .pk-summary, .tc-modal-pack .pk-summary p { color: #eef1f8; }
.tc-modal-pack .btn:not(.primary) { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .28); }
.pkx-host { position: relative; min-height: min(640px, calc(100dvh - 110px)); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: background-color .5s; }
.pkx-host[data-stage="grid"] { min-height: 0; justify-content: flex-start; }
.pkx-host::before { content: ""; position: absolute; inset: -40px; pointer-events: none; background: repeating-conic-gradient(from 0deg at 50% 45%, rgba(255, 255, 255, .035) 0 6deg, transparent 6deg 14deg); opacity: .8; }
.pkx-host[data-stage="grid"]::before { display: none; }
.pkx-actions { justify-content: center; gap: 8px; flex-wrap: wrap; position: relative; z-index: 3; }
.pkx-hint { text-align: center; margin: 14px 0 10px; position: relative; }

/* the pack */
.pkx-pack-stage { display: flex; flex-direction: column; align-items: center; position: relative; padding: 10px 0; }
.pkx-pack-wrap { perspective: 900px; padding: 30px 24px 10px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.pkx-pack { --tear: 0; position: relative; width: min(230px, 62vw); aspect-ratio: 5 / 8; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; animation: pkx-float 3.2s ease-in-out infinite; }
.pkx-pack.dragging { cursor: grabbing; animation: none; }
.pkx-body {
	position: absolute; inset: 0; border-radius: 10px 10px 12px 12px; overflow: hidden; color: var(--pk-ink);
	background: linear-gradient(160deg, var(--pk1), var(--pk2)); box-shadow: 0 24px 50px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(255, 255, 255, .18);
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
	clip-path: polygon(0 calc(13% + var(--tear) * 0%), 100% 13%, 100% 100%, 0 100%);
}
.pkx-pack:not(.torn) .pkx-body { clip-path: none; }
/* The pack foil: a transform-only shimmer (the old one animated background-position forever on a
   blended layer). It runs only while the pack is hovered, focused or being torn. */
.pkx-foil { position: absolute; inset: -50%; pointer-events: none; mix-blend-mode: overlay; opacity: .55;
	background: var(--tx-ice) 0 0 / 200px 200px, linear-gradient(120deg, transparent 38%, rgba(255, 255, 255, .7) 48%, transparent 58%) 0 0 / 100% 100%; }
.pkx-foil.foil-rainbow { mix-blend-mode: color-dodge; opacity: .5; background: var(--tx-ice) 0 0 / 200px 200px, repeating-linear-gradient(115deg, #ff5f8f 0 6%, #ffd25f 6% 12%, #7dff8a 12% 18%, #5fe6ff 18% 24%, #8f7bff 24% 30%) 0 0 / 100% 100%; }
.pkx-pack:is(:hover, :focus-within, .dragging) .pkx-foil { animation: pkx-foil 4s linear infinite; will-change: transform; }
@keyframes pkx-foil { from { transform: translate(-12%, -12%); } to { transform: translate(12%, 12%); } }
.pkx-crimp { position: absolute; left: 0; right: 0; height: 12px; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .3) 0 4px, rgba(255, 255, 255, .12) 4px 8px); }
.pkx-crimp.top { top: 0; } .pkx-crimp.bot { bottom: 0; }
.pkx-logo { font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); position: relative; }
.pkx-name { font-family: "TC Excluded", var(--sans); font-style: italic; font-size: 26px; line-height: 1; letter-spacing: .02em; text-transform: uppercase; padding: 0 14px; text-shadow: 0 3px 0 rgba(0, 0, 0, .3); position: relative; }
.pkx-sub { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .85; padding: 0 16px; position: relative; }
.pkx-count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 900; letter-spacing: .2em; padding: 3px 10px; border-radius: 99px; background: rgba(0, 0, 0, .35); white-space: nowrap; }
/* the tear strip: the top of the pack, pulled away as you drag */
.pkx-strip {
	position: absolute; left: 0; right: 0; top: 0; height: 13%; border-radius: 10px 10px 0 0; z-index: 2;
	background: linear-gradient(160deg, var(--pk1), color-mix(in srgb, var(--pk1) 70%, var(--pk2))); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18);
	clip-path: polygon(0 0, 100% 0, 100% 100%, 96% 86%, 92% 100%, 88% 86%, 84% 100%, 80% 86%, 76% 100%, 72% 86%, 68% 100%, 64% 86%, 60% 100%, 56% 86%, 52% 100%, 48% 86%, 44% 100%, 40% 86%, 36% 100%, 32% 86%, 28% 100%, 24% 86%, 20% 100%, 16% 86%, 12% 100%, 8% 86%, 4% 100%, 0 86%);
	display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 900; letter-spacing: .2em; color: var(--pk-ink);
	transform-origin: 100% 100%; transform: rotate(calc(var(--tear) * -28deg)) translate(calc(var(--tear) * 30%), calc(var(--tear) * -60%));
}
.pkx-strip span { opacity: .8; animation: pkx-nudge 1.6s ease-in-out infinite; }
.pkx-pack.torn .pkx-strip { animation: pkx-strip-fly .7s cubic-bezier(.2, .7, .4, 1) forwards; }
.pkx-pack.torn { animation: pkx-drop .8s .25s ease-in forwards; }
.pkx-seam { position: absolute; left: 4%; right: 4%; top: 13%; height: 3px; border-radius: 3px; z-index: 3; background: var(--leak); opacity: calc(var(--tear) * 1.4); box-shadow: 0 0 calc(10px + var(--tear) * 30px) calc(2px + var(--tear) * 8px) var(--leak); }
.pkx-pack:not(.leak) .pkx-seam { background: #fff; box-shadow: 0 0 calc(6px + var(--tear) * 14px) rgba(255, 255, 255, .7); }
.pkx-pack.leak { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--leak) 60%, transparent)); }
.shake-1:not(.dragging):not(.torn) { animation: pkx-float 3.2s ease-in-out infinite, pkx-shake .5s 1.2s ease-in-out 2; }
.shake-2:not(.dragging):not(.torn) { animation: pkx-float 3.2s ease-in-out infinite, pkx-shake .45s .9s ease-in-out 4; }
.shake-3:not(.dragging):not(.torn) { animation: pkx-float 3.2s ease-in-out infinite, pkx-shake .4s .6s ease-in-out infinite; }
@keyframes pkx-float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-8px) rotate(1deg); } }
@keyframes pkx-shake { 0%, 100% { translate: 0 0; rotate: 0deg; } 20% { translate: -4px 1px; rotate: -1.4deg; } 40% { translate: 4px -1px; rotate: 1.4deg; } 60% { translate: -3px -1px; rotate: -.8deg; } 80% { translate: 3px 1px; rotate: .8deg; } }
@keyframes pkx-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
@keyframes pkx-strip-fly { 0% { transform: rotate(calc(var(--tear) * -28deg)); opacity: 1; } 100% { transform: translate(60%, -260%) rotate(-38deg); opacity: 0; } }
@keyframes pkx-drop { 0% { transform: none; opacity: 1; } 100% { transform: translateY(40vh) scale(.9) rotate(-4deg); opacity: 0; } }

/* foil scraps and confetti */
.pkx-scraps { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: visible; }
.pkx-scraps i { position: absolute; top: 12%; border-radius: 1px; opacity: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); animation: pkx-scrap var(--t) cubic-bezier(.2, .7, .4, 1) var(--d) forwards; }
.pkx-scraps.big i { top: 45%; }
@keyframes pkx-scrap { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); } }

/* card by card */
.pkx-reveal { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; position: relative; }
.pkx-counter { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #b9c0d4; }
.pkx-table { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; min-height: calc(min(340px, calc(100vw - 64px)) * 1.4); }
.pkx-slot { position: relative; width: min(340px, calc(100vw - 64px)); aspect-ratio: 5 / 7; z-index: 2; }
.pkx-card { position: absolute; inset: 0; perspective: 1400px; cursor: pointer; border-radius: 4%; outline: none; }
.pkx-card:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.pkx-card.deal { animation: pkx-deal .5s cubic-bezier(.2, .8, .25, 1.05) both; }
.pkx-card.gone { animation: pkx-gone .42s ease-in forwards; pointer-events: none; }
@keyframes pkx-deal { from { opacity: 0; transform: translate(-38%, 6%) rotate(-8deg) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes pkx-gone { to { opacity: 0; transform: translate(70%, -8%) rotate(10deg) scale(.86); } }
.pkx-flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3, .7, .2, 1); }
.pkx-card.on .pkx-flip { transform: rotateY(180deg); }
.pkx-card.on.hit .pkx-flip { animation: pkx-pop .9s .35s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes pkx-pop { 0% { transform: rotateY(180deg) scale(1); } 40% { transform: rotateY(180deg) scale(1.08); } 100% { transform: rotateY(180deg) scale(1); } }
.pkx-back, .pkx-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pkx-face { transform: rotateY(180deg); display: flex; }
.pkx-face > .tc { --tcw: 100%; }
/* card back: navy diamond weave; rare pulls tease their colour at the edge */
.pkx-back {
	border-radius: 4.5% / 3.2%; padding: 5%;
	background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .18), transparent 45%), repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 6px, transparent 6px 14px), repeating-linear-gradient(-45deg, rgba(255, 255, 255, .05) 0 6px, transparent 6px 14px), linear-gradient(160deg, #1b2a5a, #0b1230);
	box-shadow: inset 0 0 0 5px #f2ead9, inset 0 0 0 7px rgba(0, 0, 0, .3), 0 16px 34px rgba(0, 0, 0, .5);
}
.pkx-back-in { position: absolute; inset: 7%; border-radius: 3%; border: 2px solid rgba(242, 234, 217, .5); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #f2ead9; text-align: center; }
.pkx-back-ball { width: 34%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.pkx-back-ball svg { width: 100%; height: auto; display: block; }
.pkx-back-name { font-family: "TC Excluded", var(--sans); font-style: italic; font-size: clamp(14px, 6vw, 24px); letter-spacing: .03em; text-transform: uppercase; padding: 0 8%; }
.pkx-back-k { font-size: 10px; font-weight: 800; letter-spacing: .24em; opacity: .7; }
.pkx-back.lv-rare { box-shadow: inset 0 0 0 5px #f2ead9, inset 0 0 0 7px rgba(0, 0, 0, .3), 0 0 22px 2px var(--tease), 0 16px 34px rgba(0, 0, 0, .5); }
.pkx-back.lv-burst { animation: pkx-tease 1.4s ease-in-out infinite; }
.pkx-back.lv-mythic { animation: pkx-tease 1s ease-in-out infinite, pkx-shake .5s ease-in-out infinite; }
.pkx-back.lv-burst::after, .pkx-back.lv-mythic::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--tease) 45%, transparent), transparent 60%); mix-blend-mode: screen; }
@keyframes pkx-tease { 0%, 100% { box-shadow: inset 0 0 0 5px #f2ead9, 0 0 16px 2px var(--tease), 0 16px 34px rgba(0, 0, 0, .5); } 50% { box-shadow: inset 0 0 0 5px #f2ead9, 0 0 44px 12px var(--tease), 0 16px 34px rgba(0, 0, 0, .5); } }
/* the remaining cards, stacked to the left */
.pkx-deck { position: absolute; left: calc(50% - min(340px, calc(100vw - 64px)) / 2 - 22px); top: 50%; width: min(340px, calc(100vw - 64px)); aspect-ratio: 5 / 7; transform: translate(-6%, -50%) scale(.92); z-index: 1; pointer-events: none; }
.pkx-deck-card { position: absolute; inset: 0; border-radius: 4.5% / 3.2%; transform: translate(calc(var(--k) * -5px), calc(var(--k) * 3px)) rotate(calc(var(--k) * -1.2deg)); background: linear-gradient(160deg, #1b2a5a, #0b1230); box-shadow: inset 0 0 0 4px #f2ead9, 0 6px 14px rgba(0, 0, 0, .45); }
.pkx-caption { min-height: 34px; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; text-align: center; position: relative; z-index: 3; }
.pkx-caption .pk-par, .pkx-caption .pk-new, .pkx-caption .pk-dupe { position: static; transform: none; }
.pkx-caption b { color: #fff; }
/* the hit: dim, rays, flash, banner */
.pkx-host.pkx-dim { background-color: rgba(0, 0, 0, .45); }
.pkx-fx { position: absolute; inset: 0; pointer-events: none; z-index: 1; display: flex; align-items: center; justify-content: center; }
.pkx-rays { position: absolute; width: 170%; aspect-ratio: 1; max-width: 900px; border-radius: 50%; opacity: 0;
	background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tier) 75%, #fff) 0 7deg, transparent 7deg 20deg);
	-webkit-mask-image: radial-gradient(circle, #000 18%, transparent 66%); mask-image: radial-gradient(circle, #000 18%, transparent 66%);
	animation: pkx-rays-in 1.9s .3s ease-out forwards, pkx-spin 9s linear infinite; }
.pkx-flash { position: absolute; width: 90%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #fff 0%, var(--tier) 35%, transparent 70%); opacity: 0; animation: pkx-flash .9s .35s ease-out forwards; }
.pkx-banner { position: absolute; top: 2%; left: 50%; transform: translateX(-50%); z-index: 4; font-family: "TC Excluded", var(--sans); font-style: italic; font-size: clamp(20px, 6vw, 34px); letter-spacing: .04em; white-space: nowrap; color: #fff; text-shadow: 0 0 18px var(--tier), 0 3px 0 rgba(0, 0, 0, .4); animation: pkx-banner 2.4s .4s ease-out both; }
@keyframes pkx-rays-in { 0% { opacity: 0; scale: .4; } 30% { opacity: .85; } 100% { opacity: .45; scale: 1; } }
@keyframes pkx-spin { to { rotate: 360deg; } }
@keyframes pkx-flash { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: .95; } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes pkx-banner { 0% { opacity: 0; transform: translateX(-50%) scale(1.6); } 20% { opacity: 1; transform: translateX(-50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
/* the multi-reveal grid */
.pkx-host[data-stage="grid"] .pk-stage { width: 100%; }
.tc-modal-pack .pk-card .pk-cover { background: linear-gradient(160deg, #1b2a5a, #0b1230); box-shadow: inset 0 0 0 5px #f2ead9, inset 0 0 0 7px rgba(0, 0, 0, .3), 0 10px 24px rgba(0, 0, 0, .4); }
.tc-modal-pack .pk-card .pk-cover-hot { box-shadow: inset 0 0 0 5px #f2ead9, 0 0 22px 4px var(--tier), 0 10px 24px rgba(0, 0, 0, .4); }
.tc-modal-pack .pk-dupe { background: #23283a; color: #cfd5e6; border-color: rgba(255, 255, 255, .25); }
@media (prefers-reduced-motion: reduce) {
	.pkx-pack, .pkx-strip span, .pkx-back, .pkx-back::after, .pkx-card, .pkx-flip, .pkx-rays, .pkx-flash, .pkx-banner, .pkx-scraps i, .pkx-foil { animation: none !important; transition: none !important; }
	.pkx-pack.torn .pkx-strip { display: none; }
}
@media (max-width: 560px) {
	.pkx-host { min-height: calc(100dvh - 90px); }
	.pkx-deck { display: none; }
}

/* ---- binder: pages of 9-pocket sleeves --------------------------------------------- */
.tc-binder-views { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tb-binder { outline: none; }
.tb-binder:focus-visible .tb-book { box-shadow: 0 0 0 3px var(--accent); }
.tb-nav { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 4px 0 12px; }
.tb-jump { width: min(240px, 40vw); }
.tb-book { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; justify-content: center; padding: 14px; border-radius: 14px; perspective: 1600px;
	background: linear-gradient(90deg, #1d2333, #2a3147 50%, #1d2333); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06), 0 18px 40px rgba(0, 0, 0, .3); }
.tb-book.tb-spread { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tb-book.tb-spread::after { content: ""; grid-column: 1 / -1; grid-row: 1; justify-self: center; width: 14px; margin: -14px 0; background: linear-gradient(90deg, rgba(0, 0, 0, .45), rgba(255, 255, 255, .08), rgba(0, 0, 0, .45)); pointer-events: none; z-index: 3; }
.tb-page { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px 14px 26px; border-radius: 8px; transform-origin: left center;
	background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)), #f4f1ea; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 2px 0 rgba(0, 0, 0, .25); }
:root[data-theme="dark"] .tb-page { background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)), #2b2f3a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tb-page { background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)), #2b2f3a; } }
.tb-spread .tb-page:nth-child(2) { transform-origin: right center; }
.tb-blank { background: rgba(255, 255, 255, .04) !important; box-shadow: none; }
.tb-page.turn-in-r { animation: tb-turn-r .5s cubic-bezier(.3, .7, .2, 1); }
.tb-page.turn-in-l { animation: tb-turn-l .5s cubic-bezier(.3, .7, .2, 1); }
@keyframes tb-turn-r { from { transform: rotateY(-70deg); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes tb-turn-l { from { transform: rotateY(70deg); opacity: .2; } to { transform: none; opacity: 1; } }
/* a pocket: clear sleeve with a glossy top edge */
.tb-pocket { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 6px 4px; border-radius: 6px; min-width: 0;
	background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .15) 8%, rgba(255, 255, 255, .06)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), inset 0 10px 0 -8px rgba(255, 255, 255, .7); }
:root[data-theme="dark"] .tb-pocket { background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05) 8%, rgba(255, 255, 255, .02)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tb-pocket { background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05) 8%, rgba(255, 255, 255, .02)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); } }
.tb-pocket::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(125deg, rgba(255, 255, 255, .18), transparent 30%, transparent 70%, rgba(255, 255, 255, .08)); z-index: 2; }
.tb-pocket .tc, .tb-pocket .tc-ghost { --tcw: 100%; width: 100%; max-width: 190px; }
.tb-pocket .tc-cell { width: 100%; }
.tb-pocket.tb-empty { aspect-ratio: 5 / 7.7; }
.tb-folio { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--dim); }
.tb-pocket .tc-cell-cap { font-size: 11px; }
@media (max-width: 560px) {
	.tb-book { padding: 8px; }
	.tb-page { gap: 6px; padding: 8px 8px 22px; }
	.tb-pocket { padding: 3px 3px 2px; }
	.tb-pocket .tc-cell-cap { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tb-page { animation: none !important; } }

/* the grid binder: rows far off screen skip layout and paint */
.tc-grid > .tc-cell, .tc-grid > .tc-ghost { content-visibility: auto; contain-intrinsic-size: auto 150px auto 240px; }

/* hover preview */
.tc-preview { position: fixed; z-index: 150; pointer-events: none; opacity: 0; transform: scale(.94); transition: opacity .16s, transform .16s; }
.tc-preview.in { opacity: 1; transform: none; }
.tc-preview .tc { --tcw: 270px; }

/* ---- set completion ----------------------------------------------------------------- */
.tc-set-badge.tc-ring { position: relative; background: conic-gradient(var(--ring, var(--accent)) calc(var(--pct) * 1%), var(--panel-2) 0); box-shadow: none; }
.tc-set-badge.tc-ring > span { position: absolute; inset: 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--c0, #59606a); color: #fff; box-shadow: inset 0 0 0 2px var(--c1, rgba(255, 255, 255, .5)); }
.tc-set.done .tc-set-badge.tc-ring { --ring: var(--gold); }
.tc-set.done { position: relative; overflow: hidden; }
.tc-set.done::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255, 236, 170, .35) 45%, transparent 60%) 0 0 / 250% 100%; background-position: 130% 0; }
.tc-set.done:is(:hover, :focus-visible)::after { animation: tc-set-shine 4s ease-in-out infinite; }
@keyframes tc-set-shine { 0%, 40% { background-position: 130% 0; } 90%, 100% { background-position: -30% 0; } }
.tc-set-stamp { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 99px; font-size: 10px; font-weight: 900; letter-spacing: .1em; color: #241800; background: linear-gradient(180deg, #ffe08a, #c99a2e); vertical-align: 1px; }
.tc-rs-bar { display: block; height: 3px; margin-top: 5px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.tc-rs-bar i { display: block; height: 100%; background: var(--tier); }
@media (prefers-reduced-motion: reduce) { .tc-set.done::after { animation: none; } }
/* grid cards already seen one by one: no second glow or deal */
.pk-card.pk-seen, .pk-card.pk-seen .pk-flip, .pk-card.pk-seen .pk-real, .pk-card.pk-seen::after, .pk-card.pk-seen::before { animation: none !important; transition: none !important; }
.pk-card.pk-seen::before { opacity: .55; }
/* wide tables in the card pages (pack value guide …) scroll inside their box on phones
   instead of widening the whole page */
.tc-body .table-wrap { max-width: 100%; overflow-x: auto; }
/* on phones, toasts move to the top while a card dialog or the pack opener is up, so they
   never sit over its buttons */
@media (max-width: 560px) { body:has(.tc-modal) .tc-toasts { top: 10px; bottom: auto; left: 12px; right: auto; max-width: calc(100vw - 76px); } body:has(.tc-modal) .tc-toast:nth-child(n+2) { display: none; } body:has(.tc-modal) .tc-toast { padding: 6px 10px; font-size: 13px; } }

/* =====================================================================================
   Almanac programs (cardgame-types.js): each line gets its own frame, art, series plate,
   title bar and caption chip. Variables per line, one set of rules for all thirteen.
   --frame/--frame-ink/--edge also dress the back (cards.css: .tc .tc-side.tc-back).
   ===================================================================================== */
.tc:is(.ins-rcl, .ins-sk, .ins-mlt, .ins-bal, .ins-sxm, .ins-tdm, .ins-srp, .ins-adt, .ins-fos, .ins-intl, .ins-jn, .ins-wi, .ins-iron) {
	--plate: linear-gradient(180deg, #14171d, #05070a); --plate-ink: #fff; --plate-sub: var(--edge);
	--now-bg: #fff; --now-ink: #0b0f1e; --now-run: var(--edge);
	--art: linear-gradient(160deg, var(--c0), var(--base) 50%, var(--deep));
}
.tc:is(.ins-rcl, .ins-sk, .ins-mlt, .ins-bal, .ins-sxm, .ins-tdm, .ins-srp, .ins-adt, .ins-fos, .ins-intl, .ins-jn, .ins-wi, .ins-iron) :is(.tc-front, .tc-front.is-now) { background: var(--frame); box-shadow: inset 0 0 0 .4cqw rgba(0, 0, 0, .25); }
.tc:is(.ins-rcl, .ins-sk, .ins-mlt, .ins-bal, .ins-sxm, .ins-tdm, .ins-srp, .ins-adt, .ins-fos, .ins-intl, .ins-jn, .ins-wi, .ins-iron) .tc-bg { background: var(--art); box-shadow: inset 0 0 0 .4cqw var(--edge), inset 0 0 0 .9cqw rgba(0, 0, 0, .3); }
.tc:is(.ins-rcl, .ins-sk, .ins-mlt, .ins-bal, .ins-sxm, .ins-tdm, .ins-srp, .ins-adt, .ins-fos, .ins-intl, .ins-jn, .ins-wi, .ins-iron) .tc-series { background: var(--plate); border-top-color: var(--edge); }
.tc:is(.ins-rcl, .ins-sk, .ins-mlt, .ins-bal, .ins-sxm, .ins-tdm, .ins-srp, .ins-adt, .ins-fos, .ins-intl, .ins-jn, .ins-wi, .ins-iron) .tc-series b { color: var(--plate-ink); }
.tc:is(.ins-rcl, .ins-sk, .ins-mlt, .ins-bal, .ins-sxm, .ins-tdm, .ins-srp, .ins-adt, .ins-fos, .ins-intl, .ins-jn, .ins-wi, .ins-iron) .tc-series span { color: var(--plate-sub); }
.tc:is(.ins-rcl, .ins-sk, .ins-mlt, .ins-bal, .ins-sxm, .ins-tdm, .ins-srp, .ins-adt, .ins-fos, .ins-intl, .ins-jn, .ins-wi, .ins-iron) .tc-title { background: var(--title); color: var(--title-ink); }
.tc:is(.ins-rcl, .ins-sk, .ins-mlt, .ins-bal, .ins-sxm, .ins-tdm, .ins-srp, .ins-adt, .ins-fos, .ins-intl, .ins-jn, .ins-wi, .ins-iron) .tc-now-big { background: var(--now-bg); color: var(--now-ink); box-shadow: inset 0 0 0 .3cqw var(--edge); }
.tc:is(.ins-rcl, .ins-sk, .ins-mlt, .ins-bal, .ins-sxm, .ins-tdm, .ins-srp, .ins-adt, .ins-fos, .ins-intl, .ins-jn, .ins-wi, .ins-iron) .tc-now-run { color: var(--now-run); }

/* Rookie Class: fresh teal and lime, a confetti dot screen */
.tc.ins-rcl { --frame: linear-gradient(135deg, #00594c, #00d1a8 30%, #e8ffd0 50%, #00b394 70%, #00463c); --frame-ink: #002a22; --edge: #b3ff6b;
	--plate: linear-gradient(90deg, #003d33, #00796b); --title: linear-gradient(90deg, #00a88f, #b3ff6b); --title-ink: #002a22; --now-bg: #e8ffd0; --now-ink: #003d33; --rib: linear-gradient(90deg, #00c2a8, #b3ff6b); --rib-ink: #002a22;
	--art: radial-gradient(circle at 20% 20%, rgba(179, 255, 107, .3) 0 .6cqw, transparent .7cqw) 0 0 / 7cqw 7cqw, radial-gradient(80% 55% at 55% 30%, color-mix(in srgb, var(--c1) 45%, transparent), transparent 70%), linear-gradient(160deg, #00594c, var(--base) 55%, #001f1a); }
/* Stat Kings: royal purple and crown gold */
.tc.ins-sk { --frame: linear-gradient(135deg, #2a0a4a, #c9a646 22%, #5a189a 45%, #f1d27a 65%, #2a0a4a); --frame-ink: #f1d27a; --edge: #f1d27a;
	--plate: linear-gradient(90deg, #2a0a4a, #5a189a); --title: linear-gradient(90deg, #8a6a1f, #f4dc8a 40%, #c9a646 70%, #8a6a1f); --title-ink: #241800; --now-bg: #2a0a4a; --now-ink: #f1d27a; --rib: linear-gradient(90deg, #5a189a, #f1d27a); --rib-ink: #fff;
	--art: repeating-conic-gradient(from 0deg at 50% 26%, rgba(241, 210, 122, .1) 0 6deg, transparent 6deg 15deg), radial-gradient(70% 45% at 50% 30%, rgba(241, 210, 122, .35), transparent 70%), linear-gradient(170deg, #3c096c, #14052e 80%); }
/* Milestone tracker: cyan-to-violet, a running progress rule */
.tc.ins-mlt { --frame: linear-gradient(135deg, #003a5c, #00e0ff 30%, #7a00ff 70%, #1d0040); --frame-ink: #e6fbff; --edge: #00e0ff;
	--plate: linear-gradient(90deg, #0b0f2a, #1d2a6a); --title: linear-gradient(90deg, #00a3c4, #5b2bd6); --title-ink: #fff; --now-bg: #0b0f2a; --now-ink: #8ff3ff; --rib: linear-gradient(90deg, #00e0ff, #7a00ff);
	--art: repeating-linear-gradient(90deg, rgba(0, 224, 255, .14) 0 .3cqw, transparent .3cqw 8cqw), linear-gradient(0deg, transparent 72%, rgba(0, 224, 255, .25) 72% 73%, transparent 73%), radial-gradient(70% 45% at 50% 32%, rgba(0, 224, 255, .3), transparent 72%), linear-gradient(172deg, #0b0f2a, var(--deep) 60%, #000); }
/* Award ballot: ivory ballot paper, navy ink, ruled lines */
.tc.ins-bal { --frame: linear-gradient(135deg, #e9e1cc, #fffaf0 40%, #d8ccb0 70%, #f4ecda); --frame-ink: #13204d; --edge: #13204d;
	--plate: #13204d; --plate-sub: #f4ecda; --title: linear-gradient(90deg, #13204d, #23408e); --title-ink: #fffaf0; --now-bg: #fffaf0; --now-ink: #13204d; --now-run: #8fb2ff; --rib: linear-gradient(90deg, #13204d, #23408e);
	--art: repeating-linear-gradient(180deg, transparent 0 5.6cqw, rgba(255, 250, 240, .08) 5.6cqw 5.9cqw), radial-gradient(70% 45% at 50% 32%, rgba(255, 250, 240, .25), transparent 70%), linear-gradient(170deg, #23408e, #0d1636 80%); }
/* Sixth Man: emerald bench green, a big 6 */
.tc.ins-sxm { --frame: linear-gradient(135deg, #04361a, #19d36a 30%, #e3ffd6 50%, #0e9a4c 70%, #04361a); --frame-ink: #04361a; --edge: #7dffb0;
	--plate: linear-gradient(90deg, #04361a, #0e7a3c); --title: linear-gradient(90deg, #0e7a3c, #19d36a); --title-ink: #fff; --now-bg: #04361a; --now-ink: #b6ffd2; --rib: linear-gradient(90deg, #0e7a3c, #7dffb0); --rib-ink: #04361a;
	--art: radial-gradient(70% 45% at 50% 32%, rgba(125, 255, 176, .28), transparent 72%), repeating-linear-gradient(135deg, rgba(125, 255, 176, .07) 0 1cqw, transparent 1cqw 4cqw), linear-gradient(172deg, #0b4a26, var(--deep) 70%); }
.tc.ins-sxm .tc-water { color: rgba(125, 255, 176, .1); }
/* Triple-Double Machine: chrome and safety orange, a machined grid */
.tc.ins-tdm { --frame: linear-gradient(135deg, #3a3f47, #e7ebef 30%, #8b939c 50%, #f4f6f8 70%, #3a3f47); --frame-ink: #1b1f24; --edge: #ff8a2a;
	--plate: linear-gradient(90deg, #1b1f24, #3a3f47); --title: linear-gradient(90deg, #ff6a00, #ffb347); --title-ink: #1b0b00; --now-bg: #1b1f24; --now-ink: #ffb347; --rib: linear-gradient(90deg, #3a3f47, #ff8a2a);
	--art: linear-gradient(rgba(255, 255, 255, .06) .2cqw, transparent .2cqw) 0 0 / 6cqw 6cqw, linear-gradient(90deg, rgba(255, 255, 255, .06) .2cqw, transparent .2cqw) 0 0 / 6cqw 6cqw, radial-gradient(70% 45% at 50% 32%, rgba(255, 138, 42, .28), transparent 72%), linear-gradient(172deg, #2b3038, #0d0f12 80%); }
/* Season Recap: newsprint — grey stock, black masthead, halftone */
.tc.ins-srp { --frame: linear-gradient(135deg, #cfcac0, #f2efe8 40%, #bdb7ab 70%, #e6e2d9); --frame-ink: #111; --edge: #111;
	--plate: #111; --plate-sub: #e6e2d9; --title: linear-gradient(90deg, #111, #333); --title-ink: #f2efe8; --now-bg: #f2efe8; --now-ink: #111; --now-run: #c8102e; --rib: #111;
	--art: radial-gradient(rgba(0, 0, 0, .22) 26%, transparent 28%) 0 0 / 1.4cqw 1.4cqw, linear-gradient(170deg, color-mix(in srgb, var(--c0) 55%, #6b6b6b), #1e1e1e 85%); }
.tc.ins-srp .tc-series b { font-family: "TC Ferro", var(--sans); font-style: normal; }
/* All-Decade team: bronze plaque, a decade sunburst */
.tc.ins-adt { --frame: linear-gradient(135deg, #4a2c0a, #cd8f3c 25%, #ffe1a6 45%, #9c6224 65%, #f0c27a 82%, #4a2c0a); --frame-ink: #2a1806; --edge: #f0c27a;
	--plate: linear-gradient(90deg, #2a1806, #6b4416); --title: linear-gradient(90deg, #6b4416, #f0c27a 50%, #6b4416); --title-ink: #1a0f02; --now-bg: #2a1806; --now-ink: #ffe1a6; --rib: linear-gradient(90deg, #4a2c0a, #d4a35a);
	--art: repeating-conic-gradient(from 0deg at 50% 100%, rgba(240, 194, 122, .1) 0 4deg, transparent 4deg 10deg), radial-gradient(70% 45% at 50% 32%, rgba(255, 225, 166, .3), transparent 72%), linear-gradient(172deg, #3d2408, #120a02 80%); }
/* Front Office Steal: banknote green and black, a guilloche */
.tc.ins-fos { --frame: linear-gradient(135deg, #0c2b1a, #6fbf73 30%, #d8f0c8 50%, #3f8f4f 70%, #0c2b1a); --frame-ink: #0c2b1a; --edge: #9fe0a0;
	--plate: linear-gradient(90deg, #050806, #0c2b1a); --title: linear-gradient(90deg, #0c2b1a, #3f8f4f); --title-ink: #e8ffe0; --now-bg: #d8f0c8; --now-ink: #0c2b1a; --rib: linear-gradient(90deg, #0c2b1a, #6fbf73);
	--art: repeating-radial-gradient(circle at 50% 30%, rgba(159, 224, 160, .1) 0 .3cqw, transparent .3cqw 2.4cqw), linear-gradient(172deg, #14402a, #050806 80%); }
/* International star: deep ocean blue with meridians */
.tc.ins-intl { --frame: linear-gradient(135deg, #04204a, #2f7cff 30%, #c4ecff 50%, #1b4fd8 70%, #04204a); --frame-ink: #04112e; --edge: #8fd3ff;
	--plate: linear-gradient(90deg, #04112e, #0b3d91); --title: linear-gradient(90deg, #0b3d91, #2f7cff); --title-ink: #fff; --now-bg: #04112e; --now-ink: #c4ecff; --rib: linear-gradient(90deg, #1b4fd8, #6fe3ff); --rib-ink: #04112e;
	--art: repeating-radial-gradient(ellipse 60% 100% at 50% 34%, transparent 0 7cqw, rgba(143, 211, 255, .14) 7cqw 7.3cqw), repeating-linear-gradient(0deg, transparent 0 9cqw, rgba(143, 211, 255, .1) 9cqw 9.3cqw), linear-gradient(172deg, #0b3d91, #020a1c 80%); }
/* Jersey legends: the team's colours as jersey mesh, big number stitching */
.tc.ins-jn { --frame: linear-gradient(135deg, var(--c0), var(--c1) 50%, var(--c0)); --frame-ink: var(--on1); --edge: var(--c1);
	--plate: var(--c0); --plate-sub: var(--c1); --title: linear-gradient(90deg, var(--c0), var(--c1)); --title-ink: #fff; --now-bg: var(--c1); --now-ink: var(--on1); --rib: linear-gradient(90deg, var(--c0), var(--c1));
	--art: radial-gradient(rgba(0, 0, 0, .28) 30%, transparent 32%) 0 0 / 1.2cqw 1.2cqw, linear-gradient(90deg, transparent 0 8%, var(--c1) 8% 10%, transparent 10% 90%, var(--c1) 90% 92%, transparent 92%), linear-gradient(172deg, var(--c0), var(--deep) 80%); }
.tc.ins-jn .tc-water { color: color-mix(in srgb, var(--c1) 26%, transparent); -webkit-text-stroke: .5cqw color-mix(in srgb, var(--c1) 45%, transparent); }
.tc.ins-jn .tc-title { text-shadow: 0 .3cqw .6cqw rgba(0, 0, 0, .5); }
/* What if: dreamy duotone, a dashed "alternate history" frame */
.tc.ins-wi { --frame: linear-gradient(135deg, #3a0ca3, #f72585 35%, #ffd6f0 50%, #7209b7 70%, #3a0ca3); --frame-ink: #fff; --edge: #ffd6f0;
	--plate: linear-gradient(90deg, #3a0ca3, #7209b7); --title: linear-gradient(90deg, #7209b7, #f72585); --title-ink: #fff; --now-bg: #ffd6f0; --now-ink: #3a0ca3; --rib: linear-gradient(90deg, #7209b7, #f72585);
	--art: radial-gradient(60% 40% at 30% 25%, rgba(247, 37, 133, .35), transparent 70%), radial-gradient(60% 40% at 75% 55%, rgba(76, 201, 240, .3), transparent 70%), linear-gradient(172deg, #240046, #10002b 85%); }
.tc.ins-wi .tc-bg { outline: .4cqw dashed rgba(255, 214, 240, .7); outline-offset: -1.4cqw; }
.tc.ins-wi .tc-portrait:not(.tc-has-photo) { filter: saturate(.85) hue-rotate(-12deg); }
/* Iron Defense: dark gunmetal, rivets, a red alarm stripe */
.tc.ins-iron { --frame: repeating-linear-gradient(90deg, #4a5059 0 .3cqw, #6b737c .3cqw .6cqw, #3d434b .6cqw 1cqw); --frame-ink: #fff; --edge: #c8102e;
	--plate: linear-gradient(90deg, #111418, #2c3036); --title: linear-gradient(90deg, #8a0c20, #c8102e); --title-ink: #fff; --now-bg: #111418; --now-ink: #ff5a6e; --rib: linear-gradient(90deg, #2c3036, #c8102e);
	--art: radial-gradient(circle at 6% 4%, #9aa3ad 0 .7cqw, transparent .8cqw), radial-gradient(circle at 94% 4%, #9aa3ad 0 .7cqw, transparent .8cqw), repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 1cqw, transparent 1cqw 3cqw), radial-gradient(70% 45% at 50% 32%, rgba(200, 16, 46, .22), transparent 72%), linear-gradient(172deg, #2c3036, #08090b 80%); }

/* Display names per line (faces from fonts.css). --fit-wrap lets cards.js fitText()
   fit a long name in steps (shrink, two lines, tighter spacing) instead of shrinking it
   to nothing, so these lines can keep their own face. */
.tc:is(.ins-rcl, .ins-sk, .ins-mlt, .ins-bal, .ins-sxm, .ins-tdm, .ins-srp, .ins-adt, .ins-fos, .ins-intl, .ins-jn, .ins-wi, .ins-iron,
	.ins-now, .ins-ra, .ins-duel, .ins-stk, .ins-deb, .ins-fin, .ins-pf, .ins-rob,
	.ins-dd, .ins-rd, .ins-smvp, .ins-g7, .ins-sw, .ins-up, .ins-ch, .ins-tbk, .ins-nm, .ins-spv,
	.ins-rbk, .ins-tor, .ins-max, .ins-bar, .ins-tdl, .ins-hh, .ins-men, .ins-fam, .ins-clu, .ins-opn, .ins-cls, .ins-rev, .ins-irn, .ins-aut, .ins-rel) { --fit-wrap: 1; }
.tc .tc-ln.tc-fit-2 { white-space: normal; text-overflow: clip; line-height: 1.28; max-height: calc(2.56em + .14em); padding: .04em 0 .1em; margin-top: 0; overflow-wrap: normal; }
/* almanac lines */
.tc.ins-rcl .tc-ln { font-family: "Varsity", var(--sans); font-weight: 400; letter-spacing: .02em; }
.tc.ins-sk .tc-ln { font-family: "IM Fell English SC", serif; font-weight: 400; letter-spacing: .03em; }
.tc.ins-mlt .tc-ln { font-family: "AeroMatics Display", var(--sans); font-style: italic; font-weight: 700; letter-spacing: .02em; }
.tc.ins-bal .tc-ln { font-family: "Moms Typewriter", monospace; font-weight: 400; letter-spacing: 0; text-shadow: none; color: var(--frame-ink); }
.tc.ins-sxm .tc-ln { font-family: "Russo One", var(--sans); font-weight: 400; letter-spacing: .01em; font-size: calc(var(--ln-fs, 12cqw) * .86); }
.tc.ins-tdm .tc-ln { font-family: "Retro", var(--sans); font-weight: 400; letter-spacing: .04em; }
.tc.ins-srp .tc-ln { font-family: "Old Newspaper Types", serif; font-weight: 400; letter-spacing: .01em; }
.tc.ins-adt .tc-ln { font-family: "Optimus Princeps", serif; font-weight: 600; letter-spacing: .04em; font-size: calc(var(--ln-fs, 12cqw) * .9); }
.tc.ins-fos .tc-ln { font-family: "MadeLikesSlab", var(--sans); font-weight: 400; letter-spacing: .02em; }
.tc.ins-intl .tc-ln { font-family: "Caviar Dreams", var(--sans); font-weight: 700; letter-spacing: .03em; font-size: calc(var(--ln-fs, 12cqw) * .9); }
.tc.ins-jn .tc-ln { font-family: "Freshman", var(--sans); font-weight: 400; letter-spacing: .03em; font-size: calc(var(--ln-fs, 12cqw) * .86); }
.tc.ins-wi .tc-ln { font-family: "MadeLikesScript", cursive; font-weight: 400; text-transform: none; letter-spacing: 0; }
.tc.ins-iron .tc-ln { font-family: "Norse", serif; font-weight: 700; letter-spacing: .05em; }
/* game programs (cardgame-programs.js) */
.tc.ins-now .tc-ln { font-family: "Excluded", var(--sans); font-style: italic; font-weight: 400; letter-spacing: 0; }
.tc.ins-ra .tc-ln { font-family: "AeroMatics Display", var(--sans); font-weight: 700; letter-spacing: .03em; }
.tc.ins-duel .tc-ln { font-family: "Midnight Spree", var(--sans); font-weight: 400; letter-spacing: .01em; }
.tc.ins-stk .tc-ln { font-family: "AeroMatics", var(--sans); font-style: normal; font-weight: 700; letter-spacing: .02em; }
.tc.ins-deb .tc-ln { font-family: "Appo Paint", var(--sans); font-weight: 400; letter-spacing: .02em; }
.tc.ins-fin .tc-ln { font-family: "Maranatha", serif; font-weight: 400; letter-spacing: .02em; }
.tc.ins-pf .tc-ln { font-family: "Quicksilver", var(--sans); font-style: italic; font-weight: 400; letter-spacing: .02em; }
.tc.ins-rob .tc-ln { font-family: "Top Secret", var(--sans); font-weight: 400; letter-spacing: .03em; }
/* history and legacy lines */
.tc:is(.ins-dd, .ins-rd) .tc-ln { font-family: "Maranatha", serif; font-weight: 400; letter-spacing: .02em; }
.tc:is(.ins-smvp, .ins-g7) .tc-ln { font-family: "Ferro Rosso", var(--sans); font-weight: 400; letter-spacing: .01em; }
.tc:is(.ins-sw, .ins-up) .tc-ln { font-family: "Open Ring", var(--sans); font-weight: 400; letter-spacing: .02em; }
.tc.ins-ch .tc-ln { font-family: "AeroMatics Display", var(--sans); font-style: italic; font-weight: 700; letter-spacing: .02em; }
.tc:is(.ins-tbk, .ins-spv) .tc-ln { font-family: "IM Fell Double Pica", serif; font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; }
.tc.ins-nm .tc-ln { font-family: "Grim Creeper", serif; font-weight: 400; letter-spacing: .03em; }
.tc:is(.ins-rbk, .ins-tor) .tc-ln { font-family: "Excelsior Sans", var(--sans); font-weight: 400; letter-spacing: .04em; }
.tc:is(.ins-max, .ins-bar, .ins-tdl) .tc-ln { font-family: "LT Sip Text", var(--sans); font-weight: 900; letter-spacing: -.01em; }
.tc:is(.ins-hh, .ins-fam, .ins-men) .tc-ln { font-family: "MadeLikesSlab", var(--sans); font-weight: 400; letter-spacing: .02em; }
.tc:is(.ins-clu, .ins-rev) .tc-ln { font-family: "Midnight Spree", var(--sans); font-weight: 400; letter-spacing: .01em; }
.tc:is(.ins-opn, .ins-cls) .tc-ln { font-family: "Lister", var(--sans); font-weight: 400; letter-spacing: .03em; }
.tc.ins-irn .tc-ln { font-family: "BrickWall", var(--sans); font-weight: 400; letter-spacing: .02em; }
.tc:is(.ins-aut, .ins-rel) .tc-ln { font-family: "Optimus Princeps", serif; font-weight: 600; letter-spacing: .04em; font-size: calc(var(--ln-fs, 12cqw) * .9); }

/* the 1/1 step of the ladder: ink-black tag with a gold edge that catches the light */
.tc-tier-tag.tier-one { color: #f4e2a1; border: 0; background: linear-gradient(110deg, #0b0b0d 30%, #3a3226 45%, #0b0b0d 60%) 0 0 / 250% 100%, #0b0b0d; box-shadow: inset 0 0 0 1px #d9c27a, 0 0 6px rgba(244, 226, 161, .35); animation: tc-one-shine 3.5s ease-in-out infinite; }
@keyframes tc-one-shine { 0%, 30% { background-position: 120% 0; } 80%, 100% { background-position: -20% 0; } }
@media (prefers-reduced-motion: reduce) { .tc-tier-tag.tier-one { animation: none; } }

/* =====================================================================================
   Game-system panels (cardgame-economy / progress / arena / mode-*.js)
   ===================================================================================== */
.tc-econ-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.tc-econ-top > .tc-ladder { grid-column: 1 / -1; }
.tc-featured { position: relative; overflow: hidden; padding: 12px 14px; border-radius: 10px; color: #fff; background: radial-gradient(120% 120% at 100% 0%, rgba(255, 214, 102, .35), transparent 55%), linear-gradient(135deg, #3a0ca3, #7209b7 55%, #c8102e); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.tc-featured::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .25) 45%, transparent 60%) 0 0 / 250% 100%; animation: tc-set-shine 5s ease-in-out infinite; }
.tc-featured .tc-kicker { color: #ffd66b; }
.tc-featured h3 { margin: 2px 0 4px; font-family: "TC Excluded", var(--sans); font-style: italic; font-weight: 400; font-size: 22px; letter-spacing: .02em; }
.tc-featured .muted { color: rgba(255, 255, 255, .82); }
.tc-pity { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.tc-pity .tc-bar-row { grid-template-columns: minmax(0, 92px) 1fr auto; }
.tc-pity .tc-set-bar span { background: linear-gradient(90deg, var(--accent), #ff7a2f); }
.tc-pity p { margin: 2px 0 0; }
.tc-ladder summary { cursor: pointer; color: var(--link); font-weight: 600; }
.tc-ladder ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.tc-ladder li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: var(--panel-2); }
.tc-ladder li .tc-tier-tag { min-width: 76px; text-align: center; }
.badge.tc-pack-grade { margin-left: 8px; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); vertical-align: 3px; }
.tc-odds-table, .tc-value-guide { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-odds-table th, .tc-odds-table td, .tc-value-guide td:not(:first-child), .tc-value-guide th:not(:first-child) { text-align: right; }
.tc-odds-table th[class*="tier-"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--tier); }
.tc-value-guide tbody tr:hover, .tc-odds-table tbody tr:hover { background: var(--panel-2); }
.tc-value-guide td:first-child { font-weight: 600; }
.tc-odds-pub { margin-top: 6px; }
.tc-craft { display: flex; flex-direction: column; gap: 10px; }
.tc-craft .row { flex-wrap: wrap; gap: 6px; }
.tc-craft-tip { padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--gold); background: linear-gradient(120deg, rgba(184, 134, 11, .1), transparent 70%); }
.tc-craft-tip .row { align-items: center; }
.tc-craft-tip .tc-ghost { --tcw: 110px; }
.tc-dim { opacity: .45; filter: grayscale(.6); }
.tc-dim .tc { cursor: not-allowed; }
.tc-bid { width: 110px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; }
.tc-bid:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tc-level { display: flex; gap: 14px; align-items: center; min-width: 0; }
.tc-level > div:last-child { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.tc-level-badge { flex: 0 0 auto; width: 64px; height: 64px; display: grid; place-items: center; font-family: "TC Excluded", var(--sans); font-style: italic; font-size: 30px; line-height: 1; color: #241800;
	clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); background: linear-gradient(135deg, #8a6a1f, #f4dc8a 40%, #c9a646 65%, #fff1bf 85%, #a87b16); text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.tc-progress-head { display: flex; flex-direction: column; gap: 12px; }
.tc-trophy-room { display: flex; flex-direction: column; gap: 12px; background: radial-gradient(120% 90% at 50% 0%, rgba(184, 134, 11, .14), transparent 60%), var(--panel); }
.tc-trophy-room .tc-h2 { margin-top: 0; }
.tc-trophy-room .tc-badge { background: linear-gradient(180deg, #2a2f3a, #14171d); color: #f1d27a; box-shadow: inset 0 0 0 1px #c9a646; }
.tc-draft-pack { padding: 10px 6px 12px; border-radius: 12px; background: radial-gradient(120% 90% at 50% 0%, rgba(122, 60, 255, .18), transparent 70%), var(--panel-2); }
.tc-draft-pack .tc-cell .tc { --tcw: 190px; }
.tc-hilo { display: flex; flex-direction: column; gap: 10px; }
.tc-hilo .tc-bt-duel { min-height: 330px; }
.tc-hilo .row { flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
	.tc-draft-pack .tc-cell .tc { --tcw: 150px; }
	.tc-hilo .tc-bt-duel .tc-md { --tcw: 150px; }
	.tc-hilo .tc-bt-duel { min-height: 0; gap: 8px; }
	.tc-level-badge { width: 52px; height: 52px; font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .tc-featured::after { animation: none; } }
/* shop art for the newer packs and boxes */
.tc-pack-vault .tc-pack-art { background: linear-gradient(160deg, #3a4048, #0b0c0f); color: #f1d27a; box-shadow: 0 6px 14px rgba(0, 0, 0, .3), inset 0 0 0 2px #c9a646; }
.tc-pack-case .tc-pack-art { background: linear-gradient(160deg, #7a5226, #2a1806); color: #f6e7c8; }
.tc-pack-history .tc-pack-art { background: linear-gradient(160deg, #8a6a3a, #3b2a17); color: #f6e7c8; }
.tc-pack-legacy .tc-pack-art { background: linear-gradient(160deg, #4a3a22, #120a02); color: #f1d27a; }
.tc-pack-almanac .tc-pack-art { background: linear-gradient(160deg, #23408e, #0d1636); }
.tc-pack-featured .tc-pack-art { background: linear-gradient(135deg, #f72585, #7209b7 50%, #3a0ca3); }
.tc-pack-hobbybox .tc-pack-art { background: linear-gradient(160deg, #1f63d8, #04112e); }
.tc-pack-legendsbox .tc-pack-art { background: linear-gradient(115deg, #ff7eb3, #b28dff 40%, #5a189a); }
.tc-pack-drop .tc-pack-art { background: linear-gradient(160deg, #00c2e0, #0b2a4a); }
.tc-pack-setpack .tc-pack-art { background: linear-gradient(160deg, #00c2a8, #00332b); }
.tc-pack-featured .tc-pack-art::after, .tc-pack-legendsbox .tc-pack-art::after, .tc-pack-vault .tc-pack-art::after { background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 45%, transparent 60%) 0 0 / 250% 100%; height: auto; top: 0; animation: tc-set-shine 5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .tc-pack-art::after { animation: none !important; } }
.tc-value-guide th, .tc-value-guide td, .tc-odds-table th, .tc-odds-table td { padding: 4px 8px; }
.tc-value-guide th:first-child, .tc-odds-table th:first-child { text-align: left; }
.tc-value-guide thead th, .tc-odds-table thead th { border-bottom: 1px solid var(--line); font-weight: 700; }
.tc-value-guide tbody tr + tr td { border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
/* segmented choices in the card pages wrap on phones instead of running off the edge */
.tc-body .ui-seg { flex-wrap: wrap; max-width: 100%; height: auto; }

/* Finishes color the card stock and frame; the player art and the plate sit above them.
   --fxk scales every finish layer; the frame ring may be bolder than the art layers. */
.tc { --fxk: .6; }
.fx-gold .tc-foil::before, .fx-sheen .tc-foil::before, .fx-goldfoil .tc-foil::before, .fx-chrome .tc-foil::before { --fxk: .9; }
.tc .tc-front > .tc-portrait, .tc .tc-front > .tc-duo-mate { z-index: 2; }
.tc .tc-front > .tc-plate, .tc .tc-front > .tc-top { z-index: 3; }

/* Pack opener polish (sweep 8): the button keeps its width between "Flip" and "Next card"; the summary and Done stay in reach under a long grid. */
.pkx-next { min-width: 128px; }
.pk-summary:not([hidden]) { position: sticky; bottom: 0; z-index: 4; width: 100%; padding: 10px 8px 6px; margin-top: 4px; background: linear-gradient(to top, #0b0d16 70%, rgba(11, 13, 22, 0)); }
.pk-summary p { margin: 4px 0; }
