/* Opening a box (alex 2026-11-18, thread "Design the pack opening"; mockup https://claude.ai/artifact/Y57V5Z2BzKqEhja9A4SbD8).
   A full-screen layer. The 3D scene is drawn for alex's phone (430 x 932) and scaled to fit other screens (--z);
   the words are never scaled, they're only placed to line up with it. Everything floats like today's card on
   home (bob 7s, sway 11s, no twirl). Reduce motion: no floating, everything simply fades and moves quickly. */
.bx { position: fixed; inset: 0; z-index: 40; overflow: hidden; color: var(--ink); --z: 1; --oy: 0px;
  background: linear-gradient(180deg, #24262b 0%, #141518 60%, #08090a 100%);
  --bx-glow: 242 192 143; --bx-ce: cubic-bezier(.45, .05, .25, 1); opacity: 0; transition: opacity .5s ease; user-select: none; -webkit-user-select: none; }
.bx.on { opacity: 1; }
.bx-stage { position: absolute; left: 50%; top: var(--oy); width: 430px; height: 932px; margin-left: -215px; transform: scale(var(--z)); transform-origin: 50% 0; }
.bx-halo { position: absolute; left: 50%; top: 450px; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--bx-glow) / .15), transparent 62%); pointer-events: none; }
.bx-halo2 { position: absolute; left: 50%; top: var(--hy, 500px); width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%; opacity: 0; transform: scale(.55); pointer-events: none;
  background: radial-gradient(circle, rgb(255 226 184 / .6), rgb(242 192 143 / .24) 30%, transparent 64%); transition: opacity 2.4s ease, transform 2.4s var(--bx-ce), top 1.2s var(--bx-ce); }
.bx-halo2.on { opacity: 1; transform: scale(1); }
.bx-halo2.breathe { animation: bx-breath 9s ease-in-out infinite; }
.bx-halo2.soft { opacity: .55; transform: scale(.7); }
@keyframes bx-breath { 0%, 100% { transform: scale(1); opacity: 1; } 44% { transform: scale(1.08); opacity: .78; } }

/* the 3D scene */
@property --bx-sw { syntax: '<number>'; inherits: true; initial-value: 1; }
@property --bx-sa { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --bx-oa { syntax: '<number>'; inherits: true; initial-value: 0; }
.bx-scene { position: absolute; inset: 0; perspective: 1300px; perspective-origin: 50% 36%; }
.bx-anchor { position: absolute; left: 215px; top: 470px; width: 0; height: 0; transform-style: preserve-3d; --bx-sw: 1; transition: --bx-sw 1.6s var(--bx-ce); }
.bx.cards .bx-anchor { --bx-sw: 0; }
/* every moving layer floats like the home card; --A says how strongly (0 = still) */
.bx-bob, .bx-sway, .bx-ms, .bx-mo { position: absolute; transform-style: preserve-3d; }
.bx-bob { --A: var(--bx-sw); animation: bx-kb 7s ease-in-out infinite; }
.bx-sway { --A: var(--bx-sw); animation: bx-ks 11s ease-in-out infinite; }
.bx-ms { inset: 0; --A: var(--bx-sa); animation: bx-kb 7s ease-in-out infinite, bx-ks 11s ease-in-out infinite; }
.bx-mo { inset: 0; --A: var(--bx-oa); animation: bx-kb var(--d1) ease-in-out var(--dl) infinite, bx-ks var(--d2) ease-in-out var(--dl) infinite; }
@keyframes bx-kb { 0%, 100% { translate: 0 0; } 50% { translate: 0 calc(var(--A) * -8px); } }
@keyframes bx-ks { 0%, 100% { transform: rotateY(calc(var(--A) * -8deg)) rotateZ(calc(var(--A) * -1deg)); } 50% { transform: rotateY(calc(var(--A) * 8deg)) rotateZ(calc(var(--A) * 1deg)); } }
/* the box leans back a little, so its front faces up */
.bx-tilt { position: absolute; transform-style: preserve-3d; transform: rotateX(8deg); transition: transform 1.4s var(--bx-ce); }
.bx.cards .bx-tilt { transform: rotateX(0deg); }
.bx-p3 { position: absolute; transform-style: preserve-3d; }
.bx-f { position: absolute; left: 0; top: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }

/* the box: body 260 x 338 x 200, lid 268 x 58 x 208 */
.bx-box { left: -130px; top: -195px; width: 260px; height: 390px; cursor: pointer; transition: transform 1.2s var(--bx-ce); }
.bx-box.gone { transform: translateY(1150px); transition: transform 2.2s cubic-bezier(.5, 0, .5, 1); }
.bx-body { left: 0; top: 52px; width: 260px; height: 338px; }
/* hinged on the back edge where it meets the box: it swings open and folds back out of sight */
.bx-lid { left: -4px; top: -2px; width: 268px; height: 58px; transform-origin: 50% 56px -104px; transition: transform 1.8s cubic-bezier(.5, 0, .2, 1); }
.bx-lid.open { transform: rotateX(178deg); }
.bx-front { background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 46%, rgb(255 230 196 / .62) 0%, rgb(250 214 170 / .52) 6%, rgb(242 192 143 / .4) 13%, rgb(242 192 143 / .29) 20%, rgb(236 182 132 / .19) 28%, rgb(226 170 120 / .11) 37%, rgb(210 155 110 / .055) 47%, rgb(200 145 100 / .02) 58%, transparent 70%),
    repeating-radial-gradient(circle at 50% 46%, transparent 0 15px, rgb(242 192 143 / .07) 15px 16px),
    linear-gradient(180deg, #202127, #191a1f);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.bx-front .frame { position: absolute; inset: 14px; border-radius: 10px; border: 1.5px solid rgb(227 196 134 / .5); }
.bx-front .word { position: absolute; left: 0; right: 0; top: 34px; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .34em; padding-left: .34em; color: var(--gold); }
.bx-front .nm { position: absolute; left: 0; right: 0; bottom: 58px; text-align: center; font-size: 22px; font-weight: 600; letter-spacing: .14em; padding-left: .14em; color: var(--ink); }
.bx-front .sub { position: absolute; left: 0; right: 0; bottom: 38px; text-align: center; font-size: 11px; font-weight: 500; letter-spacing: .2em; padding-left: .2em; color: var(--gold); }
.bx-shL { background: linear-gradient(90deg, #111216, #17181c); }
.bx-shR { background: linear-gradient(270deg, #111216, #1a1b20); }
.bx-dark { background: #101114; }
.bx-linside { background: linear-gradient(0deg, #1e1d1f, #18181b); }
.bx-inner { background: linear-gradient(0deg, #1c1a1a 0%, #141417 60%); }
.bx-ltop { background: radial-gradient(circle at 50% 50%, rgb(242 192 143 / .32) 0 9px, transparent 10px), repeating-radial-gradient(circle at 50% 50%, transparent 0 14px, rgb(242 192 143 / .07) 14px 15px), linear-gradient(180deg, #2b2c32, #24252b); }
.bx-lfront { background: linear-gradient(180deg, #25262b, #1f2025); }
.bx-glowfloor { border-radius: 4px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), radial-gradient(ellipse at 50% 50%, rgb(255 236 206) 0%, rgb(250 216 174) 18%, rgb(242 192 143 / .9) 36%, rgb(190 140 98 / .8) 56%, rgb(110 76 50 / .75) 76%, #1a1714 100%); }
.bx-beam { position: absolute; left: -120px; top: -420px; width: 240px; height: 300px; transform: translateZ(-30px); opacity: 0; transition: opacity 1.2s ease; pointer-events: none;
  background: radial-gradient(ellipse 50% 100% at 50% 100%, rgb(255 230 190 / .42) 0%, rgb(250 214 170 / .3) 15%, rgb(242 192 143 / .19) 32%, rgb(242 192 143 / .1) 48%, rgb(242 192 143 / .04) 63%, transparent 78%); }
.bx-beam.on { opacity: 1; }

/* cards: 230 x 324 */
.bx-card { left: -115px; top: -135px; width: 230px; height: 324px; cursor: pointer; --bx-sa: 0; --bx-oa: 0;
  transform: translate3d(var(--x, 0px), var(--y, 0px), var(--zz, 0px)) rotateZ(var(--rz, 0deg)) rotateX(var(--rx, 0deg)) scale(var(--s, 1));
  transition: transform 1s var(--bx-ce), --bx-sa 1.4s var(--bx-ce), --bx-oa 1.4s var(--bx-ce); }
.bx-card.rise { transition: transform 1.5s cubic-bezier(.22, 1, .36, 1), --bx-sa 1.4s, --bx-oa 1.4s; }
/* a soft light far behind the card that doesn't turn with it, so it never drops out or cuts across the card */
.bx-card .glow { position: absolute; inset: -90px; border-radius: 50%; transform: translateZ(-150px) scale(1.12); opacity: 0; transition: opacity 2.2s ease-in; pointer-events: none;
  background: radial-gradient(closest-side, rgb(255 230 196 / .8) 0%, rgb(250 212 168 / .62) 30%, rgb(242 192 143 / .4) 52%, rgb(242 192 143 / .2) 70%, rgb(242 192 143 / .07) 86%, transparent 100%); }
.bx-card.charge .glow { opacity: 1; }
.bx.fin .bx-card.charge .glow { opacity: .6; transition-duration: 1.2s; }
.bx-card .in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .8s var(--bx-ce); }
.bx-card.up .in { transform: rotateY(180deg); }
.bx-card.slow .in { transition: transform 2.2s cubic-bezier(.65, 0, .35, 1); }
.bx-card .face { position: absolute; inset: 0; border-radius: 16px; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.bx-card .bk { background: repeating-radial-gradient(circle at 50% 50%, transparent 0 10px, rgb(242 192 143 / .10) 10px 11px), radial-gradient(circle at 50% 50%, rgb(242 192 143 / .22), transparent 60%), linear-gradient(160deg, #2c2e34, #17181b);
  box-shadow: 0 0 0 1px rgba(239, 237, 233, .16), 0 8px 18px rgba(0, 0, 0, .4); }
.bx-card .bk::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: var(--sun); }
.bx-card.charge .bk { box-shadow: 0 0 0 1.5px rgb(255 226 184 / .9), 0 8px 18px rgba(0, 0, 0, .4); transition: box-shadow 2.2s ease-in; }
.bx-card .fr { transform: rotateY(180deg); padding: 22px; display: flex; flex-direction: column; gap: 12px; overflow: hidden;
  background: radial-gradient(130% 55% at 50% -8%, rgb(242 192 143 / .26), rgb(242 192 143 / .05) 55%, transparent 75%), linear-gradient(175deg, #2f3036, #1c1d21);
  box-shadow: 0 0 0 1px rgb(227 196 134 / .32), 0 0 44px rgb(242 192 143 / .18), 0 14px 30px rgba(0, 0, 0, .5); }
.bx-card .fr.look { padding: 0; overflow: visible; background: radial-gradient(120% 60% at 20% -10%, rgba(255, 255, 255, .09), transparent 60%), linear-gradient(172deg, #1d1d21 0%, #0e0e10 46%, #08080a 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .11), 0 10px 24px rgba(0, 0, 0, .45); }
.bx-card .fr.look img { position: absolute; left: -5.3%; top: -3.8%; width: 110.7%; height: 107.6%; max-width: none; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.bx-card .sheen { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; pointer-events: none; }
.bx-card .sheen::before { content: ""; position: absolute; top: -20%; bottom: -20%; width: 45%; left: -60%; transform: skewX(-18deg); background: linear-gradient(90deg, transparent, rgba(255, 250, 240, .3), transparent); }
.bx-card.shine .sheen::before { animation: bx-sheen 1.9s cubic-bezier(.45, .05, .25, 1) .1s both; }
@keyframes bx-sheen { to { left: 120%; } }
.bx-card .tagrow { display: flex; justify-content: space-between; align-items: center; }
.bx-card .tg { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink2); }
.bx-card .tg i { width: 9px; height: 9px; border-radius: 3px; }
.bx-card .tg.x { color: var(--gold); }
.bx-card .tg.x i { background: var(--gold); border-radius: 50%; }
.bx-card .nw { font-size: 12px; font-weight: 600; color: var(--gold); }
.bx-card .tk { font-size: 24px; font-weight: 600; line-height: 1.2; }
.bx-card .wy { margin-top: auto; font-size: 12px; line-height: 1.4; color: #8a867f; }

/* words: never scaled, only placed to line up with the scene */
.bx-top { position: absolute; left: 20px; right: 20px; top: calc(var(--oy) + 96px * var(--z)); text-align: center; display: flex; flex-direction: column; gap: 4px; transition: opacity .6s ease; }
.bx-top .lv { font-size: 15px; font-weight: 600; color: var(--gold); }
.bx-top .t { font-size: 22px; font-weight: 600; }
.bx-cap { position: absolute; left: 20px; right: 20px; top: calc(var(--oy) + 680px * var(--z)); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
  opacity: 0; transform: translateY(6px); transition: opacity .7s ease, transform .7s var(--ease); pointer-events: none; }
.bx-cap.on { opacity: 1; transform: none; }
.bx-cap .n { font-size: 22px; font-weight: 600; }
.bx-cap .s { font-size: 15px; color: var(--dim, #a9a59d); }
.bx-dots { display: flex; gap: 6px; margin-top: 6px; }
.bx-dots[hidden] { display: none; }
.bx-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgb(239 237 233 / .16); }
.bx-dots i.on { background: var(--gold); }
.bx-lab { position: absolute; width: 120px; margin-left: -60px; text-align: center; font-size: 13px; color: var(--ink2); line-height: 1.3; opacity: 0; transition: opacity .7s ease .7s; pointer-events: none; }
.bx-lab span { display: block; font-size: 11px; color: var(--dim, #a9a59d); }
.bx-lab.big { width: 240px; margin-left: -120px; font-size: 17px; font-weight: 600; color: var(--ink); }
.bx-lab.big span { font-size: 13px; font-weight: 400; }
.bx.fin .bx-lab { opacity: 1; }
.bx-hint { position: absolute; left: 20px; right: 20px; top: calc(var(--oy) + 724px * var(--z)); text-align: center; font-size: 15px; color: var(--dim, #a9a59d); transition: opacity .5s ease; pointer-events: none; }
.bx-btns { position: absolute; left: 20px; right: 20px; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); display: flex; flex-direction: column; gap: 4px; }
.bx-btns [hidden] { display: none; }
.bx-close { position: absolute; right: 20px; top: calc(env(safe-area-inset-top, 0px) + 12px); }

/* the box's own cards in the draw: Pick my own */
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-list h3 { font-size: 13px; font-weight: 600; color: var(--ink2); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.pick-list h3 i { width: 9px; height: 9px; border-radius: 3px; }
.pick-item { text-align: left; min-height: 52px; padding: 12px 16px; border-radius: 14px; background: rgba(239, 237, 233, .08); font-size: 17px; line-height: 1.3; }
.box-row { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--gold); font-size: 15px; font-weight: 600; }
.box-row .chev { margin-left: auto; color: var(--ink2); }

@media (prefers-reduced-motion: reduce) {
  .bx *, .bx *::before, .bx *::after { animation: none !important; transition-duration: .15s !important; transition-delay: 0s !important; }
}
