/* ───────────────────────── Tokens ───────────────────────── */
:root {
  --bg: #FADDE7;
  --bg-hi: #FDEBF1;
  --wall-l: #F6CAD8;
  --wall-r: #F0B8CB;
  --rim: #FFF3F7;
  --edge: #E6A3BB;
  --tile-line: #F1C6D5;
  --ink: #2B1A2F;
  --ink-2: #86677C;
  --paper: #FFF7FA;
  --accent: #FF4FA3;
  --mint: #4FD6A8;
  --sky: #CFE6FF;

  --px: 'Silkscreen', ui-monospace, monospace;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(16px, 3vw, 40px);
  --top-h: 64px;

  --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill='%232B1A2F' d='M0 0h1v1h1v1h1v1h1v1h1v1h1v1h1v1H5v1h1v1h1v2H5v-1H4V9H3v1H2v1H0z'/%3E%3Cpath fill='%23FFF7FA' d='M1 2h1v1h1v1h1v1h1v1H4v1H3v1H2v1H1z'/%3E%3C/svg%3E") 0 0, auto;
  --cursor-hand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill='%232B1A2F' d='M3 0h2v4h5v1h1v5h-1v2H3v-2H2V9H1V6h2z'/%3E%3Cpath fill='%23FF4FA3' d='M4 1v5h1V5h1v1h1V5h1v1h1V5h1v5H9v1H4v-1H3V9H2V7h1v1h1V1z'/%3E%3C/svg%3E") 6 0, pointer;
}

/* ───────────────────────── Base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; text-size-adjust: 100%; }
body {
  min-height: 100svh;
  font: 400 12px/1.5 var(--mono);
  letter-spacing: .01em;
  background:
    radial-gradient(rgba(43, 26, 47, .07) 1px, transparent 1.5px) 0 0 / 24px 24px,
    var(--bg);
  cursor: var(--cursor);
  overflow-x: hidden;
}
button, a, [role=button] { cursor: var(--cursor-hand); }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px dashed var(--accent); outline-offset: 4px; }

.px { font-family: var(--px); text-transform: uppercase; letter-spacing: .04em; font-weight: 400; }
.mono { font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.muted { color: var(--ink-2); }

/* ───────────────────────── Buttons ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px;
  padding: 0 20px 2px;
  font-size: 13px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: inset 0 2px 0 #fff, inset 0 -3px 0 rgba(43, 26, 47, .12), 0 3px 0 var(--ink);
  transform: translateY(0);
  white-space: nowrap;
}
.btn:hover { background: #fff; }
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 #fff, inset 0 -3px 0 rgba(43, 26, 47, .12), 0 0 0 var(--ink); }
.btn--primary {
  background: var(--ink); color: var(--paper);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .16), inset 0 -3px 0 rgba(0, 0, 0, .4), 0 3px 0 var(--accent);
}
.btn--primary:hover { background: var(--accent); color: var(--ink); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .18), 0 3px 0 var(--ink); }
.btn--primary:active { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .18), 0 0 0 var(--ink); }
.btn:disabled, .btn:disabled:hover {
  background: var(--bg-hi); color: var(--ink-2); border-color: var(--ink-2);
  box-shadow: 0 3px 0 var(--ink-2); transform: none; cursor: not-allowed;
}
.btn--sm { min-height: 36px; padding: 0 12px 2px; font-size: 12px; }
.btn--block { width: 100%; }
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px;
  background: var(--accent); color: var(--ink); border: 2px solid var(--ink); border-radius: 4px; font-size: 11px;
}
.count.bump { animation: bump .3s steps(3); }
@keyframes bump { 50% { transform: translateY(-4px); } }

/* ───────────────────────── Boot ───────────────────────── */
.boot {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .3s steps(3), visibility 0s .3s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot__inner { display: grid; justify-items: center; gap: 12px; font-size: 12px; }
.boot__bar { width: 168px; height: 16px; padding: 2px; border: 2px solid var(--ink); border-radius: 4px; background: var(--paper); }
.boot__bar i {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 10px);
  animation: load .9s steps(16) forwards;
}
@keyframes load { to { width: 100%; } }

/* ───────────────────────── Header ───────────────────────── */
.top {
  position: fixed; inset: 0 0 auto; z-index: 20;
  height: calc(var(--top-h) + env(safe-area-inset-top));
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  background: rgba(250, 221, 231, .72);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}
/* Pixel-dash rule that appears once the page scrolls under the bar. */
.top::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: repeating-linear-gradient(90deg, rgba(43, 26, 47, .25) 0 4px, transparent 4px 8px);
  opacity: 0; transition: opacity .2s steps(2);
}
.top.is-scrolled::after { opacity: 1; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .top { background: rgba(250, 221, 231, .94); }
}
.brand { justify-self: start; display: block; line-height: 0; }
.brand img { height: 34px; width: auto; transition: transform .15s steps(2); }
.brand:hover img { transform: rotate(-3deg) scale(1.04); }
.top__actions { justify-self: end; display: flex; align-items: center; gap: 10px; }

/* ───────────────────────── Drop (hero) ───────────────────────── */
.drop {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: calc(var(--top-h) + 12px) var(--gutter) calc(var(--gutter) + 8px);
}
.drop__tr { grid-area: 1 / 2; justify-self: end; display: grid; justify-items: end; gap: 2px; }
.drop__bl { grid-area: 3 / 1; align-self: end; display: grid; gap: 6px; }
.drop__br { grid-area: 3 / 2; align-self: end; justify-self: end; display: flex; align-items: center; gap: 20px; }
.drop__meta { display: flex; align-items: center; gap: 14px; }
/* "Limited edition" badge above the drop's name (collection title on desktop, product name on phones). */
.drop__badge {
  display: inline-flex; justify-self: start; align-items: center; gap: 8px;
  margin-bottom: 6px; padding: 5px 10px 6px; font-size: 11px;
  background: rgb(62, 224, 208); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 4px; box-shadow: 0 2px 0 var(--ink);
  transform: rotate(-2deg);
}
.drop__badge i { width: 8px; height: 8px; background: var(--accent); border: 2px solid var(--ink); animation: blink 1.2s steps(1) infinite; }
.drop__name { font-size: clamp(20px, 2.6vw, 34px); line-height: 1.05; max-width: 16ch; }
.drop__price { font-size: clamp(16px, 1.6vw, 20px); }
.timer { font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: .08em; }

.status { display: inline-flex; align-items: center; gap: 6px; }
.status i { width: 8px; height: 8px; background: var(--mint); border: 2px solid var(--ink); animation: blink 1.2s steps(1) infinite; }
.status.is-closed i { background: var(--ink-2); animation: none; }
@keyframes blink { 50% { opacity: .2; } }

/* --ar (the room's aspect ratio), --nav-top and --plate-top are set from the room geometry in app.js. */
.stage {
  grid-area: 2 / 1 / 3 / 3;
  align-self: center; justify-self: center;
  position: relative;
  /* Fit to the window height, but never below a readable floor; short windows scroll instead. */
  width: clamp(min(100%, 360px), calc((100svh - 290px) * var(--ar, 1.1538)), min(100%, 760px));
  aspect-ratio: var(--ar, 1.1538);
}
.drop.is-wide .stage {
  width: clamp(min(100%, 640px), calc((100svh - 340px) * var(--ar)), min(100%, 1240px));
  margin-bottom: 84px;
}
.stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.stage svg .ped { cursor: var(--cursor-hand); }
#tileHi { transition: opacity .15s steps(2); pointer-events: none; }

.stage__item {
  position: absolute;
  aspect-ratio: 1;
  transform: translateX(-50%);
  padding: 0; border: 0; background: none;
}
.stage__item.is-out { filter: grayscale(1); opacity: .55; }
/* Stand pieces on their pedestal rather than centring them in the box. */
.stage__item .art img { object-position: 50% 100%; }
.stage__items.enter .stage__item { animation: pop .24s steps(4) both; }
.stage__items.enter .stage__item:nth-child(2) { animation-delay: .05s; }
.stage__items.enter .stage__item:nth-child(3) { animation-delay: .1s; }
.stage__items.enter .stage__item:nth-child(4) { animation-delay: .15s; }
.stage__items.enter .stage__item:nth-child(5) { animation-delay: .2s; }

/* Name plates in front of each pedestal (dressing room only). */
.plates { position: absolute; inset: var(--plate-top) 0 auto; pointer-events: none; }
.plate {
  position: absolute; top: 0;
  display: grid; justify-items: center; gap: 10px;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: auto;
}
.plate__name { font-size: 11px; line-height: 1.3; text-wrap: balance; }
.plate__row { display: flex; align-items: center; gap: 12px; }
.plate .btn { min-height: 34px; padding: 0 14px 2px; font-size: 11px; }

.stage__nav { position: absolute; top: var(--nav-top, 40%); z-index: 2; transform: translateY(-50%); display: none; }
.stage__nav:active { transform: translateY(calc(-50% + 3px)); }
.stage__nav--prev { left: 0; }
.stage__nav--next { right: 0; }
.drop.is-paged .stage__nav { display: inline-flex; }
.pager { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); font-size: 11px; color: var(--ink-2); }
.drop.is-wide .pager { top: calc(100% + 60px); }
.float { position: relative; z-index: 1; display: block; width: 100%; height: 100%; animation: bob 3.2s steps(8) infinite; }

/* Turquoise uplight from inside each drop pedestal: a beam rising behind the piece plus a soft halo. */
:root { --glow: 62, 224, 208; }
.stage__item { isolation: isolate; }
.stage__item::before,
.stage__item::after {
  content: ''; position: absolute; left: 50%; pointer-events: none; z-index: 0;
  animation: glow 3.2s steps(8) infinite;
}
.stage__item::before {
  bottom: -8%; width: 78%; height: 128%;
  transform: translateX(-50%);
  background: linear-gradient(to top, rgba(var(--glow), .5), rgba(var(--glow), .22) 45%, rgba(var(--glow), 0) 92%);
  clip-path: polygon(34% 100%, 66% 100%, 100% 0, 0 0);
  filter: blur(10px);
}
.stage__item::after {
  bottom: 4%; width: 112%; aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(var(--glow), .42), rgba(var(--glow), .16) 60%, rgba(var(--glow), 0));
}
@keyframes glow { 50% { opacity: .78; } }
.stage .lamp { mix-blend-mode: screen; }
@keyframes bob { 50% { transform: translateY(-5%); } }
.stage .shadow { transform-box: fill-box; transform-origin: center; animation: shadow 3.2s steps(8) infinite; }
@keyframes shadow { 50% { transform: scale(.82); opacity: .7; } }

.art { display: block; width: 100%; height: 100%; }
.art img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.sprite { display: block; width: 100%; height: 100%; image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(43, 26, 47, .12)); }

/* Habbo-style name tag */
.tag {
  position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translate(-50%, 4px);
  padding: 5px 9px 6px;
  font-size: 11px; white-space: nowrap;
  background: var(--ink); color: var(--paper); border-radius: 4px;
  opacity: 0; pointer-events: none;
  transition: opacity .15s steps(2), transform .15s steps(2);
}
.tag::after {
  content: ''; position: absolute; left: 50%; top: 100%; margin-left: -4px;
  border: 4px solid transparent; border-top-color: var(--ink);
}
.stage__item:hover .tag, .stage__item:focus-visible .tag,
.item:hover .tag, .item:focus-visible .tag { opacity: 1; transform: translate(-50%, 0); }

.spark {
  position: absolute; left: var(--x); top: var(--y);
  width: 10px; height: 10px; pointer-events: none;
  background:
    linear-gradient(var(--paper), var(--paper)) 4px 0 / 2px 10px no-repeat,
    linear-gradient(var(--paper), var(--paper)) 0 4px / 10px 2px no-repeat;
  filter: drop-shadow(0 0 0 var(--accent));
  animation: twinkle 2.4s steps(1) infinite var(--d);
  opacity: 0;
}
@keyframes twinkle { 0%, 60%, 100% { opacity: 0; } 20% { opacity: 1; transform: scale(1); } 40% { opacity: 1; transform: scale(.6); } }

.drop.is-empty .stage__item, .drop.is-empty .spark { display: none; }
/* Between drops: the mystery box isn't clickable, and the drop's sparkles rest. */
.stage__item.is-mystery { pointer-events: none; }
.drop.is-between .spark { display: none; }
.drop__follow { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.drop__follow:hover { color: var(--accent); }

/* ───────────────────────── Core ───────────────────────── */
.core { padding: clamp(48px, 8vw, 120px) var(--gutter) clamp(64px, 10vw, 140px); }
.rule {
  max-width: 1200px; margin: 0 auto clamp(32px, 5vw, 64px);
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 14px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 4px, transparent 4px 8px) left bottom / 100% 2px no-repeat;
}
.rule h2 { font-size: 12px; }
.grid {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 56px) clamp(16px, 3vw, 40px);
}
.item { all: unset; display: block; width: 100%; cursor: var(--cursor-hand); }
.item:focus-visible { outline: 2px dashed var(--accent); outline-offset: 6px; }
.item__stage { position: relative; aspect-ratio: 1 / 1; }
.item__tile { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; overflow: visible; }
.item__tile .top { fill: var(--bg-hi); transition: fill .15s steps(2); }
.item__tile .hi { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; transition: opacity .15s steps(2); }
.item__tile .shadow { transition: transform .25s steps(3); transform-box: fill-box; transform-origin: center; }
.item:hover .item__tile .top { fill: #fff; }
.item:hover .item__tile .hi { opacity: 1; }
.item:hover .item__tile .shadow { transform: scale(.8); }
.item__art {
  position: absolute; left: 50%; bottom: 24%;
  width: 60%; aspect-ratio: 1;
  transform: translateX(-50%);
  transition: transform .25s steps(3);
}
.item:hover .item__art { transform: translate(-50%, -8%); }
.item__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 16px; }
.item__meta .px { font-size: 12px; }
.item.is-out .item__art { filter: grayscale(1); opacity: .5; }
.item.is-out .item__meta .mono { text-decoration: line-through; }

/* ───────────────────────── Footer ───────────────────────── */
.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px;
  padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  color: var(--ink-2);
}
.foot nav { display: flex; gap: 10px 22px; flex-wrap: wrap; }
.foot a:hover { color: var(--ink); }

/* ───────────────────────── Windows ───────────────────────── */
.win {
  width: min(780px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  margin: auto; padding: 0;
  border: 2px solid var(--ink); border-radius: 8px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 6px 0 var(--ink), 0 40px 80px -30px rgba(43, 26, 47, .45);
  overflow: hidden;
}
.win[open] { display: flex; flex-direction: column; animation: pop .2s steps(4); }
@keyframes pop { from { transform: scale(.94) translateY(8px); opacity: 0; } }
.win::backdrop { background: rgba(250, 221, 231, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.win__bar {
  flex: none;
  display: flex; justify-content: space-between; align-items: center;
  height: 40px; padding: 0 7px 0 14px;
  font-size: 11px;
  border-bottom: 2px solid var(--ink);
  background: repeating-linear-gradient(0deg, var(--bg) 0 2px, var(--bg-hi) 2px 4px);
}
.win__x {
  display: grid; place-items: center;
  width: 26px; height: 26px; padding: 0;
  color: var(--paper); background: var(--accent);
  border: 2px solid var(--ink); border-radius: 4px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), inset 0 -2px 0 rgba(0, 0, 0, .2);
}
.win__x svg { width: 10px; height: 10px; }
.win__x:hover { background: var(--ink); }
.win__body { overflow: auto; overscroll-behavior: contain; }

/* Product window */
.pw {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start;
  background:
    linear-gradient(26.565deg, transparent calc(50% - .75px), var(--tile-line) calc(50% - .75px) calc(50% + .75px), transparent calc(50% + .75px)) 0 0 / 48px 24px,
    linear-gradient(-26.565deg, transparent calc(50% - .75px), var(--tile-line) calc(50% - .75px) calc(50% + .75px), transparent calc(50% + .75px)) 0 0 / 48px 24px,
    var(--bg-hi);
}
/* Photo and thumbnails stay pinned while a long description scrolls beside them. */
.pw__art { position: sticky; top: 0; }
.pw__img { position: relative; aspect-ratio: 1; }
.pw__img > .art, .pw__zoom { position: absolute; inset: 12%; width: auto; height: auto; }
.pw__zoom { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.pw__hint {
  position: absolute; right: -8%; bottom: -10%;
  padding: 5px 8px 6px; font-size: 10px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 4px; box-shadow: 0 2px 0 var(--ink);
  opacity: 0; transition: opacity .15s steps(2);
}
.pw__zoom:hover .pw__hint, .pw__zoom:focus-visible .pw__hint { opacity: 1; }
@media (hover: none) { .pw__hint { opacity: 1; } }
.pw__thumbs { display: flex; gap: 8px; padding: 0 16px 16px; overflow-x: auto; scrollbar-width: none; }
.thumb { flex: none; }
.pw__thumbs:empty { display: none; }
.thumb {
  width: 48px; height: 48px; padding: 4px;
  background: var(--paper); border: 2px solid var(--ink-2); border-radius: 4px;
}
.thumb[aria-pressed=true] { border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.pw__info { display: flex; flex-direction: column; gap: 20px; align-self: stretch; padding: clamp(20px, 3vw, 32px); background: var(--paper); border-left: 2px solid var(--ink); }
.pw__name { font-size: 22px; line-height: 1.05; margin-bottom: 8px; }
/* In the product window the badge shows at every size, for drop pieces only. */
.pw__badge { margin-bottom: 12px; }
.drop.is-empty .drop__badge, .drop__badge[hidden] { display: none; }
.pw__price { font-size: 13px; }
.pw__desc { display: grid; gap: 8px; max-width: 46ch; color: var(--ink-2); font-size: 12px; line-height: 1.6; }
.pw__desc:empty, .pw__info-list:empty { display: none; }
.pw__info-list { border-top: 2px dotted rgba(43, 26, 47, .2); }
.pw__info-list details { border-bottom: 2px dotted rgba(43, 26, 47, .2); }
.pw__info-list summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; font-size: 11px; list-style: none; cursor: var(--cursor-hand);
}
.pw__info-list summary::-webkit-details-marker { display: none; }
.pw__info-list summary::after { content: '+'; font-family: var(--mono); font-size: 14px; }
.pw__info-list details[open] summary::after { content: '−'; }
.pw__info-body { display: grid; gap: 6px; padding: 0 0 14px; color: var(--ink-2); font-size: 11px; line-height: 1.55; }
.pw__desc ul, .pw__info-body ul { display: grid; gap: 4px; }
.pw__desc li::before, .pw__info-body li::before { content: '▪ '; color: var(--accent); }
.pw__desc .head, .pw__info-body .head { margin-top: 6px; font: 11px var(--px); text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.pw__desc .head:first-child, .pw__info-body .head:first-child { margin-top: 0; }
.pw__opts { display: grid; gap: 14px; }
.pw__opts:empty { display: none; }
.opt-group { display: grid; gap: 8px; }
.opt-group > .mono { font-size: 10px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt {
  min-width: 44px; height: 36px; padding: 0 10px 1px;
  font-size: 11px;
  background: var(--paper);
  border: 2px solid var(--ink); border-radius: 4px;
  box-shadow: 0 2px 0 var(--ink);
}
.opt:hover { background: #fff; }
.opt[aria-checked=true] { background: var(--ink); color: var(--paper); }
.opt:disabled { opacity: .35; text-decoration: line-through; box-shadow: none; cursor: not-allowed; }
.opt--swatch { min-width: 36px; padding: 0; background: var(--sw); }
.opt--swatch[aria-checked=true] { background: var(--sw); outline: 2px solid var(--ink); outline-offset: 2px; }
.pw__row { display: flex; gap: 10px; }
.pw__add { flex: 1; }
.pw__stock { min-height: 1.5em; }
.qty {
  display: flex; align-items: center;
  height: 44px;
  border: 2px solid var(--ink); border-radius: 6px; background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
}
.qty span { min-width: 24px; text-align: center; font-size: 13px; }
.qty__b { width: 34px; height: 100%; border: 0; background: none; font: 500 16px/1 var(--mono); }
.qty__b:hover { color: var(--accent); }

/* Bag window */
.win--bag { width: min(460px, calc(100vw - 32px)); }
.bag { padding: 6px 18px; }
.bag:empty::before { content: 'Your bag is empty'; display: block; padding: 40px 0; text-align: center; font: 12px var(--px); text-transform: uppercase; color: var(--ink-2); }
.bag li {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 0;
  border-bottom: 2px dotted rgba(43, 26, 47, .2);
}
.bag__art { width: 56px; height: 56px; padding: 6px; border: 2px solid var(--ink); border-radius: 4px; background: var(--bg-hi); }
.bag__info { display: grid; gap: 4px; min-width: 0; }
.bag__info .px { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bag__end { display: grid; justify-items: end; gap: 6px; }
.bag .qty { height: 30px; box-shadow: none; border-radius: 4px; }
.bag .qty__b { width: 26px; font-size: 14px; }
.bag .qty span { min-width: 18px; font-size: 11px; }
.bag__foot { display: grid; gap: 12px; padding: 18px; border-top: 2px solid var(--ink); background: var(--bg-hi); }
.bag__total { display: flex; justify-content: space-between; font-size: 13px; }
.bag__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bag__meta .bag__note:only-child, .bag__meta:has(.bag__clear[hidden]) .bag__note { margin: 0 auto; }
.bag__note { font-size: 10px; }
.bag__clear { padding: 0; border: 0; background: none; font-size: 10px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.bag__clear:hover { color: var(--accent); }

/* ───────────────────────── Lightbox ───────────────────────── */
.lb {
  width: 100vw; height: 100svh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background:
    radial-gradient(rgba(43, 26, 47, .07) 1px, transparent 1.5px) 0 0 / 24px 24px,
    var(--bg);
  color: var(--ink);
  overflow: hidden;
}
.lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); animation: pop .2s steps(4); }
.lb::backdrop { background: var(--bg); }
.lb__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px; padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  font-size: 12px;
}
.lb__stage { position: relative; display: grid; place-items: center; overflow: hidden; padding: 0 var(--gutter) var(--gutter); }
.lb__stage img {
  max-width: min(100%, 1100px);
  max-height: calc(100svh - 64px - var(--gutter) - env(safe-area-inset-top));
  object-fit: contain;
  cursor: zoom-in; user-select: none; -webkit-user-drag: none; touch-action: pan-y;
  transition: transform .2s steps(4);
}
.lb.is-zoomed .lb__stage img { transform: scale(2.5); cursor: zoom-out; touch-action: none; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb__nav:active { transform: translateY(calc(-50% + 3px)); }
.lb__nav--prev { left: var(--gutter); }
.lb__nav--next { right: var(--gutter); }
.lb.is-single .lb__nav, .lb.is-single #lbCount { visibility: hidden; }
.lb.is-zoomed .lb__nav { opacity: 0; pointer-events: none; }

/* ───────────────────────── Toast bubble ───────────────────────── */
.bubble {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); z-index: 100;
  padding: 10px 14px 11px;
  font-size: 12px;
  background: #fff;
  border: 2px solid var(--ink); border-radius: 8px;
  box-shadow: 0 3px 0 var(--ink);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: opacity .2s steps(2), transform .2s steps(2);
}
.bubble::after {
  content: ''; position: absolute; left: 50%; top: 100%; margin: 1px 0 0 -5px;
  width: 10px; height: 8px; background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.bubble.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  :root { --top-h: 56px; }
  .brand img { height: 28px; }
  .hide-sm { display: none; }
  .top__actions { gap: 8px; }
  .drop { grid-template-rows: auto auto auto auto; min-height: auto; padding-bottom: 24px; gap: 20px; }
  .stage { width: calc(100% + 2 * var(--gutter)); margin: 8px calc(-1 * var(--gutter)) 0; justify-self: stretch; }
  .drop.is-paged .stage { margin-bottom: 20px; }
  .stage__nav--prev { left: var(--gutter); }
  .stage__nav--next { right: var(--gutter); }
  .pager { top: calc(100% + 4px); }
  .drop__bl { grid-area: 3 / 1 / 4 / 3; }
  .drop__br { grid-area: 4 / 1 / 5 / 3; justify-self: stretch; justify-content: space-between; }
  .drop__br .btn { flex: 1; max-width: 220px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .pw { display: block; }
  .lb__stage img { max-height: calc(100svh - 64px - 84px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .lb__stage { padding-bottom: 84px; }
  .lb__nav { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); transform: none; }
  .lb__nav:active { transform: translateY(3px); }
  .pw__art { position: static; border-bottom: 2px solid var(--ink); }
  .pw__info { border-left: 0; }
  .pw__img { position: relative; aspect-ratio: 4 / 3; }
  .pw__img > .art, .pw__zoom { inset: 6% 18%; }
  .pw__hint { right: -14%; bottom: -4%; }
  .win { max-height: calc(100svh - 24px); width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .spark { display: none; }
}
