/* MapleSMP store, on the MapleSMP brand kit v1 (/brand).
   Mostly Plum. Maple for the good bits. Pixelify Sans for the name and short
   headlines; Rubik for everything you read. Amber is the "hey, look" colour:
   at most once per page. Ember and Bark belong to the leaf and maple tree only. */

/* Pixelify's 5 reads as an S. Digits in pixel headings come from Rubik
   Bold instead (a 3 KB subset, digits only); letters stay pixelated. */
@font-face {
  font-family: "Maple Digits";
  src: url("/fonts/rubik-digits.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0030-0039;
}

:root {
  --plum: #2b1a2e;
  --plum-deep: #23152a;
  --dusk: #4a3150;
  --dusk-lo: #3a2541; /* the back-row tree tone: slots, wells */
  --dusk-hi: #5a3d61;
  --cream: #f4ebdd;
  --cream-2: #d8ccd6; /* body copy on plum, from the guidelines */
  --mauve: #a08ca6;
  --maple: #f7731c;
  --maple-hi: #ff8a3a;
  --maple-ink: #2b1a2e;
  --amber: #ffa62b;
  --accent: var(--maple); /* per-gamemode marker colour, set inline */

  --display: "Maple Digits", "Pixelify Sans", ui-monospace, monospace;
  --body: "Rubik", ui-sans-serif, system-ui, sans-serif;

  --t-xs: 0.8125rem;
  --t-sm: 0.9rem;
  --t-md: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.563rem;
  --t-2xl: 1.953rem;
  --t-3xl: 2.441rem;
  --t-4xl: 3.052rem;

  --gap: 16px;
  --wrap: 1120px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--plum);
  color: var(--cream);
  font: 400 var(--t-md) / 1.6 var(--body);
  overflow-x: hidden;
}
main {
  flex: 1;
}
img {
  max-width: 100%;
}
a {
  color: var(--maple);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 2px;
}
button {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}

/* The brand's stepped pixel corner (base.css .px), sized by --p. */
.btn,
.tile,
.mode-card,
.featured,
.rank-hero,
.best,
.seasonal,
.pack,
.card,
.bundle,
.widget,
.list,
.pdp-buy,
.pdp-art,
.table-scroll,
.modal,
.slot,
.tag,
.ip-chip,
.ip-inline,
.seg,
.qty,
.qty-thumb,
.qty-meter,
.offer,
.cart-line,
.nudge,
.field input,
.promo input,
.back,
.stat,
.owned-banner,
.toast,
.tile-badge,
.mode-card-cat,
.seasonal-tag,
.sale-sticker,
.sale-bar-link,
.cd-cell,
.deal,
.sale-hero {
  --p: 4px;
  clip-path: polygon(
    0 calc(var(--p) * 2),
    var(--p) calc(var(--p) * 2),
    var(--p) var(--p),
    calc(var(--p) * 2) var(--p),
    calc(var(--p) * 2) 0,
    calc(100% - var(--p) * 2) 0,
    calc(100% - var(--p) * 2) var(--p),
    calc(100% - var(--p)) var(--p),
    calc(100% - var(--p)) calc(var(--p) * 2),
    100% calc(var(--p) * 2),
    100% calc(100% - var(--p) * 2),
    calc(100% - var(--p)) calc(100% - var(--p) * 2),
    calc(100% - var(--p)) calc(100% - var(--p)),
    calc(100% - var(--p) * 2) calc(100% - var(--p)),
    calc(100% - var(--p) * 2) 100%,
    calc(var(--p) * 2) 100%,
    calc(var(--p) * 2) calc(100% - var(--p)),
    var(--p) calc(100% - var(--p)),
    var(--p) calc(100% - var(--p) * 2),
    0 calc(100% - var(--p) * 2)
  );
}
.btn,
.slot,
.seg,
.qty,
.qty-thumb,
.qty-meter,
.field input,
.promo input,
.back,
.stat,
.toast,
.ip-chip,
.ip-inline {
  --p: 3px;
}
.tag,
.tile-badge,
.mode-card-cat,
.seasonal-tag {
  --p: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 16px;
}
main.wrap {
  padding-block: 28px 24px;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 99;
  background: var(--cream);
  color: var(--plum);
  padding: 8px 12px;
}
.sr-only-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------- type */

.h-pixel {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.05;
  margin: 0;
}
.h-mode {
  font-size: clamp(var(--t-2xl), 5vw, var(--t-4xl));
}
.h-cat {
  font-size: clamp(var(--t-xl), 4vw, var(--t-3xl));
}
.h-section {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t-xl);
  margin: 48px 0 14px;
}
.sub-h {
  margin: -6px 0 18px;
}
.lede {
  font-size: var(--t-lg);
  max-width: 56ch;
  margin: 10px 0 0;
  color: var(--cream-2);
}
.muted {
  color: var(--mauve);
}
.tiny {
  font-size: var(--t-xs);
}
/* Brand label: Rubik Medium, uppercase, +0.14em, Mauve. */
.label {
  font: 500 var(--t-xs) / 1.3 var(--body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mauve);
}
.center {
  justify-content: center;
}
.leaf {
  display: block;
  image-rendering: pixelated;
  flex: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  font: 500 var(--t-sm) / 1 var(--body);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.15s,
    transform 0.08s;
}
.btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--cream);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-buy {
  background: var(--maple);
  color: var(--maple-ink);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.2);
}
.btn-buy:hover:not(:disabled) {
  background: var(--maple-hi);
}
.btn-ghost {
  background: var(--dusk);
  color: var(--cream);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--dusk-hi);
}
.btn-discord {
  background: #5865f2;
  color: #fff;
}
.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: var(--t-xs);
}
.btn-lg {
  min-height: 50px;
  padding-inline: 22px;
  font-size: var(--t-md);
}
.btn-wide {
  width: 100%;
}
.btn.is-busy {
  pointer-events: none;
}
.btn-gift {
  min-width: 42px;
  padding-inline: 10px;
}
.link-quiet {
  font-size: var(--t-sm);
  color: var(--cream-2);
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* --------------------------------------------------------------- tags */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font: 500 var(--t-xs) / 1.4 var(--body);
  vertical-align: middle;
}
.tag-gold,
.tag-sale {
  background: var(--maple);
  color: var(--maple-ink);
}
.tag-line {
  background: var(--dusk-lo);
  color: var(--cream-2);
}
.tag-save {
  background: color-mix(in srgb, var(--maple) 18%, var(--dusk-lo));
  color: var(--maple-hi);
}
.tag-ok {
  background: var(--cream);
  color: var(--plum);
}
.ribbon {
  position: absolute;
  top: 0;
  right: 18px;
  z-index: 2;
  padding: 6px 10px 7px;
  background: var(--maple);
  color: var(--maple-ink);
  font: 500 var(--t-xs) / 1 var(--body);
}
/* Amber is kept for announcements (the seasonal key); "Best value" is Maple. */
.ribbon-left {
  right: auto;
  left: 24px;
}

/* -------------------------------------------------------------- price */

.price {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.price-now {
  font: 500 var(--t-lg) / 1.1 var(--body);
  color: var(--cream);
}
.price-was {
  color: var(--mauve);
  font-size: var(--t-sm);
}
.price-per {
  color: var(--mauve);
  font-size: var(--t-sm);
}
.price-lg .price-now {
  font-size: var(--t-xl);
}
.price-xl .price-now {
  font-size: var(--t-2xl);
}

/* --------------------------------------------------- inventory slot */

.slot {
  --s: 96px;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--s);
  height: var(--s);
  padding: 4px;
  background: var(--dusk-lo);
  box-shadow:
    inset 3px 3px 0 rgb(0 0 0 / 0.28),
    inset -3px -3px 0 rgb(255 255 255 / 0.06);
}
.slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--plum-deep) 94%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--dusk);
}
.head-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: none;
  color: var(--cream);
}
.wordmark {
  font: 700 1.5rem / 1 var(--display);
  color: var(--cream);
  white-space: nowrap;
}
.wordmark b {
  color: var(--maple);
  font-weight: 700;
}
.brand-sub {
  font: 500 var(--t-xs) / 1 var(--body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mauve);
  padding-top: 4px;
}
.ip-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-inline: auto;
  height: 40px;
  padding: 0 8px 0 14px;
  border: 0;
  background: var(--dusk);
  cursor: pointer;
  white-space: nowrap;
}
.ip-chip:hover {
  background: var(--dusk-hi);
}
.ip-chip:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--cream);
}
.ip-addr {
  font: 500 var(--t-sm) / 1 var(--body);
  color: var(--cream);
}
.ip-count {
  font-size: var(--t-xs);
  color: var(--mauve);
}
.ip-copy {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--mauve);
}
.ip-chip:hover .ip-copy {
  color: var(--cream);
}
.dot {
  width: 8px;
  height: 8px;
  background: var(--mauve);
  display: inline-block;
  flex: none;
}
.dot-on {
  background: var(--maple);
}
.head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: none;
}
.acct {
  max-width: 190px;
}
.acct-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.head-av {
  image-rendering: pixelated;
}
.btn-cart {
  background: var(--maple);
  color: var(--maple-ink);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.2);
}
.btn-cart:hover {
  background: var(--maple-hi);
}
.cart-count {
  background: var(--plum);
  color: var(--cream);
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font: 500 var(--t-xs) var(--body);
  padding-inline: 6px;
}
.btn-cart.bump {
  animation: bump 0.4s;
}
@keyframes bump {
  40% {
    transform: scale(1.06);
  }
}

.mode-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  padding-block: 0 8px;
}
.mode-tabs,
.cat-tabs {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  text-decoration: none;
  font: 500 var(--t-sm) / 1 var(--body);
  color: var(--cream-2);
  white-space: nowrap;
}
.mode-tab:hover {
  color: var(--cream);
  background: var(--dusk-lo);
}
.mode-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
}
.mode-tab.is-on {
  background: var(--dusk);
  color: var(--cream);
}
.mode-tab.is-soon {
  color: var(--mauve);
}
.mode-tab.is-soon .mode-dot {
  opacity: 0.5;
}
.soon {
  font-size: 0.72rem;
  color: var(--mauve);
}
.cat-tab {
  display: block;
  padding: 7px 10px;
  text-decoration: none;
  font-size: var(--t-sm);
  color: var(--mauve);
  white-space: nowrap;
}
.cat-tab:hover {
  color: var(--cream);
}
.cat-tab.is-on {
  color: var(--cream);
  box-shadow: inset 0 -3px 0 var(--maple);
}

/* ---------------------------------------------------------------- home */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  padding-top: 24px;
  box-shadow: inset 0 -3px 0 var(--dusk);
}
.hero-copy {
  padding-bottom: 36px;
}
.hero-mark {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
}
.hero-mark .wordmark {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
}
.hero-join {
  margin: 18px 0 0;
  color: var(--cream-2);
}
.ip-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dusk);
  border: 0;
  padding: 5px 10px;
  font: 500 var(--t-md) var(--body);
  color: var(--cream);
  cursor: pointer;
}
.ip-inline:hover {
  background: var(--dusk-hi);
}
.trees {
  line-height: 0;
}
.trees svg {
  display: block;
  height: 100%;
  width: auto;
}
.hero-trees {
  height: 120px;
}

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap);
}
.mode-card {
  --p: 5px;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 24px 22px 20px;
  min-height: 170px;
  text-decoration: none;
  color: var(--cream);
  background: var(--dusk);
  transition: background-color 0.15s;
}
.mode-card:hover {
  background: var(--dusk-hi);
}
.mode-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.mode-card-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--t-2xl);
}
.mode-card-name .mode-dot {
  width: 12px;
  height: 12px;
}
.mode-card-tag {
  color: var(--cream-2);
}
.mode-card-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.mode-card-cat {
  font-size: var(--t-xs);
  padding: 3px 8px;
  background: var(--dusk-lo);
  color: var(--cream-2);
}
.mode-card.is-soon {
  background: var(--dusk-lo);
}
.mode-card.is-soon .mode-card-name,
.mode-card.is-soon .mode-card-tag {
  color: var(--mauve);
}

/* ---------------------------------------------------------- mode page */

.mode-head {
  padding: 4px 0 22px;
}
.bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.bento.n1 {
  grid-template-columns: 1fr;
}
.tile {
  --p: 5px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 16px;
  text-decoration: none;
  color: var(--cream);
  background: var(--dusk);
  transition: background-color 0.15s;
}
.tile:hover {
  background: var(--dusk-hi);
}
.tile:hover .tile-name {
  color: var(--maple);
}
.tile-big {
  grid-row: span 2;
  padding: 26px 26px 18px;
}
.tile-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.tile-name {
  font-size: var(--t-2xl);
  transition: color 0.15s;
}
.tile-big .tile-name {
  font-size: var(--t-3xl);
}
.tile-badge {
  flex: none;
  font: 500 var(--t-xs) / 1.3 var(--body);
  padding: 4px 8px;
  background: color-mix(in srgb, var(--maple) 20%, var(--dusk-lo));
  color: var(--maple-hi);
}
.tile-blurb {
  color: var(--cream-2);
}
.tile-slots {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}
.tile-big .tile-slots {
  gap: 10px;
}
.tile-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  font-size: var(--t-sm);
  color: var(--mauve);
  box-shadow: inset 0 1px 0 var(--dusk-hi);
}

.featured,
.rank-hero {
  --p: 5px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  margin-top: 28px;
  padding: 24px 26px;
  background: var(--dusk);
  box-shadow: inset 4px 0 0 var(--maple);
}
.featured-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.featured-title {
  font-size: var(--t-2xl);
}
.featured-blurb {
  margin: 8px 0 0;
  max-width: 56ch;
  color: var(--cream-2);
}
.featured-buy {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}
.ticks {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: var(--t-sm);
  color: var(--cream-2);
}
.ticks li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  background: var(--maple);
  vertical-align: 2px;
}

.widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
  margin-top: 28px;
}
.widget {
  --p: 5px;
  background: var(--dusk);
  padding: 18px 20px;
}
.widget-h {
  margin: 0 0 12px;
  font: 500 var(--t-xs) / 1.3 var(--body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mauve);
}
.goal {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 3px;
}
.goal i {
  height: 14px;
  background: var(--dusk-lo);
}
.goal i.on {
  background: var(--maple);
}
.goal-num {
  margin: 8px 0 0;
}
.recent {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.recent img {
  image-rendering: pixelated;
  display: block;
}

/* --------------------------------------------------------- category */

.cat-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 8px;
}
.cat-head p {
  margin: 4px 0 0;
}
.back {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  background: var(--dusk);
  color: var(--cream);
}
.back:hover {
  background: var(--dusk-hi);
}
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.stat {
  display: grid;
  padding: 8px 14px;
  background: var(--dusk-lo);
  min-width: 88px;
}
.stat strong {
  font: 500 var(--t-lg) / 1.2 var(--body);
}
.stat span {
  font-size: var(--t-xs);
  color: var(--mauve);
}
.callout {
  margin: 14px 0 0;
  color: var(--maple-hi);
  font-weight: 500;
  font-size: var(--t-sm);
}

.owned-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--dusk);
  box-shadow: inset 4px 0 0 var(--maple);
}

/* The ladder: ranks grow out of the ground, left to right. */
.ladder-wrap {
  margin-top: 8px;
}
.ladder-top {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.ladder-top .h-section {
  margin-bottom: 0;
}
.ladder {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  margin-top: 26px;
}
.rung {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: calc(340px + var(--i) * 32px);
  padding: 26px 14px 16px;
  background: var(--dusk);
  clip-path: polygon(0 10px, 5px 10px, 5px 5px, 10px 5px, 10px 0, calc(100% - 10px) 0, calc(100% - 10px) 5px, calc(100% - 5px) 5px, calc(100% - 5px) 10px, 100% 10px, 100% 100%, 0 100%);
}
.rung .slot {
  --s: calc(64px + var(--i) * 12px);
}
.rung-name {
  font-size: var(--t-xl);
  margin-top: 12px;
}
.rung-tag {
  margin: 4px 0 0;
  font-size: var(--t-sm);
  color: var(--mauve);
}
.rung-perks {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 3px;
  font-size: var(--t-sm);
  color: var(--cream-2);
}
.rung-perks strong {
  font-weight: 500;
  color: var(--cream);
}
.rung-buy {
  margin-top: auto;
  width: 100%;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding-top: 16px;
}
.rung-bill {
  font-size: var(--t-xs);
  color: var(--mauve);
  margin-top: -4px;
}
.rung-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.rung-flag {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--maple);
  color: var(--maple-ink);
  font: 500 var(--t-xs) / 1 var(--body);
  padding: 5px 10px 6px;
  white-space: nowrap;
}
.rung-flag-alt {
  background: var(--cream);
  color: var(--plum);
}
.rung.is-top {
  background: var(--dusk-hi);
  box-shadow: inset 0 3px 0 var(--maple);
}
.rung-owned {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--maple-hi);
}
.rung.is-below {
  opacity: 0.5;
}
/* The ground the ladder grows from: Dusk, like the treeline's base. */
.ground {
  height: 12px;
  background: var(--dusk);
  box-shadow: inset 0 3px 0 var(--dusk-lo);
}

.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--plum-deep);
}
.seg label {
  position: relative;
  cursor: pointer;
}
.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.seg span {
  display: block;
  padding: 8px 18px;
  font: 500 var(--t-sm) / 1.2 var(--body);
  color: var(--mauve);
}
.seg input:checked + span {
  background: var(--dusk);
  color: var(--cream);
  box-shadow: inset 0 -3px 0 var(--maple);
}
.seg input:focus-visible + span {
  outline: 2px solid var(--cream);
  outline-offset: -2px;
}
.seg-sm span {
  padding: 6px 12px;
}

.compare {
  margin-top: 16px;
}
.table-scroll {
  --p: 5px;
  overflow-x: auto;
  background: var(--dusk);
}
.cmp {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
}
.cmp th,
.cmp td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--dusk-hi);
  text-align: center;
}
.cmp thead th {
  vertical-align: bottom;
  font-weight: 500;
}
.cmp thead th .slot {
  margin: 0 auto 6px;
}
.cmp thead .h-pixel {
  font-size: var(--t-md);
}
.cmp tbody th,
.cmp tfoot th {
  text-align: left;
  font-weight: 500;
  position: sticky;
  left: 0;
  background: var(--dusk);
  min-width: 150px;
}
.cmp th small {
  display: block;
  color: var(--mauve);
  font-size: var(--t-xs);
  font-weight: 400;
}
.cmp .is-top {
  background: var(--dusk-hi);
}
.cmp thead .is-top {
  box-shadow: inset 0 3px 0 var(--maple);
}
.cmp .yes {
  color: var(--maple);
  display: inline-flex;
}
.cmp .no {
  color: var(--mauve);
}
.cmp code {
  font: 500 var(--t-sm) var(--body);
  color: var(--cream);
}
.cmp tfoot td {
  border-bottom: 0;
}
.cmp tfoot .price {
  justify-content: center;
  margin-bottom: 6px;
}
.cmd-toggle-cell {
  text-align: center;
}
.note {
  margin-top: 10px;
}

/* currency */
.best {
  --p: 5px;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  margin-top: 20px;
  padding: 40px 30px 28px;
  background: var(--dusk);
}
.best-title {
  font-size: clamp(var(--t-2xl), 5vw, var(--t-4xl));
}
.value-list {
  margin: 18px 0 22px;
  display: grid;
  gap: 6px;
}
.value-list div {
  display: grid;
  grid-template-columns: 6em 1fr;
  gap: 12px;
  align-items: baseline;
}
.value-list dt {
  font: 500 var(--t-lg) var(--body);
  color: var(--maple-hi);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.value-list dd {
  margin: 0;
  color: var(--cream-2);
}
.bonus {
  color: var(--maple-hi);
  font-weight: 500;
}
.packs,
.grid,
.bundles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--gap);
}
.pack,
.card,
.bundle {
  --p: 5px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 28px 16px 16px;
  background: var(--dusk);
}
.pack .slot,
.card .slot {
  margin-bottom: 8px;
}
.pack-name,
.card-name {
  font-size: var(--t-lg);
}
.pack-buy,
.card-actions,
.bundle-buy {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding-top: 12px;
}
.card-link {
  display: grid;
  justify-items: center;
  text-decoration: none;
  color: var(--cream);
}
.card-desc {
  margin: 0;
}
.card-buy {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* bundles */
.bundles {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.bundle {
  align-items: stretch;
  text-align: left;
}
.bundle-top {
  display: flex;
  gap: 14px;
  align-items: center;
}
.bundle-top p {
  margin: 4px 0 0;
}
.bundle-name {
  font-size: var(--t-lg);
}
.variant-solo {
  margin: 14px 0 0;
}

/* product page */
.crumbs {
  display: flex;
  gap: 8px;
  font-size: var(--t-sm);
  color: var(--mauve);
  padding: 0 0 16px;
}
.crumbs a {
  color: var(--cream-2);
}
.pdp {
  display: grid;
  grid-template-columns: minmax(200px, 340px) 1fr;
  gap: 36px;
  align-items: start;
}
.pdp-art {
  --p: 5px;
  position: sticky;
  top: 140px;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--dusk);
}
.pdp-buy {
  --p: 5px;
  display: grid;
  gap: 10px;
  justify-items: start;
  margin: 18px 0 24px;
  padding: 18px;
  background: var(--dusk);
}
.pdp-buy .tiny {
  margin: 0;
}
.prose {
  max-width: 64ch;
  color: var(--cream-2);
}
.prose p {
  margin: 0 0 0.6em;
}
.prose strong {
  color: var(--cream);
  font-weight: 500;
}
.prose:empty {
  display: none;
}

/* account + receipts */
.acct-head {
  display: flex;
  gap: 20px;
  align-items: center;
}
.acct-head p {
  margin: 6px 0 10px;
}
.acct-body {
  image-rendering: pixelated;
  height: 135px;
  width: auto;
}
.acct-subs {
  margin-top: 32px;
}
.acct-subs p {
  max-width: 64ch;
  margin: 0 0 14px;
}
.list {
  --p: 5px;
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--dusk);
}
.list-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  box-shadow: inset 0 -1px 0 var(--dusk-hi);
}
.list-row:last-child {
  box-shadow: none;
}
.list-main {
  display: grid;
  flex: 1;
  min-width: 0;
}
.list-amt {
  font-weight: 500;
}
.thanks {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
}
.thanks .lede {
  margin-inline: auto;
}
.receipt {
  width: 100%;
  max-width: 520px;
  margin-top: 24px;
  text-align: left;
}
.empty-state {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 56px 0;
  gap: 10px;
}

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

.site-foot {
  margin-top: 32px;
}
.foot-trees {
  display: flex;
  justify-content: flex-end;
}
.foot-trees .trees {
  height: 80px;
}
.foot-band {
  background: var(--dusk);
  padding: 26px 0 22px;
  font-size: var(--t-sm);
  color: var(--cream-2);
}
.foot-band a {
  color: var(--cream);
}
.foot-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}
.foot-grid p {
  max-width: 52ch;
  margin: 0;
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px !important;
}
.foot-brand .wordmark {
  font-size: var(--t-lg);
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-content: start;
}
.foot-small {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  font-size: var(--t-xs);
  color: var(--mauve);
}
.foot-small a {
  color: var(--cream-2);
}

/* ------------------------------------------------------ modals + drawer */

.modal {
  --p: 5px;
  border: 0;
  padding: 0;
  background: var(--dusk);
  color: var(--cream);
  width: min(420px, calc(100vw - 32px));
}
.modal::backdrop {
  background: rgb(20 10 22 / 0.72);
  backdrop-filter: blur(3px);
}
.modal-body {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 26px 24px 24px;
}
.modal-body > p {
  margin: 0;
}
.modal-body .muted {
  color: var(--cream-2);
}
.modal-body .h-pixel {
  font-size: var(--t-2xl);
  padding-right: 36px;
}
/* Edition picker sits centred under the explanation, sized to its options. */
.modal-body .seg {
  justify-self: center;
}
.modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  background: var(--dusk-lo);
  border: 0;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--cream);
}
.field {
  display: grid;
  gap: 6px;
}
.field-label {
  font-size: var(--t-sm);
  font-weight: 500;
}
.field input,
.promo input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  background: var(--plum-deep);
  color: var(--cream);
  font: 400 var(--t-md) var(--body);
}
.field input:focus,
.promo input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--maple);
}
.field-error {
  color: var(--maple-hi);
  font-size: var(--t-sm);
  margin: 0;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}
.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgb(20 10 22 / 0.65);
  opacity: 0;
  transition: opacity 0.2s;
}
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--plum);
  box-shadow: -1px 0 0 var(--dusk);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer.is-open {
  pointer-events: auto;
}
.drawer.is-open .drawer-scrim {
  opacity: 1;
}
.drawer.is-open .drawer-panel {
  transform: none;
}
.drawer-head {
  position: relative;
  padding: 20px 20px 14px;
  box-shadow: inset 0 -1px 0 var(--dusk);
}
.drawer-head .h-pixel {
  font-size: var(--t-xl);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: grid;
  align-content: start;
  gap: 16px;
}
.drawer-foot {
  padding: 16px 20px 20px;
  display: grid;
  gap: 8px;
  background: var(--dusk);
}
.drawer-foot .tiny {
  margin: 0;
  color: var(--cream-2);
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--t-lg);
  margin: 6px 0 0;
}
.total-row strong {
  font: 500 var(--t-2xl) var(--body);
  font-variant-numeric: tabular-nums;
}
.promo summary {
  cursor: pointer;
  color: var(--cream-2);
  font-size: var(--t-sm);
}
.promo input {
  margin-top: 8px;
}

.cart-lines {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.cart-line {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: var(--dusk);
}
.cart-line.is-new {
  box-shadow: inset 3px 0 0 var(--maple);
}
.cl-name {
  font-weight: 500;
  line-height: 1.3;
}
.cl-meta {
  font-size: var(--t-xs);
  color: var(--mauve);
}
.cl-right {
  display: grid;
  justify-items: end;
  gap: 6px;
}
.cl-price {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.cl-price s {
  font-weight: 400;
  font-size: var(--t-xs);
  color: var(--mauve);
  margin-right: 4px;
}
.stepper {
  display: inline-flex;
  align-items: center;
  background: var(--dusk-lo);
}
.stepper button {
  width: 28px;
  height: 28px;
  background: none;
  border: 0;
  cursor: pointer;
  font-weight: 500;
}
.stepper span {
  min-width: 22px;
  text-align: center;
  font-size: var(--t-sm);
}
.cl-remove {
  background: none;
  border: 0;
  color: var(--mauve);
  cursor: pointer;
  font-size: var(--t-xs);
  text-decoration: underline;
  padding: 0;
}

.nudge {
  padding: 12px;
  background: var(--dusk);
  font-size: var(--t-sm);
}
.nudge-bar {
  height: 8px;
  margin-top: 8px;
  background: var(--dusk-lo);
}
.nudge-bar i {
  display: block;
  height: 100%;
  background: var(--maple);
}

.offers h3 {
  margin: 0 0 8px;
}
.offer {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 4px 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--dusk-lo);
}
.offer.is-swap,
.offer.is-subscribe {
  background: var(--dusk);
  box-shadow: inset 3px 0 0 var(--maple);
}
.offer .slot {
  grid-row: span 2;
}
.offer-t {
  font-weight: 500;
  line-height: 1.3;
}
.offer-d {
  font-size: var(--t-xs);
  color: var(--cream-2);
}
.offer .btn {
  grid-column: 2;
  justify-self: start;
  margin-top: 6px;
}
.cart-empty {
  text-align: center;
  padding: 24px 0;
  display: grid;
  gap: 10px;
  justify-items: center;
}
.cart-empty p {
  margin: 0;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 12px 16px;
  background: var(--cream);
  color: var(--plum);
  font-weight: 500;
  animation: toast-in 0.2s ease-out;
}
.toast.is-error {
  background: var(--maple);
  color: var(--maple-ink);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 860px) {
  .featured,
  .rank-hero {
    grid-template-columns: auto 1fr;
  }
  .featured-buy {
    grid-column: 1 / -1;
    justify-items: start;
    text-align: left;
  }
  .ladder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 16px;
  }
  .rung {
    min-height: 0;
  }
  .rung .slot {
    --s: 72px;
  }
  .ground {
    display: none;
  }
  .pdp {
    grid-template-columns: 1fr;
  }
  .pdp-art {
    position: static;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-copy {
    padding-bottom: 0;
  }
  .hero-trees {
    justify-self: end;
    height: 80px;
  }
}

@media (max-width: 680px) {
  .head-row {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding-block: 10px;
  }
  .brand-sub {
    display: none;
  }
  .head-actions {
    margin-left: auto;
  }
  .ip-chip {
    order: 3;
    width: 100%;
    margin: 0;
  }
  .ip-chip .ip-addr {
    flex: 1;
    text-align: left;
  }
  .acct-name {
    max-width: 90px;
  }
  .cart-total {
    display: none;
  }
  .bento {
    grid-template-columns: 1fr;
  }
  .tile-big {
    grid-row: auto;
  }
  .featured,
  .rank-hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .best {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 40px 18px 22px;
  }
  .best-copy {
    width: 100%;
  }
  .value-list div {
    grid-template-columns: 5em 1fr;
  }
}

@media (max-width: 420px) {
  .ladder {
    gap: 8px;
  }
  .rung {
    padding-inline: 10px;
  }
  .rung-perks {
    font-size: var(--t-xs);
  }
  .wordmark {
    font-size: 1.25rem;
  }
  .tile-slots .slot {
    --s: 48px !important;
  }
}



/* Secondary buttons sitting on a Dusk card step down to the darker tone so they stay visible. */
:is(.rung, .pack, .card, .bundle, .featured, .rank-hero, .best, .pdp-buy, .widget, .list, .tile) .btn-ghost {
  background: var(--dusk-lo);
}
:is(.rung, .pack, .card, .bundle, .featured, .rank-hero, .best, .pdp-buy, .widget, .list, .tile) .btn-ghost:hover:not(:disabled) {
  background: var(--plum-deep);
}

/* ------------------------------------------------ server page sections */

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
.shop-sec {
  scroll-margin-top: 120px;
  padding-top: 40px;
}
.shop-sec + .shop-sec {
  margin-top: 24px;
  box-shadow: inset 0 3px 0 var(--dusk);
}
.shop-sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.shop-sec-title {
  font-size: var(--t-2xl);
}
.shop-sec-head p {
  margin: 6px 0 0;
}
.shop-sec .ladder-top {
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}
.shop-sec .best {
  margin-top: 18px;
}
.shop-sec .bundles,
.shop-sec .grid {
  margin-top: 20px;
}
.shop-sec .h-section {
  font-size: var(--t-lg);
  margin-top: 28px;
}

/* ===================================================================== motion
   Cosy, pixel-flavoured, and never in the way: page content is never hidden
   unless JS is running (html.js) AND the device allows motion. */

/* ---- loader: the brand leaf grows pixel by pixel, stem first */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--plum);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.boot-leaf {
  image-rendering: pixelated;
}
.boot rect {
  opacity: 0;
}
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 101;
  height: 3px;
  width: 0;
  background: var(--maple);
  pointer-events: none;
}

/* ---- busy buttons: three pixels, ticking */
.btn.is-busy {
  color: transparent !important;
  position: relative;
}
.btn.is-busy > * {
  visibility: hidden;
}
.btn.is-busy::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -13px;
  background: var(--busy, var(--maple-ink));
  box-shadow:
    10px 0 0 var(--busy, var(--maple-ink)),
    20px 0 0 var(--busy, var(--maple-ink));
}
.btn-ghost.is-busy {
  --busy: var(--cream);
}

@media (prefers-reduced-motion: no-preference) {
  /* Page to page: content cross-fades, the header stays put. */
  @view-transition {
    navigation: auto;
  }
  .site-head {
    view-transition-name: site-head;
  }
  ::view-transition-old(root) {
    animation: vt-out 0.16s ease-in both;
  }
  ::view-transition-new(root) {
    animation: vt-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  @keyframes vt-out {
    to {
      opacity: 0;
      transform: translateY(-6px);
    }
  }
  @keyframes vt-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }

  /* Loader shows only if the page is still loading after 250ms. */
  .boot {
    animation:
      boot-show 0.2s 0.25s forwards,
      boot-hide 0.3s 4s forwards;
  }
  .boot rect {
    animation: px-in 0.01s steps(1) forwards;
    animation-delay: calc(250ms + var(--d) * 5ms);
  }
  .boot-leaf {
    animation: leaf-bob 1.2s steps(2, jump-none) 1.2s infinite;
  }
  /* Leaving for another page: same loader, after a short grace period. */
  .boot.is-leaving {
    animation: boot-show 0.2s 0.35s forwards;
  }
  .boot.is-leaving rect {
    animation-name: px-in-again;
    animation-delay: calc(350ms + var(--d) * 5ms);
  }
  html.is-leaving .nav-bar {
    animation: nav-progress 6s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
  }
  @keyframes boot-show {
    to {
      opacity: 1;
      visibility: visible;
    }
  }
  @keyframes boot-hide {
    to {
      opacity: 0;
      visibility: hidden;
    }
  }
  @keyframes px-in {
    to {
      opacity: 1;
    }
  }
  @keyframes px-in-again {
    to {
      opacity: 1;
    }
  }
  @keyframes leaf-bob {
    from {
      transform: translateY(0);
    }
    to {
      transform: translateY(-6px);
    }
  }
  @keyframes nav-progress {
    0% {
      width: 0;
    }
    10% {
      width: 30%;
    }
    100% {
      width: 92%;
    }
  }

  .btn.is-busy::after {
    animation: dots 0.9s steps(1, end) infinite;
  }
  @keyframes dots {
    0% {
      box-shadow:
        10px 0 0 transparent,
        20px 0 0 transparent;
    }
    33% {
      box-shadow:
        10px 0 0 var(--busy, var(--maple-ink)),
        20px 0 0 transparent;
    }
    66% {
      box-shadow:
        10px 0 0 var(--busy, var(--maple-ink)),
        20px 0 0 var(--busy, var(--maple-ink));
    }
  }

  /* ---- buttons and cards respond to the pointer */
  .btn {
    transition:
      background-color 0.15s,
      translate 0.12s,
      transform 0.08s;
  }
  .btn:hover:not(:disabled) {
    translate: 0 -1px;
  }
  :is(.pack, .bundle, .card, .mode-card, .rung, .offer) {
    transition:
      translate 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
      background-color 0.15s;
  }
  :is(.pack, .bundle, .card, .mode-card):hover {
    translate: 0 -4px;
  }
  .rung:hover {
    translate: 0 -6px;
  }
  /* Items bob in their slot like a dropped item in-game. */
  :is(.pack, .bundle, .card, .rung, .offer, .best, .seasonal, .rank-hero, .pdp-art):hover .slot img {
    animation: bob 1.4s ease-in-out infinite;
  }
  @keyframes bob {
    0%,
    100% {
      translate: 0 0;
    }
    50% {
      translate: 0 -5px;
    }
  }

  /* ---- entrances (only with JS: app.js adds .in when scrolled into view) */
  html.js :is(.packs, .bundles, .grid, .modes, .widgets) > * {
    opacity: 0;
  }
  html.js :is(.packs, .bundles, .grid, .modes, .widgets).in > * {
    animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--k, 0) * 70ms);
  }
  html.js :is(.best, .seasonal) {
    opacity: 0;
  }
  html.js :is(.best, .seasonal).in {
    animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  /* Ranks grow out of the ground, smallest first. */
  html.js .ladder {
    overflow: hidden;
    padding-top: 8px;
    margin-top: 18px;
  }
  html.js .ladder:not(.in) .rung {
    transform: translateY(105%);
  }
  html.js .ladder.in .rung {
    animation: sprout 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.12) both;
    animation-delay: calc(var(--i) * 110ms);
  }
  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes sprout {
    from {
      transform: translateY(105%);
    }
    to {
      transform: none;
    }
  }

  /* Billing labels and swapped prices fade in when they change. */
  [data-bill-sub],
  [data-bill-once] {
    animation: fade 0.25s ease-out;
  }
  .flash {
    animation: flash 0.5s ease-out;
  }
  @keyframes fade {
    from {
      opacity: 0;
    }
  }
  @keyframes flash {
    0% {
      filter: brightness(1.35);
    }
  }

  /* ---- sliding tab underline */
  .cat-tabs.has-ink {
    position: relative;
  }
  .cat-tabs.has-ink .cat-tab.is-on {
    box-shadow: none;
  }
  .tab-ink {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--maple);
    transition:
      left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
      width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  /* ---- dialogs and drawer */
  .modal[open] {
    animation: pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  }
  .modal[open]::backdrop {
    animation: fade 0.2s;
  }
  @keyframes pop {
    from {
      opacity: 0;
      transform: translateY(10px) scale(0.97);
    }
  }
  .drawer.just-opened :is(.cart-line, .offer, .cart-empty) {
    animation: slide-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(120ms + var(--k, 0) * 45ms);
  }
  .cart-line.is-new {
    animation: line-new 0.9s ease-out;
  }
  @keyframes slide-in {
    from {
      opacity: 0;
      transform: translateX(18px);
    }
  }
  @keyframes line-new {
    0% {
      background: color-mix(in srgb, var(--maple) 35%, var(--dusk));
    }
  }
  .toast {
    animation: toast-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  }
  .toast.is-leaving {
    animation: toast-out 0.2s ease-in forwards;
  }
  @keyframes toast-out {
    to {
      opacity: 0;
      transform: translateY(8px);
    }
  }

  /* ---- leaves drifting from the maple in the treeline */
  .trees {
    position: relative;
  }
  .leaf-px {
    position: absolute;
    width: var(--px);
    height: var(--px);
    pointer-events: none;
    animation: leaf-fall var(--t, 2.6s) linear forwards;
  }
  @keyframes leaf-fall {
    0% {
      transform: translate(0, 0);
      opacity: 0;
    }
    10% {
      opacity: 1;
    }
    35% {
      transform: translate(calc(var(--dx) * 0.6), calc(var(--dy) * 0.35));
    }
    65% {
      transform: translate(calc(var(--dx) * -0.2), calc(var(--dy) * 0.7));
    }
    85% {
      opacity: 1;
    }
    100% {
      transform: translate(var(--dx), var(--dy));
      opacity: 0;
    }
  }
}

/* ------------------------------------------------ seasonal crate key
   A limited-time key gets its own card above the regular keys. It's an
   announcement, so it carries the page's one use of Amber. */
.seasonal {
  --p: 5px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  margin-top: 20px;
  padding: 26px 28px;
  background: var(--dusk);
  box-shadow: inset 4px 0 0 var(--amber);
}
.seasonal + .bundles {
  margin-top: 16px;
}
.seasonal-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 10px;
}
.seasonal-tag {
  background: var(--amber);
  color: var(--plum);
  font: 500 var(--t-xs) / 1 var(--body);
  padding: 6px 10px;
}
.seasonal-ends {
  font-size: var(--t-sm);
  color: var(--cream-2);
}
.seasonal-ends time {
  font-weight: 500;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.seasonal-name {
  font-size: var(--t-2xl);
}
.seasonal-blurb {
  margin: 8px 0 0;
  max-width: 60ch;
  color: var(--cream-2);
}
.seasonal-pick {
  max-width: 440px;
  margin-top: 16px;
}
.seasonal-pick .qty {
  margin-top: 0;
}
.seasonal .link-quiet {
  display: inline-block;
  margin-top: 12px;
}
@media (max-width: 680px) {
  .seasonal {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .seasonal-art {
    justify-self: center;
  }
  .seasonal-art .slot {
    --s: 160px !important;
  }
}

/* ------------------------------------------------ key size picker
   A track of sizes with a sliding thumb, a readout that rolls to the new
   price, and an in-game stack count on the item slot. */
.stack {
  position: relative;
  display: inline-grid;
  flex: none;
}
.stack-n {
  position: absolute;
  right: 6px;
  bottom: 2px;
  font: 700 clamp(15px, calc(var(--s, 80px) * 0.2), 40px) / 1 var(--body);
  color: #fff;
  text-shadow: 2px 2px 0 #3f3f3f;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.seasonal-art .stack-n {
  font-size: 40px;
  right: 12px;
  bottom: 8px;
  text-shadow: 3px 3px 0 #3f3f3f;
}
.qty {
  --p: 3px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  margin: 14px 0 0;
  padding: 4px;
  border: 0;
  background: var(--plum-deep);
  box-shadow:
    inset 3px 3px 0 rgb(0 0 0 / 0.28),
    inset -3px -3px 0 rgb(255 255 255 / 0.05);
}
.qty-opt {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 8px 4px 7px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.qty-opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.qty-x {
  font: 600 var(--t-lg) / 1.1 var(--body);
  color: var(--cream-2);
  font-variant-numeric: tabular-nums;
}
.qty-save {
  font-size: var(--t-xs, 12px);
  font-weight: 600;
  color: var(--mauve);
  letter-spacing: 0.02em;
}
.qty-opt:has(input:checked) .qty-x {
  color: var(--cream);
}
.qty-opt:has(input:checked) .qty-save {
  color: var(--cream);
}
.qty-opt:has(input:focus-visible) {
  outline: 2px solid var(--cream);
  outline-offset: -2px;
}
/* Without JS the checked size is simply filled in. */
.qty-opt:has(input:checked) {
  background: var(--maple);
}
.qty-thumb {
  display: none;
}
html.js .qty-opt:has(input:checked) {
  background: none;
}
html.js .qty-thumb {
  display: block;
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: calc(4px + (100% - 8px) / var(--n) * var(--i));
  width: calc((100% - 8px) / var(--n));
  background: var(--maple);
  box-shadow:
    inset 0 -3px 0 rgb(0 0 0 / 0.22),
    inset 0 2px 0 rgb(255 255 255 / 0.18);
}
.qty-read {
  margin-top: 12px;
}
.qty-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
}
.qty-total {
  font: 600 var(--t-xl, 24px) / 1.1 var(--body);
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.qty-each {
  font-size: var(--t-sm);
  color: var(--mauve);
  font-variant-numeric: tabular-nums;
}
.qty-meter {
  --p: 2px;
  display: block;
  height: 8px;
  margin-top: 10px;
  background: var(--plum-deep);
  overflow: hidden;
}
.qty-meter i {
  display: block;
  height: 100%;
  width: calc(var(--w) * 100%);
  background: repeating-linear-gradient(90deg, var(--maple) 0 6px, color-mix(in srgb, var(--maple) 78%, #fff) 6px 8px);
}
.qty-saved {
  min-height: 1.4em;
  margin: 6px 0 0;
  font-size: var(--t-sm);
  color: var(--cream-2);
}
.qty-saved.is-saving {
  color: var(--maple);
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  html.js .qty-thumb {
    transition:
      left 0.42s cubic-bezier(0.3, 1.45, 0.45, 1),
      scale 0.2s;
  }
  .qty-thumb.is-moving {
    scale: 1.06 0.9;
  }
  .qty-opt {
    transition: translate 0.15s;
  }
  .qty-opt:hover:not(:has(input:checked)) {
    translate: 0 -2px;
  }
  .qty-opt:active {
    translate: 0 1px;
  }
  .qty-x,
  .qty-save {
    transition: color 0.2s;
  }
  .qty-meter i {
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    animation: meter-crawl 0.9s linear infinite;
  }
  @keyframes meter-crawl {
    to {
      background-position: 8px 0;
    }
  }
  .stack-n.pop {
    animation: stack-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
  }
  @keyframes stack-pop {
    from {
      scale: 1.7;
      opacity: 0;
    }
  }
  .stack.grab .slot img {
    animation: stack-grab 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
  }
  @keyframes stack-grab {
    40% {
      scale: 1.12;
      translate: 0 -4px;
    }
  }
  .qty-saved.swap {
    animation: fade 0.3s ease-out;
  }
  .qty-spark {
    position: fixed;
    z-index: 60;
    width: 4px;
    height: 4px;
    background: var(--maple);
    pointer-events: none;
  }
}

/* ================================================================== sales
   A PayNow sale should be impossible to miss: a striped strip under the
   header, a big banner with a scrolling tape and countdown, an "On sale now"
   row, and a sticker on every discounted item. Maple throughout; Amber stays
   free for the seasonal announcement. */

.sale-bar {
  position: relative;
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgb(0 0 0 / 0.08) 14px 28px),
    var(--maple);
  background-size: 40px 40px, auto;
  color: var(--maple-ink);
  font-size: var(--t-sm);
}
.sale-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  justify-content: center;
  padding-block: 9px;
}
.sale-row strong {
  font: 700 var(--t-md) / 1 var(--display);
  letter-spacing: 0.02em;
}
.sale-ends time {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.sale-bar-link {
  --p: 2px;
  padding: 3px 10px;
  background: var(--maple-ink);
  color: var(--cream);
  font-weight: 500;
  text-decoration: none;
}
.sale-bar-link:hover {
  background: var(--plum-deep);
}
.sale-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  background: currentColor;
}

/* ---- sticker on a discounted item's slot */
.sale-pin {
  position: relative;
  display: inline-grid;
  flex: none;
}
.sale-sticker {
  --p: 2px;
  position: absolute;
  z-index: 2;
  top: -8px;
  left: -10px;
  padding: 4px 7px 5px;
  background: var(--maple);
  color: var(--maple-ink);
  font: 700 var(--t-sm) / 1 var(--body);
  font-variant-numeric: tabular-nums;
  rotate: -8deg;
  box-shadow: 0 3px 0 rgb(0 0 0 / 0.3);
  pointer-events: none;
}
.best .sale-sticker,
.rank-hero .sale-sticker,
.pdp-art .sale-sticker,
.seasonal .sale-sticker {
  font-size: var(--t-lg);
  padding: 6px 10px 7px;
}
/* Ranks carry flags up top, so their sticker sits on the other corner. */
.rung .sale-sticker,
.sale-hero-item:nth-child(3) .sale-sticker {
  left: auto;
  right: -10px;
  rotate: 8deg;
}
.pack-sale-price {
  justify-content: center;
}
.best-sale-price {
  display: flex;
  margin: 14px 0 -4px;
}
/* Sale prices: old price louder, new price in Maple. */
.price:has(.price-was) .price-now,
.qty-price:has(.price-was:not([hidden])) .qty-total {
  color: var(--maple-hi);
}
.price-was {
  text-decoration-thickness: 2px;
  text-decoration-color: var(--maple);
}

/* ---- tab and mode card */
.cat-tab-sale {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--maple-hi) !important;
  font-weight: 500;
}
.cat-tab-sale .sale-live-dot {
  background: var(--maple);
}
.mode-sale {
  --p: 2px;
  padding: 3px 8px;
  background: var(--maple);
  color: var(--maple-ink);
  font: 500 var(--t-xs) / 1.4 var(--body);
  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)));
}

/* ---- the banner */
.sale-hero {
  --p: 6px;
  position: relative;
  margin: 24px 0 8px;
  background:
    radial-gradient(120% 140% at 85% 60%, color-mix(in srgb, var(--maple) 30%, transparent), transparent 60%),
    var(--plum-deep);
  box-shadow: inset 0 0 0 4px var(--maple);
  overflow: hidden;
}
.sale-tape {
  overflow: hidden;
  background: var(--maple);
  color: var(--maple-ink);
  white-space: nowrap;
  font: 700 var(--t-md) / 1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sale-tape-run {
  display: flex;
  width: max-content;
}
.sale-tape-run > span {
  display: flex;
  align-items: center;
  padding-block: 9px;
}
.sale-tape em {
  font-style: normal;
  padding-inline: 14px;
}
.sale-tape i {
  width: 8px;
  height: 8px;
  background: var(--maple-ink);
}
.sale-hero-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 28px 36px 34px;
}
.sale-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--maple-hi);
  font-weight: 500;
  font-size: var(--t-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sale-live .sale-live-dot {
  background: var(--maple);
}
.sale-hero-name {
  margin: 8px 0 0;
  font-size: clamp(var(--t-2xl), 5vw, var(--t-4xl));
  line-height: 1.05;
  color: var(--cream);
}
.sale-hero-pct {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 6px 0 0;
}
.sale-hero-pct b {
  font-size: clamp(3.5rem, 11vw, 6.5rem);
  line-height: 0.95;
  color: var(--maple);
  text-shadow: 5px 5px 0 rgb(0 0 0 / 0.35);
  font-variant-numeric: tabular-nums;
}
.sale-upto,
.sale-off {
  font: 500 var(--t-xl) / 1 var(--body);
  color: var(--cream);
}
.sale-hero-line {
  margin: 10px 0 0;
  max-width: 52ch;
  color: var(--cream-2);
}
.sale-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* countdown tiles */
.cd {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.cd-cell {
  --p: 3px;
  display: grid;
  justify-items: center;
  min-width: 64px;
  padding: 9px 6px 7px;
  background: var(--dusk);
  box-shadow:
    inset 0 -4px 0 rgb(0 0 0 / 0.25),
    inset 0 3px 0 rgb(255 255 255 / 0.06);
}
.cd-n {
  font: 700 var(--t-2xl) / 1 var(--display);
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.cd-u {
  margin-top: 4px;
  font-size: var(--t-xs);
  color: var(--mauve);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cd.is-urgent .cd-n {
  color: var(--maple-hi);
}

/* fanned products */
.sale-hero-art {
  position: relative;
  width: 300px;
  height: 230px;
}
.sale-hero-item {
  position: absolute;
  left: 50%;
  top: 50%;
}
.sale-hero-item:nth-child(1) {
  z-index: 3;
  translate: -50% -50%;
}
.sale-hero-item:nth-child(2) {
  z-index: 2;
  translate: -128% -38%;
  rotate: -9deg;
}
.sale-hero-item:nth-child(3) {
  z-index: 1;
  translate: 28% -62%;
  rotate: 8deg;
}
.sale-hero-art.n1 .sale-hero-item:nth-child(1),
.sale-hero-art.n2 .sale-hero-item:nth-child(1) {
  translate: -50% -50%;
}
.sale-hero-item .slot {
  box-shadow:
    inset 3px 3px 0 rgb(0 0 0 / 0.28),
    inset -3px -3px 0 rgb(255 255 255 / 0.06),
    0 10px 0 rgb(0 0 0 / 0.25);
}

/* ---- "On sale now" row */
.sale-sec .shop-sec-title {
  color: var(--maple-hi);
}
.sale-badge {
  background: var(--maple) !important;
  color: var(--maple-ink) !important;
}
.deals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap);
}
.deal {
  --p: 5px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 14px 14px;
  background: var(--dusk);
  box-shadow: inset 0 3px 0 var(--maple);
  text-align: center;
}
.deal-link {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
}
.deal-name {
  margin: 0;
  font: 500 var(--t-md) / 1.25 var(--body);
}
.deal-price {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
}
.deal-price .price-now {
  font-size: var(--t-lg);
  font-weight: 500;
  color: var(--maple-hi);
}
.deal-saved {
  margin: 0 0 10px;
  font-size: var(--t-xs);
  color: var(--cream-2);
}
.deal .btn {
  margin-top: auto;
}

@media (max-width: 760px) {
  .sale-hero-body {
    grid-template-columns: 1fr;
    padding: 22px 20px 26px;
  }
  .sale-hero-art {
    grid-row: 1;
    justify-self: center;
    width: 260px;
    height: 170px;
    scale: 0.8;
  }
  .cd-cell {
    min-width: 0;
    flex: 1;
  }
  .deals {
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 62%);
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
  }
  .deal {
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .sale-bar {
    animation: sale-stripes 1.6s linear infinite;
  }
  @keyframes sale-stripes {
    to {
      background-position: 40px 0, 0 0;
    }
  }
  .sale-live-dot {
    animation: sale-blink 1.2s steps(2, jump-none) infinite;
  }
  @keyframes sale-blink {
    50% {
      opacity: 0.25;
    }
  }
  .sale-tape-run {
    animation: tape 26s linear infinite;
  }
  .sale-tape.is-rev .sale-tape-run {
    animation-direction: reverse;
  }
  @keyframes tape {
    to {
      translate: -50% 0;
    }
  }
  .sale-hero-item {
    animation: sale-float 3.2s ease-in-out infinite;
    animation-delay: calc(var(--k) * -1.1s);
  }
  @keyframes sale-float {
    50% {
      margin-top: -8px;
    }
  }
  .sale-sticker {
    transition: rotate 0.2s cubic-bezier(0.3, 1.6, 0.5, 1), scale 0.2s;
  }
  :is(.pack, .bundle, .card, .rung, .best, .rank-hero, .deal, .seasonal, .pdp-art):hover .sale-sticker {
    rotate: 4deg;
    scale: 1.12;
  }
  html.js .sale-hero {
    animation: sale-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
  }
  @keyframes sale-in {
    from {
      opacity: 0;
      transform: translateY(16px) scale(0.98);
    }
  }
  html.js .sale-sticker {
    animation: sticker-slap 0.45s cubic-bezier(0.3, 1.7, 0.5, 1) both;
    animation-delay: 0.35s;
  }
  @keyframes sticker-slap {
    from {
      scale: 2.2;
      opacity: 0;
      rotate: -20deg;
    }
  }
  .cd-n.tick {
    animation: cd-tick 0.3s ease-out;
  }
  @keyframes cd-tick {
    from {
      translate: 0 -4px;
      opacity: 0.4;
    }
  }
  .deal {
    transition: translate 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .deal:hover {
    translate: 0 -4px;
  }
  .deal:hover .slot img {
    animation: bob 1.4s ease-in-out infinite;
  }
}
