/* MelonVault storefront styles.
 *
 * Mobile first. Every value comes from tokens.css; the only literals here
 * are structural (grid tracks, aspect ratios, 0/100%).
 *
 *   1. Base            5. Catalog            9. Legal / FAQ / support
 *   2. Layout          6. Product page      10. Giveaways
 *   3. Components      7. Reviews           11. Motion preferences
 *   4. Home            8. Checkout
 */

/* ============================================================
   1. Base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: var(--weight-regular) var(--text-base) / var(--leading-body) var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.panel-open { overflow: hidden; }
/* The header is injected by app.js and fixed to the top. Its height is
   reserved here, in CSS, so the page is already in its final position before
   the script runs. The admin page does not load this file. */
body { padding-top: calc(var(--header-h) + var(--border)); }

[hidden] { display: none !important; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-md); line-height: var(--leading-snug); }
h4 { font-size: var(--text-base); line-height: var(--leading-snug); }

p { margin: 0 0 var(--space-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: var(--border); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-strong); text-decoration-thickness: var(--border-thick); }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

code, kbd, .mono { font-family: var(--font-mono); font-size: 0.95em; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus { outline: none; }
:focus-visible {
  outline: var(--border-thick) solid var(--accent);
  outline-offset: var(--border-thick);
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-4); top: var(--space-2); z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  background: var(--accent); color: var(--accent-ink);
  font-weight: var(--weight-bold); border-radius: var(--radius-sm);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--accent-ink); }

/* ============================================================
   2. Layout
   ============================================================ */

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.page { flex: 1; padding-bottom: var(--section-gap); }
.page > * + .section { margin-top: var(--section-gap); }
.page > * + .section--tight { margin-top: var(--space-6); }

.section--band {
  padding-block: var(--space-8);
  background: var(--surface-1);
  border-block: var(--border) solid var(--line);
}

.sec-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  margin-bottom: var(--space-5);
}
.sec-head p { margin: var(--space-2) 0 0; color: var(--text-muted); max-width: var(--maxw-prose); }

/* A small label above a heading. The square is the site's "pixel". */
.eyebrow {
  display: flex; align-items: center; gap: var(--space-2);
  margin: 0 0 var(--space-3);
  color: var(--accent);
  font-size: var(--text-sm); font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
}
.eyebrow::before {
  content: ""; width: var(--space-2); height: var(--space-2);
  background: currentColor; flex: none;
}

.lede { color: var(--text-muted); font-size: var(--text-md); max-width: var(--maxw-prose); }

.text-link {
  display: inline-flex; align-items: center; gap: var(--space-1);
  min-height: var(--tap);
  font-weight: var(--weight-bold); color: var(--accent);
  text-decoration: underline;
}

.page-head { padding-block: var(--space-5) var(--space-6); }
.page-head h1 { margin-bottom: var(--space-3); }
.page-head .lede { margin: 0; }

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
  margin: 0 0 var(--space-4); padding: 0; list-style: none;
  color: var(--text-dim); font-size: var(--text-sm);
}
.crumbs a { color: var(--text-muted); padding-block: var(--space-2); }
/* Pages with no page-head (the product page) still need air under the header. */
.page > nav:first-child { padding-top: var(--space-5); }
.crumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--line-strong); }
.crumbs [aria-current] { color: var(--text); }

/* ---------- header ---------- */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-header);
  background: var(--bg);
  border-bottom: var(--border) solid var(--line);
}
.site-header__in { display: flex; align-items: center; gap: var(--space-3); height: var(--header-h); }

.brand {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: var(--tap);
  font: var(--weight-display) var(--text-lg) / 1 var(--font-display);
  letter-spacing: var(--tracking-display);
  text-decoration: none; color: var(--text);
  margin-right: auto;
}
.brand:hover { color: var(--text); }
.brand__mark { width: var(--space-6); height: var(--space-6); image-rendering: pixelated; }

.site-nav { display: none; align-items: center; gap: var(--space-1); }
.site-nav a {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: var(--tap); padding-inline: var(--space-3);
  color: var(--text-muted); text-decoration: none; font-weight: var(--weight-medium);
  border-radius: var(--radius-sm);
}
.site-nav a:hover { color: var(--text); background: var(--surface-1); }
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: var(--space-1);
  height: var(--border-thick); background: var(--accent);
}
.nav-dot { width: var(--space-2); height: var(--space-2); background: var(--accent); flex: none; }

.site-header__actions { display: flex; align-items: center; gap: var(--space-2); }
.site-header .header-discord { display: none; }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: var(--tap); height: var(--tap); flex: none;
  background: transparent; color: var(--text);
  border: var(--border) solid var(--line-strong); border-radius: var(--radius-sm);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-control); }
.cart-count {
  position: absolute; top: calc(-1 * var(--space-1)); right: calc(-1 * var(--space-1));
  min-width: var(--space-5); height: var(--space-5); padding-inline: var(--space-1);
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font: var(--weight-bold) var(--text-xs) / 1 var(--font-mono);
  border-radius: var(--radius-sm);
}

/* Signed-in Discord account (giveaways only). <details> gives keyboard and
   Escape handling for free. */
.acct { position: relative; }
.acct > summary {
  display: flex; align-items: center; gap: var(--space-2);
  min-height: var(--tap); padding-inline: var(--space-2);
  list-style: none; cursor: pointer;
  border: var(--border) solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
}
.acct > summary::-webkit-details-marker { display: none; }
.acct > summary img { width: var(--space-5); height: var(--space-5); border-radius: var(--radius-sm); }
.acct-name { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: var(--z-header);
  width: min(18rem, calc(100vw - 2 * var(--gutter)));
  padding: var(--space-4);
  background: var(--surface-2); border: var(--border) solid var(--line-strong);
  border-radius: var(--radius-md); box-shadow: var(--shadow-float);
  font-size: var(--text-sm);
}
.acct-who { color: var(--text-muted); }
.acct-good, .acct-hint { display: block; margin-top: var(--space-1); }
.acct-good { color: var(--accent); }
.acct-link { display: block; padding-block: var(--space-2); font-weight: var(--weight-bold); }
.acct-out {
  width: 100%; min-height: var(--tap); margin-top: var(--space-2);
  background: transparent; border: var(--border) solid var(--line-strong); border-radius: var(--radius-sm);
}
.acct-out:hover { border-color: var(--line-control); }

@media (min-width: 60rem) {
  .site-nav { display: flex; }
  .menu-btn { display: none; }
  .site-header .header-discord { display: inline-flex; }
  .brand { margin-right: var(--space-5); }
  .site-header__actions { margin-left: auto; }
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: auto;
  padding-block: var(--space-7) var(--space-6);
  background: var(--surface-1);
  border-top: var(--border) solid var(--line);
  font-size: var(--text-sm);
}
.site-footer__top { display: grid; gap: var(--space-6); }
.site-footer__about p { margin: var(--space-3) 0 var(--space-4); color: var(--text-muted); max-width: 32ch; }
.site-footer__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.site-footer h2 {
  margin-bottom: var(--space-2);
  font: var(--weight-bold) var(--text-sm) / var(--leading-snug) var(--font-body);
  letter-spacing: 0; color: var(--text);
}
.site-footer__cols ul { margin: 0; padding: 0; list-style: none; }
.site-footer__cols a {
  display: inline-flex; align-items: center; min-height: var(--space-6);
  color: var(--text-muted); text-decoration: none;
}
.site-footer__cols a:hover { color: var(--text); text-decoration: underline; }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4);
  margin-top: var(--space-6); padding-top: var(--space-5);
  border-top: var(--border) solid var(--line);
  color: var(--text-dim);
}
.site-footer__pay { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); color: var(--text-muted); }
.site-footer__legal { margin: 0; max-width: 60ch; }

.contacts { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.contact-row {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--space-6);
  font-weight: var(--weight-bold);
}
.contact-note { color: var(--text-dim); }
.contact-todo {
  padding: var(--space-3); border: var(--border) dashed var(--mark); border-radius: var(--radius-sm);
  color: var(--mark);
}

@media (min-width: 48rem) {
  .site-footer__top { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); gap: var(--space-8); }
  .site-footer__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- drawers (menu + cart) ---------- */

.scrim {
  position: fixed; inset: 0; z-index: var(--z-scrim);
  background: var(--scrim);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur);
}
.scrim.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-drawer);
  width: min(100vw, var(--drawer-w));
  display: flex; flex-direction: column;
  background: var(--surface-1);
  border-left: var(--border) solid var(--line-strong);
  box-shadow: var(--shadow-float);
  transform: translateX(100%); visibility: hidden;
  /* Hidden only after the slide out has finished; visible the instant it
     opens, so focus can move into the panel in the same tick. */
  transition: transform var(--dur-slow) var(--ease), visibility 0s linear var(--dur-slow);
}
.drawer.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); padding-inline: var(--space-4);
  border-bottom: var(--border) solid var(--line);
}
.drawer__title { font: var(--weight-display) var(--text-md) / 1 var(--font-display); margin: 0; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--space-4); overscroll-behavior: contain; }
.drawer__foot {
  padding: var(--space-4);
  padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
  border-top: var(--border) solid var(--line);
}
.drawer__fine { margin: var(--space-3) 0 0; color: var(--text-dim); font-size: var(--text-sm); text-align: center; }

.menu-links { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.menu-links a {
  display: flex; align-items: center; gap: var(--space-2);
  min-height: var(--space-7); padding-inline: var(--space-2);
  font: var(--weight-display) var(--text-lg) / 1 var(--font-display);
  text-decoration: none; border-bottom: var(--border) solid var(--line);
}
.menu-links a[aria-current="page"] { color: var(--accent); }
.menu-legal { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-4); font-size: var(--text-sm); color: var(--text-muted); }

.total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--space-4);
  font-weight: var(--weight-bold);
}
.total-row span:last-child { font: var(--weight-display) var(--text-lg) / 1 var(--font-display); }

.line-item {
  display: grid; grid-template-columns: var(--space-8) minmax(0, 1fr) auto; gap: var(--space-3);
  align-items: start;
  padding-block: var(--space-3);
  border-bottom: var(--border) solid var(--line);
}
.line-item:first-child { padding-top: 0; }
.line-item__img {
  aspect-ratio: 1; overflow: hidden;
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.line-item__img img { width: 100%; height: 100%; object-fit: cover; }
.line-item__name { font-weight: var(--weight-bold); line-height: var(--leading-snug); }
.line-item__sub { color: var(--text-muted); font-size: var(--text-sm); }
.line-item__price { font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.line-item__remove {
  min-height: var(--space-6); padding: 0; margin-top: var(--space-1);
  background: none; border: 0;
  color: var(--text-muted); font-size: var(--text-sm); text-decoration: underline;
}
.line-item__remove:hover { color: var(--text); }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: max(var(--space-5), env(safe-area-inset-bottom)); z-index: var(--z-toast);
  width: max-content; max-width: calc(100vw - 2 * var(--gutter));
  padding: var(--space-3) var(--space-4);
  background: var(--surface-3); color: var(--text);
  border: var(--border) solid var(--line-control); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-float);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  transform: translate(-50%, var(--space-4)); opacity: 0; visibility: hidden;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility var(--dur);
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ============================================================
   3. Components
   ============================================================ */

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: var(--space-2) var(--space-5);
  border: var(--border) solid transparent; border-radius: var(--radius-sm);
  font-weight: var(--weight-bold); line-height: var(--leading-snug);
  text-align: center; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; box-shadow: none; }

.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-press); }
.btn--primary:hover:not(:disabled) { background: var(--accent-strong); color: var(--accent-ink); }
.btn--primary:active:not(:disabled) { transform: translateY(var(--border-thick)); box-shadow: 0 var(--border) 0 var(--accent-deep); }

.btn--secondary { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-press-neutral); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-control); color: var(--text); }
.btn--secondary:active:not(:disabled) { transform: translateY(var(--border-thick)); box-shadow: 0 var(--border) 0 var(--line); }

.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-control); color: var(--text); }

.btn--link {
  min-height: var(--tap); padding: 0; background: none; border: 0;
  color: var(--accent); text-decoration: underline; font-weight: var(--weight-bold);
}
.btn--link:hover { color: var(--accent-strong); }

.btn--lg { min-height: 3.25rem; padding-inline: var(--space-6); font-size: var(--text-md); }
.btn--sm { padding-inline: var(--space-3); font-size: var(--text-sm); }
.btn--block { display: flex; width: 100%; }

/* ---------- form fields ---------- */

.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field > label, .field-label { font-weight: var(--weight-bold); }
.input {
  width: 100%; min-height: var(--tap); padding: var(--space-2) var(--space-3);
  background: var(--surface-1); color: var(--text);
  border: var(--border) solid var(--line-control); border-radius: var(--radius-sm);
  font-size: var(--text-base);
}
.input::placeholder { color: var(--text-dim); }
.input:hover { border-color: var(--text-muted); }
.input:focus-visible { border-color: var(--accent); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.hint { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.field-error { margin: 0; color: var(--danger); font-size: var(--text-sm); font-weight: var(--weight-medium); }

.search { position: relative; }
.search .icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.search .input { padding-left: var(--space-7); }

/* ---------- chips ---------- */

.chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 0 var(--space-2); min-height: var(--space-5);
  background: var(--surface-2); color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs); font-weight: var(--weight-bold); white-space: nowrap;
}
.chip--ok { background: var(--accent-tint); color: var(--accent); }
.chip--mark { background: var(--mark-tint); color: var(--mark); }

/* Filter toggles. Scroll sideways on a phone rather than wrapping into a
   wall of buttons above the products. */
.chip-row {
  display: flex; gap: var(--space-2);
  margin-inline: calc(-1 * var(--gutter)); padding: var(--space-1) var(--gutter);
  overflow-x: auto; scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-btn {
  display: inline-flex; align-items: center; gap: var(--space-2); flex: none;
  min-height: var(--tap); padding-inline: var(--space-4);
  background: var(--surface-1); color: var(--text-muted);
  border: var(--border) solid var(--line-strong); border-radius: var(--radius-sm);
  font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap;
}
.chip-btn:hover { color: var(--text); border-color: var(--line-control); }
.chip-btn.is-active, .chip-btn[aria-pressed="true"], .chip-btn[aria-current="true"] {
  background: var(--accent-tint); color: var(--accent); border-color: var(--accent);
}
.chip-btn .count { font-family: var(--font-mono); font-size: var(--text-sm); opacity: 0.8; }
.chip-btn.skel { width: 12rem; border-color: transparent; }
.chip-row--start { margin-bottom: var(--space-4); }
.shop-head { display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }
.shop-head > * { min-width: 0; }
.shop-head .result-count { margin: var(--space-1) 0 0; }
.shop-head .chip-row { margin-bottom: 0; }
.shop-more { margin-top: var(--space-4); }
@media (min-width: 60rem) {
  .shop-head { grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: var(--space-6); }
  .shop-head .chip-row { justify-content: flex-end; }
}

@media (min-width: 48rem) {
  .chip-row { flex-wrap: wrap; margin-inline: 0; padding: 0; overflow: visible; }
}

/* ---------- tags, stars, price, stock, coins ---------- */

.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag {
  padding: var(--space-1) var(--space-2);
  border: var(--border) solid var(--line-strong); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: var(--text-xs); font-weight: var(--weight-medium);
}

.stars { display: inline-flex; gap: calc(var(--space-1) / 2); vertical-align: middle; }
.stars__star { width: var(--space-4); height: var(--space-4); fill: var(--line-strong); }
.stars__star.is-on { fill: var(--accent); }

.rating { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); color: var(--text-muted); }
.rating b { color: var(--text); }
.rating--none { color: var(--text-dim); }
[data-rating-summary] { min-height: calc(var(--text-base) * var(--leading-body)); margin: 0; }

.price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); }
.price__now { font-family: var(--font-display); font-weight: var(--weight-display); color: var(--text); letter-spacing: var(--tracking-display); font-variant-numeric: tabular-nums; }
.price__was { color: var(--text-dim); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.price__save {
  padding: 0 var(--space-2); align-self: center;
  background: var(--mark-tint); color: var(--mark); border-radius: var(--radius-sm);
  font-size: var(--text-xs); font-weight: var(--weight-bold); line-height: var(--space-5);
}
.price--sm .price__now { font-size: var(--text-md); }
.price--md .price__now { font-size: var(--text-lg); }
.price--lg .price__now { font-size: var(--text-2xl); line-height: 1; }
.price--lg .price__was { font-size: var(--text-md); }

.stock { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-medium); white-space: nowrap; }
.stock__dot { width: var(--space-2); height: var(--space-2); flex: none; background: currentColor; }
.stock--in { color: var(--text); }
.stock--out { color: var(--text-dim); }
.stock--out .stock__dot { background: none; box-shadow: inset 0 0 0 var(--border-thick) currentColor; }

.coins { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.coins__coin { display: inline-flex; align-items: center; gap: var(--space-2); }
.coins__coin svg { width: var(--space-5); height: var(--space-5); flex: none; }
.coins--named { gap: var(--space-2) var(--space-4); color: var(--text-muted); font-size: var(--text-sm); }

.icon, .px-icon { flex: none; }

/* A reserved box for a pixel icon that app.js draws in (data-px="name"), so
   static markup can use the ui.js artwork without the page shifting. */
.px-slot { display: inline-grid; place-items: center; flex: none; }
.px-slot--sm { width: var(--space-6); height: var(--space-6); }
.px-slot--lg { width: var(--space-8); height: var(--space-8); }
.px-slot svg { width: 100%; height: auto; }

.mt-3 { margin-top: var(--space-3); }
.mt-5 { margin-top: var(--space-5); }

/* ---------- skeleton ---------- */

.skel {
  display: block;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  animation: skel-pulse 1.4s var(--ease) infinite alternate;
}
.skel--line { height: var(--space-4); width: 100%; }
.skel--xs { width: 35%; height: var(--space-3); }
.skel--sm { width: 55%; }
.skel--md { width: 75%; }
.skel--title { height: var(--space-6); }
/* Product-card placeholders: each is exactly as tall as the line of text
   that replaces it, so a card does not change height when it fills in. */
.skel--cat { width: 45%; height: calc(var(--text-xs) * var(--leading-body)); }
.skel--name { height: calc(2 * var(--leading-snug) * var(--text-base)); }
.skel--meta { width: 80%; height: calc(var(--text-sm) * var(--leading-body)); }
.skel--foot { margin-top: auto; height: calc(var(--text-md) * var(--leading-body) + var(--space-3) + var(--border)); }
@media (min-width: 40rem) { .skel--name { height: calc(2 * var(--leading-snug) * var(--text-md)); } }
.skel--box { height: 16rem; }
.skel-stack { display: grid; gap: var(--space-4); align-content: start; }
@keyframes skel-pulse { from { opacity: 1; } to { opacity: 0.45; } }

/* ---------- empty / sold out ---------- */

.empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: var(--space-7) var(--space-4);
  border: var(--border) dashed var(--line-strong); border-radius: var(--radius-md);
  text-align: center;
}
.empty__art { color: var(--text-dim); }
.empty__title { font-size: var(--text-lg); }
.empty__body { margin: 0; color: var(--text-muted); max-width: 46ch; }
.empty__action { margin-top: var(--space-2); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }

.soldout__note { margin: var(--space-3) 0 0; color: var(--text-muted); font-size: var(--text-sm); }

/* ---------- panel + callout ---------- */

.panel {
  padding: var(--space-5);
  background: var(--surface-1);
  border: var(--border) solid var(--line); border-radius: var(--radius-md);
}
.panel > h2, .panel > h3 { margin-bottom: var(--space-3); }

.callout {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-2); border-left: var(--pixel) solid var(--accent);
  border-radius: var(--radius-sm);
}
.callout--mark { border-left-color: var(--mark); }
.callout .px-icon, .callout .icon { color: var(--accent); margin-top: var(--space-1); }
.callout--mark .px-icon, .callout--mark .icon { color: var(--mark); }
.callout p { margin: 0; color: var(--text-muted); }
.callout b { color: var(--text); }
.callout + p { margin-top: var(--space-4); }

/* Stepped corners: the one place the layout itself goes blocky. Used on the
   cape frames only. */
.px-frame {
  --p: var(--pixel);
  clip-path: polygon(
    0 var(--p), var(--p) var(--p), var(--p) 0,
    calc(100% - var(--p)) 0, calc(100% - var(--p)) var(--p), 100% var(--p),
    100% calc(100% - var(--p)), calc(100% - var(--p)) calc(100% - var(--p)), calc(100% - var(--p)) 100%,
    var(--p) 100%, var(--p) calc(100% - var(--p)), 0 calc(100% - var(--p)));
}
/* A quiet checker behind artwork, two "pixels" per tile. */
.px-ground {
  background-color: var(--surface-1);
  background-image: conic-gradient(var(--surface-2) 25%, transparent 0 50%, var(--surface-2) 0 75%, transparent 0);
  background-size: calc(var(--pixel) * 4) calc(var(--pixel) * 4);
}

/* ---------- FAQ accordion ---------- */

.faq { border-top: var(--border) solid var(--line); }
.faq-item { border-bottom: var(--border) solid var(--line); }
.faq-item > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: var(--space-8); padding-block: var(--space-3);
  list-style: none; cursor: pointer;
  font-weight: var(--weight-bold); font-size: var(--text-md); line-height: var(--leading-snug);
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:hover { color: var(--accent-strong); }
/* Plus that becomes a minus: two bars, one rotates away. */
.faq-item > summary::after {
  content: ""; flex: none;
  width: var(--space-4); height: var(--space-4);
  background:
    linear-gradient(currentColor, currentColor) center / 100% var(--border-thick) no-repeat,
    linear-gradient(currentColor, currentColor) center / var(--border-thick) 100% no-repeat;
  color: var(--accent);
  transition: transform var(--dur) var(--ease);
}
.faq-item[open] > summary::after {
  background: linear-gradient(currentColor, currentColor) center / 100% var(--border-thick) no-repeat;
  transform: rotate(180deg);
}
.faq-item__body { padding: 0 0 var(--space-5); color: var(--text-muted); max-width: var(--maxw-prose); }
.faq-item__body ol, .faq-item__body ul { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
.faq-item__body li + li { margin-top: var(--space-2); }

/* ---------- numbered steps ---------- */

.steps { display: grid; gap: var(--space-5); margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); align-items: start; align-content: start; counter-increment: step; }
.step__num {
  display: grid; place-items: center;
  width: var(--space-7); height: var(--space-7);
  background: var(--accent-tint); color: var(--accent);
  border-radius: var(--radius-sm);
}
.step__num::before { content: counter(step); font: var(--weight-bold) var(--text-lg) / 1 var(--font-mono); }
.step__num[data-px]::before { content: none; }
.step__num svg { width: 60%; height: auto; }
/* When the tile shows a picture, the number moves into the heading. */
.step:has(.step__num[data-px]) h3::before {
  content: counter(step) ". "; color: var(--accent); font-family: var(--font-mono);
}
.step h3 { margin-bottom: var(--space-1); }
.step p { color: var(--text-muted); margin: 0; }

.steps--compact { gap: var(--space-4); }
.steps--compact .step__num { width: var(--space-6); height: var(--space-6); }
.steps--compact .step__num::before { font-size: var(--text-base); }

@media (min-width: 48rem) {
  .steps--row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); }
  .steps--row .step { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- plain lists with pixel bullets ---------- */

.ticks { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ticks li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); align-items: start; color: var(--text-muted); }
.ticks li::before {
  content: ""; width: var(--space-2); height: var(--space-2); margin-top: 0.55em;
  background: var(--accent);
}
.ticks b { color: var(--text); }

/* ============================================================
   4. Home
   ============================================================ */

/* The hero is a band of its own: text on the left, the turning cape on the
   right. It is kept short on purpose - the shop grid starts directly under
   it, and on a phone the first products are on the first screen. */
.hero {
  padding-block: var(--space-4) var(--space-5);
  background: var(--surface-1);
  border-bottom: var(--border) solid var(--line);
}
.hero__in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "head cape" "body body";
  gap: var(--space-4);
  align-items: center;
}
.hero__head { grid-area: head; }
.hero__body { grid-area: body; }
.hero h1 { font-size: var(--text-hero); line-height: 1; }
.hero__dim { color: var(--text-dim); }
.hero .eyebrow { display: none; color: var(--text-muted); }
.hero .lede { margin-bottom: var(--space-4); font-size: var(--text-base); }
/* Side by side on a phone, so the buttons cost one row, not two. */
.hero__cta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.hero__cta .btn { min-height: var(--tap); padding-inline: var(--space-3); font-size: var(--text-base); }

.paystrip {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  margin-top: var(--space-4);
  color: var(--text-muted); font-size: var(--text-sm);
}

.hero__cape {
  grid-area: cape;
  display: grid; justify-items: center; gap: var(--space-4);
  padding-inline: var(--space-2);
  color: var(--text); text-decoration: none;
}
.hero__cape:hover { color: var(--text); }
/* On a phone there is no room for the caption, but it is still the link's
   accessible name, so it is clipped rather than removed. */
.hero__cape-cap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hero__cape-name { font: var(--weight-display) var(--text-lg) / var(--leading-snug) var(--font-display); letter-spacing: var(--tracking-display); }
.hero__cape-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2) var(--space-4); }
.hero__cape:hover .hero__cape-name { text-decoration: underline; }

/* ---------- 3D cape ----------
   A 10 x 16 x 1 slab built from six faces, the same proportions as a cape in
   the game. --u is the size of one of its pixels; everything else is a
   multiple of it. Only `transform` is animated, so it runs on the compositor
   and costs nothing on the main thread. */
.cape3d {
  --u: var(--cape-unit);
  position: relative; display: grid; justify-items: center;
  padding-bottom: calc(var(--u) * 3);
  perspective: calc(var(--u) * 70);
}
.cape3d__tilt, .cape3d__spin { display: block; transform-style: preserve-3d; }
.cape3d__tilt { width: calc(var(--u) * 10); height: calc(var(--u) * 16); transform: rotateX(-10deg); }
.cape3d__spin { position: relative; width: 100%; height: 100%; animation: cape-spin 11s linear infinite; }
.hero__cape:hover .cape3d__spin, .hero__cape:focus-visible .cape3d__spin { animation-play-state: paused; }
.cape3d__face { position: absolute; display: block; background-color: var(--cape-edge); }
.cape3d__face--front, .cape3d__face--back {
  inset: 0;
  background-image: url("/assets/moonlight-cape-face.png");
  background-size: 100% 100%;
  image-rendering: pixelated;
}
.cape3d__face--front { transform: translateZ(calc(var(--u) / 2)); }
.cape3d__face--back { transform: rotateY(180deg) translateZ(calc(var(--u) / 2)); filter: brightness(0.6); }
.cape3d__face--left, .cape3d__face--right { top: 0; bottom: 0; left: calc(50% - var(--u) / 2); width: var(--u); }
.cape3d__face--left { transform: rotateY(-90deg) translateZ(calc(var(--u) * 5)); }
.cape3d__face--right { transform: rotateY(90deg) translateZ(calc(var(--u) * 5)); }
.cape3d__face--top, .cape3d__face--bottom { left: 0; right: 0; top: calc(50% - var(--u) / 2); height: var(--u); background-color: var(--cape-edge-dark); }
.cape3d__face--top { transform: rotateX(90deg) translateZ(calc(var(--u) * 8)); }
.cape3d__face--bottom { transform: rotateX(-90deg) translateZ(calc(var(--u) * 8)); }
/* Something for it to stand over: a flat disc, no blur and no glow. */
.cape3d__floor {
  position: absolute; bottom: 0; z-index: -1;
  width: calc(var(--u) * 13); height: calc(var(--u) * 2.5);
  background: var(--surface-3); border-radius: 50%;
}
@keyframes cape-spin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }

@media (min-width: 48rem) {
  .hero { padding-block: var(--space-6); }
  .hero .eyebrow { display: flex; }
  .hero .lede { font-size: var(--text-md); margin-bottom: var(--space-5); }
  .hero__cta { display: flex; flex-wrap: wrap; }
  .hero__cta .btn { min-height: 3.25rem; padding-inline: var(--space-6); font-size: var(--text-md); }
  .hero__in {
    grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
    grid-template-areas: "head cape" "body cape";
    column-gap: var(--space-7); row-gap: var(--space-5);
  }
  .hero__head { align-self: end; }
  .hero__body { align-self: start; }
  .hero__cape { text-align: center; }
  .hero__cape-cap { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; display: grid; justify-items: center; gap: var(--space-3); }
}

/* Trust: reviews beside plain statements of fact. */
.trust { display: grid; gap: var(--space-6); }
.trust__reviews { display: grid; gap: var(--space-3); align-content: start; }
.facts { display: grid; gap: var(--space-5); margin: 0; padding: 0; list-style: none; align-content: start; }
.fact { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); }
.fact .px-slot { color: var(--text); margin-top: var(--space-1); }
.fact h3 { margin-bottom: var(--space-1); }
.fact p { margin: 0; color: var(--text-muted); }
@media (min-width: 60rem) { .trust { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--space-8); } }

/* Discord call to action. */
.cta-band {
  display: grid; gap: var(--space-5); align-items: center;
  padding: var(--space-5);
  background: var(--surface-1); border: var(--border) solid var(--line-strong); border-radius: var(--radius-lg);
}
.cta-band h2 { margin-bottom: var(--space-2); }
.cta-band p { color: var(--text-muted); margin: 0; max-width: 52ch; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.cta-band__art { color: var(--accent); }
@media (min-width: 48rem) {
  .cta-band { grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-6); padding: var(--space-6); }
}

.split { display: grid; gap: var(--space-5); }
@media (min-width: 60rem) { .split { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: var(--space-8); } }

/* ============================================================
   5. Catalog
   ============================================================ */

.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 21rem) { .pgrid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 40rem) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); } }
@media (min-width: 64rem) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); } }

.pcard {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface-1); color: var(--text);
  border: var(--border) solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
a.pcard:hover { border-color: var(--accent); color: var(--text); transform: translateY(calc(-1 * var(--border-thick))); }
.pcard__media { display: block; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.pimg { width: 100%; height: 100%; object-fit: cover; }
.pimg--placeholder { object-fit: contain; padding: var(--space-3); image-rendering: pixelated; }
.pcard.is-out .pimg { opacity: 0.45; filter: grayscale(0.7); }
.pcard__body { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; padding: var(--space-3); }
.pcard__cat { color: var(--text-dim); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.pcard__name {
  font: var(--weight-display) var(--text-base) / var(--leading-snug) var(--font-display);
  letter-spacing: var(--tracking-display);
  /* Two lines reserved, so prices line up across a row whatever the name. */
  min-height: calc(2 * var(--leading-snug) * 1em);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.pcard__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.pcard__delivery { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--text-muted); font-size: var(--text-sm); white-space: nowrap; }
.pcard__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  margin-top: auto; padding-top: var(--space-3);
  border-top: var(--border) solid var(--line);
}
.pcard__go { color: var(--text-dim); transition: transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
a.pcard:hover .pcard__go { color: var(--accent); transform: translateX(var(--space-1)); }
.pcard--skeleton .pcard__media { border-radius: 0; }

@media (min-width: 40rem) {
  .pcard__body { padding: var(--space-4); }
  .pcard__name { font-size: var(--text-md); }
}

.filters { display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }
.result-count { margin: 0 0 var(--space-4); color: var(--text-muted); font-size: var(--text-sm); }
@media (min-width: 48rem) {
  .filters { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); align-items: center; gap: var(--space-4); }
  .filters .chip-row { justify-content: flex-end; }
}

/* ============================================================
   6. Product page
   ============================================================ */

.product { display: grid; gap: var(--space-5); }
.product > * { min-width: 0; }
.gallery__main { aspect-ratio: 1; padding: var(--space-3); }
.gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumbs { display: flex; gap: var(--space-2); margin-top: var(--space-3); overflow-x: auto; padding-bottom: var(--space-1); }
.thumb {
  flex: none; width: var(--space-8); height: var(--space-8); padding: 0; overflow: hidden;
  background: var(--surface-2); border: var(--border-thick) solid var(--line); border-radius: var(--radius-sm);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { border-color: var(--line-control); }
.thumb.is-active { border-color: var(--accent); }

.product__title { font-size: var(--text-2xl); margin-bottom: var(--space-3); }
.product__sub { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-5); color: var(--text-muted); font-size: var(--text-sm); }

.buybox { display: grid; gap: var(--space-4); padding: var(--space-4); background: var(--surface-1); border: var(--border) solid var(--line-strong); border-radius: var(--radius-md); }
.buybox__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.buybox__actions { display: grid; gap: var(--space-3); }
.buybox__pay { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding-top: var(--space-4); border-top: var(--border) solid var(--line); color: var(--text-muted); font-size: var(--text-sm); }

.stepper { display: inline-flex; border: var(--border) solid var(--line-control); border-radius: var(--radius-sm); overflow: hidden; }
.stepper button { display: grid; place-items: center; width: var(--tap); height: var(--tap); background: var(--surface-2); border: 0; }
.stepper button:hover { background: var(--surface-3); }
.stepper input {
  width: 3.5rem; height: var(--tap); padding: 0; text-align: center;
  background: var(--surface-1); border: 0; border-inline: var(--border) solid var(--line-control);
  font-family: var(--font-mono); font-weight: var(--weight-bold); font-size: var(--text-base);
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper :focus-visible { outline-offset: calc(-1 * var(--border-thick)); }

.product__links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); margin-top: var(--space-4); font-size: var(--text-sm); }

.info { display: grid; gap: var(--space-7); margin-top: var(--space-8); }
.info-block > h2 { font-size: var(--text-lg); margin-bottom: var(--space-4); padding-bottom: var(--space-3); border-bottom: var(--border) solid var(--line); }
.info-block p { color: var(--text-muted); max-width: var(--maxw-prose); }
.info-block .desc { white-space: pre-line; }
.info-block .reviews-list { display: grid; gap: var(--space-3); }

@media (min-width: 48rem) {
  .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-7); align-items: start; }
  .product__buy { position: sticky; top: calc(var(--header-h) + var(--space-5)); }
  .buybox { padding: var(--space-5); }
  .buybox__actions { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .gallery__main { padding: var(--space-5); }
  .info { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-7) var(--space-8); }
  .info-block--wide { grid-column: 1 / -1; }
  .info-block .reviews-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
}

/* ============================================================
   7. Reviews
   ============================================================ */

.review {
  display: flex; flex-direction: column; gap: var(--space-3); min-width: 0;
  padding: var(--space-4);
  background: var(--surface-1); border: var(--border) solid var(--line); border-radius: var(--radius-md);
}
.review__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.review__date { color: var(--text-dim); font-size: var(--text-sm); white-space: nowrap; }
.review__text { margin: 0; overflow-wrap: anywhere; }
.review__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4);
  margin-top: auto; padding-top: var(--space-3);
  border-top: var(--border) solid var(--line);
  font-size: var(--text-sm);
}
.review__who { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-weight: var(--weight-bold); overflow-wrap: anywhere; }
.review__product { color: var(--text-muted); }
.review__product.is-gone { color: var(--text-dim); font-style: italic; }
.review--skeleton { gap: var(--space-3); min-height: 9rem; }

.review-grid { display: grid; gap: var(--space-3); }
@media (min-width: 40rem) { .review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); } }
@media (min-width: 64rem) { .review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.review-controls { display: grid; gap: var(--space-4); margin-bottom: var(--space-5); }
.control-group { display: grid; gap: var(--space-2); min-width: 0; }
.control-group > .field-label { font-size: var(--text-sm); color: var(--text-muted); }
.select {
  min-height: var(--tap); padding: 0 var(--space-6) 0 var(--space-3);
  background: var(--surface-1) no-repeat right var(--space-3) center / var(--space-3);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 0), linear-gradient(-45deg, transparent 50%, var(--text-muted) 0);
  background-size: calc(var(--space-2) * 0.75) calc(var(--space-2) * 0.75);
  background-position: right calc(var(--space-3) + var(--space-2) * 0.75) center, right var(--space-3) center;
  border: var(--border) solid var(--line-control); border-radius: var(--radius-sm);
  appearance: none; -webkit-appearance: none; max-width: 100%;
}
@media (min-width: 60rem) {
  .review-controls { grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: var(--space-5); }
}

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); }
.pager__range { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.pager__pages { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.page-btn {
  min-width: var(--tap); min-height: var(--tap); padding-inline: var(--space-2);
  background: var(--surface-1); border: var(--border) solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-weight: var(--weight-bold);
}
.page-btn:hover:not(:disabled) { border-color: var(--line-control); }
.page-btn.is-active { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.page-btn:disabled { opacity: 0.4; }

/* ============================================================
   8. Checkout
   ============================================================ */

/* Tall enough from the first paint that the footer starts below the fold and
   is not seen moving when the form appears. */
.checkout { display: grid; gap: var(--space-5); min-height: 36rem; align-content: start; }
.checkout > * { min-width: 0; }
.checkout__main { display: grid; gap: var(--space-4); align-content: start; }

.costeps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.costeps li {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) 0;
  border-top: var(--pixel) solid var(--line);
  color: var(--text-dim); font-size: var(--text-sm); font-weight: var(--weight-bold);
}
.costeps li.is-current { border-top-color: var(--accent); color: var(--text); }
.costeps li.is-done { border-top-color: var(--text-dim); color: var(--text-muted); }
.costeps__n { font-family: var(--font-mono); }

.co-form { display: grid; gap: var(--space-5); }
.co-fine { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }

/* Coin picker: real radio buttons, so arrow keys move between coins. */
.coinpick { display: grid; gap: var(--space-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.coinpick legend { padding: 0; margin-bottom: var(--space-2); font-weight: var(--weight-bold); }
.coinpick__list { display: grid; gap: var(--space-2); }
.coinopt {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-1) var(--space-3); align-items: center;
  padding: var(--space-3);
  background: var(--surface-1); border: var(--border-thick) solid var(--line-strong); border-radius: var(--radius-sm);
  cursor: pointer;
}
.coinopt:hover { border-color: var(--line-control); }
.coinopt:has(input:checked), .coinopt.is-active { border-color: var(--accent); background: var(--accent-tint); }
.coinopt:has(input:focus-visible) { outline: var(--border-thick) solid var(--accent); outline-offset: var(--border-thick); }
.coinopt__ico { grid-row: span 2; }
.coinopt__ico svg { width: var(--space-6); height: var(--space-6); }
.coinopt__name { font-weight: var(--weight-bold); }
.coinopt__name span { color: var(--text-muted); font-weight: var(--weight-regular); font-family: var(--font-mono); font-size: var(--text-sm); }
.coinopt__meta { color: var(--text-muted); font-size: var(--text-sm); }
.coinopt__amt { grid-column: 2; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text); overflow-wrap: anywhere; }
@media (min-width: 40rem) {
  .coinopt { grid-template-columns: auto minmax(0, 1fr) auto; }
  .coinopt__amt { grid-column: 3; grid-row: 1 / span 2; text-align: right; }
}

.pay-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-5); }
.pay-hold { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.pay-hold b { font-family: var(--font-mono); color: var(--text); }
.pay-hold b.is-low { text-decoration: underline; }

.pay-grid { display: grid; gap: var(--space-5); }
.pay-fields { display: grid; gap: var(--space-5); min-width: 0; }

.copyfield { display: grid; gap: var(--space-2); min-width: 0; }
.copyfield__label { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-weight: var(--weight-bold); }
.copyfield__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); align-items: center;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  background: var(--bg); border: var(--border) solid var(--line-control); border-radius: var(--radius-sm);
}
.copyfield__row code { font-size: var(--text-base); font-weight: var(--weight-medium); overflow-wrap: anywhere; user-select: all; }
.copyfield--amount code { font-size: var(--text-lg); font-weight: var(--weight-bold); }

.qr { display: grid; gap: var(--space-3); justify-items: start; }
.qr__panel { display: grid; gap: var(--space-3); justify-items: center; width: 100%; }
.qr__stage {
  position: relative; display: grid; place-items: center;
  width: min(100%, 15rem); aspect-ratio: 1; padding: var(--space-3);
  background: var(--qr-paper); border-radius: var(--radius-sm);
}
.qr__canvas { width: 100%; height: 100%; image-rendering: pixelated; opacity: 0; }
.qr__loader { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent-ink); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.qr__panel.is-ready .qr__canvas { opacity: 1; }
.qr__panel.is-ready .qr__loader { display: none; }
.qr__panel.is-failed .qr__stage { display: none; }
.qr__note { margin: 0; color: var(--text-muted); font-size: var(--text-sm); text-align: center; max-width: 34ch; }

@media (min-width: 48rem) {
  .pay-grid { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .qr { width: 15rem; }
  .qr [data-qr-toggle] { display: none; }
}

.paystatus { display: grid; gap: var(--space-4); padding: var(--space-4); background: var(--surface-2); border-radius: var(--radius-md); margin-top: var(--space-5); }
.paystatus__track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.paystatus__step {
  display: flex; align-items: center; gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: var(--pixel) solid var(--line-strong);
  color: var(--text-dim); font-size: var(--text-sm); font-weight: var(--weight-bold);
}
.paystatus__dot { width: var(--space-2); height: var(--space-2); background: currentColor; flex: none; }
.paystatus__step.is-done { border-top-color: var(--text-dim); color: var(--text-muted); }
.paystatus__step.is-current { border-top-color: var(--accent); color: var(--text); }
.paystatus__step.is-current .paystatus__dot { background: var(--accent); animation: blink 1.2s steps(2, jump-none) infinite; }
.paystatus--paid .paystatus__step { border-top-color: var(--accent); color: var(--accent); }
.paystatus--expired .paystatus__step.is-current { border-top-color: var(--danger); }
.paystatus--expired .paystatus__step.is-current .paystatus__dot { background: var(--danger); animation: none; }
.paystatus__title { margin: 0 0 var(--space-1); font-weight: var(--weight-bold); font-size: var(--text-md); }
.paystatus__body { margin: 0; color: var(--text-muted); }
.paystatus__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@keyframes blink { from { opacity: 1; } to { opacity: 0.25; } }

.handoff { display: grid; gap: var(--space-3); justify-items: start; min-width: 0; }
.handoff pre { max-width: 100%; }
.handoff pre {
  margin: 0; padding: var(--space-3);
  background: var(--bg); border: var(--border) solid var(--line-strong); border-radius: var(--radius-sm);
  font: var(--text-sm) / var(--leading-body) var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere;
}

.helper > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: var(--tap); list-style: none; cursor: pointer; font-weight: var(--weight-bold);
}
.helper > summary::-webkit-details-marker { display: none; }
.helper > summary .icon { transition: transform var(--dur) var(--ease); color: var(--accent); }
.helper[open] > summary .icon { transform: rotate(180deg); }
.helper__body { padding-top: var(--space-3); color: var(--text-muted); }
.helper__body .steps { margin-bottom: var(--space-4); }

.summary { position: static; }
.summary h2 { font-size: var(--text-lg); margin-bottom: var(--space-4); }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: var(--space-4); font-weight: var(--weight-bold); }
.summary__total span:last-child { font: var(--weight-display) var(--text-lg) / 1 var(--font-display); }
.summary__crypto { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); margin-top: var(--space-2); color: var(--text-muted); font-size: var(--text-sm); }
.summary__crypto b { font-family: var(--font-mono); color: var(--text); }
.summary__help { margin: var(--space-4) 0 0; padding-top: var(--space-4); border-top: var(--border) solid var(--line); color: var(--text-muted); font-size: var(--text-sm); }

.done-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); align-items: center; margin-bottom: var(--space-5); }
.done-check { display: grid; place-items: center; width: var(--space-7); height: var(--space-7); background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-sm); }
.done-head p { margin: var(--space-1) 0 0; color: var(--text-muted); overflow-wrap: anywhere; }
.done-head b { color: var(--text); }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); align-items: center; padding: var(--space-3); margin-bottom: var(--space-2); background: var(--bg); border: var(--border) solid var(--line-strong); border-radius: var(--radius-sm); }
.code-row .code-for { grid-column: 1 / -1; color: var(--text-muted); font-size: var(--text-sm); }
.code-row code { font-weight: var(--weight-bold); overflow-wrap: anywhere; }
.code-note { color: var(--text-dim); font-size: var(--text-sm); }
.done-next { margin-top: var(--space-5); }
.done-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }

@media (min-width: 60rem) {
  .checkout { grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--space-6); align-items: start; }
  .summary { position: sticky; top: calc(var(--header-h) + var(--space-5)); }
}

/* ============================================================
   9. Legal / FAQ / support / 404
   ============================================================ */

.summary-card { margin-bottom: var(--space-7); border-color: var(--line-strong); }
.summary-card h2 { font-size: var(--text-lg); }
.summary-card .ticks { max-width: var(--maxw-prose); }
.summary-card__foot { margin: var(--space-4) 0 0; color: var(--text-dim); font-size: var(--text-sm); }

.legal { display: grid; gap: var(--space-6); }
.legal > * { min-width: 0; }
.toc-title { margin-bottom: var(--space-2); color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.toc { display: none; }
.toc a { display: block; padding: var(--space-2) var(--space-3); border-left: var(--border-thick) solid var(--line); color: var(--text-muted); font-size: var(--text-sm); text-decoration: none; }
.toc a:hover { color: var(--text); }
.toc a.is-active { border-left-color: var(--accent); color: var(--text); }
.legal > nav { display: none; }

.prose { max-width: var(--maxw-prose); }
.prose h2 { font-size: var(--text-lg); margin: var(--space-7) 0 var(--space-3); }
.prose h2:first-of-type { margin-top: var(--space-5); }
.prose p, .prose li { color: var(--text-muted); }
.prose b { color: var(--text); }
.prose ul { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
.prose li + li { margin-top: var(--space-2); }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--accent); }
.prose .updated { color: var(--text-dim); font-size: var(--text-sm); }
.prose .callout { display: block; margin-block: var(--space-4); }

@media (min-width: 60rem) {
  .legal { grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-8); align-items: start; }
  .legal > nav { display: block; position: sticky; top: calc(var(--header-h) + var(--space-5)); }
  .toc { display: block; }
}

.faq-group + .faq-group { margin-top: var(--space-7); }
.faq-group > h2 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.faq-layout { display: grid; gap: var(--space-6); }
.faq-layout > *, .support-grid > *, .split > *, .trust > * { min-width: 0; }
@media (min-width: 60rem) {
  .faq-layout { grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-8); align-items: start; }
  .faq-layout > nav { position: sticky; top: calc(var(--header-h) + var(--space-5)); }
  .faq-layout .chip-row { flex-direction: column; }
  .faq-layout .chip-btn { justify-content: flex-start; }
}

.support-grid { display: grid; gap: var(--space-5); }
.support-main { border-color: var(--accent); }
.support-main .btn { margin-top: var(--space-4); }
.support-main p { color: var(--text-muted); }
@media (min-width: 60rem) { .support-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; } }
.link-list { display: grid; margin: 0; padding: 0; list-style: none; }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--space-7); border-bottom: var(--border) solid var(--line); text-decoration: none; font-weight: var(--weight-bold); }
.link-list li:last-child a { border-bottom: 0; }
.link-list .icon { color: var(--text-dim); }
.link-list a:hover .icon { color: var(--accent); }

.notfound { display: grid; justify-items: center; gap: var(--space-4); padding-block: var(--space-8); text-align: center; }
.notfound__art { width: var(--space-9); height: var(--space-9); image-rendering: pixelated; }
.notfound__code { margin: 0; font: var(--weight-bold) var(--text-sm) / 1 var(--font-mono); color: var(--text-muted); letter-spacing: var(--tracking-label); }
.notfound p { color: var(--text-muted); max-width: 44ch; }
.notfound__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-2); }

/* ============================================================
   10. Giveaways (markup from giveaways.js)
   ============================================================ */

.gw-account { margin-bottom: var(--space-5); padding: var(--space-4); background: var(--surface-1); border: var(--border) solid var(--line); border-radius: var(--radius-md); }
.gw-acct-row { display: grid; gap: var(--space-4); align-items: center; }
.gw-acct-skel { display: grid; gap: var(--space-3); }
.gw-acct-skel .skel--btn { height: 3.25rem; }
.gw-acct-row h2 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.gw-acct-row p { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.gw-acct-row.is-in { grid-template-columns: auto minmax(0, 1fr); }
.gw-acct-row.is-in .gw-acct-out { grid-column: 1 / -1; }
.gw-avatar { width: var(--tap); height: var(--tap); border-radius: var(--radius-sm); }
.gw-avatar-blank { display: inline-block; width: var(--space-5); height: var(--space-5); background: var(--surface-3); border-radius: var(--radius-sm); }
.gw-acct-good { color: var(--text) !important; font-weight: var(--weight-bold); }
@media (min-width: 48rem) {
  .gw-acct-row { grid-template-columns: minmax(0, 1fr) auto; }
  .gw-acct-row.is-in { grid-template-columns: auto minmax(0, 1fr) auto; }
  .gw-acct-row.is-in .gw-acct-out { grid-column: auto; }
}

.gw-note { margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4); background: var(--surface-2); border-left: var(--pixel) solid var(--line-control); border-radius: var(--radius-sm); }
.gw-note.is-good { border-left-color: var(--accent); }
.gw-note.is-warn { border-left-color: var(--danger); }

.gw-list { display: grid; gap: var(--space-4); align-content: start; }
[data-gw-list] { min-height: 22rem; }
.gw-card { display: grid; background: var(--surface-1); border: var(--border) solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.gw-card > * { min-width: 0; }
.gw-media { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); }
.gw-media img { width: 100%; height: 100%; object-fit: cover; }
.gw-card.is-done .gw-media img { opacity: 0.5; filter: grayscale(0.6); }
.gw-flag { position: absolute; left: var(--space-3); top: var(--space-3); padding: 0 var(--space-2); background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: var(--weight-bold); line-height: var(--space-5); }
.gw-card.is-done .gw-flag { background: var(--surface-3); color: var(--text-muted); }
.gw-body { display: grid; gap: var(--space-3); padding: var(--space-4); align-content: start; }
.gw-title { font-size: var(--text-lg); }
.gw-prize { margin: 0; color: var(--accent); font-weight: var(--weight-bold); }
.gw-bonus { justify-self: start; padding: 0 var(--space-2); background: var(--mark-tint); color: var(--mark); border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: var(--weight-bold); line-height: var(--space-5); }
.gw-desc { margin: 0; color: var(--text-muted); white-space: pre-line; font-size: var(--text-sm); }
.gw-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); padding-block: var(--space-3); border-block: var(--border) solid var(--line); }
.gw-stats b { display: block; font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; line-height: var(--leading-snug); }
.gw-stats span { color: var(--text-muted); font-size: var(--text-sm); }
.gw-cta { display: grid; gap: var(--space-2); justify-items: start; }
.gw-cta-note { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.gw-cta-note a, .gw-acct-hint a { color: var(--accent); }
.gw-entered { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--accent); font-weight: var(--weight-bold); }
.gw-won-label { margin: 0; color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.gw-winners { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0; padding: 0; list-style: none; }
.gw-winners li { display: flex; align-items: center; gap: var(--space-2); font-weight: var(--weight-bold); }
.gw-winners img { width: var(--space-5); height: var(--space-5); border-radius: var(--radius-sm); }
.gw-you-won { margin: 0; color: var(--accent); font-weight: var(--weight-bold); }
.gw-card--skeleton .gw-media { border-radius: 0; }
@media (min-width: 48rem) {
  .gw-card { grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); }
  .gw-media { aspect-ratio: auto; min-height: 100%; }
  .gw-body { padding: var(--space-5); }
}

.gw-past { margin-top: var(--space-8); }
.gw-rules { margin-top: var(--space-8); }

/* ============================================================
   11. Motion preferences
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* The cape stops at a three-quarter view instead of turning. */
  .cape3d__spin { animation: none !important; transform: rotateY(-32deg); }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (hover: none) {
  a.pcard:hover { transform: none; }
}
