/* The booster pack (app.js packFace): a 3D foil pack in plastic wrap, like a Magic booster (Joe, 2026-10-23).
   It is a real 3D object: the front, two foil side edges with thickness, crimped seals top and bottom (the body's
   edge is cut into teeth), a crinkled plastic sheen and a specular glint that follow the pointer, and a slow idle sway
   so the depth shows even when nobody touches it. Placeholder art (the Atlas scene) until Codex's pack textures land in
   assets/art/new/pack/. Kinds: daily (crimson), trial (bone), vip (black and gold). */
@property --sway { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.booster { --foil-a: #5e1018; --foil-b: #1c0508; --foil-c: #9a2530; --ink: #f6e7d2; --accent: #e8c27a; --depth: 12px;
  position: relative; height: 100%; aspect-ratio: .62; margin: 0 auto; transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(var(--ry, 0deg)) rotateY(calc(var(--rx, 0deg) + var(--sway))); transition: transform .5s var(--ease);
  animation: boosterSway 7s ease-in-out infinite alternate; } /* no filter here: it would flatten the 3D */
.b-shade { position: absolute; left: 8%; right: 8%; top: 8%; bottom: -4%; z-index: -1; border-radius: 40%; background: rgba(0, 0, 0, .75); filter: blur(22px); transform: translateZ(-40px); pointer-events: none; }
.booster:hover { animation-play-state: paused; transition: transform .12s linear; }
.booster[data-kind="trial"] { --foil-a: #8d8173; --foil-b: #2b2622; --foil-c: #d9ccb8; --ink: #fff7ea; --accent: #f4e3c4; }
.booster[data-kind="vip"] { --foil-a: #2a2318; --foil-b: #060505; --foil-c: #b48a3c; --ink: #fff0cf; --accent: #f3cf7c; }
@keyframes boosterSway { from { --sway: -9deg; } to { --sway: 9deg; } }

/* the body: foil with a pillow bulge, teeth cut along the top and bottom seals */
.b-body { position: absolute; inset: 0; container-type: inline-size; overflow: hidden; border-radius: 2px;
  background: linear-gradient(115deg, var(--foil-a), var(--foil-b) 28%, var(--foil-c) 47%, var(--foil-b) 62%, var(--foil-a) 82%, var(--foil-b));
  -webkit-mask: conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) 0 0 / 9px 4.5px repeat-x, linear-gradient(#000 0 0) 0 4.5px / 100% calc(100% - 9px) no-repeat, conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 0 100% / 9px 4.5px repeat-x;
  mask: conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) 0 0 / 9px 4.5px repeat-x, linear-gradient(#000 0 0) 0 4.5px / 100% calc(100% - 9px) no-repeat, conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 0 100% / 9px 4.5px repeat-x; }
.b-body::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 6; /* the pillow: darker at the sides and under the seals */
  background: linear-gradient(90deg, rgba(0, 0, 0, .6), transparent 16%, rgba(255, 255, 255, .05) 48%, transparent 84%, rgba(0, 0, 0, .6)),
    linear-gradient(180deg, rgba(0, 0, 0, .45), transparent 11% 89%, rgba(0, 0, 0, .45)); }
.b-crimp { position: absolute; left: 0; right: 0; height: 8.5%; z-index: 5;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .28) 0 1px, rgba(0, 0, 0, .4) 1px 3px, transparent 3px 5px),
    linear-gradient(180deg, color-mix(in srgb, var(--foil-c) 70%, #fff 10%), var(--foil-b)); }
.b-crimp.top { top: 0; box-shadow: 0 2px 6px rgba(0, 0, 0, .55); }
.b-crimp.bottom { bottom: 0; transform: scaleY(-1); box-shadow: 0 2px 6px rgba(0, 0, 0, .55); }
.b-crimp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: color-mix(in srgb, var(--accent) 60%, transparent); }
/* the art: the world, printed like the rest of it */
.b-art { position: absolute; left: 7%; right: 7%; top: 21%; height: 46%; z-index: 1; border-radius: 50% 50% 3px 3px / 26% 26% 3px 3px; overflow: hidden;
  background: url("assets/art/hall-atlas.webp") 62% 28% / auto 118% no-repeat, #120b0c;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, #000), 0 0 0 5px rgba(0, 0, 0, .5), 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent); }
.b-art::after { content: ""; position: absolute; inset: 0; mix-blend-mode: multiply;
  background: radial-gradient(circle, transparent 0 .35cqw, rgba(10, 4, 5, .55) .6cqw) 0 0 / 1.3cqw 1.3cqw, linear-gradient(180deg, rgba(120, 12, 20, .15), rgba(120, 12, 20, .5)); }
.booster[data-kind="trial"] .b-art { filter: sepia(.35) brightness(1.1); }
.b-brand { position: absolute; z-index: 3; left: 0; right: 0; top: 10.5%; text-align: center; font: 400 15cqw/1 var(--wordmark); letter-spacing: .12em; padding-left: .12em; color: var(--ink);
  text-shadow: 0 .4cqw 1.2cqw rgba(0, 0, 0, .7); }
.b-title { position: absolute; z-index: 3; left: 6%; right: 6%; top: 70%; text-align: center; font: 700 8.4cqw/1.05 var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--ink);
  text-shadow: 0 .4cqw 1cqw rgba(0, 0, 0, .8); }
.b-sub { position: absolute; z-index: 3; left: 6%; right: 6%; top: 79.6%; text-align: center; font: 700 3.4cqw/1 var(--sans); letter-spacing: .3em; padding-left: .3em; text-transform: uppercase; color: var(--accent); }
.b-gems { position: absolute; z-index: 3; left: 0; right: 0; top: 85.4%; display: flex; justify-content: center; gap: 2.6cqw; }
.b-gems i { width: 3cqw; height: 3cqw; transform: rotate(45deg); background: var(--c); box-shadow: 0 0 2cqw var(--c), 0 0 0 .4cqw rgba(0, 0, 0, .6); }
/* the side edges: a little thickness, seen when the pack turns */
.b-edge { position: absolute; top: 2.5%; bottom: 2.5%; width: var(--depth); z-index: 0;
  background: linear-gradient(90deg, var(--foil-b), var(--foil-c) 45%, var(--foil-b)); }
.b-edge.left { left: 0; transform-origin: left; transform: rotateY(90deg); }
.b-edge.right { right: 0; transform-origin: right; transform: rotateY(-90deg); }
/* the plastic wrap: soft diagonal streaks, a crinkled sheen, bright rims where the wrap folds over the edges */
.b-wrap { position: absolute; inset: -1px; z-index: 8; pointer-events: none; mix-blend-mode: screen; transform: translateZ(1px);
  background:
    linear-gradient(104deg, transparent calc(14% + var(--wx, 0%)), rgba(255, 255, 255, .2) calc(19% + var(--wx, 0%)), transparent calc(25% + var(--wx, 0%))),
    linear-gradient(78deg, transparent calc(56% - var(--wx, 0%)), rgba(255, 255, 255, .1) calc(60% - var(--wx, 0%)), transparent calc(66% - var(--wx, 0%))),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='380'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='turbulence' baseFrequency='.012 .035' numOctaves='3' seed='11'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -5 0 0 0 .62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E") 0 0 / 100% 100%,
    linear-gradient(90deg, rgba(255, 255, 255, .22), transparent 3% 97%, rgba(255, 255, 255, .22));
  opacity: .55;
  -webkit-mask: conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) 0 0 / 9px 4.5px repeat-x, linear-gradient(#000 0 0) 0 4.5px / 100% calc(100% - 9px) no-repeat, conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 0 100% / 9px 4.5px repeat-x;
  mask: conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) 0 0 / 9px 4.5px repeat-x, linear-gradient(#000 0 0) 0 4.5px / 100% calc(100% - 9px) no-repeat, conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 0 100% / 9px 4.5px repeat-x; }
.b-glint { position: absolute; inset: 0; z-index: 9; pointer-events: none; mix-blend-mode: overlay; opacity: 0; transition: opacity .3s; transform: translateZ(2px);
  background: radial-gradient(circle at var(--bx, 50%) var(--by, 40%), rgba(255, 255, 255, .7), transparent 34%); }
.booster:hover .b-glint, .tear-pack .b-glint { opacity: 1; }
.booster:hover { --wx: calc((var(--bx, 50%) - 50%) * .3); }

/* where the pack lives */
.pack::before, .pack::after { display: none; }
.pack { transform: none; }
.pack .booster { height: 100%; }
.tear-pack .pack-body { background: none; border-radius: 0; isolation: auto; }
.tear-pack .pack-body .booster { height: 100%; animation: none; }
.tear-pack .pack-strip { left: 6%; right: 6%; top: 0; height: 8.5%; border-radius: 0; border: 0; box-shadow: none; background: transparent; }
.tear-pack .pack-strip span { background: rgba(10, 6, 8, .78); border: 1px solid color-mix(in srgb, var(--t-titan) 40%, transparent); color: #f5e5c5; }
.tear-pack.unsealing .booster, .tear-pack.dragging .booster { animation: boosterShake .35s ease-in-out infinite; }
@keyframes boosterShake { 25% { translate: -2px 0; } 75% { translate: 2px 0; } }
@media (prefers-reduced-motion: reduce) { .booster { animation: none; transition: none; } .tear-pack.unsealing .booster, .tear-pack.dragging .booster { animation: none; } }
/* on the opening screen the top seal is the strip you pull off */
.tear-pack .b-crimp.top { visibility: hidden; }
.tear-pack .pack-strip { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .28) 0 1px, rgba(0, 0, 0, .4) 1px 3px, transparent 3px 5px), linear-gradient(180deg, #a3303b, #1c0508);
  -webkit-mask: conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) 0 0 / 9px 4.5px repeat-x, linear-gradient(#000 0 0) 0 4.5px / 100% calc(100% - 4.5px) no-repeat;
  mask: conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) 0 0 / 9px 4.5px repeat-x, linear-gradient(#000 0 0) 0 4.5px / 100% calc(100% - 4.5px) no-repeat; }
.tear-pack[data-kind="trial"] .pack-strip { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .3) 0 1px, rgba(0, 0, 0, .35) 1px 3px, transparent 3px 5px), linear-gradient(180deg, #e2d6c3, #2b2622); }
.tear-pack[data-kind="vip"] .pack-strip { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .28) 0 1px, rgba(0, 0, 0, .4) 1px 3px, transparent 3px 5px), linear-gradient(180deg, #c99a45, #060505); }

/* ---------- the pack (has-art): one pack, the same on Today, on the opening screen and in the tear strip ----------
   Codex's daily pack front (assets/art/new/packs/web) for every kind: the printed foil, its art and its crimped seals
   are the picture; IRIS, "Artist Pack" and the count are live text in Codex's safe boxes (packs/README.md), on a soft
   dark scrim because the marble veins vary. At rest it faces you, centred; it turns only a little toward the pointer,
   and that turn shows its real thickness (side edges, Codex's pack back on the rear plane). The plastic is Codex's
   alpha sheen, used once; the light breathes across it slowly. The pack never sways or pulses in size by itself. */
.booster.has-art { --art: url("assets/art/new/packs/web/pack-daily.webp"); --depth: 14px;
  --foil-a: #2a1d1f; --foil-b: #0b0708; --foil-c: #6b2a2f; --accent: #e8c27a;
  aspect-ratio: 1024 / 1536; animation: none; transform: perspective(1100px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); }
.has-art .b-shade { left: 6%; right: 6%; top: auto; bottom: -5%; height: 10%; border-radius: 50%; background: rgba(0, 0, 0, .8); filter: blur(14px); transform: translateZ(-30px); }
.has-art .b-rear { position: absolute; inset: 0; border-radius: 2px; transform: translateZ(calc(var(--depth) * -1)) rotateY(180deg);
  background: #120d0e url("assets/art/new/packs/web/pack-back.webp") 0 0 / 100% 100%; }
.has-art .b-edge { top: 1%; bottom: 1%; background: repeating-linear-gradient(0deg, rgba(176, 165, 139, .25) 0 1px, transparent 1px 4px), linear-gradient(90deg, #171112, #8d806a 40%, #2c2223 75%, #110d0e); }
.has-art .b-body { background: #0b0809 var(--art) 0 0 / 100% 100% no-repeat; }
.has-art .b-body::after { background: linear-gradient(90deg, rgba(0, 0, 0, .5), transparent 10%, rgba(255, 255, 255, .05) 40%, transparent 70%, rgba(0, 0, 0, .45)),
  linear-gradient(180deg, rgba(0, 0, 0, .3), transparent 9% 90%, rgba(0, 0, 0, .4)); }
.has-art .b-art, .has-art .b-crimp, .has-art .b-gems { display: none; }
.has-art .b-plate { position: absolute; z-index: 3; left: 20%; right: 20%; top: 40.7%; height: 14.3%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6cqw;
  background: radial-gradient(closest-side, rgba(6, 4, 5, .55), transparent); }
.has-art .b-brand, .has-art .b-title { position: static; }
.has-art .b-brand { font-size: 12cqw; }
.has-art .b-title { font-size: 6.4cqw; }
.has-art .b-sub { top: 79.8%; height: 6%; left: 19%; right: 19%; display: grid; place-items: center; padding: 0 2cqw; border-radius: 1cqw; background: rgba(9, 6, 8, .82);
  font-size: 3.8cqw; letter-spacing: .14em; white-space: nowrap; }
.has-art .b-wrap { opacity: .32; mix-blend-mode: screen; background: url("assets/art/new/packs/web/plastic-sheen.webp") 0 0 / 100% 100%; }
.has-art .b-glint { mix-blend-mode: screen; opacity: .5; background: linear-gradient(112deg, transparent 30%, rgba(255, 246, 225, .16) 44%, rgba(255, 246, 225, .3) 50%, rgba(255, 246, 225, .16) 56%, transparent 70%) 0 0 / 300% 100%;
  animation: packBreath 7s ease-in-out infinite alternate; }
.booster.has-art:hover .b-glint { animation-play-state: paused; background-position: calc(100% - var(--bx, 50%)) 0; opacity: .75; }
@keyframes packBreath { from { background-position: 90% 0; } to { background-position: 10% 0; } }
.pack-home .pack { animation: none; filter: none; overflow: visible; }
.pack-home .pack:disabled { opacity: .55; filter: grayscale(.4); cursor: default; }
/* the glow behind the resting pack (Dodd, 10-25): a soft bone-and-red halo that breathes slowly; the 3D pack adds a few
   drifting motes on top (pack-gl.js). Under both the 3D and the 2D pack; dimmer when there's no pack to open. */
.pack-home { position: relative; }
.pack-home .pack { z-index: 1; }
.pack-home::before, .pack-home::after { content: ""; position: absolute; z-index: 0; pointer-events: none; border-radius: 50%; }
.pack-home::before { left: -22%; right: -22%; top: -9%; bottom: -9%;
  background: radial-gradient(closest-side, rgba(233, 223, 204, .2), rgba(198, 59, 53, .16) 42%, rgba(143, 28, 41, .08) 66%, transparent);
  animation: packHalo 6.5s ease-in-out infinite alternate; }
.pack-home::after { left: 4%; right: 4%; top: 10%; bottom: 10%;
  background: radial-gradient(closest-side, rgba(255, 236, 214, .16), rgba(198, 59, 53, .1) 55%, transparent);
  filter: blur(10px); animation: packHalo 4.8s ease-in-out -2.4s infinite alternate-reverse; }
.pack-home:has(.pack:disabled)::before, .pack-home:has(.pack:disabled)::after { opacity: .35; animation: none; }
@keyframes packHalo { from { opacity: .62; transform: scale(.95); } to { opacity: 1; transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .pack-home::before, .pack-home::after { animation: none; } }
/* #79: while the opening screen is up, Today's pack is the one flying in there, so it isn't also left here (and its
   halo goes with it); it comes back when the screen closes */
body:has(#opening:not([hidden])) .pack-home .pack { visibility: hidden; }
body:has(#opening:not([hidden])) .pack-home::before, body:has(#opening:not([hidden])) .pack-home::after { visibility: hidden; }
/* #149 the same from Inventory > Packs: the pack on the plinth is the one that flies out */
body:has(#opening:not([hidden])) .inv-detail .iv-hero.rk-pack { visibility: hidden; }
/* ---------- #149 Home's pack ring (app.js ringHtml / ringTurn): the pack in front, the others behind it to the sides ----------
   Every pack stands in the same box (the front one's); app.js places each round the ring with an inline transform
   (out to the side, back, smaller, a little higher) and dims it with a filter, the further back the dimmer. Only the
   front one is the 3D pack. The arrows sit low, just outside the front pack and under the dim ones, so they hide no art. */
.pack-ring { perspective: 1400px; }
.pack-home.pack-ring > .ring-pack { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 50% 62%; }
.pack-ring > .ring-pack:not(.is-front) .b-glint { animation: none; opacity: .2; }
.pack-ring > .ring-pack:not(.is-front) .b-wrap { opacity: .2; }
/* the dim is on the pack only (--ring-dim, app.js ringPut), so the count badge stays bright on the packs behind */
.pack-ring > .ring-pack > :not(.ring-count) { filter: var(--ring-dim, none); }
/* #156 the count (Dodd: "I see the times 9... make that a little more obvious"): a big coin on the pack's top corner,
   bone numerals on near-black, rimmed and lit in the pack type's colour (--rc: RevealRules.OPEN) */
/* #235 restyled (Dodd 10-27: the pill looked generic): an engraved seal. Gold-leaf rim, a dark wine field, a beaded inner
   ring in the pack type's colour (--rc), the numerals in the app's serif cut into the field. It sits on the pack's top
   corner on the outer side; when the pack changes side it glides across (left + translate are transitioned), no jump. */
.ring-count { position: absolute; z-index: 6; left: 102%; top: -1%; translate: -100% 0; min-width: 52px; height: 52px; padding: 0 11px; box-sizing: border-box; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 1px; font: 700 25px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums;
  color: #f3e7d2; text-shadow: 0 -1px 0 rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 232, 190, .22);
  border: 2px solid transparent; pointer-events: none;
  background: radial-gradient(circle at 34% 22%, #4a2326, #1a0c0e 58%, #080405) padding-box, linear-gradient(150deg, #fbe7a8, #c99a45 38%, #6a4418 54%, #e9c577 80%, #fff0c4) border-box;
  box-shadow: inset 0 0 0 2px rgba(6, 3, 4, .92), inset 0 0 0 3px color-mix(in srgb, var(--rc, #e8c27a) 60%, transparent), inset 0 3px 8px rgba(0, 0, 0, .55),
    0 0 14px 1px color-mix(in srgb, var(--rc, #e8c27a) 38%, transparent), 0 6px 12px rgba(0, 0, 0, .55);
  transition: left .46s cubic-bezier(.2, .8, .2, 1), translate .46s cubic-bezier(.2, .8, .2, 1), scale .3s ease; }
.ring-count small { font: 600 .56em/1 var(--serif); color: #e8c27a; opacity: .9; margin-right: 1px; text-shadow: none; }
.pack-ring > .ring-pack:not(.is-front) .ring-count { scale: .9; }
/* #234 no focus rectangle on the packs (polish.css gives every button a 2px outline): keyboard focus is a soft glow under
   the pack, :focus-visible only */
.pack-ring > .ring-pack, .pack-ring > .ring-pack:focus, .pack-ring > .ring-pack:focus-visible { outline: none; -webkit-tap-highlight-color: transparent; }
.pack-ring > .ring-pack:focus-visible::after { content: ""; position: absolute; z-index: 0; pointer-events: none; left: 2%; right: 2%; bottom: -5%; height: 14%; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rc, #e8c27a) 70%, #fff3d6), transparent); opacity: .95; filter: blur(8px); animation: ringFocus .3s ease-out both; }
.pack-ring > .ring-pack > :is(.pack-gl, .pack-snap, .booster) { transition: translate .25s ease; }
.pack-ring > .ring-pack:focus-visible > :is(.pack-gl, .pack-snap, .booster) { translate: 0 -1.4%; }
@keyframes ringFocus { from { opacity: 0; transform: scale(.7); } }
.ring-arrow { position: absolute; z-index: 30; bottom: 3%; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(236, 228, 216, .22); background: rgba(10, 7, 8, .7); color: var(--bone, #ece4d8); box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  transition: background-color .18s ease, border-color .18s ease, scale .14s ease; }
.ring-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ring-arrow.is-prev { right: calc(100% + 8px); }
.ring-arrow.is-next { left: calc(100% + 8px); }
@media (hover: hover) and (pointer: fine) { .ring-arrow:hover { background-color: rgba(34, 20, 22, .9); border-color: color-mix(in srgb, var(--t-titan) 60%, transparent); } }
.ring-arrow:active { scale: .92; }
.ring-arrow:focus-visible { outline: 2px solid var(--t-titan); outline-offset: 3px; }
body:has(#opening:not([hidden])) .pack-ring > .ring-arrow { visibility: hidden; }
/* on the opening screen the strip you tear is cut from the pack's own top seal */
.opening .tear-pack .pack-strip { background: url("assets/art/new/packs/web/pack-daily.webp") 50% 0 / 113.7% auto no-repeat; border: 0; box-shadow: none; }

/* ---------- opening: tear -> light through the seam -> the cards rise out of the pack -> card back -> flip ----------
   app.js sets the classes: .unsealing (the seam glows), .torn (the strip flies off, light spills out), .dealing (the
   stack rises out of the opening while the pack sinks away), then each card flips on a click. */
.opening-stage { perspective: 1600px; }
.tear-pack { z-index: 2; }
.tear-pack .pack-body { transition: transform .45s cubic-bezier(.77, 0, .175, 1), opacity .35s .1s; } /* the exit is quicker than the entrance */
.tear-pack.unsealing .pack-spill { opacity: .55; }
.tear-pack.torn .pack-spill { opacity: .7; transition: opacity .25s; }
.tear-pack.torn .pack-body { transform: none; opacity: 1; } /* the pack stays while the cards come out */
.tear-pack.dealing { pointer-events: none; } /* QA: the sinking pack sat over the stack and swallowed the first card click */
.tear-pack.dealing .pack-body { transform: translateY(58vh); opacity: 0; }
.tear-pack.dealing .pack-spill { opacity: 0; transition: opacity .5s; }
.opening-stage .big-card.inpack { transform: translateY(4%) scale(.95); transition: none; }   /* hidden behind the pack front */
.opening-stage .big-card.peek { transform: translateY(var(--rise, -32%)) scale(.95); transition: transform .5s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i) * 18ms); } /* rising out of the opening */
.opening-stage .big-card.stacked { transform: translateY(calc(var(--i) * -3px)) translateX(calc(var(--i) * 1px)); opacity: 1;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .3s; transition-delay: calc(var(--i) * 25ms); }
.opening-stage .big-card.flipped { transform: rotateY(180deg); transition: transform .42s cubic-bezier(.23, 1, .32, 1); } /* ten flips a pack: crisp, not ceremonial */

/* ---------- the shared card back (face down in a pack): Codex's card-back frame, a dark marble field, one IRIS ---------- */
.card-down { position: absolute; inset: 0; container-type: inline-size; border-radius: 3.6% / 2.4%; overflow: hidden; background: #0b0809 url("assets/art/new/cards/web/card-back.webp") 0 0 / 100% 100%;
  box-shadow: 0 2cqw 7cqw rgba(0, 0, 0, .7), 0 0 0 1px rgba(236, 228, 216, .08); }
.card-down::before { content: ""; position: absolute; left: 8.8%; right: 8.6%; top: 20.8%; height: 67.1%; border-radius: 1cqw;
  background: linear-gradient(rgba(8, 6, 7, .55), rgba(8, 6, 7, .55)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='450'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='turbulence' baseFrequency='.006 .022' numOctaves='4' seed='9'/%3E%3CfeColorMatrix values='0 0 0 0 .92 0 0 0 0 .86 0 0 0 0 .8 -2.6 0 0 0 .42'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E") 0 0 / 100% 100%,
    radial-gradient(90% 70% at 50% 45%, #1e1719, #070506 75%);
  box-shadow: inset 0 0 0 .5cqw rgba(214, 196, 160, .35), inset 0 0 0 1.4cqw rgba(0, 0, 0, .6), inset 0 0 0 1.7cqw rgba(214, 196, 160, .18), inset 0 0 8cqw #000; }
.card-down .cd-seal { position: absolute; left: 42%; top: 2.6%; width: 16.4%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #d9c79f 0 7%, transparent 8%), radial-gradient(circle, #19121a 0 62%, transparent 63%), conic-gradient(from 45deg, #6d5a3c, #e3d1a6, #6d5a3c, #e3d1a6, #6d5a3c); }
.card-down .cd-mark { position: absolute; left: 50%; top: 54%; width: 46%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; display: grid; place-items: center;
  box-shadow: 0 0 0 .35cqw rgba(214, 196, 160, .7), 0 0 0 1.6cqw rgba(0, 0, 0, .35), 0 0 0 1.9cqw rgba(214, 196, 160, .35), 0 0 6cqw rgba(0, 0, 0, .8) inset; }
.card-down .cd-mark b { font: 400 11cqw/1 var(--wordmark, var(--serif)); letter-spacing: .12em; padding-left: .12em; color: #eadbbd; text-shadow: 0 .3cqw 1cqw #000; }
.card-down .cd-foil { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: .35;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 236, 205, .22) 47%, rgba(205, 230, 255, .18) 53%, transparent 65%) calc(100% - var(--bx, 50%)) 0 / 260% 100%; }
.big-card.charging .card-down { animation: charge var(--charge, .6s) ease-in forwards; }
/* the card back you wear (board #109): card-backs.js puts data-card-back and --card-back(-2x) / --cb-foil on <html>.
   Codex's backs carry IRIS in the art, so the drawn panel, seal and mark step aside; their rounded corners are baked in
   as alpha (6.25% / 4.17%), which the radius here matches so the shadow follows the card. The glint is tuned per
   material and kept off the IRIS letters (a band across the middle, where every back has them). .is-stock = a picture
   of the stock back somewhere else (the Locker), which stays stock. */
html[data-card-back] .card-down:not(.is-stock) { background: transparent var(--card-back) 0 0 / 100% 100% no-repeat; border-radius: 6.25% / 4.17%; }
html[data-card-back] .card-down:not(.is-stock)::before, html[data-card-back] .card-down:not(.is-stock) > .cd-seal, html[data-card-back] .card-down:not(.is-stock) > .cd-mark { display: none; }
html[data-card-back] .card-down:not(.is-stock) > .cd-foil { opacity: var(--cb-foil, .3);
  -webkit-mask-image: radial-gradient(40% 7% at 50% 47.5%, transparent 55%, #000 100%); mask-image: radial-gradient(40% 7% at 50% 47.5%, transparent 55%, #000 100%); }
html[data-card-back="iris-holo"] .card-down:not(.is-stock) > .cd-foil,
html[data-card-back="random"] .card-down[data-cb="iris-holo"]:not(.is-stock) > .cd-foil { mix-blend-mode: color-dodge;
  background: linear-gradient(115deg, transparent 34%, rgba(229, 156, 169, .3) 42%, rgba(199, 164, 90, .3) 47%, rgba(110, 155, 129, .28) 52%, rgba(97, 143, 191, .3) 57%, rgba(152, 118, 199, .28) 62%, transparent 70%) calc(100% - var(--bx, 50%)) 0 / 260% 100%; }
@media (min-resolution: 1.5dppx) { html[data-card-back] .card-down:not(.is-stock) { background-image: var(--card-back-2x, var(--card-back)); } }
@media (prefers-reduced-motion: reduce) {
  .has-art .b-glint { animation: none; }
  /* reduced motion: nothing travels or turns; the pack and the faces just cross-fade */
  .tear-pack .pack-body, .opening-stage .big-card.stacked, .opening-stage .big-card.flipped, .opening-stage .big-card.peek { transition: opacity .2s ease; }
  .opening-stage .big-card.inpack, .opening-stage .big-card.peek { transform: none; opacity: 0; }
  .tear-pack.dealing .pack-body { transform: none; }
}
/* ---------- #156 Home's switch (app.js packPanel / homeMode): Message (N left) / Open packs (N) ----------
   Shown only when there are artists to message and packs waiting. A lit plate (the desk's red) slides to the one
   chosen; the stage under it swaps with a short slide. Remembered on this computer (local.homeMode). */
.hm-mode { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr 1fr; flex: none; box-sizing: border-box; width: min(440px, 100%); padding: 4px; margin: 0 auto 14px;
  border-radius: 999px; background: rgba(10, 7, 8, .8); border: 1px solid rgba(236, 228, 216, .16);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hm-mode-lit { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; pointer-events: none;
  background: linear-gradient(160deg, #c22d31, #7c1720 70%); box-shadow: inset 0 1px 0 rgba(255, 214, 200, .35), inset 0 0 0 1px rgba(255, 190, 180, .18), 0 4px 16px rgba(170, 28, 36, .5);
  transition: translate .34s cubic-bezier(.3, 1.25, .5, 1); }
.hm-mode[data-mode="packs"] .hm-mode-lit { translate: 100% 0; }
.hm-mode-b { position: relative; z-index: 1; min-height: 46px; padding: 0 14px; border: 0; border-radius: 999px; background: none; cursor: pointer; white-space: nowrap;
  color: rgba(236, 228, 216, .66); font: 600 15px/1 var(--sans); letter-spacing: .01em; transition: color .2s ease; }
.hm-mode-b b { font-weight: 500; opacity: .78; }
.hm-mode-b[aria-pressed="true"] { color: #fff7ef; }
.hm-mode-b[aria-pressed="true"] b { opacity: .92; }
@media (hover: hover) and (pointer: fine) { .hm-mode-b[aria-pressed="false"]:hover { color: #fff7ef; } }
.hm-mode-b:active { scale: .97; }
.hm-mode-b:focus-visible { outline: 2px solid var(--t-titan); outline-offset: 2px; }
@media (max-width: 400px) { .hm-mode-b { font-size: 14px; padding: 0 8px; } }
@media (prefers-reduced-motion: reduce) { .hm-mode-lit { transition: none; } }
#panel.is-home .hm-stage.has-mode .pcard { height: clamp(220px, min(46vh, 100vh - 520px), 540px); }
@media (max-width: 860px) { #panel.is-home .hm-stage.has-mode .pcard { height: 290px; } }
.pack-ring > .ring-pack.on-left .ring-count { left: -2%; translate: 0 0; }
/* #166 (Dodd, 10-26: "the background is darkened out and waiting to load in. Once it's centred, it loads in fully...
   make it more consistent so they all look like they're already loaded in and moving"): the packs behind the front
   one keep their plastic sheen and glint (softer), sway on their own beat and float a little, so the whole ring looks
   alive, not just the 3D pack in front. Reduced motion: still, as before. */
.pack-ring > .ring-pack:not(.is-front) .b-wrap { opacity: .75; }
.pack-ring > .ring-pack:not(.is-front) .b-glint { animation: none; opacity: .45; }
.pack-ring > .ring-pack:not(.is-front) .booster { animation: boosterSway 7s ease-in-out infinite alternate, ringFloat 5.2s ease-in-out infinite; }
.pack-ring > .ring-pack:nth-child(3n+1):not(.is-front) .booster { animation-delay: -2.3s, -1.1s; }
.pack-ring > .ring-pack:nth-child(3n+2):not(.is-front) .booster { animation-delay: -4.6s, -3.4s; }
@keyframes ringFloat { 50% { translate: 0 -1.8%; } }
@media (prefers-reduced-motion: reduce) { .pack-ring > .ring-pack:not(.is-front) .booster { animation: none; } }
