/* =====================================================
   Mr. Bombastic — site styles
   One stylesheet for every page. Dark is the default theme;
   <html data-theme="light"> switches the token set.
   Narrow layout (< 720px) follows the mobile artboards.
   ===================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #16201B;
  --bg2: #1C2823;
  --bg3: #121A16;
  --card: #22302A;
  --card2: #2B3B34;
  --line: #36473E;
  --line2: #4A5E53;
  --text: #EDF3EF;
  --muted: #B2C0B7;
  --accent: #3DFF8F;
  --onAccent: #04130B;
  --accentSoft: #B8FFD9;
  --accentBg: #163425;
  --gold: #F2C14E;
  --onGold: #1A1204;
  --warnBg: #2A2410;
  --warnLine: #6B5A22;
  --warnText: #F2D58A;
  --dangerLine: #7A3A30;
  --dangerText: #FF9C8A;
  --glow1: rgba(61, 255, 143, .26);
  --glow2: rgba(242, 193, 78, .12);
  --bannerA: #1A2A20;
  --tglow: 0 0 32px rgba(61, 255, 143, .55);
  --btnGlow: 0 10px 32px -6px rgba(61, 255, 143, .45);
  --crack: .35;

  /* product hues */
  --dice: #3DFF8F;
  --sticker: #F2C14E;
  --cash: #7CE7FF;
  --carry: #FF8A6B;
  --r1: #B2C0B7;
  --r4: #B98CFF;
  --onHue: #04130B;

  --font-display: 'Big Shoulders Display', Impact, sans-serif;
  --font-body: Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F1F5F2;
  --bg2: #E7EEE9;
  --bg3: #DCE6DF;
  --card: #FFFFFF;
  --card2: #EDF3EF;
  --line: #CFDAD2;
  --line2: #AABBB0;
  --text: #13201A;
  --muted: #46584E;
  --accent: #0B7A3E;
  --onAccent: #FFFFFF;
  --accentSoft: #064D27;
  --accentBg: #DDF3E5;
  --gold: #7A5600;
  --onGold: #FFFFFF;
  --warnBg: #FFF6DC;
  --warnLine: #E0C26A;
  --warnText: #5E4600;
  --dangerLine: #E3A596;
  --dangerText: #A52A12;
  --glow1: rgba(11, 122, 62, .16);
  --glow2: rgba(122, 86, 0, .10);
  --bannerA: #EAF3EC;
  --tglow: none;
  --btnGlow: 0 6px 18px rgba(11, 122, 62, .25);
  --crack: .22;

  --dice: #0B7A3E;
  --sticker: #7A5600;
  --cash: #0A6C8A;
  --carry: #B83E1F;
  --r1: #46584E;
  --r4: #6B3FC4;
  --onHue: #FFFFFF;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
svg { display: block; flex: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accentSoft); }

button { font-family: inherit; cursor: pointer; }

h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Browser surfaces carry the palette too */
html { scrollbar-color: var(--line2) var(--bg); }
::selection { background: var(--accent); color: var(--onAccent); }
input, textarea { caret-color: var(--accent); }
.price,
.pick-count,
.count-badge,
.count-pill,
.cart-item__total,
.cart-total strong,
.stepper output,
[data-cart-count] { font-variant-numeric: tabular-nums; }

/* Native search clear button, redrawn in the muted ink */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--muted);
  -webkit-mask: var(--x-mark) center / contain no-repeat;
  mask: var(--x-mark) center / contain no-repeat;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--onGold);
  font-weight: 700;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--onGold); }

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: 24px;
}

.display {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  transition: filter .15s, background-color .15s, color .15s, border-color .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { filter: none; }
/* A disabled primary must not read as a live one: drop the fill, not just the opacity */
.btn--accent:disabled,
.btn--gold:disabled {
  border-color: var(--line2);
  background: var(--card2);
  color: var(--muted);
  box-shadow: none;
  opacity: 1;
}

.btn--accent { border-color: var(--accent); background: var(--accent); color: var(--onAccent); }
.btn--accent:hover { color: var(--onAccent); }
.btn--gold { border-color: var(--gold); background: var(--gold); color: var(--onGold); }
.btn--gold:hover { color: var(--onGold); }
.btn--ghost { border-color: var(--line2); color: var(--text); font-weight: 600; }
.btn--ghost:hover { color: var(--text); border-color: var(--muted); }
.btn--outline { border-color: var(--accent); color: var(--accent); }
.btn--outline:hover { color: var(--accent); background: var(--accentBg); }
.btn--danger { border-color: var(--dangerLine); color: var(--dangerText); font-weight: 600; }
.btn--danger:hover { color: var(--dangerText); }
.btn--lg { min-height: 52px; padding: 0 30px; font-size: 16px; }
.btn--glow { box-shadow: var(--btnGlow); }

/* Filter chips and toggle buttons share the pressed look */
.chip,
.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: background-color .15s, color .15s, border-color .15s;
}
.chip { padding: 0 20px; border-radius: 999px; }
.toggle { padding: 0 16px; border-radius: 10px; }
.chip:hover,
.toggle:hover { border-color: var(--accent); }
.chip:active:not(:disabled),
.toggle:active:not(:disabled) { transform: translateY(1px); }
.chip[aria-pressed="true"],
.toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--onAccent);
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.input::placeholder { color: var(--muted); opacity: 1; }

/* ---------- Announcement bar ---------- */
.announce {
  padding: 10px 16px;
  background: var(--accent);
  color: var(--onAccent);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding-block: 14px;
}
.site-header__spacer { flex: 1 1 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px; /* a full-size tap target, even where the wordmark is short */
  color: var(--text);
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
}
.brand:hover { color: var(--text); }
.brand__mark { width: 30px; height: 30px; color: var(--accent); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 15px;
  font-weight: 500;
}
.site-nav a { color: var(--text); }
.site-nav a:hover { color: var(--accent); }
.site-nav a.is-feature,
.site-nav a[aria-current="page"] { color: var(--accent); }


.theme-toggle { width: 44px; padding: 0; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }

.cart-btn { padding: 0 18px; gap: 10px; font-size: 15px; font-weight: 600; }
.cart-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

.live-count { font-size: 13px; color: var(--muted); }
.live-count strong { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse at 78% 45%, var(--glow1), transparent 55%),
    radial-gradient(ellipse at 5% 110%, var(--glow2), transparent 50%),
    var(--bg);
}
.hero__cracks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: var(--crack);
  color: var(--accent);
  pointer-events: none;
}
/* The board cracks open once the loading screen leaves: trunk first, then the branches.
   (.motion-ok is only set when motion is welcome; otherwise the cracks are simply drawn.) */
.motion-ok .hero__cracks path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.motion-ok .hero.is-in .hero__cracks path { animation: crack-open 1.4s cubic-bezier(.16, 1, .3, 1) .2s forwards; }
.motion-ok .hero.is-in .hero__cracks path + path { animation-duration: 1s; animation-delay: .7s; }
@keyframes crack-open { to { stroke-dashoffset: 0; } }
.hero__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  padding-block: 72px 88px;
}
.hero__copy { flex: 1 1 440px; min-width: 0; }

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(56px, 7.2vw, 96px);
  font-weight: 900;
  line-height: .92;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.hero__glow { color: var(--accent); text-shadow: var(--tglow); }

.hero__lede {
  margin-top: 24px;
  max-width: 480px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.hero__art {
  flex: 1 1 340px;
  max-width: 480px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line2);
  border-radius: 28px;
  /* The artwork keeps its night palette in both themes */
  background: radial-gradient(circle at 50% 45%, #1C2D23, #111915);
}
.hero__art > svg { width: 100%; height: auto; }

/* ---------- Hero slideshow: a fanned deck of the rarest stickers ---------- */
.hero-show {
  /* The panel stays dark in both themes, so its rarity hues stay the dark-theme ones */
  --r1: #B2C0B7;
  --cash: #7CE7FF;
  --dice: #3DFF8F;
  --r4: #B98CFF;
  --sticker: #F2C14E;
  --carry: #FF8A6B;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  overflow: hidden;
}
.hero-show__stage { position: relative; height: 300px; }
.hero-show__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.6);
  transition: transform .7s cubic-bezier(.16, 1, .3, 1), opacity .5s ease;
  pointer-events: none;
}
/* Rarity glow behind the card in front */
.hero-show__slide::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--hue) 55%, transparent), transparent 68%);
  opacity: 0;
  transition: opacity .6s ease;
}
.hero-show__slide.is-active { z-index: 2; opacity: 1; transform: none; }
.hero-show__slide.is-active::before { opacity: .9; }
.hero-show__slide.is-prev { z-index: 1; opacity: .4; transform: translateX(-36%) rotate(-11deg) scale(.7); }
.hero-show__slide.is-next { z-index: 1; opacity: .4; transform: translateX(36%) rotate(11deg) scale(.7); }
.hero-show__img {
  position: relative;
  display: block;
  width: auto;
  height: 248px;
  max-width: 100%;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .55));
}

/* One caption per slide, stacked in the same cell; only the current one shows */
.hero-show__captions { display: grid; }
.hero-show__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s;
}
.hero-show__caption.is-active { opacity: 1; visibility: visible; }
.hero-show__text { min-width: 0; }
.hero-show__name {
  color: #EDF3EF; /* the art panel stays dark in both themes */
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}
.hero-show__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: #B2C0B7;
  font-size: 13px;
}
.hero-show__meta .stars svg { width: 13px; height: 13px; }
.hero-show__buy { flex: none; }

.hero-show__controls { display: flex; align-items: center; gap: 8px; }
.hero-show__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(237, 243, 239, .22);
  border-radius: 10px;
  background: transparent;
  color: #EDF3EF;
}
.hero-show__btn:hover { border-color: #3DFF8F; color: #3DFF8F; }
.hero-show__count { min-width: 52px; color: #B2C0B7; font-size: 13px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.hero-show__pause { margin-left: auto; }
.hero-show__pause .i-play { display: none; }
.hero-show__pause.is-paused .i-pause { display: none; }
.hero-show__pause.is-paused .i-play { display: block; }

@media (prefers-reduced-motion: reduce) {
  .hero-show__slide,
  .hero-show__slide::before,
  .hero-show__caption { transition: none; }
}

/* ---------- Trust strip ---------- */
.trust {
  border-block: 1px solid var(--line);
  background: var(--bg2);
}
.trust__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  margin: 0 auto;
  padding-block: 22px;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
}
.trust__list li { display: flex; align-items: center; gap: 12px; }
.trust__list li::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--accent);
}

/* ---------- Shop ---------- */
.shop { padding-block: 72px 40px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.section-title { font-size: 56px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 36px;
}

.product {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  transition: border-color .2s;
}
.product:hover { border-color: color-mix(in srgb, var(--hue) 45%, var(--line)); }
.product__icon { transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.product:hover .product__icon { transform: translateY(-4px) scale(1.04); }
@media (prefers-reduced-motion: reduce) {
  .product:hover .product__icon { transform: none; }
}

/* "Added" confirmation on cart buttons */
[data-add-to-cart][data-added]::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--check) center / contain no-repeat;
  mask: var(--check) center / contain no-repeat;
}
/* One hue per star rating, climbing from quiet to hot (product cards and the hero slideshow) */
.product--r1, .rarity-1 { --hue: var(--r1); }
.product--r2, .rarity-2 { --hue: var(--cash); }
.product--r3, .rarity-3 { --hue: var(--dice); }
.product--r4, .rarity-4 { --hue: var(--r4); }
.product--r5, .rarity-5,
.product--golden { --hue: var(--sticker); }
.product--r6, .rarity-6 { --hue: var(--carry); }

.stars { display: flex; gap: 3px; color: var(--hue); }
.stars svg { width: 16px; height: 16px; fill: currentColor; }

/* Sticker art (transparent PNGs) sits on the rarity glow like a card on a table */
.product__img {
  display: block;
  width: auto;
  height: 152px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .35));
  transition: transform .35s cubic-bezier(.16, 1, .3, 1);
}
.product:hover .product__img { transform: translateY(-4px) scale(1.03); }
@media (prefers-reduced-motion: reduce) {
  .product:hover .product__img { transform: none; }
}
/* Art sits at the bottom of a slightly taller panel, so the set badge has its own strip on top */
.product--has-art .product__art { height: 204px; justify-content: flex-end; padding-bottom: 14px; }

.product__art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 180px;
  background: var(--card2);
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--hue) 20%, transparent), transparent 65%),
    var(--card2);
}
.product__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--hue);
  color: var(--onHue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}
.product__icon {
  width: 92px;
  height: 92px;
  color: var(--hue);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.product__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}
.product__cat {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.product__name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}
.product__desc { color: var(--muted); font-size: 14px; line-height: 1.5; }
.product__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}

/* Scoped to product cards: WooCommerce also uses a .price class on its own markup */
.product .price {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.shop__empty { margin-top: 28px; color: var(--muted); font-size: 15px; }
.shop__more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding-bottom: 40px;
}
.shop__count { color: var(--muted); font-size: 13px; }

/* Star-rating chips and the set picker */
/* Toolbar above the grid: search grows, then rating chips and the set picker */
.shop__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 24px;
}
.shop-search { position: relative; flex: 1 1 280px; margin: 0; }
.shop-search .ico {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.shop-search .input { min-height: 44px; padding-left: 42px; }
.shop__filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.chip--stars { gap: 4px; padding: 0 16px; }
.chip--stars svg { width: 14px; height: 14px; fill: currentColor; }
.set-filter { position: relative; display: block; }
.set-filter::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 12px;
  height: 12px;
  background: var(--muted);
  -webkit-mask: var(--chevron) center / contain no-repeat;
  mask: var(--chevron) center / contain no-repeat;
  transform: translateY(-50%);
  pointer-events: none;
}
.set-filter__select {
  min-width: 240px;
  padding-right: 40px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

/* ---------- How it works ---------- */
.how {
  border-top: 1px solid var(--line);
  background: var(--bg2);
}
.how__inner { padding-block: 72px; }
.how__title { font-size: 52px; }

/* Typographic columns on a thin rule: used for the shop's steps and roulette's points */
.steps,
.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.step,
.point { padding-top: 20px; border-top: 1px solid var(--line2); }
.step__num {
  display: block;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 900;
  line-height: .9;
}
.step__title,
.point__title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}
.point__title { margin-top: 0; }
.step__text,
.point__text {
  max-width: 34ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.points { margin-top: 64px; }

/* "What we need from you": two short numbered lists under How it works */
.howto { margin-top: 64px; }
.howto__title { font-size: 32px; }
.howto__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  margin-top: 22px;
}
.howto__col { padding-top: 18px; border-top: 1px solid var(--line2); }
.howto__subtitle {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
}
.howto__steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: howto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.howto__steps li { display: flex; gap: 12px; counter-increment: howto; }
.howto__steps li::before {
  content: counter(howto);
  flex: none;
  width: 24px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
}
.howto__steps strong { color: var(--text); }
.howto__note { max-width: 640px; margin-top: 28px; }

/* ---------- FAQ ---------- */
.faq { padding-block: 72px; }
.faq__title { font-size: 52px; }
.faq__list { max-width: 820px; margin-top: 24px; border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 18px 0;
  font-size: 17px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: var(--muted);
  -webkit-mask: var(--chevron) center / contain no-repeat;
  mask: var(--chevron) center / contain no-repeat;
  transition: transform .25s cubic-bezier(.16, 1, .3, 1);
}
.faq__item[open] summary::after { background: var(--accent); transform: rotate(180deg); }
.faq__item summary:hover { color: var(--accent); }
.faq__item p { max-width: 65ch; padding-bottom: 20px; color: var(--muted); font-size: 15px; line-height: 1.6; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg3);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  padding-block: 48px;
}
.site-footer__about { max-width: 320px; }
.site-footer__brand {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .04em;
}
.site-footer__note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 48px; font-size: 14px; }
.site-footer__col { display: flex; flex-direction: column; gap: 10px; }
.site-footer__heading { font-size: 14px; font-weight: 700; }

/* ---------- Mobile tab bar ---------- */
.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line2);
  background: var(--bg2);
}
.tabbar button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
}
.tabbar a,
.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }

/* =====================================================
   Trade Roulette
   ===================================================== */
.roulette { padding-block: 36px 72px; }
.roulette__title { font-size: 60px; }

.prefs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.prefs__gap { margin-left: 8px; }

.tag {
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-weight: 600;
}
.tag--want { color: var(--accent); }
.tag--have { color: var(--gold); }
.tag--topic { border-color: var(--line2); color: var(--text); }

.notice {
  margin-top: 20px;
  padding: 12px 16px;
  border: 1px solid var(--warnLine);
  border-radius: 10px;
  background: var(--warnBg);
  color: var(--warnText);
  font-size: 14px;
  line-height: 1.5;
}

.roulette__body {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 24px;
  margin-top: 24px;
}

/* Chat */
.chat {
  display: flex;
  flex: 1 1 560px;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.chat__view { display: flex; flex: 1; flex-direction: column; min-height: 0; }

.chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 20px;
  border-bottom: 1px solid var(--line);
}
.chat__meta {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  min-width: 0;
}
.chat__who strong:focus { outline: none; }
.chat__who { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.live-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.chat__common { color: var(--muted); font-size: 13px; }

/* At least the design's 400px, and fills the row when the trade panel is taller */
.chat__log {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 12px;
  min-height: 400px;
  overflow-y: auto;
  padding: 20px;
}
.msg { display: flex; justify-content: flex-start; }
.msg--me { justify-content: flex-end; }
.msg__bubble {
  max-width: 70%;
  padding: 10px 16px;
  border-radius: 16px;
  background: var(--card2);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.msg--me .msg__bubble { background: var(--accent); color: var(--onAccent); }
.msg-sys { color: var(--muted); font-size: 13px; text-align: center; }
.chat__typing { color: var(--muted); font-size: 13px; }

.chat__form {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.chat__field { flex: 1; min-width: 0; }
.chat__form .input { min-height: 48px; background: var(--bg2); font-size: 15px; }
.chat__form .btn { min-height: 48px; padding: 0 24px; font-size: 15px; }
.chat__form .share-code { flex: none; gap: 8px; padding: 0 16px; }

/* ---------- MGO codes ----------
   Codes are shown as text in a mono face, never as links: copy them, don't follow them. */
.input--code { font-family: var(--font-mono); }
.input--code::placeholder { font-family: var(--font-body); }
.input[aria-invalid="true"] { border-color: var(--dangerText); }
.field-error { margin-top: 8px; color: var(--dangerText); font-size: 13px; font-weight: 600; line-height: 1.45; }

.code-form { padding: 14px 20px 0; border-top: 1px solid var(--line); }
.code-form + .chat__form { border-top: 0; }
.code-form__label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.code-form__row { display: flex; gap: 8px; }
.code-form__row .input { flex: 1; min-width: 0; min-height: 48px; background: var(--bg2); }
.code-form__row .btn { flex: none; min-height: 48px; }
.code-form__cancel { width: 48px; padding: 0; }

.msg--code { align-items: flex-start; }
.code-card {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(100%, 440px);
  padding: 10px 10px 10px 16px;
  border: 1px solid var(--line2);
  border-radius: 16px;
  background: var(--card2);
}
.msg--me .code-card { border-color: var(--accent); background: var(--accentBg); }
.code-card__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.code-card__label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.code-card__value { color: var(--text); font-family: var(--font-mono); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.code-copy { flex: none; gap: 6px; min-height: 44px; padding: 0 14px; }

.codes { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.codes__row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card2);
}
.codes dt { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.codes dd { margin: 0; }
.codes__value { overflow: hidden; font-family: var(--font-mono); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.codes__value.is-empty { color: var(--muted); font-family: var(--font-body); font-weight: 500; }
.codes__act { display: flex; justify-content: flex-end; }

/* Searching state */
.scan {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex: 1;
  min-height: 564px;
  padding: 0 20px;
  text-align: center;
}
.scan__radar { position: relative; width: 120px; height: 120px; }
.scan__ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: ping 1.6s ease-out infinite;
}
.scan__ring + .scan__ring { animation-delay: .8s; }
.scan__core {
  position: absolute;
  inset: 44px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 28px var(--accent);
}
.scan__title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  text-transform: uppercase;
}
.scan__text { color: var(--muted); font-size: 15px; }

@keyframes ping {
  0% { transform: scale(.3); opacity: .9; }
  100% { transform: scale(1.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .scan__ring { animation: none; opacity: .4; }
}

/* Trade panel */
.trade {
  display: flex;
  flex: 1 1 340px;
  flex-direction: column;
  gap: 18px;
  max-width: 440px;
  min-width: 0;
}
.trade-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.trade-card__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.offer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.offer-list li {
  padding: 12px 14px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card2);
  font-weight: 600;
}
.trade-status { margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.trade-status.is-confirmed { color: var(--accent); }

.offer-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.confirm-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--onAccent);
  font-size: 16px;
  font-weight: 700;
  transition: background-color .2s, opacity .2s;
}
.confirm-btn[data-state="waiting"] { background: var(--gold); cursor: default; }
.confirm-btn[data-state="done"] { background: var(--accentSoft); cursor: default; }
.confirm-btn:disabled { opacity: .5; cursor: not-allowed; }

.trade-done {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accentBg);
  color: var(--accentSoft);
  font-size: 14px;
  font-weight: 600;
}

.trade-actions { display: flex; gap: 12px; }
.trade-actions .btn,
.mobile-actions .btn { min-height: 52px; }
.btn-next { flex: 1; font-size: 16px; }
.trade-actions .btn--danger { padding: 0 22px; font-size: 15px; }

.mobile-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line2);
  background: var(--bg2);
}
.mobile-actions .btn--danger { padding: 0 20px; font-size: 15px; }

/* =====================================================
   Responsive: wide-only / narrow-only content
   ===================================================== */
@media (min-width: 720px) {
  .only-narrow { display: none !important; }
}

/* Narrow tablets: the shop nav drops to its own row instead of wrapping at random */
@media (min-width: 720px) and (max-width: 959.98px) {
  .site-nav--full { order: 5; flex-basis: 100%; }
}

@media (max-width: 719.98px) {
  .only-wide { display: none !important; }

  .wrap { padding-inline: 20px; }

  .announce { padding: 9px 12px; font-size: 12px; letter-spacing: .06em; }

  /* Header: logo, theme, cart on one row; search below */
  .site-header__inner { gap: 8px; padding: 10px 16px; }
  .brand { flex: 1; gap: 8px; font-size: 24px; }
  .brand__mark { width: 26px; height: 26px; }
  .theme-toggle { width: 44px; height: 44px; padding: 0; }
  .cart-btn { padding: 0 14px; gap: 8px; font-size: 14px; }
  .cart-btn svg { width: 18px; height: 18px; }

  /* Hero */
  .hero__inner { gap: 28px; padding-block: 32px 28px; }
  .hero__title { font-size: 64px; }
  .hero__lede { margin-top: 16px; font-size: 16px; }
  .hero__ctas { flex-direction: column; gap: 12px; margin-top: 22px; }
  .hero__ctas .btn { width: 100%; }
  .hero__art { flex-basis: 100%; max-width: none; padding: 10px; border-radius: 24px; }
  .hero-show { padding: 16px; gap: 12px; }
  .hero-show__stage { height: 240px; }
  .hero-show__img { height: 200px; }
  .hero-show__slide::before { width: 190px; height: 190px; }
  .hero-show__name { font-size: 24px; }
  .hero-show__buy { width: 100%; }

  /* Shop */
  .shop { padding-block: 28px 12px; }
  .section-head { display: block; }
  .section-title { font-size: 40px; }
  .filters {
    flex-wrap: nowrap;
    gap: 8px;
    margin: 16px -20px 0;
    padding: 0 20px 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex: none; padding: 0 18px; }

  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
  .product { border-radius: 14px; }
  .product__art { height: 110px; }
  .product__badge { top: 8px; left: 8px; padding: 3px 7px; font-size: 12px; letter-spacing: .04em; }
  .product__icon { width: 56px; height: 56px; }
  .product__body { gap: 6px; padding: 12px; }
  .product__cat { font-size: 12px; letter-spacing: .06em; }
  .product__name { font-size: 22px; }
  .product__desc { display: none; }
  /* Price and a short "Add" share one row so cards stay compact */
  .product__foot { gap: 8px; padding-top: 8px; }
  .product__foot .btn { flex: none; padding: 0 14px; }
  .product__foot .price { font-size: 24px; }

  .shop__toolbar { gap: 10px; margin-top: 16px; }
  .shop-search { flex-basis: 100%; }
  .shop__filters { width: 100%; gap: 10px; }
  .shop__filters .filters { margin-top: 0; }
  .set-filter { width: 100%; }
  .set-filter__select { width: 100%; min-width: 0; }
  .stars svg { width: 12px; height: 12px; }
  .product__img { height: 96px; }
  .product--has-art .product__art { height: 140px; padding-bottom: 8px; }
  .product__art { gap: 8px; }
  .shop__more { margin-top: 24px; padding-bottom: 24px; }

  /* How it works */
  .how { border-top: 0; background: none; }
  .how__inner { padding-block: 8px 32px; }
  .how__title { font-size: 36px; }
  .steps { gap: 18px; margin-top: 18px; }
  .step {
    display: grid;
    grid-template-columns: 52px 1fr;
    column-gap: 14px;
    padding-top: 14px;
  }
  .step__num { grid-row: span 2; font-size: 44px; }
  .step__title { margin: 0; font-size: 22px; }
  .step__text { margin-top: 4px; font-size: 14px; line-height: 1.45; }

  /* Footer clears the fixed tab bar */
  .site-footer__inner { padding-block: 24px 96px; }
  .site-footer__brand { font-size: 26px; }
  .site-footer__note { margin-top: 8px; font-size: 13px; }

  .tabbar { display: grid; }

  /* ---------- Trade Roulette, narrow ---------- */
  .roulette-page .site-header__inner { padding-block: 6px; }

  .roulette {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }
  .roulette__head { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  .roulette__title { margin: 0; font-size: 38px; }
  .prefs { flex-wrap: nowrap; gap: 6px; overflow-x: auto; font-size: 12px; white-space: nowrap; scrollbar-width: none; }
  .tag { padding: 6px 10px; }
  .notice { margin-top: 0; padding: 8px 12px; font-size: 12px; line-height: 1.4; }

  .roulette__body { flex-direction: column; flex-wrap: nowrap; gap: 10px; margin-top: 0; }

  .chat { flex: 1 1 auto; border-radius: 14px; }
  .chat__head { gap: 8px; padding: 6px 6px 6px 14px; }
  .chat__meta { flex-direction: column; align-items: flex-start; gap: 2px; }
  .roulette__live { display: flex; flex-direction: column; gap: 8px; }
  .chat__who { gap: 8px; font-size: 14px; }
  .live-dot { width: 9px; height: 9px; box-shadow: 0 0 10px var(--accent); }
  .chat__common { font-size: 12px; }
  .chat__log { min-height: min(400px, 55vh); gap: 8px; padding: 10px 12px; }
  .chat__log > :first-child { margin-top: auto; }
  .msg__bubble { max-width: 80%; padding: 7px 12px; border-radius: 14px; font-size: 14px; line-height: 1.35; }
  .msg-sys { font-size: 12px; }
  .chat__form { gap: 8px; padding: 8px; }
  .chat__form .input { padding: 0 14px; }
  .chat__form .btn { padding: 0 18px; }
  .chat__form .share-code { width: 48px; padding: 0; }
  .code-form { padding: 10px 8px 0; }
  .code-form__label { font-size: 12px; }
  .code-card { gap: 8px; padding: 8px 8px 8px 12px; border-radius: 14px; }
  .code-card__value { font-size: 14px; }

  .scan { gap: 16px; min-height: min(400px, 55vh); }
  .scan__radar { width: 80px; height: 80px; }
  .scan__core { inset: 28px; box-shadow: 0 0 22px var(--accent); }
  .scan__title { font-size: 28px; }
  .scan__text { font-size: 13px; }

  /* Mid-chat the conversation gets the screen: the title, want/have tags and safety banner step
     aside (the safety line becomes the chat's first message), and the trade panel becomes a sheet
     pulled up from the bottom bar. Their offer | your offer side by side, confirm underneath. */
  .roulette-page:not([data-stage="setup"]) .roulette__head,
  .roulette-page:not([data-stage="setup"]) .notice { display: none; }
  .trade {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-areas: "head head" "codes codes" "theirs yours" "confirm confirm";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 10px;
    max-width: none;
    max-height: 80dvh;
    overflow-y: auto;
    padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line2);
    border-radius: 20px 20px 0 0;
    background: var(--bg2);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, .45);
    visibility: hidden;
    transform: translateY(105%);
    transition: transform .35s cubic-bezier(.16, 1, .3, 1), visibility .35s;
  }
  .trade.is-open { visibility: visible; transform: none; }
  .trade__head { grid-area: head; display: flex; align-items: center; justify-content: space-between; }
  .trade__title { font-size: 24px; }
  .trade-scrim {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(4, 10, 7, .6);
  }
  .mobile-actions .trade-open { position: relative; padding: 0 18px; font-size: 15px; }
  .trade-open__dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--bg2);
  }
  .trade-card { padding: 12px; border-radius: 14px; }
  .trade-card--theirs { grid-area: theirs; }
  .trade-card--yours { display: contents; }
  .trade-card__pick {
    grid-area: yours;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
  }
  .trade-card__label { font-size: 12px; letter-spacing: .1em; }
  .codes-card { grid-area: codes; }
  .codes { margin-top: 8px; }
  .codes__row { grid-template-columns: 52px minmax(0, 1fr) auto; padding: 4px 4px 4px 10px; }
  .codes__value { font-size: 13px; }
  .offer-list { gap: 6px; margin-top: 8px; }
  .offer-list li { padding: 9px 10px; border-radius: 8px; font-size: 13px; }
  .trade-status { margin-top: 8px; font-size: 12px; }
  .offer-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
  .offer-picks .toggle { padding: 0 6px; border-radius: 8px; font-size: 12px; }
  .confirm-btn { grid-area: confirm; min-height: 48px; margin-top: 0; font-size: 15px; }
  .trade-done { display: none; }
}

/* Phone held upright with room to spare: once matching starts, roulette becomes a
   full-screen app view. The setup stage scrolls like a normal page. */
@media (max-width: 719.98px) and (min-height: 600px) {
  .roulette-page:not([data-stage="setup"]) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .roulette-page .site-header,
  .roulette-page .mobile-actions { flex: none; }
  .roulette-page:not([data-stage="setup"]) .roulette-main { display: flex; flex: 1; flex-direction: column; min-height: 0; }
  .roulette-page:not([data-stage="setup"]) .roulette { flex: 1; min-height: 0; width: 100%; }
  .roulette__live,
  .roulette__body { flex: 1; min-height: 0; }
  .chat { min-height: 0; }
  .chat__log { min-height: 0; }
  .scan { min-height: 0; }
}

/* =====================================================
   Trade Roulette — setup, matching, ended, sheets
   Flow is driven by <body data-stage="setup|scan|chat|ended">.
   ===================================================== */
:root {
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E");
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --x-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
}

.ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.roulette-page[data-stage="setup"] [data-live],
.roulette-page[data-stage="setup"] .mobile-actions,
.roulette-page[data-stage="setup"] .prefs,
.roulette-page:not([data-stage="setup"]) [data-setup] { display: none; }

/* Header buttons */
.head-actions { display: flex; align-items: center; gap: 8px; }
.head-btn { position: relative; padding: 0 14px; font-size: 14px; }
.head-btn--icon { width: 44px; padding: 0; }
.count-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--onAccent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.link-btn {
  /* Text-sized look, 44px-tall hit area: the padding grows the target, the negative margin keeps the line */
  padding: 14px 0;
  margin: -14px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accentSoft); }
.link-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* Setup */
.setup { margin-top: 14px; }
.setup__lede { max-width: 620px; color: var(--muted); font-size: 18px; line-height: 1.55; text-wrap: balance; }
.nowrap { white-space: nowrap; }
.setup__lede strong { color: var(--text); }
.setup__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.pick-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.nick-card { margin-top: 22px; }
.topics-card { margin-top: 28px; }
/* Nickname and MGO code sit side by side */
.setup__grid .nick-card { margin-top: 0; }
.code-setup__note { margin-top: 10px; color: var(--muted); font-size: 13px; }
.pick-card__title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}
.optional {
  margin-left: 4px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  vertical-align: middle;
}
.pick-card__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.pick-count {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accentBg);
  color: var(--accent);
  font-weight: 600;
}
.pick-card__hint { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.pick-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pick-chips .chip[aria-pressed="true"]::after {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--check) center / contain no-repeat;
  mask: var(--check) center / contain no-repeat;
}
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip:disabled:hover { border-color: var(--line2); }
.chip--add { border-style: dashed; color: var(--accent); }

.add-row { display: flex; gap: 8px; margin-top: 12px; }
.add-row .input { flex: 1; min-width: 0; }

.nick-pill {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.nick-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.nick-row .input { flex: 1 1 240px; min-width: 0; }

.setup__go {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  text-align: center;
}
.setup__start { min-width: 320px; min-height: 60px; font-size: 18px; }
.setup__consent { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Matching extras */
.scan__title:focus { outline: none; }
.scan__picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 440px; }
.scan__picks .tag { font-size: 13px; }
.scan__fallback { color: var(--warnText); font-size: 14px; font-weight: 600; }

/* Chat: end button and ended bar */
.chat__end { flex: none; padding: 0 14px; font-size: 14px; }
.is-ended .live-dot { background: var(--muted); box-shadow: none; }
.is-ended [data-who-prefix] { display: none; }
.chat__ended {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg2);
}
.chat__ended-text { color: var(--muted); font-size: 14px; }
.chat__ended-text:focus { outline: none; }
.chat__ended-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.toggle:disabled { opacity: .5; cursor: not-allowed; }
.toggle:disabled:hover { border-color: var(--line2); }

/* Sheets (native <dialog>) */
.sheet {
  width: min(560px, calc(100% - 32px));
  max-height: min(720px, calc(100dvh - 48px));
  padding: 0;
  border: 1px solid var(--line2);
  border-radius: 20px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(4, 10, 7, .72); backdrop-filter: blur(3px); }
.sheet__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
}
.sheet__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accentBg);
  color: var(--accent);
}
.sheet__icon .ico { width: 22px; height: 22px; }
.sheet__titles { flex: 1; min-width: 0; }
.sheet__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}
.count-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accentBg);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
}
.sheet__sub { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.sheet__close {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
}
.sheet__close:hover { border-color: var(--muted); }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
.sheet__foot { padding: 14px 20px; border-top: 1px solid var(--line); font-size: 14px; text-align: right; }

.sheet__empty { padding: 28px 8px; text-align: center; }
.sheet__empty .sheet__icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 16px; }
.sheet__empty .sheet__icon .ico { width: 28px; height: 28px; }
.sheet__empty h3 { margin-top: 16px; font-size: 18px; }
.sheet__empty p { max-width: 380px; margin: 8px auto 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.sheet__empty .btn { margin-top: 12px; }

.history { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.history__item { border: 1px solid var(--line); border-radius: 12px; background: var(--card2); }
.history__item summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 14px 16px;
  list-style: none;
  cursor: pointer;
}
.history__item summary::-webkit-details-marker { display: none; }
.history__who { font-weight: 700; }
.history__outcome {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.history__outcome.is-complete { color: var(--accent); }
.history__outcome.is-reported { color: var(--dangerText); }
.history__meta { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.history__body { padding: 0 16px 16px; }
.history__msgs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  margin: 0 0 12px;
  padding: 12px;
  overflow-y: auto;
  border-radius: 10px;
  background: var(--bg2);
  list-style: none;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.history__msgs .is-sys { color: var(--muted); font-size: 12px; text-align: center; }
.history__msgs .is-code { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.history__msgs .is-code .code-card__value { font-size: 14px; }

/* Cart sheet */
.cart-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
/* With sticker art: a thumbnail column in front of the name and price */
.cart-item--art { grid-template-columns: 56px 1fr auto; }
.cart-item--art .cart-item__img { grid-row: 1 / span 2; grid-column: 1; }
.cart-item--art .cart-item__name,
.cart-item--art .cart-item__each { grid-column: 2; }
.cart-item--art .cart-item__total,
.cart-item--art .stepper { grid-column: 3; }
.cart-item__img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .3));
}
.cart-item:first-child { padding-top: 0; }
.cart-item:last-child { padding-bottom: 0; border-bottom: 0; }
.cart-item__name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}
.cart-item__each { grid-column: 1; color: var(--muted); font-size: 13px; }
.cart-item__total {
  grid-row: 1;
  grid-column: 2;
  justify-self: end;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
}
.stepper {
  grid-row: 2;
  grid-column: 2;
  justify-self: end;
  display: flex;
  align-items: center;
  border: 1px solid var(--line2);
  border-radius: 10px;
}
.stepper button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
}
.stepper button:hover { color: var(--accent); }
.stepper output { min-width: 28px; font-weight: 700; text-align: center; }
.cart-foot { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; font-size: 15px; }
.cart-total strong {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 900;
}
.cart-note { color: var(--muted); font-size: 13px; line-height: 1.45; }
.cart-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--dangerLine);
  border-radius: 10px;
  color: var(--dangerText);
  font-size: 14px;
  line-height: 1.45;
}
/* While a quantity change is in flight, the steppers wait */
.sheet[aria-busy="true"] .stepper { opacity: .6; pointer-events: none; }
[data-add-to-cart][aria-busy="true"] { cursor: progress; }

/* The cart count lands with a small bump when something is added */
@media (prefers-reduced-motion: no-preference) {
  .is-bumped { animation: bump .45s cubic-bezier(.16, 1, .3, 1); }
}
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.safety-age {
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--warnLine);
  border-radius: 12px;
  background: var(--warnBg);
  color: var(--warnText);
  font-size: 14px;
  line-height: 1.55;
}
.safety-age .ico { width: 22px; height: 22px; }
.safety-age strong { display: block; margin-bottom: 4px; font-size: 15px; }
.safety-rules__title {
  margin-top: 22px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.safety-rules {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.safety-rules strong { color: var(--text); }

@media (max-width: 719.98px) {
  .head-actions { gap: 6px; }
  .head-btn { width: 44px; height: 44px; padding: 0; }

  .setup { margin-top: 0; }
  .setup__lede { font-size: 15px; }
  .setup__grid { grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
  .pick-card { padding: 16px; border-radius: 14px; }
  .nick-card { margin-top: 12px; }
  .topics-card { margin-top: 14px; }
  .pick-card__title { font-size: 26px; }
  .pick-chips { gap: 8px; }
  .pick-chips .chip { padding: 0 14px; }
  .nick-row .btn { flex: 1 0 100%; }
  .setup__go { margin-top: 18px; }
  .setup__start { width: 100%; min-width: 0; }
  .howto { margin-top: 40px; }
  .howto__title { font-size: 28px; }
  .howto__grid { gap: 24px; margin-top: 16px; }
  .howto__note { margin-top: 20px; }
  .faq { padding-block: 32px 40px; }
  .faq__title { font-size: 36px; }
  .faq__item summary { padding: 14px 0; font-size: 16px; }
  .points { gap: 18px; margin-top: 36px; }
  .point { padding-top: 14px; }
  .point__title { font-size: 22px; }
  .point__text { margin-top: 4px; font-size: 14px; }

  .chat__end { width: 44px; padding: 0; }
  .chat__ended { gap: 8px; padding: 10px 12px; }
  .chat__ended-text { font-size: 12px; }
  .chat__ended-actions { gap: 8px; width: 100%; }
  .chat__ended-actions .btn { flex: 1; padding: 0 10px; font-size: 13px; }

  .sheet {
    width: 100%;
    max-width: 100%;
    max-height: 88dvh;
    margin: auto 0 0;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
  }
  .sheet__head { padding: 16px 16px 14px; }
  .sheet__title { font-size: 24px; }
  .sheet__body { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
}

/* =====================================================
   Monogle hero (roulette page, before matching only)
   ===================================================== */
/* The hero carries the page heading during setup; the compact head returns mid-chat */
.roulette-page[data-stage="setup"] .roulette__head { display: none; }
.mg-hero .hero__inner { padding-block: 64px 72px; }
.mg-hero__tagline {
  margin-top: 14px;
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
}
.mg-hero .hero__lede { margin-top: 14px; }
/* Monogle preview: the stranger is a demo bot until real matching ships */
.mg-preview {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 560px;
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.mg-preview__tag,
.demo-tag {
  flex: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--onGold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.5;
  text-transform: uppercase;
}
.mg-preview__tag { margin-top: 1px; }
.mg-beats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.mg-beats li { display: flex; align-items: center; gap: 8px; }
.mg-beats li > span:first-child {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accentBg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

/* Sample match: always a dark panel, like the shop's art */
.mg-demo { display: flex; flex-direction: column; gap: 14px; padding: 20px; color: #EDF3EF; }
.mg-demo__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(237, 243, 239, .12);
  font-size: 15px;
}
.mg-demo .live-dot { background: #3DFF8F; box-shadow: 0 0 12px #3DFF8F; }
.mg-demo__state { margin-left: auto; color: #3DFF8F; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mg-demo__msgs { display: flex; flex-direction: column; gap: 8px; }
.mg-bubble { max-width: 80%; padding: 9px 14px; border-radius: 16px; font-size: 14px; line-height: 1.4; }
.mg-bubble--them { align-self: flex-start; background: #2B3B34; }
.mg-bubble--me { align-self: flex-end; background: #3DFF8F; color: #04130B; }
.mg-demo__swap { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 6px 0 2px; }
.mg-demo__sticker { display: block; width: auto; height: 104px; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .45)); }
/* Their MGO code, as it arrives in a real chat */
.mg-code {
  display: grid;
  grid-template-areas: "label copy" "value copy";
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  align-self: flex-start;
  max-width: 88%;
  padding: 8px 8px 8px 14px;
  border: 1px solid rgba(237, 243, 239, .18);
  border-radius: 14px;
  background: #2B3B34;
}
.mg-code__label { grid-area: label; color: #A9BDB3; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.mg-code__value { grid-area: value; font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.mg-code__copy {
  display: inline-flex;
  grid-area: copy;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(237, 243, 239, .3);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
.mg-demo__sticker--icon { width: 90px; height: 90px; color: #F2C14E; fill: none; stroke: currentColor; stroke-width: 1.4; }
.mg-demo__arrows { width: 34px; height: 34px; color: #3DFF8F; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mg-demo__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #3DFF8F;
  border-radius: 10px;
  background: rgba(61, 255, 143, .1);
  color: #B8FFD9;
  font-size: 13px;
  font-weight: 700;
}
/* The match plays through: messages arrive, the swap turns, both confirm. Loops quietly. */
.motion-ok .mg-demo.is-in .mg-bubble,
.motion-ok .mg-demo.is-in .mg-code,
.motion-ok .mg-demo.is-in .mg-demo__status { animation: mg-step 12s cubic-bezier(.16, 1, .3, 1) infinite both; }
.motion-ok .mg-demo.is-in .mg-bubble:nth-child(1) { animation-delay: .6s; }
.motion-ok .mg-demo.is-in .mg-bubble:nth-child(2) { animation-delay: 2s; }
.motion-ok .mg-demo.is-in .mg-bubble:nth-child(3) { animation-delay: 3.4s; }
.motion-ok .mg-demo.is-in .mg-code { animation-delay: 4.6s; }
.motion-ok .mg-demo.is-in .mg-demo__status { animation-delay: 6.4s; }
.motion-ok .mg-demo.is-in .mg-demo__arrows { animation: mg-turn 12s cubic-bezier(.16, 1, .3, 1) 5.6s infinite both; }
@keyframes mg-step {
  0% { opacity: 0; transform: translateY(8px); }
  5%, 84% { opacity: 1; transform: none; }
  92%, 100% { opacity: 0; transform: none; }
}
@keyframes mg-turn {
  0% { transform: rotate(0deg); }
  7%, 100% { transform: rotate(180deg); }
}

@media (max-width: 719.98px) {
  .mg-hero .hero__inner { padding-block: 32px 28px; }
  .mg-hero__tagline { font-size: 21px; }
  .mg-beats { flex-direction: column; gap: 10px; margin-top: 22px; }
  .mg-demo { padding: 16px; }
  .mg-demo__sticker { height: 88px; }
}

/* =====================================================
   Loading screen (templates/parts/loader.php)
   On while html.is-loading (first load) or .is-leaving-page (on the way out).
   ===================================================== */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%),
    var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s;
}
html.is-loading .page-loader,
.page-loader.is-leaving-page { opacity: 1; visibility: visible; }
.page-loader__inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.page-loader__art { display: grid; place-items: center; width: 120px; height: 120px; }
.page-loader__brand {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .04em;
}
.page-loader__text { color: var(--muted); font-size: 14px; font-weight: 600; }

/* One art per destination; only the matching one shows */
.ld { display: none; position: relative; color: var(--accent); }
.page-loader[data-loader="shop"] .ld--shop,
.page-loader[data-loader="roulette"] .ld--roulette,
.page-loader[data-loader="checkout"] .ld--checkout,
.page-loader[data-loader="cart"] .ld--cart { display: block; }
.ld svg { width: 64px; height: 64px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Shop: a fanned deck of sticker cards, shuffling */
.ld--shop { width: 110px; height: 80px; }
.ld--shop i {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 48px;
  height: 66px;
  margin-left: -24px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--card);
  transform-origin: 50% 120%;
}
.ld--shop i:nth-child(1) { transform: rotate(-16deg); border-color: var(--cash); }
.ld--shop i:nth-child(2) { transform: rotate(16deg); border-color: var(--gold); }
.ld--shop i:nth-child(3) { z-index: 1; }
/* Roulette: the matching radar */
.ld--roulette { width: 84px; height: 84px; }
.ld--roulette i { position: absolute; inset: 0; border: 2px solid var(--accent); border-radius: 50%; }
.ld--roulette b {
  position: absolute;
  inset: 31px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 22px var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .ld--shop i:nth-child(3) { animation: ld-deal 1.1s cubic-bezier(.16, 1, .3, 1) infinite; }
  .ld--shop i:nth-child(1) { animation: ld-fan-left 1.1s cubic-bezier(.16, 1, .3, 1) infinite; }
  .ld--shop i:nth-child(2) { animation: ld-fan-right 1.1s cubic-bezier(.16, 1, .3, 1) infinite; }
  .ld--roulette i { animation: ping 1.6s ease-out infinite; }
  .ld--roulette i + i { animation-delay: .8s; }
  .ld--checkout { animation: ld-pulse 1.3s ease-in-out infinite; }
  .ld--cart { animation: ld-hop .9s cubic-bezier(.3, 0, .2, 1) infinite; }
}
@keyframes ld-deal { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-14px); } }
@keyframes ld-fan-left { 0%, 100% { transform: rotate(-16deg); } 45% { transform: rotate(-24deg); } }
@keyframes ld-fan-right { 0%, 100% { transform: rotate(16deg); } 45% { transform: rotate(24deg); } }
@keyframes ld-pulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); } 50% { transform: scale(1.08); filter: drop-shadow(0 0 14px var(--accent)); } }
@keyframes ld-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-12px) rotate(-6deg); } 70% { transform: translateY(0) rotate(0); } }

/* =====================================================
   Entrance motion (assets/js/motion.js)
   Only under html.motion-ok; each element animates once on entering view.
   animation-fill-mode: backwards hides it during its stagger delay, then hands
   back to its normal styles, so hover and press transitions keep working.
   ===================================================== */
/* Hidden with opacity, never clip-path: a fully clipped element counts as not intersecting,
   so the observer would never reveal it. The wipe's clip lives only inside its keyframes. */
.motion-ok [data-reveal="rise"]:not(.is-in),
.motion-ok [data-reveal="slide"]:not(.is-in),
.motion-ok [data-reveal="pop"]:not(.is-in),
.motion-ok [data-reveal="wipe"]:not(.is-in) { opacity: 0; }
.motion-ok [data-reveal].is-in {
  animation-duration: .75s;
  animation-timing-function: cubic-bezier(.16, 1, .3, 1);
  animation-delay: calc(var(--i, 0) * 80ms);
  animation-fill-mode: backwards;
}
.motion-ok [data-reveal="rise"].is-in { animation-name: rv-rise; }
.motion-ok [data-reveal="slide"].is-in { animation-name: rv-slide; }
.motion-ok [data-reveal="pop"].is-in { animation-name: rv-pop; animation-duration: .9s; }
.motion-ok [data-reveal="wipe"].is-in { animation-name: rv-wipe; animation-duration: .9s; }
.hero__line { display: inline-block; }
/* The slideshow arrives as a closed deck, then fans out */
.motion-ok .hero-show:not(.is-in) .hero-show__slide.is-prev,
.motion-ok .hero-show:not(.is-in) .hero-show__slide.is-next { opacity: 0; transform: scale(.6); }

@keyframes rv-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes rv-slide { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes rv-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes rv-wipe {
  from { clip-path: inset(100% -10% -40% -10%); transform: translateY(18px); }
  to { clip-path: inset(-40% -10% -40% -10%); transform: none; }
}

/* ---------- Sticker preview (shop) ---------- */
.product__zoom {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: zoom-in;
}
.sheet.preview { width: min(780px, calc(100% - 32px)); overflow: hidden; }
.sheet.preview[open] { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.preview__close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--card); }
.preview__stage {
  /* Always a dark stage, so its hues are the dark-theme ones */
  --r1: #B2C0B7;
  --cash: #7CE7FF;
  --dice: #3DFF8F;
  --r4: #B98CFF;
  --sticker: #F2C14E;
  --carry: #FF8A6B;
  display: grid;
  place-items: center;
  min-height: 400px;
  padding: 32px;
  background:
    radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--hue) 42%, transparent), transparent 62%),
    radial-gradient(circle at 50% 45%, #1C2D23, #111915);
}
.preview__img {
  width: auto;
  height: 300px;
  max-width: 100%;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .55));
  transition: transform .2s ease-out;
}
.preview__info { display: flex; flex-direction: column; gap: 12px; padding: 64px 28px 28px; }
.preview__title { font-size: 46px; line-height: .95; }
.preview__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--muted); font-size: 14px; }
.preview__desc { color: var(--muted); font-size: 15px; }
.preview__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.preview__price {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}
@media (prefers-reduced-motion: no-preference) {
  .sheet.preview { transition: opacity .25s ease, transform .35s cubic-bezier(.16, 1, .3, 1), overlay .35s allow-discrete, display .35s allow-discrete; }
  @starting-style {
    .sheet.preview[open] { opacity: 0; transform: scale(.96); }
  }
}
@media (max-width: 719.98px) {
  .sheet.preview { width: 100%; max-width: 100%; max-height: 92dvh; overflow-y: auto; }
  .sheet.preview[open] { grid-template-columns: 1fr; }
  .preview__stage { min-height: 260px; padding: 24px; }
  .preview__img { height: 210px; }
  .preview__info { padding: 18px 18px calc(20px + env(safe-area-inset-bottom)); }
  .preview__title { font-size: 36px; }
  .preview__price { font-size: 34px; }
  .preview__foot .btn { flex: 1; }
}

/* ---------- Drawer: a sheet docked to the right edge (the cart) ---------- */
.sheet.sheet--drawer {
  inset: 0 0 0 auto;
  width: min(440px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  border: 0;
  border-left: 1px solid var(--line2);
  border-radius: 0;
  box-shadow: -24px 0 60px rgba(0, 0, 0, .35);
}
.sheet--drawer .sheet__foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
@media (max-width: 719.98px) {
  /* Leave a sliver of the page showing so it reads as a panel over the shop */
  .sheet.sheet--drawer { width: min(420px, 90%); max-height: 100%; }
}
/* Slides in from the right; the backdrop fades. Browsers without @starting-style just show it. */
@media (prefers-reduced-motion: no-preference) {
  .sheet--drawer,
  .sheet--drawer::backdrop {
    transition: transform .38s cubic-bezier(.16, 1, .3, 1), opacity .3s ease, overlay .38s allow-discrete, display .38s allow-discrete;
  }
  .sheet--drawer { transform: translateX(100%); }
  .sheet--drawer[open] { transform: none; }
  .sheet--drawer::backdrop { opacity: 0; }
  .sheet--drawer[open]::backdrop { opacity: 1; }
  @starting-style {
    .sheet--drawer[open] { transform: translateX(100%); }
    .sheet--drawer[open]::backdrop { opacity: 0; }
  }
}

/* The page behind an open sheet stays put */
html:has(dialog.sheet[open]) { overflow: hidden; }
