/* ============================================================
 * C4YOS LAND SHOP — the card shop.
 * Loaded after shop.css on every shop page (body.shop-store). The room is
 * wood: a plank wall with a lamp, a hanging sign, one shelf unit per
 * aisle with cubbies, hanging paper price tags, and the Trader's counter
 * with the notes pinned behind it. shop.css keeps the header, footer,
 * product page, cart drawer and forms.
 * ============================================================ */

.shop-store {
  --wood-1: #a9713f;
  --wood-2: #8a5a34;
  --wood-3: #6b4022;
  --wood-4: #4a2c17;
  --wood-dark: #2a160b;
  --wood-shadow: #1a0e07;
  --room: #2b1a10;
}

/* ---------- the room ---------- */

/* the plank wall is on the page itself (so it covers any page length);
   the fixed layer above only adds the lamp light and the floor shadow */
body.shop-store {
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .16) 0 2px, transparent 2px 172px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .03) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #3d2515 0, var(--room) 900px, #1c110a 100%);
}
.shop-store .shop-sky {
  background:
    radial-gradient(ellipse 46% 26% at 50% -4%, rgba(255, 214, 150, .32), transparent 72%),
    radial-gradient(ellipse 90% 60% at 50% 105%, rgba(0, 0, 0, .5), transparent 70%);
}

/* ---------- the sign over the door ---------- */

.store-front {
  position: relative;
  padding-block: clamp(40px, 5vw, 64px) clamp(16px, 2vw, 28px);
  text-align: center;
}
.store-lamp {
  position: absolute;
  left: 50%;
  top: -30px;
  width: min(720px, 90vw);
  height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 220, 160, .28), rgba(255, 220, 160, .08) 45%, transparent 70%);
  pointer-events: none;
}
.store-sign {
  position: relative;
  display: inline-block;
  padding: clamp(18px, 2.4vw, 30px) clamp(26px, 4vw, 56px) clamp(16px, 2vw, 24px);
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, var(--wood-1), var(--wood-2) 55%, var(--wood-3));
  border: 6px solid var(--wood-dark);
  border-radius: 16px;
  box-shadow: 0 10px 0 var(--wood-shadow), 0 30px 40px -18px rgba(0, 0, 0, .9), inset 0 2px 0 rgba(255, 255, 255, .18);
  rotate: -1.2deg;
}
.store-sign::before,
.store-sign::after {
  content: "";
  position: absolute;
  top: -66px;
  width: 4px;
  height: 66px;
  background: repeating-linear-gradient(180deg, #6f6a62 0 8px, #3d3a35 8px 12px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5);
}
.store-sign::before { left: 12%; }
.store-sign::after { right: 12%; }
.store-sign-logo {
  width: clamp(200px, 26vw, 300px);
  height: auto;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .55));
  rotate: -1deg;
}
.store-sign-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(42px, 6vw, 82px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--gold);
  -webkit-text-stroke: .08em var(--card-black);
  paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--card-black);
  letter-spacing: .02em;
}
.store-sign-sub {
  margin: 8px 0 0;
  font-family: var(--font-hand);
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--paper);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}
.store-lead {
  max-width: 58ch;
  margin: clamp(22px, 3vw, 34px) auto 0;
  font-family: var(--font-hand);
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.45;
  color: var(--paper-dim);
}
.aisle-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
  margin-top: clamp(18px, 2.4vw, 28px);
}
.aisle-chip {
  display: inline-block;
  padding: 10px 16px 7px;
  background: var(--paper);
  color: var(--ink-text);
  border: 3px solid var(--card-black);
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--card-black);
  transition: transform var(--t-hover, .16s) var(--ease-out), box-shadow var(--t-hover, .16s);
}
.aisle-chip:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--card-black); color: var(--ink-text); }
.aisle-chip:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--card-black); }
.aisle-chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- aisles ---------- */

.aisle { padding-block: clamp(28px, 4vw, 52px) clamp(10px, 2vw, 20px); scroll-margin-top: calc(var(--header-h, 80px) + 12px); }
.aisle-sign {
  position: relative;
  display: inline-block;
  margin: 26px 0 22px 14px;
  padding: 14px 24px 11px;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, var(--wood-1), var(--wood-3));
  border: 5px solid var(--wood-dark);
  border-radius: 12px;
  box-shadow: 0 7px 0 var(--wood-shadow), 0 20px 30px -14px rgba(0, 0, 0, .9), inset 0 2px 0 rgba(255, 255, 255, .16);
  rotate: -1.4deg;
}
.aisle-sign::before,
.aisle-sign::after {
  content: "";
  position: absolute;
  top: -30px;
  width: 3px;
  height: 30px;
  background: repeating-linear-gradient(180deg, #6f6a62 0 6px, #3d3a35 6px 9px);
}
.aisle-sign::before { left: 14px; }
.aisle-sign::after { right: 14px; }
.aisle-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--paper);
  -webkit-text-stroke: .07em var(--card-black);
  paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--card-black);
}
.aisle-sub { margin: 5px 0 0; font-family: var(--font-hand); font-size: 16px; line-height: 1.2; color: var(--paper); opacity: .85; }

/* the shelf unit: a wooden frame with cubbies */
.shelf-unit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: clamp(16px, 2vw, 26px);
  padding: clamp(16px, 2.4vw, 30px);
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, var(--wood-2), var(--wood-3) 60%, var(--wood-4));
  border: 14px solid var(--wood-dark);
  border-radius: 18px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .06), 0 18px 0 var(--wood-shadow), 0 50px 70px -30px rgba(0, 0, 0, .95);
}
.shelf-unit--related { margin-top: 6px; }

.cubby { display: flex; flex-direction: column; min-width: 0; }
.cubby-box {
  position: relative;
  aspect-ratio: 1 / 1.04;
  border-radius: 10px;
  background: radial-gradient(ellipse 80% 60% at 50% 18%, #4f311b, #1c1009 78%);
  box-shadow: inset 0 22px 34px rgba(0, 0, 0, .75), inset 0 -8px 0 rgba(0, 0, 0, .45), inset 0 0 0 3px var(--wood-dark);
}
/* the board the product stands on */
.cubby-box::after {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  bottom: -11px;
  height: 17px;
  background: linear-gradient(180deg, #d3a06a, #a9713f 45%, #6b4022);
  border: 3px solid var(--wood-dark);
  border-radius: 4px;
  box-shadow: 0 9px 12px rgba(0, 0, 0, .6), inset 0 2px 0 rgba(255, 255, 255, .25);
}
.cubby-art {
  position: absolute;
  inset: 12px 8px 4px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 8px;
}
.cubby-art:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.cubby-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 16px 14px rgba(0, 0, 0, .6));
  transition: transform .3s var(--ease-out);
}
.cubby-img.fit-cover { object-fit: cover; height: 100%; border-radius: 8px; }
.cubby:hover .cubby-img { transform: translateY(-10px) scale(1.05); }
/* the sticker sits low on the right, above the board, clear of the tag */
.cubby-box .stamp { position: absolute; right: -6px; bottom: 22px; top: auto; z-index: 3; font-size: 12px; padding-inline: 8px; rotate: -4deg; }

/* hanging paper tag: just the price, the name is right below the shelf */
.price-tag {
  position: absolute;
  left: 12px;
  top: 2px;
  z-index: 3;
  max-width: 46%;
  padding: 16px 9px 7px;
  background: var(--paper);
  border: 2.5px solid var(--card-black);
  border-radius: 6px 6px 9px 9px;
  box-shadow: 0 4px 0 var(--card-black), 0 12px 14px -6px rgba(0, 0, 0, .6);
  text-align: center;
  rotate: -7deg;
  transform-origin: 50% -20px;
}
.price-tag::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--wood-dark);
  box-shadow: inset 0 0 0 2px var(--card-black);
}
.price-tag::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -22px;
  width: 2px;
  height: 24px;
  background: #d9d2c3;
}
.price-tag-name { display: none; }
.price-tag-price { display: block; font-family: var(--font-hand); font-size: 14px; line-height: 1.12; color: var(--ink-text); }
.cubby:hover .price-tag { animation: tag-swing 1.3s ease-in-out; }
@keyframes tag-swing {
  0% { rotate: -7deg; }
  30% { rotate: 5deg; }
  60% { rotate: -4deg; }
  100% { rotate: -7deg; }
}

.cubby-foot { padding: 22px 4px 2px; }
.cubby-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--paper);
  -webkit-text-stroke: .06em var(--card-black);
  paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--card-black);
}
.cubby-name a { color: inherit; text-decoration: none; }
.cubby-name a:hover { color: var(--gold); }
.cubby-tagline { margin: 6px 0 0; font-family: var(--font-hand); font-size: 16px; line-height: 1.35; color: var(--paper-dim); }
.cubby-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; margin-top: 12px; }
.cubby-price { font-family: var(--font-display); font-size: 20px; line-height: 1; color: var(--gold); text-shadow: 0 2px 0 var(--card-black); }
/* without a real price the hanging tag already says it: nothing to repeat here */
.cubby-price.is-note { display: none; }

/* ---------- the counter ---------- */

.counter { padding-block: clamp(36px, 5vw, 64px) clamp(56px, 7vw, 96px); }
.counter-heading { text-align: center; margin-bottom: clamp(18px, 2.4vw, 28px); }
.counter-wall {
  position: relative;
  padding: clamp(18px, 2.6vw, 32px) clamp(14px, 2vw, 28px) clamp(22px, 3vw, 36px);
  background:
    radial-gradient(circle at 20% 30%, rgba(0, 0, 0, .08) 0 1px, transparent 2px) 0 0 / 7px 7px,
    linear-gradient(180deg, #b58a5c, #9c7148);
  border: 12px solid var(--wood-dark);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .35);
}
.counter-notes-label { margin: 0 0 14px; font-family: var(--font-hand); font-size: 16px; color: #3a2a1a; text-align: center; }
.counter-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: clamp(14px, 2vw, 22px); margin: 0; }
.note {
  position: relative;
  padding: 28px 18px 18px;
  background: var(--paper);
  color: var(--ink-text);
  border: 2px solid var(--card-black);
  box-shadow: 0 10px 16px -6px rgba(0, 0, 0, .55);
}
.note::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a78, var(--red) 65%);
  border: 2px solid var(--card-black);
  box-shadow: 0 3px 3px rgba(0, 0, 0, .4);
}
.note--1 { rotate: -2deg; } .note--2 { rotate: 1.5deg; } .note--3 { rotate: -1deg; } .note--4 { rotate: 2deg; }
.note dt { margin: 0 0 6px; font-family: var(--font-display); font-size: 18px; line-height: 1; text-transform: uppercase; }
.note dd { margin: 0; font-family: var(--font-hand); font-size: 16px; line-height: 1.4; color: var(--ink-secondary); }
.counter-desk {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
  align-items: end;
  gap: clamp(16px, 3vw, 36px);
  padding: clamp(16px, 2.4vw, 28px) clamp(18px, 3vw, 36px) clamp(22px, 3vw, 34px);
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, var(--wood-1), var(--wood-2) 50%, var(--wood-3));
  border: 12px solid var(--wood-dark);
  border-radius: 0 0 18px 18px;
  box-shadow: 0 18px 0 var(--wood-shadow), 0 50px 70px -30px rgba(0, 0, 0, .95), inset 0 3px 0 rgba(255, 255, 255, .2);
}
.counter-trader { margin: 0; position: relative; }
.counter-trader img { display: block; width: 100%; height: auto; margin-top: -60px; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .55)); }
.counter-says {
  position: relative;
  margin: 8px 0 0;
  padding: 10px 14px 8px;
  background: var(--paper);
  color: var(--ink-text);
  border: 3px solid var(--card-black);
  border-radius: 10px;
  font-family: var(--font-hand);
  font-size: 17px;
  line-height: 1.3;
  box-shadow: 0 4px 0 var(--card-black);
  rotate: -1.5deg;
}
.counter-says::before {
  content: "";
  position: absolute;
  left: 40px;
  top: -14px;
  width: 20px;
  height: 20px;
  background: var(--paper);
  border-left: 3px solid var(--card-black);
  border-top: 3px solid var(--card-black);
  transform: rotate(45deg);
}
.counter-actions { display: flex; flex-wrap: wrap; gap: 14px; padding-bottom: 6px; }

/* ---------- product pages in the room ---------- */

.shop-store .gallery--preview { --field-color: #1d120b; }
.shop-store .gallery--preview .gallery-stage { background: radial-gradient(ellipse 80% 60% at 50% 22%, #4f311b, #1c1009 80%); }
.shop-store .gallery--preview .gallery-img.fit-contain { padding: 6%; }
.shop-store .gallery--preview .gallery-thumb { background: #1d120b; }
.pdp-preview {
  margin: 10px 0 0;
  padding: 8px 12px 7px;
  font-family: var(--font-hand);
  font-size: 15px;
  line-height: 1.35;
  color: var(--paper-dim);
  background: rgba(0, 0, 0, .35);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
}
.shop-store .related .shelf-unit { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

/* ---------- phones ---------- */

@media (max-width: 760px) {
  .counter-desk { grid-template-columns: 1fr; }
  .counter-trader { max-width: 240px; margin-inline: auto; }
  .counter-actions { justify-content: center; }
  .counter-actions .btn { flex: 1 1 100%; }
}
@media (max-width: 640px) {
  .store-sign { padding: 16px 20px 14px; }
  .store-sign::before { left: 10%; } .store-sign::after { right: 10%; }
  .store-sign-title { font-size: clamp(38px, 11vw, 48px); }
  .aisle-sign { margin: 22px 0 18px 6px; padding: 10px 16px 8px; }
  .shelf-unit { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; border-width: 9px; border-radius: 14px; }
  .cubby-box { border-radius: 8px; }
  .cubby-art { inset: 12px 8px 6px; }
  .cubby-box::after { left: -5px; right: -5px; height: 13px; bottom: -8px; }
  .price-tag { left: 6px; max-width: 54%; padding: 13px 6px 5px; }
  .price-tag-price { font-size: 12px; }
  .cubby-box .stamp { font-size: 10px; right: -4px; bottom: 16px; }
  .cubby-foot { padding: 16px 2px 0; }
  .cubby-name { font-size: 16px; }
  .cubby-tagline { font-size: 14px; line-height: 1.3; }
  .cubby-actions { margin-top: 10px; }
  .cubby-actions .btn { width: 100%; display: flex; }
  .cubby-price { font-size: 17px; }
  .counter-wall, .counter-desk { border-width: 8px; }
  .shop-store .related .shelf-unit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .cubby:hover .price-tag { animation: none; }
  .cubby:hover .cubby-img { transform: none; }
}

/* ============================================================
 * THE CABINET (shop-front.js) — the painted shop scene
 * The scene image is the page. Each compartment has an interior (dark box),
 * the product, and a "door": a window onto the same scene image, so closed
 * it is pixel-identical to the painting and lifts up (hinged at the top)
 * on hover, focus, or while its card is open. The drawers open by fading
 * in the crop of the second painting.
 * ============================================================ */

.shop-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shop-cabinet-page .site-footer { margin-top: 0; }
.shop-cabinet-page .site-footer::before { display: none; } /* the footer's notch would poke into the drawers */
.shop-cabinet-page .shop-sky { background: #1d120b; }
/* The scene COVERS the space under the header: wider screens lose a bit of
   ceiling (the scene is bottom-aligned so the drawers always stay on screen),
   narrower ones lose a bit of the room at the sides. */
.cabinet-wrap { position: relative; }
.cabinet-scroller {
  position: relative;
  height: calc(100vh - var(--header-h, 76px));
  height: calc(100svh - var(--header-h, 76px));
  overflow: hidden;
}
/* the same painting, blurred and darkened, continues the room behind the cabinet */
.cabinet-scroller::before {
  content: "";
  position: absolute;
  inset: -40px;
  background: url("assets/web/shop/cabinet-scene-v3-1200.webp") center / cover no-repeat;
  filter: blur(22px) brightness(.5);
  display: none;
}
.cabinet {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, calc((100vh - var(--header-h, 76px)) * 2000 / 1116));
  width: min(100%, calc((100svh - var(--header-h, 76px)) * 2000 / 1116));
  box-shadow: 0 0 60px rgba(0, 0, 0, .6);
  aspect-ratio: 2000 / 1116;
  user-select: none;
  -webkit-user-select: none;
  background: #1d120b;
}
.cabinet-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
/* the wider painting continues the room behind the sharp scene; the scene's own edges fade into it */
.cabinet-pano { position: absolute; height: auto; max-width: none; pointer-events: none; filter: brightness(.9); }
.cabinet-img:not(.cabinet-img--open) { -webkit-mask-image: linear-gradient(90deg, transparent 4.6%, #000 6.4%, #000 94.6%, transparent 96.4%), linear-gradient(180deg, transparent .4%, #000 3.2%, #000 100%); mask-image: linear-gradient(90deg, transparent 4.6%, #000 6.4%, #000 94.6%, transparent 96.4%), linear-gradient(180deg, transparent .4%, #000 3.2%, #000 100%); -webkit-mask-composite: source-in; mask-composite: intersect; }
.cabinet-deco { position: absolute; object-fit: contain; pointer-events: none; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .6)); }
/* the drawers slide out: the open painting is revealed from the counter's edge
   downwards while it moves out, then settles; closing pushes it back in */
.cabinet-img--open {
  inset: auto;
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transform: translateY(-7%) scaleY(.92);
  transform-origin: 50% 0;
  transition: clip-path .32s cubic-bezier(.6, 0, .4, 1), transform .32s cubic-bezier(.6, 0, .4, 1), opacity .18s .1s;
}
.cabinet-img--open.is-on {
  opacity: 1;
  clip-path: inset(0);
  transform: none;
  transition: clip-path .48s cubic-bezier(.3, .9, .3, 1.08), transform .52s cubic-bezier(.3, 1.3, .4, 1), opacity .12s;
}
/* while they slide, the drawer fronts throw a growing shadow onto the cupboard below */
.drawer::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -10%;
  height: 22%;
  background: radial-gradient(ellipse at 50% 0%, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0) 70%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.drawer-open .drawer::after { opacity: 1; }

/* compartments */
.slot {
  position: absolute;
  display: block;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  perspective: 900px;
}
.slot--empty, .slot--deco { cursor: default; pointer-events: none; }
.slot:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.interior {
  position: absolute;
  inset: 12% 12% 15%;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 30%),
    linear-gradient(180deg, #3a2314, #24150b 70%, #17100a);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .5), inset 0 -6px 10px rgba(0, 0, 0, .5);
}
.interior::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9%; background: linear-gradient(180deg, #7a4d2a, #4a2c17); box-shadow: 0 -2px 4px rgba(0, 0, 0, .5); }
.slot-product {
  position: absolute;
  left: 15%;
  bottom: 17%;
  width: 70%;
  height: 66%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 5px 4px rgba(0, 0, 0, .6));
  transition: transform .3s var(--ease-out);
  pointer-events: none;
}
.door {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform-origin: 50% 0;
  transform: rotateX(0deg);
  /* closing: drops back and settles */
  transition: transform .38s cubic-bezier(.55, 0, .35, 1.25), box-shadow .3s, opacity .3s;
  backface-visibility: hidden;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  pointer-events: none;
  /* the glass is see-through: the frame is pixel-identical to the painting below, so only
     the pane area changes and the product shows through the painted reflections */
  opacity: .58;
}
.door img { position: absolute; max-width: none; height: auto; pointer-events: none; }
/* a glare that sweeps across the glass while the door swings */
.door::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 236, 200, .55) 46%, rgba(255, 236, 200, .1) 52%, transparent 60%);
  transform: translateX(-120%);
  opacity: 0;
}
/* the lamp light falls into the compartment once the door is up */
.interior::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 0%, rgba(255, 214, 150, .55), rgba(255, 214, 150, 0) 70%);
  opacity: 0;
  transition: opacity .35s;
}
/* the open door casts a shadow band on the back wall */
.slot::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 12%;
  height: 22%;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.slot:hover .door, .slot:focus-visible .door, .slot.is-open .door {
  opacity: 1;
  animation: door-open .62s cubic-bezier(.35, .9, .3, 1) both;
  box-shadow: 0 34px 22px -12px rgba(0, 0, 0, .65);
}
.slot:hover .door::after, .slot:focus-visible .door::after, .slot.is-open .door::after { animation: door-glare .5s ease-out both; }
.slot:hover .interior::before, .slot:focus-visible .interior::before, .slot.is-open .interior::before,
.slot:hover::before, .slot:focus-visible::before, .slot.is-open::before { opacity: 1; }
.slot:hover .slot-product, .slot:focus-visible .slot-product, .slot.is-open .slot-product { animation: product-rise .55s cubic-bezier(.3, 1.2, .4, 1) .08s both; }
@keyframes door-open {
  0% { transform: rotateX(0deg); }
  62% { transform: rotateX(-92deg); }
  80% { transform: rotateX(-76deg); }
  100% { transform: rotateX(-84deg); }
}
@keyframes door-glare {
  0% { opacity: 0; transform: translateX(-120%); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateX(120%); }
}
@keyframes product-rise {
  0% { transform: translateY(0) scale(1); }
  60% { transform: translateY(-9%) scale(1.16); }
  100% { transform: translateY(-6%) scale(1.13); }
}
.slot.is-taken .slot-product { opacity: .6; filter: grayscale(.4); }
/* figurines are tall: let them stand in the whole compartment height */
.slot[data-product^="figure-"] .slot-product { bottom: 13%; height: 76%; }
.slot.is-taken::after {
  content: "✓";
  position: absolute;
  right: 6%;
  top: 8%;
  z-index: 3;
  width: 18%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  color: var(--card-black);
  border: 2px solid var(--card-black);
  font: 700 .85em/1.35 var(--font-hand);
  text-align: center;
}
.slot-tag {
  position: absolute;
  left: 50%;
  bottom: 100%;
  z-index: 3;
  transform: translate(-50%, 6px) rotate(-3deg);
  padding: 6px 9px 4px;
  background: var(--paper);
  color: var(--ink-text);
  border: 2px solid var(--card-black);
  border-radius: 5px;
  box-shadow: 0 3px 0 var(--card-black);
  font-family: var(--font-hand);
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s var(--ease-out);
}
.slot-tag::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; margin-left: -5px; background: var(--paper); border-right: 2px solid var(--card-black); border-bottom: 2px solid var(--card-black); transform: rotate(45deg); }
.slot:hover .slot-tag, .slot:focus-visible .slot-tag { opacity: 1; transform: translate(-50%, -2px) rotate(-3deg); }
.is-dragging .slot-tag { opacity: 0 !important; }

/* decorations behind glass */
.slot-deco-card { position: absolute; bottom: 12%; width: 38%; height: auto; border-radius: 4px; box-shadow: 0 3px 4px rgba(0, 0, 0, .5); }
.slot-deco-card--1 { left: 16%; rotate: -8deg; }
.slot-deco-card--2 { left: 44%; rotate: 6deg; bottom: 14%; }
.slot-sign { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-6deg); padding: 4px 8px 2px; background: var(--paper); border: 2px solid var(--card-black); border-radius: 4px; font-family: var(--font-display); font-size: 12px; text-transform: uppercase; color: var(--ink-text); box-shadow: 0 2px 0 var(--card-black); }

/* drawers */
.drawer {
  position: absolute;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 4%;
  margin: 0;
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.drawer-label {
  padding: 5px 10px 3px;
  background: rgba(255, 246, 227, .92);
  color: var(--ink-text);
  border: 2px solid var(--card-black);
  border-radius: 5px;
  box-shadow: 0 3px 0 var(--card-black);
  font-family: var(--font-display);
  font-size: clamp(10px, 1.1vw, 14px);
  line-height: 1;
  text-transform: uppercase;
  transition: transform .18s var(--ease-out), opacity .18s;
}
.drawer:hover .drawer-label, .drawer:focus-visible .drawer-label, .drawer.is-over .drawer-label { transform: translateY(-3px); }
.drawer.is-over .drawer-label { background: var(--gold); }
.drawer:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.drawer-count {
  position: absolute;
  right: 4%;
  top: 8%;
  min-width: 22px;
  height: 22px;
  padding: 3px 6px 0;
  border-radius: 11px;
  background: var(--red);
  color: var(--paper);
  border: 2px solid var(--card-black);
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 15px;
  text-align: center;
}
.drawer-items { position: absolute; inset: 6% 8% 40%; pointer-events: none; }
.drawer-item { position: absolute; bottom: 0; width: 22%; height: auto; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55)); opacity: 0; transform: translateY(40%) scale(.8); transition: opacity .2s, transform .25s cubic-bezier(.6, 0, .4, 1); }
/* the items ride out with the drawer, one after the other */
.drawer-open .drawer-item { opacity: 1; transform: none; transition: opacity .2s .2s, transform .45s cubic-bezier(.3, 1.4, .4, 1) .2s; }
.drawer-open .drawer-item--2 { transition-delay: .26s; } .drawer-open .drawer-item--3 { transition-delay: .32s; }
.drawer-open .drawer-item--4 { transition-delay: .38s; } .drawer-open .drawer-item--5 { transition-delay: .44s; } .drawer-open .drawer-item--6 { transition-delay: .5s; }
.drawer-item--1 { left: 0; rotate: -8deg; } .drawer-item--2 { left: 14%; rotate: 5deg; } .drawer-item--3 { left: 29%; rotate: -4deg; }
.drawer-item--4 { left: 44%; rotate: 7deg; } .drawer-item--5 { left: 58%; rotate: -6deg; } .drawer-item--6 { left: 70%; rotate: 4deg; }
.drawer-open .drawer[data-drawer="inventory"] .drawer-label { opacity: 0; }
.drawer.is-bump .drawer-label { animation: drawer-bump .45s var(--ease-deal); }
@keyframes drawer-bump { 0% { transform: translateY(0); } 35% { transform: translateY(-8px) scale(1.08); } 100% { transform: translateY(0); } }
.is-dragging .drawer[data-drawer="inventory"]::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 3px dashed var(--gold);
  border-radius: 8px;
  animation: drawer-pulse 1s ease-in-out infinite;
}
@keyframes drawer-pulse { 50% { opacity: .35; } }

.cabinet-ghost { position: fixed; z-index: 400; object-fit: contain; pointer-events: none; filter: drop-shadow(0 18px 16px rgba(0, 0, 0, .6)); }
.cabinet-ghost.is-dragging { transform: scale(1.12) rotate(-4deg); }

/* the hint floats over the left cupboard door */
.cabinet-hint { position: absolute; left: 16px; bottom: 14px; z-index: 5; margin: 0; max-width: min(34%, 360px); font-family: var(--font-hand); font-size: 14px; line-height: 1.3; pointer-events: none; }
.cabinet-hint-text { display: inline-block; padding: 8px 12px 6px; background: rgba(0, 0, 0, .6); border-radius: 12px; color: var(--paper); }
.cabinet-hint-swipe { display: none; }
/* phones: the drawer may be off-screen while dragging, so a drop zone sits at the bottom of the screen */
.drop-zone { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 350; padding: 18px 16px 15px; background: var(--paper); color: var(--ink-text); border: 4px dashed var(--card-black); border-radius: 14px; font-family: var(--font-display); font-size: 20px; line-height: 1; text-transform: uppercase; text-align: center; box-shadow: 0 8px 0 var(--card-black), 0 30px 40px -20px #000; }
.drop-zone[hidden] { display: none; }
.drop-zone.is-over { background: var(--gold); border-style: solid; }
@media (min-width: 641px) { .drop-zone { display: none !important; } }

/* the product card in front of the cabinet */
.cabinet-card { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 6, 3, .72); opacity: 0; transition: opacity .2s; }
.cabinet-card[hidden], .inventory-panel[hidden], .drawer-count[hidden], .inventory-empty[hidden] { display: none; }
.cabinet-card.is-open { opacity: 1; }
.cabinet-card-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(16px, 3vw, 32px);
  width: min(760px, 100%);
  padding: clamp(18px, 3vw, 30px);
  background: var(--paper);
  color: var(--ink-text);
  border: 5px solid var(--card-black);
  border-radius: 18px;
  box-shadow: 0 12px 0 var(--card-black), 0 60px 80px -30px #000;
  transform: translateY(24px) rotate(-1deg);
  transition: transform .26s var(--ease-deal);
}
.cabinet-card.is-open .cabinet-card-inner { transform: none; }
.cabinet-card-close { position: absolute; right: -14px; top: -14px; width: 44px; height: 44px; background: var(--paper); border: 4px solid var(--card-black); border-radius: 50%; font: 28px/1 var(--font-display); color: var(--ink-text); cursor: pointer; box-shadow: 0 4px 0 var(--card-black); }
.cabinet-card-art { aspect-ratio: 1; border-radius: 12px; background: radial-gradient(ellipse 80% 60% at 50% 22%, #4f311b, #1c1009 80%); border: 4px solid var(--card-black); display: grid; place-items: center; }
.cabinet-card-art img { width: 90%; height: 90%; object-fit: contain; filter: drop-shadow(0 16px 14px rgba(0, 0, 0, .6)); }
.cabinet-card-info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.cabinet-card-info .stamp { position: static; font-size: 12px; }
.cabinet-card-name { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 3vw, 34px); line-height: 1; text-transform: uppercase; }
.cabinet-card-tagline { margin: 0; font-family: var(--font-hand); font-size: 18px; line-height: 1.35; color: var(--ink-secondary); }
.cabinet-card-price { margin: 4px 0 0; padding: 8px 12px 6px; background: #fff; border: 2px solid var(--card-black); border-radius: 6px; box-shadow: 0 3px 0 var(--card-black); font-family: var(--font-hand); font-size: 17px; rotate: -2deg; }
.cabinet-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 10px; }
.cabinet-card-actions .btn:disabled { opacity: .6; cursor: default; }

/* the inventory list */
.inventory-panel { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 6, 3, .72); opacity: 0; transition: opacity .2s; }
.inventory-panel.is-open { opacity: 1; }
.inventory-paper { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 20px 22px 22px; background: var(--paper); color: var(--ink-text); border: 4px solid var(--card-black); border-radius: 14px; box-shadow: 0 10px 0 var(--card-black), 0 40px 60px -30px #000; rotate: -.6deg; }
.inventory-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inventory-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1; text-transform: uppercase; }
.inventory-close { width: 40px; height: 40px; background: #fff; border: 3px solid var(--card-black); border-radius: 50%; font: 24px/1 var(--font-display); cursor: pointer; box-shadow: 0 3px 0 var(--card-black); }
.inventory-empty { margin: 14px 0 0; font-family: var(--font-hand); font-size: 17px; color: var(--ink-secondary); }
.inventory-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.inv-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: #fff; border: 2px solid var(--card-black); border-radius: 8px; }
.inv-item img { width: 56px; height: 56px; object-fit: contain; }
.inv-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inv-item-text a { font-family: var(--font-display); text-transform: uppercase; font-size: 15px; color: var(--ink-text); text-decoration: none; }
.inv-item-text small { font-family: var(--font-hand); font-size: 14px; color: #6d6047; }
.inv-remove { width: 34px; height: 34px; background: var(--paper); border: 2px solid var(--card-black); border-radius: 50%; font: 20px/1 var(--font-display); cursor: pointer; }
.inventory-checkout { margin: 16px 0 0; padding: 10px 12px; background: rgba(0, 0, 0, .05); border-left: 4px solid var(--gold); border-radius: 6px; font-family: var(--font-hand); font-size: 16px; line-height: 1.4; }
.inventory-checkout.is-flash { animation: note-flash .8s ease; }
@keyframes note-flash { 30% { background: rgba(255, 198, 41, .45); } }
.inventory-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

@media (max-width: 640px) {
  /* phones: swipeable strip again, the hint under it */
  .cabinet-scroller { height: auto; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .cabinet-scroller::-webkit-scrollbar { display: none; }
  .cabinet { position: relative; left: auto; bottom: auto; transform: none; width: 900px; }
  .cabinet-hint { position: static; max-width: none; padding: 10px 12px 14px; text-align: center; background: #1d120b; }
  .cabinet-hint-swipe { display: inline; }
  .cabinet-card-inner { grid-template-columns: 1fr; padding: 16px; }
  .cabinet-card-art { max-width: 60%; margin-inline: auto; }
  .cabinet-card-close { right: -8px; top: -8px; }
  .cabinet-card-actions .btn, .inventory-actions .btn { flex: 1 1 100%; display: flex; }
}
@media (hover: none) {
  /* touch: the door only lifts while the card is open */
  .slot:hover .door { animation: none; box-shadow: none; opacity: .58; }
  .slot:hover .door::after, .slot:hover .slot-product { animation: none; }
  .slot:hover .interior::before, .slot:hover::before { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .door, .slot-product, .slot-tag, .drawer-label, .cabinet-card, .cabinet-card-inner, .cabinet-img--open, .drawer-item, .interior::before, .slot::before { transition: none; }
  .slot:hover .door, .slot:focus-visible .door, .slot.is-open .door { animation: none; transform: rotateX(-84deg); }
  .slot:hover .door::after, .slot:focus-visible .door::after, .slot.is-open .door::after { animation: none; }
  .slot:hover .slot-product, .slot:focus-visible .slot-product, .slot.is-open .slot-product { animation: none; transform: translateY(-6%) scale(1.13); }
  .drawer.is-bump .drawer-label, .is-dragging .drawer[data-drawer="inventory"]::before { animation: none; }
}
