/* ==================== StackDraft · cosmetics ====================
   Every cosmetic slot (patch, frame, title, plate, tag, Armory tile, Patch Board) and the unlock ceremonies.
   Markup comes from js/cosmetics.js. Prefixed cz- so nothing collides with the game's generic class names.
   The rarity system (v2), for every cosmetic now and later: five categories. Each owns a colour (--cz-c), a sound
   and an unlock ceremony, and how many players hold an item decides its rarity (js/cosmetics.js RARITY).
   The colour is UI only (tiles, labels, the ceremony, the ID card's counts): it is never painted into the art.
     standard  bone      most players          rare   cobalt    under 25%        epic  violet   under 8%
     legendary crimson   under 3%              topfrag Fragment (and the Cut)   under 1%
   Motion still steps up with rarity: Rare one light sweep, Epic tilt and parallax, Legendary the live signal,
   TOPFRAG the live glass.
   No glows anywhere: the aura is material, hard light sweeps, parallax, hard-edged motion and sound. */

:root {
  --cz-ink: #0a0a0b;
  --cz-panel: #0e0e10;
  --cz-bone: #f4f1ea;
  --cz-bone-2: rgba(244, 241, 234, 0.72);
  --cz-mute: #8c8b91;
  --cz-rule: rgba(244, 241, 234, 0.16);
  --cz-red: #F0144A;
  --cz-brass: #b8913f;
  --cz-brass-hi: #e3cc90;
  --cz-brass-lo: #7d5f24;
  --cz-gun: #3d4148;
  --cz-gun-hi: #8a909b;
  /* the rarity colours */
  --cz-std: #d9d4c8;
  --cz-cobalt: #3d8bf0;
  --cz-cobalt-lo: #1f4f9e;
  --cz-violet: #a46bff;
  --cz-violet-lo: #5a3aa8;
  --cz-hud: "Chakra Petch", "Barlow Condensed", "Arial Narrow", sans-serif;
  --cz-cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --cz-body: "Barlow", "Segoe UI", sans-serif;
  --cz-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cz-r-standard { --cz-c: var(--cz-std); --cz-c2: rgba(217, 212, 200, 0.35); }
.cz-r-rare { --cz-c: var(--cz-cobalt); --cz-c2: var(--cz-cobalt-lo); }
.cz-r-epic { --cz-c: var(--cz-violet); --cz-c2: var(--cz-violet-lo); }
.cz-r-legendary { --cz-c: var(--cz-red); --cz-c2: #8a0b2c; }
.cz-r-topfrag { --cz-c: var(--cz-bone); --cz-c2: var(--cz-red); }

.cz-beta { text-transform: none; }

/* ---------- shared: the hard light sweep (masked to the item, so it only crosses the material) ---------- */
.cz-p-sweep, .cz-f-sweep, .cz-g-sweep {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  background: linear-gradient(104deg, transparent 0 44%, rgba(255, 249, 232, 0.5) 44% 46.5%, transparent 46.5% 49%, rgba(255, 249, 232, 0.26) 49% 49.8%, transparent 49.8%) 0 0 / 300% 100% no-repeat;
  mix-blend-mode: screen;
}
.cz-r-rare .cz-p-sweep, .cz-r-rare .cz-f-sweep, .cz-r-rare .cz-g-sweep {
  background-image: linear-gradient(104deg, transparent 0 44%, rgba(255, 226, 160, 0.55) 44% 46.5%, transparent 46.5% 49%, rgba(255, 226, 160, 0.28) 49% 49.8%, transparent 49.8%);
}
.cz-live:hover .cz-p-sweep, .cz-live:hover .cz-f-sweep, .cz-live:hover .cz-g-sweep,
.cz-sweeping .cz-p-sweep, .cz-sweeping .cz-f-sweep, .cz-sweeping .cz-g-sweep, .cz-sweeping.cz-title b::after { animation: czSweepRun 0.9s linear both; }
@keyframes czSweepRun { from { opacity: 1; background-position: 100% 0; } to { opacity: 1; background-position: 0 0; } }

/* the Legendary signal: a hard red-white band runs through the red thread or enamel, every few seconds */
.cz-p-sig {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  background: linear-gradient(90deg, transparent 0 47%, rgba(255, 92, 128, 0.95) 47% 48.4%, rgba(255, 214, 224, 0.95) 48.4% 49%, transparent 49%) 0 0 / 400% 100% no-repeat;
  background-position: 100% 0; mix-blend-mode: screen;
  animation: czSignal 3.6s steps(48) infinite;
}
@keyframes czSignal { 0% { background-position: 100% 0; } 55%, 100% { background-position: 0 0; } }

/* ==================== EMBER (the Witching Hour bundle, Halloween 2026) ====================
   Candlelight that lives only in the carvings and the cracks: a hot gradient through the item's light mask, flickering
   like a flame (never on a beat), with its glow carried past the mask by the wrapper. */
.cz-ember { position: absolute; inset: 0; pointer-events: none; filter: drop-shadow(0 0 calc(var(--s, 200px) * 0.02) rgba(255, 96, 30, 0.85)) drop-shadow(0 0 calc(var(--s, 200px) * 0.06) rgba(240, 60, 20, 0.45)); animation: czCandle 3.1s linear infinite; }
.cz-frame .cz-ember { filter: drop-shadow(0 0 3px rgba(255, 96, 30, 0.9)) drop-shadow(0 0 10px rgba(240, 60, 20, 0.5)); }
.cz-m-ember[data-item] .cz-p-sig { background: radial-gradient(ellipse at 50% 58%, #fff0c4 0, #ffb04a 30%, #ff6424 62%, #c4231b 100%); mix-blend-mode: screen; animation: none; opacity: 0.42; }
.cz-frame.cz-m-ember[data-item] .cz-p-sig { background: linear-gradient(180deg, #ffcf7a, #ff6a24 55%, #e2471a); opacity: 0.8; }
@keyframes czCandle {
  0% { opacity: 0.78; } 7% { opacity: 0.94; } 11% { opacity: 0.7; } 19% { opacity: 1; } 26% { opacity: 0.84; } 33% { opacity: 0.9; }
  41% { opacity: 0.66; } 44% { opacity: 0.97; } 52% { opacity: 0.82; } 61% { opacity: 1; } 67% { opacity: 0.74; } 73% { opacity: 0.9; }
  81% { opacity: 0.8; } 86% { opacity: 0.98; } 93% { opacity: 0.72; } 100% { opacity: 0.78; } }
.cz-patch.cz-m-ember .cz-p-sweep { background: linear-gradient(104deg, transparent 0 46%, rgba(255, 196, 120, 0.22) 46% 48%, transparent 48%) 100% 0 / 300% 100% no-repeat; }
/* the frame: heat rising off the foot of the card */
.cz-frame .cz-f-heat { background: radial-gradient(ellipse 70% 22% at 50% 102%, rgba(255, 90, 30, 0.22), transparent 70%); animation: czCandle 2.4s linear infinite reverse; }
/* the title: ember-lit letters in a charred box */
.cz-title.cz-m-ember[data-item] b { color: transparent; background: linear-gradient(180deg, #ffe6a8 0 22%, #ffa448 44%, #ec5420 68%, #9c1a26 100%); -webkit-background-clip: text; background-clip: text;
  box-shadow: inset 0 0 0 2px #2c2321, inset 0 0 0 3px rgba(255, 106, 36, 0.55); filter: drop-shadow(0 0 0.3em rgba(255, 90, 30, 0.45)); animation: czCandle 3.4s linear infinite; }
.cz-title.cz-m-ember[data-item] b::after { display: none; }
.cz-title.cz-m-ember::before { content: ""; width: 0.42em; height: 0.62em; flex: none; background: linear-gradient(180deg, #ffe6a8, #ff7a2e 60%, #c4231b); clip-path: polygon(50% 0, 78% 38%, 100% 70%, 74% 100%, 26% 100%, 0 70%, 22% 38%); animation: czCandle 1.9s linear infinite; }
/* the plate: 3:00 AM */
.cz-pl-hallow { background: linear-gradient(180deg, #08070a 0%, #0d0a0b 60%, #1a0e0b 100%); box-shadow: inset 0 0 0 1px rgba(255, 106, 36, 0.28); }
.cz-pl-hallow .cz-pl-bg::after { display: none; }
.cz-pl-hallow .cz-hw-glow { background: radial-gradient(ellipse 60% 70% at 78% 118%, rgba(255, 96, 30, 0.34), transparent 70%), radial-gradient(ellipse 40% 60% at 20% 120%, rgba(240, 20, 74, 0.16), transparent 70%); animation: czCandle 3.6s linear infinite; }
.cz-pl-hallow svg.cz-hw-clock { left: auto; right: 4cqw; top: 50%; width: 30cqw; height: 30cqw; transform: translateY(-50%); fill: none; stroke: rgba(244, 241, 234, 0.3); stroke-width: 0.35; overflow: visible; }
.cz-pl-hallow .cz-hc-in { stroke: rgba(244, 241, 234, 0.12); stroke-dasharray: 0.6 1.4; }
.cz-pl-hallow .cz-hc-hand { stroke: rgba(244, 241, 234, 0.75); stroke-width: 0.9; stroke-linecap: square; }
.cz-pl-hallow .cz-hc-hr { stroke: #ff7a2e; stroke-width: 1.4; filter: drop-shadow(0 0 1.5px rgba(255, 96, 30, 0.9)); }
.cz-pl-hallow .cz-hc-iii { stroke: #ff7a2e; stroke-width: 1.2; filter: drop-shadow(0 0 1.5px rgba(255, 96, 30, 0.9)); }
.cz-pl-hallow .cz-hc-pin { fill: #ffb04a; stroke: none; }
.cz-pl-hallow .cz-hw-fog { left: -100%; width: 200%; top: auto; bottom: -8%; height: 70%; background: rgba(214, 206, 196, 0.13); -webkit-mask: var(--fog) 0 100% / 50% 100% repeat-x; mask: var(--fog) 0 100% / 50% 100% repeat-x; animation: czFog 26s linear infinite; }
.cz-pl-hallow .cz-hw-fog2 { height: 46%; bottom: -10%; background: rgba(255, 150, 110, 0.09); animation-duration: 15s; animation-direction: reverse; }
@keyframes czFog { to { transform: translateX(50%); } }
.cz-pl-hallow .cz-hw-em { position: absolute; inset: 0; overflow: hidden; }
.cz-pl-hallow .cz-hw-em i { position: absolute; left: var(--x); bottom: -2cqw; width: var(--s); height: var(--s); border-radius: 50%; background: #ffb04a; box-shadow: 0 0 0.8cqw #ff6424; opacity: 0; animation: czRise var(--d) linear var(--dl) infinite; }
@keyframes czRise { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 0.95; } 70% { opacity: 0.55; } 100% { transform: translate(var(--dx), -34cqw); opacity: 0; } }
.cz-pl-hallow .cz-pl-crest { background: rgba(8, 7, 10, 0.7); }
.cz-pl-hallow .cz-pl-rar { color: #ffb04a; }
@media (prefers-reduced-motion: reduce) { .cz-ember, .cz-m-ember .cz-p-sig, .cz-title.cz-m-ember b, .cz-title.cz-m-ember::before, .cz-pl-hallow .cz-hw-glow, .cz-pl-hallow .cz-hw-fog, .cz-f-heat { animation: none; } .cz-pl-hallow .cz-hw-em { display: none; } }

/* ==================== PATCH ==================== */
.cz-patch { position: relative; width: var(--s); height: var(--s); margin: 0; flex: none; transition: transform 0.25s var(--cz-ease); }
.cz-patch > img, .cz-patch > canvas, .cz-patch > i { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cz-patch img { user-select: none; -webkit-user-drag: none; }
.cz-patch canvas.cz-frag { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
/* thread sheen: the patch is rendered under two lights; moving across it crossfades them, so the threads catch light */
.cz-p-alt { opacity: 0; transition: opacity 0.2s linear; }
.cz-live:hover .cz-p-alt { opacity: clamp(0, calc(0.5 + var(--mx, 0) * 1.8), 1); }
.cz-live.cz-r-legendary .cz-p-alt, .cz-live.cz-r-topfrag .cz-p-alt { animation: czSheen 7s ease-in-out infinite; }
.cz-live.cz-r-legendary:hover .cz-p-alt, .cz-live.cz-r-topfrag:hover .cz-p-alt { animation: none; }
@keyframes czSheen { 0%, 100% { opacity: 0; } 50% { opacity: 0.85; } }
/* Epic and up tilt toward the pointer (real depth, not a glow) */
.cz-live.cz-r-epic, .cz-live.cz-r-legendary, .cz-live.cz-r-topfrag { transform: perspective(700px) rotateX(calc(var(--my, 0) * -14deg)) rotateY(calc(var(--mx, 0) * 16deg)); }
/* the stitched serial: glyphs from the thread sprite, 1em = one glyph cell */
.cz-p-serial { position: absolute; transform: translate(-50%, -50%); line-height: 1; white-space: nowrap; pointer-events: none; }
.cz-stitch { display: inline-flex; height: 1em; }
.cz-stitch i { display: block; height: 1em; flex: none; background: var(--sheet) 0 0 / var(--sw) 1em no-repeat; }
.cz-stitch i.cz-sp { width: 0.28em; background: none; }
.cz-nogl canvas.cz-frag { display: none; }

/* ==================== FRAME (inside a 0.66 : 1 card) ==================== */
.cz-frame { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.cz-frame > img, .cz-frame > canvas, .cz-frame > i { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cz-frame canvas.cz-frag { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.cz-frame .cz-f-back { transform: translate(calc(var(--mx, 0) * 3px), calc(var(--my, 0) * 3px)); transition: transform 0.2s var(--cz-ease); }
.cz-frame .cz-f-front { transform: translate(calc(var(--mx, 0) * -7px), calc(var(--my, 0) * -7px)); transition: transform 0.2s var(--cz-ease); }
/* the 1 px fallback for small cards */
.cz-frame-line { position: absolute; inset: 0; z-index: 3; pointer-events: none; box-shadow: inset 0 0 0 1px var(--cz-bone-2); }
.cz-frame-line.cz-r-rare { box-shadow: inset 0 0 0 1px var(--cz-brass); }
.cz-frame-line.cz-r-legendary { box-shadow: inset 0 0 0 1px #1a1a1d, inset 0 0 0 2px rgba(240, 20, 74, 0.7); }
.cz-frame-line.cz-r-epic { box-shadow: inset 0 0 0 1px var(--cz-gun-hi), inset 0 0 0 2px rgba(244, 241, 234, 0.4); }
.cz-frame-line.cz-r-topfrag { box-shadow: inset 0 0 0 1px var(--cz-bone), inset 0 0 0 2px #050506; }
.cz-frame-line.cz-r-topfrag::after { content: ""; position: absolute; left: 50%; top: 0; width: 18%; height: 6%; transform: translateX(-50%); background: var(--cz-bone); clip-path: polygon(0 0, 100% 0, 50% 100%); }

/* ==================== TITLE ==================== */
.cz-title { position: relative; display: inline-flex; align-items: center; gap: 0.5em; font: 700 1em/1 var(--cz-cond); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cz-bone-2); white-space: nowrap; }
.cz-title b { position: relative; font-weight: 700; }
/* every title is a chip with its own material (the colour of the rarity lives in the UI, not here):
   bone · brass · gunmetal with a bone line · red thread · Fragment with the Cut */
.cz-title b { padding: 0.3em 0.55em 0.26em; }
.cz-title.cz-r-standard b { color: var(--cz-bone-2); box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.32); }
/* machined brass, one sweep on equip */
.cz-title.cz-r-rare b { background: linear-gradient(180deg, var(--cz-brass-hi) 0 46%, var(--cz-brass) 46% 70%, var(--cz-brass-lo) 70%); -webkit-background-clip: text; background-clip: text; color: transparent; box-shadow: inset 0 0 0 2px rgba(184, 145, 63, 0.85); }
.cz-title.cz-r-rare b::after, .cz-title.cz-r-epic b::after { content: attr(data-text); position: absolute; inset: 0; color: transparent; pointer-events: none;
  background: linear-gradient(104deg, transparent 0 45%, rgba(255, 246, 220, 0.95) 45% 49%, transparent 49%) 0 0 / 300% 100% no-repeat; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; }
.cz-title.cz-r-epic b { background: linear-gradient(180deg, #34373e, #24262b); color: var(--cz-bone); box-shadow: inset 0 0 0 2px #50555e, inset 0 0 0 3px rgba(244, 241, 234, 0.55); }
.cz-title.cz-r-epic b::after { padding: inherit; }
.cz-t-marks { display: inline-flex; gap: 0.18em; }
.cz-t-marks i { width: 0.34em; height: 0.34em; background: var(--cz-brass); }
.cz-t-count { font: 700 0.8em/1 var(--cz-hud); letter-spacing: 0.06em; color: var(--cz-bone); padding: 0.28em 0.38em 0.22em; box-shadow: inset 0 0 0 1px rgba(184, 145, 63, 0.7); }
/* Legendary: bone, a red enamel pip, the signal through the letters */
.cz-title.cz-r-legendary b { color: var(--cz-bone); box-shadow: inset 0 0 0 2px #b40e37, inset 0 0 0 3px rgba(244, 241, 234, 0.25); }
.cz-title.cz-r-legendary b::after { content: attr(data-text); position: absolute; inset: 0; padding: inherit; color: var(--cz-red); clip-path: inset(0 100% 0 0); animation: czTitleSig 4.2s steps(30) infinite; }
@keyframes czTitleSig { 0% { clip-path: inset(0 100% 0 0); } 18% { clip-path: inset(0 0 0 92%); } 19%, 100% { clip-path: inset(0 0 0 100%); } }
/* TOPFRAG: bone on a Fragment chip with the Cut */
.cz-title.cz-r-topfrag b { padding: 0.36em 0.6em 0.26em; color: var(--cz-bone); background: url("../assets/cosmetics/core/fragment.webp") 30% 40% / 9em auto; box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.55);
  clip-path: polygon(0 0, 44% 0, 50% 22%, 56% 0, 100% 0, 100% 100%, 0 100%); animation: czFragPan 14s linear infinite; }
@keyframes czFragPan { from { background-position: 30% 40%; } to { background-position: 130% 60%; } }
.cz-t-cut { width: 0.62em; height: 0.42em; background: var(--cz-bone); clip-path: polygon(0 0, 30% 0, 50% 52%, 70% 0, 100% 0, 50% 100%); }

/* the Nightfall emblem (insignia) */
.cz-emblem { display: block; flex: none; }

/* the crest's frame on the ID card (the profile's frame slot): a rarity ring; Nightfall adds its two-tone and medallion */
.cz-pl-crest.cz-cf { box-shadow: inset 0 0 0 2px var(--cz-c), inset 0 0 0 3px rgba(5, 5, 6, 0.9); }
.cz-pl-crest.cz-cf-nightfall { box-shadow: inset 0 0 0 0.9cqw #41454d, inset 0 0 0 calc(0.9cqw + 1px) rgba(244, 241, 234, 0.75); }
.cz-pl-crest.cz-cf-nightfall::before, .cz-pl-crest.cz-cf-nightfall::after { border-color: var(--cz-bone); width: 24%; height: 24%; }
.cz-cf-mark { position: absolute; left: 50%; top: 0; transform: translate(-50%, -46%); line-height: 0; }

/* ==================== TAG (the Agent dog tag) ==================== */
.cz-tag { position: relative; width: min(var(--w), 100%); aspect-ratio: 480 / 285; margin: 0; flex: none; container-type: inline-size; transition: transform 0.25s var(--cz-ease); }
.cz-tag > img, .cz-tag > canvas, .cz-tag > i { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cz-tag canvas.cz-frag { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.cz-live.cz-tag-epic, .cz-live.cz-tag-legendary, .cz-live.cz-tag-topfrag { transform: perspective(600px) rotateX(calc(var(--my, 0) * -12deg)) rotateY(calc(var(--mx, 0) * 14deg)); }
.cz-g-text { position: absolute; left: 21%; right: 21%; top: 22%; bottom: 21%; display: grid; align-content: center; gap: 3.2cqw; color: rgba(22, 22, 24, 0.84);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42), 0 -1px 0 rgba(0, 0, 0, 0.3); /* debossed: stamped into the steel */ }
.cz-g-text b { font: 800 9.6cqw/0.9 var(--cz-cond); letter-spacing: 0.04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-g-text span { font: 700 4.6cqw/1 var(--cz-hud); letter-spacing: 0.12em; }
.cz-g-text em { font-style: normal; font-size: 1.5em; letter-spacing: 0.06em; }
.cz-g-text small { font: 700 3cqw/1 var(--cz-hud); letter-spacing: 0.26em; opacity: 0.75; }
.cz-tag-epic .cz-g-text, .cz-tag-legendary .cz-g-text, .cz-tag-topfrag .cz-g-text { color: rgba(244, 241, 234, 0.88); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 -1px 0 rgba(255, 255, 255, 0.1); right: 25%; }
.cz-tag-topfrag .cz-g-text { top: 27%; }

/* ==================== PLATE: the ID card ==================== */
.cz-plate { position: relative; display: block; width: min(var(--w), 100%); aspect-ratio: 3.2 / 1; container-type: inline-size; background: var(--cz-panel); color: var(--cz-bone); box-shadow: inset 0 0 0 1px var(--cz-rule); overflow: hidden; isolation: isolate; transition: transform 0.25s var(--cz-ease); }
.cz-pl-in { position: absolute; inset: 0; display: grid; grid-template-columns: 22cqw minmax(0, 1fr) auto; align-items: center; gap: 3.4cqw; padding: 0 4.2cqw; }
.cz-pl-bg { position: absolute; inset: 0; z-index: -1; }
.cz-pl-bg > * { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.cz-pl-tex { background: var(--topo) center / cover no-repeat; opacity: 0.16; mix-blend-mode: screen; }
.cz-pl-bg::after { content: ""; position: absolute; left: 30cqw; right: 4cqw; bottom: 3cqw; height: 1.1cqw; background: repeating-linear-gradient(90deg, rgba(244, 241, 234, 0.32) 0 1px, transparent 1px 1.6cqw);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); }
.cz-pl-br::before, .cz-pl-br::after { content: ""; position: absolute; width: 3.6cqw; height: 3.6cqw; border: 2px solid var(--cz-bone); pointer-events: none; transition: transform 0.18s var(--cz-ease); }
.cz-pl-br::before { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.cz-pl-br::after { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.cz-plate:hover .cz-pl-br::before { transform: translate(1.2cqw, 1.2cqw); }
.cz-plate:hover .cz-pl-br::after { transform: translate(-1.2cqw, -1.2cqw); }
.cz-pl-crest { position: relative; aspect-ratio: 1; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.2); background: rgba(10, 10, 11, 0.55); }
.cz-pl-crest::before, .cz-pl-crest::after { content: ""; position: absolute; width: 18%; height: 18%; border: 1px solid var(--cz-c); }
.cz-pl-crest::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.cz-pl-crest::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.cz-pl-crest img { width: 86%; height: 86%; object-fit: contain; }
.cz-pl-nocrest { width: 40%; aspect-ratio: 1; box-shadow: inset 0 0 0 1px var(--cz-rule); transform: rotate(45deg); }
.cz-pl-id { display: grid; justify-items: start; gap: 1.5cqw; min-width: 0; }
.cz-pl-call { margin: 0; max-width: 100%; font: 800 7.6cqw/0.86 var(--cz-cond); letter-spacing: 0.01em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-pl-id .cz-title { font-size: 2.7cqw; }
.cz-pl-tracker { display: inline-flex; align-items: center; gap: 0.6em; font: 700 2.05cqw/1 var(--cz-hud); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cz-mute); }
.cz-pl-tracker b { color: var(--cz-bone); font-size: 1.3em; letter-spacing: 0.04em; }
.cz-chev { display: inline-block; width: 0.5em; height: 0.8em; background: var(--cz-red); clip-path: polygon(0 0, 100% 50%, 0 100%, 0 72%, 52% 50%, 0 28%); }
.cz-pl-ins { display: grid; place-items: center; min-width: 13cqw; }
.cz-pl-rar { position: absolute; right: 3.4cqw; top: 2.6cqw; font: 700 1.55cqw/1 var(--cz-hud); letter-spacing: 0.26em; text-transform: uppercase; color: var(--cz-c); }
/* Machined (example): a brass edge */
/* plates wear the same edges as the patches and titles */
.cz-plate.cz-pl-default { box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.32); }
.cz-pl-ex-rare { box-shadow: inset 0 0 0 2px rgba(184, 145, 63, 0.85); }
.cz-pl-ex-rare .cz-pl-bg::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1.6cqw; background: repeating-linear-gradient(180deg, #c9a660 0 1px, #9a7834 1px 2px, #b8913f 2px 3px); }
.cz-pl-ex-rare .cz-pl-br::before, .cz-pl-ex-rare .cz-pl-br::after { border-color: var(--cz-brass); }
.cz-pl-ex-rare .cz-pl-bg { background: linear-gradient(104deg, transparent 0 45%, rgba(255, 226, 160, 0.08) 45% 47%, transparent 47%) 100% 0 / 300% 100% no-repeat; }
.cz-pl-ex-rare:hover .cz-pl-bg, .cz-pl-ex-rare.cz-sweeping .cz-pl-bg { animation: czSweepRun 1s linear both; }
/* Epic (example): two layers of gunmetal and bone that part with the pointer */
.cz-pl-ex-epic { background: #121316; box-shadow: inset 0 0 0 2px #50555e, inset 0 0 0 3px rgba(244, 241, 234, 0.55); }
.cz-pl-ex-epic .cz-pl-bg::before { content: ""; position: absolute; inset: -10%; background: repeating-linear-gradient(118deg, rgba(244, 241, 234, 0.07) 0 2px, transparent 2px 12px); transform: translate(calc(var(--mx, 0) * 10px), calc(var(--my, 0) * 6px)); transition: transform 0.2s var(--cz-ease); }
.cz-pl-ex-epic .cz-pl-tex { opacity: 0; }
.cz-pl-ex-epic .cz-pl-bg > .cz-pl-tex + * { display: none; }
.cz-pl-ex-epic .cz-pl-bg { background: linear-gradient(118deg, transparent 0 58%, #2b2e34 58% 77%, #3a3e46 77% 77.6%, #2b2e34 77.6%); }
.cz-pl-ex-epic .cz-pl-ins { transform: translate(calc(var(--mx, 0) * -8px), calc(var(--my, 0) * -5px)); transition: transform 0.2s var(--cz-ease); }
/* Legendary (example): the signal runs across, an engraved serial */
.cz-pl-ex-legendary { box-shadow: inset 0 0 0 2px #b40e37, inset 0 0 0 3px rgba(244, 241, 234, 0.25); }
.cz-pl-ex-legendary .cz-pl-bg::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0.7cqw; background: var(--cz-red); }
.cz-pl-ex-legendary .cz-pl-tex { opacity: 0.08; }
.cz-pl-ex-legendary .cz-pl-bg { background: repeating-linear-gradient(0deg, rgba(244, 241, 234, 0.035) 0 1px, transparent 1px 3px), var(--cz-panel); }
.cz-pl-ex-legendary .cz-pl-bg::after { left: 0; right: 0; top: 0; bottom: 0; height: auto; -webkit-mask-image: none; mask-image: none;
  background: linear-gradient(90deg, transparent 0 49.6%, rgba(240, 20, 74, 0.85) 49.6% 50%, transparent 50%) 0 0 / 300% 100% no-repeat; animation: czSignal 4.4s steps(60) infinite; }
/* TOPFRAG: the Threat 10 card. Fragment glass, the etched 10, a bone rim with the Cut */
.cz-pl-t10 { background: #050506; box-shadow: none; clip-path: polygon(0 0, 46.5% 0, 50% 9%, 53.5% 0, 100% 0, 100% 100%, 0 100%); }
.cz-pl-t10 .cz-pl-bg::after { display: none; }
.cz-pl-t10 .cz-pl-etch { object-fit: cover; mix-blend-mode: screen; opacity: 0.9; }
.cz-pl-t10::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(var(--cz-bone), var(--cz-bone)) left top / 46.5% 1px no-repeat, linear-gradient(var(--cz-bone), var(--cz-bone)) right top / 46.5% 1px no-repeat,
    linear-gradient(var(--cz-bone), var(--cz-bone)) left bottom / 100% 1px no-repeat, linear-gradient(var(--cz-bone), var(--cz-bone)) left top / 1px 100% no-repeat, linear-gradient(var(--cz-bone), var(--cz-bone)) right top / 1px 100% no-repeat; opacity: 0.7; }
.cz-pl-t10 .cz-pl-crest { background: rgba(5, 5, 6, 0.7); }
.cz-pl-t10 .cz-pl-rar { color: var(--cz-bone); top: 3.6cqw; }
.cz-pl-t10 .cz-pl-rar::before { content: ""; display: inline-block; width: 0.9em; height: 0.6em; margin-right: 0.6em; background: var(--cz-red); clip-path: polygon(0 0, 30% 0, 50% 52%, 70% 0, 100% 0, 50% 100%); }
.cz-pl-t10.cz-live { transform: perspective(900px) rotateX(calc(var(--my, 0) * -5deg)) rotateY(calc(var(--mx, 0) * 6deg)); }

/* ==================== ARMORY tile ==================== */
.cz-tile { position: relative; display: grid; grid-template-rows: auto auto; gap: 0.7rem; padding: 0.8rem 0.8rem 0.9rem; border: 0; margin: 0; text-align: left; font: inherit; color: var(--cz-bone); cursor: pointer;
  background: rgba(14, 14, 16, 0.75); box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.1); transition: box-shadow 0.15s, background 0.15s; }
.cz-tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--cz-c); }
.cz-tile.cz-r-standard::after { background: rgba(244, 241, 234, 0.45); }
.cz-tile.cz-r-epic::after { background: linear-gradient(90deg, var(--cz-violet) 0 70%, var(--cz-bone) 70%); }
.cz-tile.cz-r-topfrag::after { height: 3px; background: url("../assets/cosmetics/core/fragment.webp") center / 200px auto; box-shadow: inset 0 1px 0 var(--cz-bone); }
.cz-tile:hover, .cz-tile:focus-visible { background: rgba(20, 20, 23, 0.9); box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.34); outline: none; }
.cz-tile:focus-visible { box-shadow: inset 0 0 0 2px var(--cz-bone); }
.cz-tl-thumb { position: relative; height: 104px; display: grid; place-items: center; }
.cz-tl-meta { display: grid; gap: 0.3rem; min-width: 0; }
.cz-tl-meta b { font: 700 1rem/1.05 var(--cz-cond); letter-spacing: 0.06em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-tl-meta small { font: 700 0.62rem/1 var(--cz-hud); letter-spacing: 0.2em; text-transform: uppercase; color: var(--cz-c); }
.cz-r-standard .cz-tl-meta small { color: var(--cz-mute); }
.cz-tl-card { position: relative; display: block; width: 66px; height: 100px; background: #15171c; }
.cz-tl-card img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cz-tl-title { font-size: 0.9rem; }
.cz-tl-plate { display: block; width: 100%; max-width: 150px; aspect-ratio: 3.2 / 1; background: var(--cz-panel) center / cover; box-shadow: inset 0 0 0 1px var(--cz-rule); }
.cz-tl-plate.cz-pl-mini-default { background-image: linear-gradient(90deg, transparent 0 8%, rgba(244, 241, 234, 0.2) 8% 26%, transparent 26%), linear-gradient(rgba(14, 14, 16, 0.82), rgba(14, 14, 16, 0.82)), url("../assets/cosmetics/core/plate-topo.webp"); background-size: 100% 46%, cover, cover; background-position: 0 50%, center, center; background-repeat: no-repeat; }
.cz-tl-tag { width: 120px; }
/* missing: a redacted silhouette, never a blank */
.cz-tl-redact { display: block; width: 84px; height: 84px; background: repeating-linear-gradient(135deg, rgba(244, 241, 234, 0.1) 0 2px, transparent 2px 7px); }
.cz-tl-redact.cz-shape-hex { clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.cz-tl-redact.cz-shape-round { border-radius: 50%; }
.cz-tl-redact.cz-shape-rect { height: 60px; clip-path: polygon(8% 0, 92% 0, 100% 12%, 100% 88%, 92% 100%, 8% 100%, 0 88%, 0 12%); }
.cz-tl-redact.cz-shape-cut { clip-path: polygon(7% 25%, 36% 9%, 50% 22%, 64% 9%, 93% 25%, 93% 75%, 50% 100%, 7% 75%); }
.cz-tl-redact.cz-shape-shield { clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); }
.cz-tl-redact.cz-shape-frame { width: 66px; height: 100px; background: none; box-shadow: inset 0 0 0 4px rgba(244, 241, 234, 0.1); }
.cz-tl-redact.cz-shape-title { width: 120px; height: 18px; }
.cz-tl-redact.cz-shape-plate { width: 150px; height: 47px; }
.cz-missing .cz-tl-thumb::after { content: "Redacted"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-4deg); padding: 0.35em 0.6em 0.3em; background: #000; color: rgba(244, 241, 234, 0.55); font: 700 0.62rem/1 var(--cz-hud); letter-spacing: 0.28em; text-transform: uppercase; }
.cz-missing .cz-tl-meta b { color: var(--cz-mute); }
.cz-pip { position: absolute; top: 0.6rem; right: 0.6rem; display: inline-flex; align-items: center; gap: 0.4em; padding: 0.3em 0.45em 0.25em; font: 700 0.6rem/1 var(--cz-hud); font-style: normal; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cz-red); box-shadow: inset 0 0 0 1px var(--cz-red); background: rgba(10, 10, 11, 0.8); }
.cz-pip::before { content: ""; width: 0.5em; height: 0.5em; background: var(--cz-red); }
.cz-tl-card-info { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 5; display: grid; gap: 0.3rem; padding: 0.7rem 0.8rem; background: #0b0b0d; box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.3);
  font: 500 0.78rem/1.35 var(--cz-body); color: var(--cz-bone-2); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity 0.12s, transform 0.12s; }
.cz-tl-card-info b { font: 700 0.95rem/1 var(--cz-cond); letter-spacing: 0.06em; text-transform: uppercase; color: var(--cz-bone); }
.cz-tl-serial { font: 700 0.9rem/1 var(--cz-hud); letter-spacing: 0.08em; color: var(--cz-bone); }
.cz-tl-how { color: var(--cz-mute); }
.cz-tile:hover .cz-tl-card-info, .cz-tile:focus-visible .cz-tl-card-info { opacity: 1; transform: none; }
.cz-setc { font: 700 0.72rem/1 var(--cz-hud); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cz-mute); }
.cz-setc b { color: var(--cz-bone); }
.cz-setc.cz-near { color: var(--cz-bone); }

/* ==================== PATCH BOARD (velcro, 6 pins) ==================== */
.cz-board { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 26px; background: #0d0d0f url("../assets/cosmetics/core/velcro.webp") 0 0 / 128px 128px; box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.08), 0 0 0 1px #000; }
.cz-board::before { content: ""; position: absolute; inset: 8px; border: 1px dashed rgba(244, 241, 234, 0.12); pointer-events: none; }
.cz-pin { position: relative; display: grid; place-items: center; aspect-ratio: 1; }
.cz-pin.cz-empty::after { content: "Pin"; display: grid; place-items: center; width: 62%; aspect-ratio: 1; box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.12); color: rgba(244, 241, 234, 0.3); font: 700 0.62rem/1 var(--cz-hud); letter-spacing: 0.3em; text-transform: uppercase; }
.cz-pin .cz-patch { width: 100%; height: auto; aspect-ratio: 1; }

/* ==================== UNLOCK CEREMONIES ==================== */
.cz-cer { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 24px; color: var(--cz-bone); font-family: var(--cz-body); }
.cz-cer.cz-out { animation: czFadeOut 0.26s linear forwards; }
@keyframes czFadeOut { to { opacity: 0; } }
.cz-cer-dim { position: absolute; inset: 0; background: #050506; opacity: 0.9; animation: czDim 0.2s linear both; }
@keyframes czDim { from { opacity: 0; } }
.cz-cer-stage { position: relative; display: grid; justify-items: center; gap: 22px; text-align: center; }
.cz-cer-card { position: relative; aspect-ratio: 0.66; background: #15171c; }
.cz-cer-title { font-size: clamp(22px, 4vw, 40px); }
.cz-cer-cap { display: grid; justify-items: center; gap: 8px; animation: czCapIn 0.32s var(--cz-ease) both; animation-delay: var(--cap-at, 0.3s); }
@keyframes czCapIn { from { opacity: 0; transform: translateY(10px); } }
.cz-cer-rar { display: inline-flex; align-items: center; gap: 8px; font: 700 12px/1 var(--cz-hud); letter-spacing: 0.34em; text-transform: uppercase; color: var(--cz-c); }
.cz-cer-rar::before { content: ""; width: 9px; height: 9px; background: var(--cz-c); }
.cz-cer-cap b { font: 800 clamp(28px, 4.4vw, 46px)/0.9 var(--cz-cond); text-transform: uppercase; letter-spacing: 0.02em; }
.cz-cer-serial { font: 700 15px/1 var(--cz-hud); letter-spacing: 0.14em; }
.cz-cer-cap small { max-width: 44ch; font: 500 14px/1.4 var(--cz-body); color: var(--cz-mute); }
.cz-cer-skip { margin-top: 6px; padding: 12px 22px 11px; border: 0; background: none; color: var(--cz-bone); box-shadow: inset 0 0 0 2px var(--cz-bone); font: 700 13px/1 var(--cz-hud); letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer;
  animation: czCapIn 0.3s var(--cz-ease) both; animation-delay: var(--skip-at, 0.6s); }
.cz-cer-skip:hover, .cz-cer-skip:focus-visible { background: var(--cz-bone); color: #0a0a0b; outline: none; }
.cz-cer .cz-p-sweep, .cz-cer .cz-f-sweep, .cz-cer .cz-g-sweep { animation: czSweepRun 0.8s linear both; animation-delay: var(--sweep-at, 0.4s); }
.cz-cer .cz-p-alt { animation: none; opacity: 0; }
@keyframes czGone { to { opacity: 0; visibility: hidden; } }
@keyframes czAppear { from { visibility: hidden; } to { visibility: visible; } }
@keyframes czFadeIn { from { opacity: 0; } }
@keyframes czShake { 25% { translate: 3px -2px; } 50% { translate: -3px 2px; } 75% { translate: 2px 0; } }
@keyframes czStamp { from { opacity: 0; transform: scale(1.24); } to { opacity: 1; transform: scale(1); } }

/* ---------- v4: the deck, the charge, the live card (js/cosmetics.js draws the light, the sparks and the poses) ---------- */
.cz-cer.cz-v4 { --dk: min(96vmin, 880px); display: block; padding: 0; overflow: hidden; }
.cz-cer.cz-v4 .cz-cer-dim { opacity: 1; }
.cz-dk { position: absolute; left: 50%; top: 50%; width: var(--dk); aspect-ratio: 1; margin: calc(var(--dk) / -2) 0 0 calc(var(--dk) / -2); pointer-events: none; z-index: 1; }
.cz-dk-gl, .cz-dk-still { position: absolute; inset: 0; width: 100%; height: 100%; }
.cz-dk-gl { animation: czFadeIn 0.3s linear both; }
.cz-dk-lite .cz-dk-gl { display: none; }
.cz-dk-still { object-fit: cover; -webkit-mask-image: radial-gradient(closest-side, #000 70%, transparent); mask-image: radial-gradient(closest-side, #000 70%, transparent); animation: czFadeIn 0.4s linear both; }
.cz-revealed .cz-dk-still { opacity: 0.35; }
/* where it came from, over the deck, until the reveal */
.cz-dk-src { position: absolute; left: 0; right: 0; top: 3.2%; display: grid; justify-items: center; gap: 7px; animation: czFadeIn 0.4s linear 0.3s both, czGone 0.25s linear var(--t-reveal) forwards; }
.cz-dk-src em { font: 700 10px/1 var(--cz-hud); font-style: normal; letter-spacing: 0.4em; text-indent: 0.4em; text-transform: uppercase; color: rgba(244, 241, 234, 0.45); }
.cz-dk-src b { font: 700 13px/1 var(--cz-hud); letter-spacing: 0.3em; text-indent: 0.3em; text-transform: uppercase; }
/* the card's light, full screen, added over the deck (round glow, rays, shockwaves) */
.cz-lt { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; mix-blend-mode: screen; animation: czFadeIn 0.5s linear 0.6s both; }
.cz-lt-lite .cz-lt { display: none; }
/* without WebGL (or after Skip): a soft round glow behind the card instead */
.cz-fc-aura { position: fixed; left: 50%; top: 45.5%; width: calc(var(--ch) * 1.7); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none; z-index: 1; opacity: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--cz-c) 42%, transparent), color-mix(in srgb, var(--cz-c) 12%, transparent) 55%, transparent); }
.cz-lt-lite.cz-revealed .cz-fc-aura { opacity: calc(var(--glow, 0.6) * 0.7); }
.cz-cer.cz-fast .cz-fc-aura { opacity: 0.6; }

/* the live card: a CSS 3D card posed through the render's own lens (perspective = the focal length in px) */
/* (flat on purpose: preserve-3d here let Chrome show the page through the overlay; perspective alone projects the card) */
.cz-c3 { position: absolute; width: 0; height: 0; z-index: 2; perspective-origin: 0 0; pointer-events: none; }
.cz-fc { position: absolute; left: calc(var(--cw) / -2); top: calc(var(--ch) / -2); width: var(--cw); height: var(--ch); transform-style: preserve-3d; visibility: hidden; will-change: transform; }
.cz-revealed .cz-fc, .cz-cer.cz-fast .cz-fc { visibility: visible; }
.cz-fc-side { position: absolute; inset: 0; overflow: hidden; border-radius: calc(var(--cw) * 0.049); background: #0b0b0d center / 100% 100% no-repeat; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 0 0 1px rgba(244, 241, 234, 0.16); }
.cz-revealed .cz-fc-side, .cz-cer.cz-fast .cz-fc-side { box-shadow: 0 0 0 1px color-mix(in srgb, var(--cz-c) 75%, transparent), 0 0 calc(var(--cw) * 0.07) color-mix(in srgb, var(--cz-c) 42%, transparent); }
.cz-fc-back { background-image: url("../assets/cosmetics/deck/card-back.webp"); }
.cz-fc-face { background-image: url("../assets/cosmetics/deck/card-face.webp"); transform: rotateY(180deg); }
/* the card's thickness: foil edges, only seen edge-on */
.cz-fc-edge { position: absolute; top: 3%; bottom: 3%; width: 3px; background: linear-gradient(#efeadf, #8d877c 50%, #efeadf); }
.cz-fc-l { left: -1.5px; transform: rotateY(90deg); }
.cz-fc-r { right: -1.5px; transform: rotateY(-90deg); }
/* its own light: a sheen that follows the angle, the foil glinting (--sh, --sha, --sh2, --fo from js) */
.cz-fc-sheen { position: absolute; inset: 0; pointer-events: none; opacity: var(--sha, 0);
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.2) 48%, rgba(255, 255, 255, 0.34) 50%, rgba(255, 255, 255, 0.2) 52%, transparent 62%) calc(50% + var(--sh, 0) * 70%) 0 / 260% 100% no-repeat; }
.cz-fc-foil { position: absolute; inset: 0; pointer-events: none; opacity: var(--fo, 0);
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.95) 50%, transparent 68%) calc(50% + var(--sh2, 0) * 80%) 0 / 300% 100% no-repeat;
  -webkit-mask: url("../assets/cosmetics/deck/card-back-foil.webp") 0 0 / 100% 100%; mask: url("../assets/cosmetics/deck/card-back-foil.webp") 0 0 / 100% 100%; }
.cz-fc-face .cz-fc-foil { -webkit-mask-image: url("../assets/cosmetics/deck/card-face-foil.webp"); mask-image: url("../assets/cosmetics/deck/card-face-foil.webp"); }
/* the face: rarity and set on top, the item in the window, the name under the rule */
.cz-fc-top { position: absolute; left: 11.5%; right: 11.5%; top: 9.4%; display: flex; justify-content: space-between; align-items: center; gap: 1em;
  font: 700 calc(var(--cw) * 0.032)/1 var(--cz-hud); letter-spacing: 0.24em; text-transform: uppercase; white-space: nowrap; }
.cz-fc-rar { display: inline-flex; align-items: center; gap: 0.7em; color: var(--cz-c); }
.cz-fc-rar::before { content: ""; width: 0.8em; height: 0.8em; background: var(--cz-c); }
.cz-r-topfrag .cz-fc-rar { color: var(--cz-bone); }
.cz-r-topfrag .cz-fc-rar::before { background: var(--cz-red); }
.cz-fc-set { overflow: hidden; text-overflow: ellipsis; color: rgba(244, 241, 234, 0.5); }
.cz-fc-art { position: absolute; left: 9%; right: 9%; top: 14%; bottom: 29%; display: grid; place-items: center; }
.cz-fc-art > .cz-cer-item { display: grid; place-items: center; width: 100%; max-width: 100%; }
.cz-fc-cap { position: absolute; left: 8%; right: 8%; top: 76.2%; display: grid; justify-items: center; gap: calc(var(--cw) * 0.022); text-align: center; }
.cz-fc-name { font: 800 calc(var(--cw) * 0.1)/0.92 var(--cz-cond); letter-spacing: 0.02em; text-transform: uppercase; color: var(--cz-bone); }
.cz-fc-ser { font: 700 calc(var(--cw) * 0.034)/1 var(--cz-hud); letter-spacing: 0.14em; color: rgba(244, 241, 234, 0.72); }
.cz-fc-redact { position: absolute; left: 4%; right: 4%; top: -6%; bottom: -6%; background: #050506; box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.14); transform-origin: 100% 50%;
  animation: czRedact 0.34s cubic-bezier(0.7, 0, 0.3, 1) var(--t-name) forwards; }
@keyframes czRedact { to { transform: scaleX(0); } }
.cz-cer.cz-v4 .cz-cer-title b { white-space: normal; }

/* under the card: where it comes from, Continue; Skip until it lands */
.cz-cer-under { position: absolute; left: 0; right: 0; top: var(--under); z-index: 5; display: grid; justify-items: center; gap: 12px; text-align: center; animation: czCapIn 0.32s var(--cz-ease) var(--cap-at) both; }
.cz-cer-under small { max-width: 48ch; padding: 0 16px; font: 500 13px/1.4 var(--cz-body); color: var(--cz-mute); }
.cz-cer.cz-v4 .cz-cer-skip { margin: 0; animation: none; }
.cz-dk-fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.cz-dk-flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 4; mix-blend-mode: screen; }
.cz-dk-skip { position: absolute; right: 20px; bottom: 18px; z-index: 6; padding: 10px 12px; border: 0; background: none; color: rgba(244, 241, 234, 0.45); font: 700 11px/1 var(--cz-hud); letter-spacing: 0.26em; text-transform: uppercase; cursor: pointer;
  animation: czFadeIn 0.3s linear 0.8s both, czGone 0.01s linear var(--t-land) forwards; }
.cz-dk-skip:hover, .cz-dk-skip:focus-visible { color: var(--cz-bone); outline: none; }

/* ---------- Epic: the item's layers settle apart ---------- */
.cz-cer.cz-r-epic .cz-f-front, .cz-cer.cz-r-epic .cz-p-base + .cz-p-alt { animation: czLayer 0.3s var(--cz-ease) var(--t-front) both; }
@keyframes czLayer { from { opacity: 0; transform: translate(14px, 14px); } }

/* ---------- Legendary: DECLASSIFIED on the face, the name unredacted, the serial stitched in, the signal ---------- */
.cz-cer-stamp { position: absolute; left: 50%; top: 50%; padding: 0.24em 0.4em 0.18em; font: 800 calc(var(--cw) * 0.1)/1 var(--cz-cond); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cz-red);
  box-shadow: inset 0 0 0 calc(var(--cw) * 0.008) var(--cz-red); background: rgba(5, 5, 6, 0.4); transform: translate(-50%, -50%) rotate(-8deg); pointer-events: none;
  animation: czStampBig 0.15s cubic-bezier(0.5, 0, 0.9, 0.5) var(--t-stamp) both, czStampAway 0.4s linear calc(var(--t-stamp) + 1.1s) forwards; }
@keyframes czStampBig { from { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(2.1); } to { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); } }
@keyframes czStampAway { to { opacity: 0; } }
.cz-cer.cz-r-legendary .cz-p-sig { animation-delay: var(--t-signal); }

/* ---------- TOPFRAG: the lights die, the back cracks, the Cut, the glass comes home ---------- */
.cz-cer.cz-r-topfrag .cz-cer-dim { animation: czDim 0.2s linear both, czBlack 0.4s linear var(--t-reveal) forwards; }
@keyframes czBlack { to { opacity: 1; } }
.cz-fc-crack { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cz-fc-crack path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: czTrace 0.6s cubic-bezier(0.6, 0, 0.3, 1) var(--t-glass) forwards; }
.cz-ck-glow { stroke: var(--cz-red); stroke-width: 3.5px; opacity: 0.42; }
.cz-ck-core { stroke: #fff; stroke-width: 1px; }
@keyframes czTrace { to { stroke-dashoffset: 0; } }
.cz-shard { position: absolute; left: calc(var(--cw) / -2); top: calc(var(--ch) / -2); width: var(--cw); height: var(--ch); visibility: hidden; border-radius: calc(var(--cw) * 0.049);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 40%, rgba(240, 20, 74, 0.18)), #0b0b0d url("../assets/cosmetics/deck/card-back.webp") center / 100% 100% no-repeat; will-change: transform, opacity;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cz-cut .cz-shard { visibility: visible; }
.cz-cut .cz-fc-back { visibility: hidden; }
.cz-fc-face::after { content: ""; position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.cz-cer.cz-r-topfrag .cz-fc-face::after { opacity: 0.8; animation: czUnveil 0.8s cubic-bezier(0.6, 0, 0.9, 0.6) var(--t-cut) forwards; }
@keyframes czUnveil { to { opacity: 0; } }
.cz-cer.cz-r-topfrag .cz-cer-item canvas.cz-frag { animation: czFadeIn 0.06s linear var(--t-lock) both; }
.cz-cer.cz-r-topfrag .cz-p-serial { animation: czSerStamp 0.12s cubic-bezier(0.5, 0, 0.9, 0.5) var(--t-serial) both; }
/* the serial is centred on its strip by translate(-50%, -50%): the stamp has to keep it, or the number lands off the plate */
@keyframes czSerStamp { from { opacity: 0; transform: translate(-50%, -50%) scale(1.24); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* reduced motion, or Skip: no ceremony motion at all, the final frame and a short sound */
.cz-cer.cz-fast *, .cz-cer.cz-fast { animation: none !important; }
.cz-cer.cz-fast .cz-dk, .cz-cer.cz-fast .cz-lt, .cz-cer.cz-fast .cz-dk-fx, .cz-cer.cz-fast .cz-dk-flash, .cz-cer.cz-fast .cz-dk-skip, .cz-cer.cz-fast .cz-cer-stamp, .cz-cer.cz-fast .cz-fc-redact, .cz-cer.cz-fast .cz-shard, .cz-cer.cz-fast .cz-fc-crack { display: none; }
.cz-cer.cz-fast .cz-fc-face::after { opacity: 0; }
.cz-cer.cz-fast .cz-fc-back { visibility: visible; }
@media (prefers-reduced-motion: reduce) {
  .cz-patch, .cz-tag, .cz-plate, .cz-live { transform: none !important; }
  .cz-p-sig, .cz-p-alt, .cz-title b::after, .cz-title b, .cz-pl-bg::after, .cz-pl-bg { animation: none !important; }
  .cz-p-sig { display: none; }
  .cz-live:hover .cz-p-sweep, .cz-live:hover .cz-f-sweep, .cz-live:hover .cz-g-sweep { animation: none; }
}

/* ==================== ID CARD v2: identity everywhere ==================== */
/* the edge takes the colour of the rarest thing the player owns */
.cz-plate.cz-edge { --cz-e: var(--cz-std); }
.cz-plate.cz-edge-rare { --cz-e: var(--cz-cobalt); }
.cz-plate.cz-edge-epic { --cz-e: var(--cz-violet); }
.cz-plate.cz-edge-legendary { --cz-e: var(--cz-red); }
.cz-plate.cz-edge-topfrag { --cz-e: var(--cz-bone); }
.cz-plate.cz-edge::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0.8cqw; min-width: 3px; background: var(--cz-e); z-index: 1; }
.cz-plate.cz-edge-topfrag::before { background: url("../assets/cosmetics/core/fragment.webp") center / 40px auto; box-shadow: inset -1px 0 0 var(--cz-bone); }
/* three showcase patches under the tracker */
.cz-pl-show { display: flex; gap: 1cqw; align-items: center; }
.cz-pl-show .cz-patch { flex: none; }
/* what they hold, per rarity: a square in the rarity colour and the count */
.cz-pl-counts { position: absolute; right: 3.4cqw; bottom: 2.4cqw; display: flex; gap: 1.6cqw; font: 700 1.8cqw/1 var(--cz-hud); letter-spacing: 0.06em; color: var(--cz-bone); z-index: 1; }
.cz-pl-counts span { display: inline-flex; align-items: center; gap: 0.6cqw; }
.cz-pl-counts i { width: 1.2cqw; height: 1.2cqw; background: var(--cz-c); }
.cz-pl-counts .cz-r-topfrag i { width: 1.6cqw; background: var(--cz-bone); clip-path: polygon(0 0, 30% 0, 50% 52%, 70% 0, 100% 0, 50% 100%); }
/* the row variant: leaderboard and Daily rows (8 : 1) */
/* the row (the leaderboard size), readable first (owner, Oct 28: "the leaderboard cards are kind of hard to read"):
   a dark scrim over the plate's art behind the words and the counts, a bigger callsign and title, the counts on a chip */
.cz-plate.cz-pl-row { aspect-ratio: 7.2 / 1; }
.cz-pl-row::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 7, 9, 0.9) 0, rgba(7, 7, 9, 0.8) 44%, rgba(7, 7, 9, 0.5) 64%, rgba(7, 7, 9, 0.88) 82%, rgba(7, 7, 9, 0.96) 100%); }
.cz-pl-row .cz-pl-tex { opacity: 0.08; }
.cz-pl-row .cz-pl-in { grid-template-columns: 11.5cqw minmax(0, 1fr) auto auto; gap: 2.2cqw; padding: 0 19cqw 0 2.6cqw; }
.cz-pl-row .cz-pl-crest { height: 11.5cqw; width: 11.5cqw; }
.cz-pl-row .cz-pl-id { gap: 1cqw; }
.cz-pl-row .cz-pl-call { font-size: 4.4cqw; text-shadow: 0 1px 0 #000; }
.cz-pl-row .cz-pl-id .cz-title { font-size: 1.75cqw; }
.cz-pl-row .cz-pl-show { gap: 1.2cqw; }
.cz-pl-row .cz-pl-ins { min-width: 0; }
.cz-pl-row .cz-pl-bg::after { display: none; }
.cz-pl-row .cz-pl-br::before, .cz-pl-row .cz-pl-br::after { width: 1.6cqw; height: 1.6cqw; border-width: 1px; }
.cz-pl-row .cz-pl-counts { top: 50%; bottom: auto; right: 2.2cqw; transform: translateY(-50%); padding: 1.1cqw 1.4cqw; gap: 1.6cqw; font-size: 2cqw;
  background: rgba(5, 5, 6, 0.9); box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.14); }
.cz-pl-row .cz-pl-counts i { width: 1.15cqw; height: 1.15cqw; }
.cz-pl-row .cz-pl-counts .cz-r-topfrag i { width: 1.5cqw; }

/* ---------- the bundle ceremony (the Witching Hour): the clock, the hand of four, the headline ---------- */
.cz-cer.cz-bd { display: block; padding: 0; overflow: hidden; }
.cz-cer.cz-bd .cz-cer-dim { opacity: 1; background: radial-gradient(ellipse at 50% 70%, #140a08 0%, #060506 60%); }
.cz-bd-time { position: fixed; left: 0; right: 0; z-index: 2; display: grid; justify-items: center; gap: 10px; text-align: center; pointer-events: none; opacity: 0; }
.cz-bd-time b { font: 700 clamp(30px, 5.4vmin, 58px)/1 var(--cz-hud); letter-spacing: 0.18em; color: var(--cz-bone); font-variant-numeric: tabular-nums; }
.cz-bd-time span { font: 900 clamp(15px, 2.4vmin, 24px)/1 var(--cz-cond); letter-spacing: 0.32em; text-transform: uppercase; color: #ff8a3c; }
.cz-bd-hand { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.cz-bd-card { position: absolute; left: 0; top: 0; perspective: 900px; opacity: 0; will-change: transform; }
.cz-bd-in { position: absolute; inset: 0; transform-style: preserve-3d; }
.cz-bd-side { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; border-radius: 4.5% / 3%; }
.cz-bd-back img { width: 100%; height: 100%; display: block; object-fit: cover; }
.cz-bd-burn { position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255, 140, 70, 0.75), inset 0 0 18px rgba(255, 96, 30, 0.45); }
.cz-bd-face { transform: rotateY(180deg); background: linear-gradient(180deg, #0f0c0c, #0a0809 70%, #170c09); box-shadow: inset 0 0 0 1px rgba(255, 122, 46, 0.6), inset 0 0 0 4px #0a0809, inset 0 0 0 5px rgba(244, 241, 234, 0.12); display: grid; grid-template-rows: auto 1fr auto; }
.cz-bd-top { display: flex; justify-content: space-between; padding: 9% 9% 0; font: 700 clamp(8px, 0.7vw, 11px)/1 var(--cz-hud); letter-spacing: 0.22em; text-transform: uppercase; color: var(--cz-mute); }
.cz-bd-top em { font-style: normal; color: #ff8a3c; }
.cz-bd-art { display: grid; place-items: center; min-height: 0; padding: 4% 6%; }
.cz-bd-art .cz-cer-title { font-size: 9px; }
.cz-bd-cap { padding: 0 8% 10%; text-align: center; }
.cz-bd-cap b { display: block; font: 900 clamp(14px, 1.5vw, 22px)/1 var(--cz-cond); letter-spacing: 0.04em; text-transform: uppercase; color: var(--cz-bone); }
.cz-bd-cap small { display: block; margin-top: 5px; font: 700 clamp(8px, 0.65vw, 10px)/1 var(--cz-hud); letter-spacing: 0.24em; text-transform: uppercase; color: #ff8a3c; }
.cz-bd-sheen { position: absolute; inset: -20%; pointer-events: none; background: linear-gradient(105deg, transparent 40%, rgba(255, 220, 180, 0.22) 50%, transparent 60%); transform: translateX(calc(var(--sh, 1) * 60%)); mix-blend-mode: screen; }
.cz-bd-head { position: fixed; left: 0; right: 0; z-index: 5; display: grid; justify-items: center; gap: 8px; text-align: center; pointer-events: none; opacity: 0; }
.cz-bd-head small { font: 700 clamp(10px, 1.3vmin, 13px)/1 var(--cz-hud); letter-spacing: 0.36em; text-transform: uppercase; color: #ff8a3c; }
.cz-bd-head h2 { margin: 0; font: 900 clamp(44px, 9vmin, 104px)/0.86 var(--cz-cond); text-transform: uppercase; letter-spacing: 0.01em; color: transparent;
  background: linear-gradient(180deg, #fff0cc 0 30%, #ffa448 55%, #e2471a 80%, #9c1a26 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 18px rgba(255, 90, 30, 0.45)); }
.cz-bd-ser { margin-top: 2px; padding: 7px 12px 6px; font: 700 clamp(11px, 1.4vmin, 14px)/1 var(--cz-hud); letter-spacing: 0.24em; text-transform: uppercase; color: var(--cz-bone); box-shadow: inset 0 0 0 2px #ff7a2e; background: rgba(10, 8, 9, 0.7); }
.cz-bd-under { position: fixed; left: 0; right: 0; z-index: 5; display: grid; justify-items: center; gap: 12px; text-align: center; opacity: 0; }
.cz-bd-under small { max-width: 52ch; padding: 0 16px; font: 500 13px/1.4 var(--cz-body); color: var(--cz-bone-2); text-shadow: 0 1px 2px #000, 0 0 12px #000, 0 0 24px rgba(0, 0, 0, 0.9); }
.cz-cer.cz-bd .cz-cer-skip { margin: 0; animation: none; }
.cz-cer.cz-bd .cz-lt { z-index: 1; animation: none; }
.cz-cer.cz-bd.cz-fast .cz-dk-fx, .cz-cer.cz-bd.cz-fast .cz-dk-skip, .cz-cer.cz-bd.cz-fast .cz-bd-time, .cz-cer.cz-bd.cz-fast .cz-bd-film { display: none; }
.cz-bd-rot { position: relative; flex: none; }
.cz-bd-rot > div { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); }
.cz-bd-rot .cz-plate { width: 100%; }
/* v2: the rendered film (the clock, the shatter, the fire) under the live cards */
.cz-bd-stage { position: fixed; z-index: 1; transform: translate(-50%, -50%); -webkit-mask: radial-gradient(closest-side, #000 72%, transparent 100%); mask: radial-gradient(closest-side, #000 72%, transparent 100%); }
.cz-bd-stage > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cz-bd-stage .cz-bd-still { opacity: 0; }
.cz-bd-nofilm .cz-bd-stage .cz-bd-still, .cz-cer.cz-bd.cz-fast .cz-bd-stage .cz-bd-still { opacity: 1; }
.cz-bd-stage .cz-bd-loop { opacity: 0; }
.cz-bd-scrim { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; background: radial-gradient(ellipse 60% 46% at 50% 54%, rgba(4, 3, 3, 0.62), transparent 75%); }
.cz-bd-card .cz-bd-burn { box-shadow: inset 0 0 0 1px rgba(255, 140, 70, calc(0.35 + 0.6 * var(--heat, 0))), inset 0 0 calc(10px + 30px * var(--heat, 0)) rgba(255, 96, 30, calc(0.25 + 0.6 * var(--heat, 0))); }
/* v2: the rendered 3:00 AM plate (the unlock's clock, its dial cracked) and the forged title */
.cz-pl-hallow .cz-hw-img { object-fit: cover; object-position: 100% 50%; }
.cz-pl-hallow .cz-hw-glow { mix-blend-mode: screen; background: radial-gradient(ellipse 30% 70% at 82% 55%, rgba(255, 110, 40, 0.22), transparent 70%); }
.cz-pl-hallow .cz-pl-id { text-shadow: 0 2px 10px #000; }
.cz-title.cz-title-img { gap: 0.4em; }
.cz-title.cz-title-img::before { display: none; }
.cz-title.cz-title-img img { display: block; height: 1.55em; width: auto; filter: drop-shadow(0 1px 1px #000) drop-shadow(0 0 0.2em rgba(255, 90, 30, 0.3)); animation: czCandle 3.4s linear infinite; }
.cz-pl-id .cz-title.cz-title-img img { height: 1.9em; }
@media (prefers-reduced-motion: reduce) { .cz-title.cz-title-img img { animation: none; } }
