/*
  In Order website: shared styles for every page.
  Tokens first (from the app's src/ui/palette.ts and theme.ts), then base,
  site chrome, components, home sections and the document pages.
  Class names are BEM-style so they can become global classes in a builder.
*/

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: "Baloo 2"; src: url("baloo2-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url("baloo2-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url("baloo2-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("figtree-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("figtree-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  /* The Holo palette, as in the app */
  --cloud: #E9F1FF;        /* ground: the app's table */
  --cloud-deep: #D2E0FA;   /* quiet surfaces and rules */
  --sparkle: #D3E0F8;      /* the backdrop's sparkles */
  --ink: #1C1E3A;          /* text, outlines, hard shadows */
  --slate: #5B6182;        /* secondary text (5.3:1 on cloud) */
  --deck-label: #4A5180;   /* small labels (6.6:1 on cloud) */
  --white: #FFFFFF;        /* card faces */
  --sun: #FFC43D;          /* actions, the rule card, the icon's gold */
  --sun-light: #FFE48A;
  --sun-pale: #FFE7A8;
  --felt: #232650;         /* the daily deal's table */
  --felt-deep: #1A1C40;
  --felt-text: #C9D2F2;    /* body text on felt (9:1) */
  --cherry: #FF4F6E;       /* out of place */
  --cherry-deep: #D6264C;
  --cherry-wash: #FFE3E8;
  --mint: #2ED3A0;         /* locked */
  --grape: #6E3FEF;        /* links and focus on light grounds */
  --ink-faint: rgba(28, 30, 58, 0.12);
  --ink-dots: rgba(28, 30, 58, 0.4);
  --star-off: #DCE5F7;
  --faded: #EEF2FB;
  --faded-ink: #8A90AE;

  /* Type */
  --font-display: "Baloo 2", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
  --font-text: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(0.875rem, 0.86rem + 0.06vw, 0.9375rem);  /* 14 → 15px */
  --step-0: clamp(1.0625rem, 1.03rem + 0.12vw, 1.125rem);   /* 17 → 18px body */
  --step-1: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);     /* 19 → 22px lead */
  --step-2: clamp(1.375rem, 1.2rem + 0.75vw, 1.75rem);      /* 22 → 28px h3 */
  --step-3: clamp(2rem, 1.55rem + 2vw, 3.25rem);            /* 32 → 52px h2 */
  --step-4: clamp(2.5rem, 1.9rem + 2.6vw, 4rem);            /* 40 → 64px page h1 */
  --display: clamp(3rem, 1.85rem + 5vw, 6rem);              /* 48 → 96px hero */

  /* Space: 8px unit */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  --space-7: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 3rem);
  --wrap: 1200px;
  --measure: 66ch;

  /* The sticker: outline and hard shadow straight down, as in the app */
  --line: 3px;
  --depth: 4px;
  --radius-card: 17px;
  --radius-button: 18px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-synthesis: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--cloud);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.08; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 6px; }
.on-dark :focus-visible { outline-color: var(--sun); }
::selection { background: var(--sun-light); color: var(--ink); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 12px;
  font: 700 1rem/1 var(--font-display); text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

/* The app's table: faint sparkles and dots on cloud (Backdrop in src/ui/art/Art.tsx) */
.backdrop {
  background-color: var(--cloud);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M16 9l1.8 5.2L23 16l-5.2 1.8L16 23l-1.8-5.2L9 16l5.2-1.8z' fill='%23D3E0F8'/%3E%3Ccircle cx='47' cy='45' r='2.4' fill='%23D3E0F8'/%3E%3C/svg%3E");
  background-size: 64px 64px;
}

/* ---------- Site header ---------- */
.site-header { position: relative; z-index: 20; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 80px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.625rem/1 var(--font-display); letter-spacing: -0.01em; padding: 6px 0; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav__link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px;
  font: 700 1.0625rem/1 var(--font-display); text-decoration: none; color: var(--ink);
}
.nav__link:hover { background: var(--cloud-deep); }
.nav__link[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.3em; text-decoration-color: var(--sun); }
.nav__cta { margin-left: 10px; }
@media (max-width: 860px) {
  .nav__link--wide { display: none; }
}
@media (max-width: 420px) {
  .brand { font-size: 1.4rem; }
  .brand__mark { width: 26px; height: 26px; }
  .nav__cta { margin-left: 2px; }
  .nav__link { padding: 0 8px; }
}

/* ---------- Buttons and pills ---------- */
.button {
  --face: var(--sun);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  border: var(--line) solid var(--ink); border-radius: var(--radius-button);
  background: var(--face); color: var(--ink);
  font: 800 1.25rem/1 var(--font-display); text-decoration: none; white-space: nowrap;
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background-color 0.2s;
}
.button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.button--white { --face: var(--white); }
.button--small { min-height: 44px; padding: 0 16px; font-size: 1.0625rem; border-radius: 14px; box-shadow: 0 4px 0 var(--ink); }
.button--small:active { box-shadow: 0 1px 0 var(--ink); }
.button[disabled], .button[aria-disabled="true"] { --face: var(--sun-pale); color: var(--slate); cursor: default; }
.button[disabled]:active { transform: none; box-shadow: 0 5px 0 var(--ink); }
.button__icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Store availability: flat (not buttons) until the listings are live. Swap for the official badges at launch. */
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.store {
  display: inline-flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 20px 8px 14px;
  border: var(--line) solid var(--ink); border-radius: 16px; background: var(--white);
}
.store__icon { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.store__text { display: flex; flex-direction: column; line-height: 1.1; }
.store__soon { font: 600 0.875rem/1.2 var(--font-display); color: var(--slate); }
.store__name { font: 800 1.1875rem/1.15 var(--font-display); }
@media (max-width: 480px) {
  .stores { gap: 10px; }
  .store { flex: 1 1 0; min-width: 0; gap: 8px; padding: 8px 10px; min-height: 56px; }
  .store__icon { width: 24px; height: 24px; }
  .store__soon { font-size: 0.8125rem; }
  .store__name { font-size: 1rem; }
}

/* ---------- Game pieces (from src/ui/CardBits.tsx and Column.tsx) ---------- */
.tile {
  --size: 40px;
  width: var(--size); height: var(--size); flex: none; display: grid; place-items: center;
  border: 2.5px solid var(--ink); border-radius: calc(var(--size) * 0.3); background: var(--tile, var(--sun));
}
.icon { width: 55%; height: 55%; fill: none; stroke: var(--ink); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }

.rule-pill {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  padding: 8px 28px 10px; background: var(--sun); color: var(--ink);
  border: var(--line) solid var(--ink); border-radius: var(--radius-button); box-shadow: 0 5px 0 var(--ink);
  font: 800 clamp(1.5rem, 1.25rem + 0.9vw, 2rem)/1.15 var(--font-display);
}
.deck-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 2px 16px;
  border: 2px solid var(--cloud-deep); border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.55);
  font: 700 0.9375rem/1 var(--font-display); color: var(--deck-label);
}

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px 0 5px; border-radius: 15px;
  background: var(--ink); color: var(--white); white-space: nowrap;
  font: 800 1rem/1 var(--font-display); font-variant-numeric: tabular-nums;
}
.badge__dot { width: 20px; height: 20px; border-radius: 50%; background: var(--mint); display: grid; place-items: center; flex: none; }
.badge__dot svg { width: 13px; height: 13px; fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.year-pill {
  display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 15px; white-space: nowrap;
  background: var(--cherry-wash); border: 2.5px solid var(--cherry);
  font: 800 1rem/1 var(--font-display); font-variant-numeric: tabular-nums;
}
.out-tag {
  display: inline-flex; align-items: center; height: 25px; padding: 0 9px; border-radius: 10px;
  background: var(--cherry-deep); color: var(--white); border: 2.5px solid var(--ink); box-shadow: 0 2px 0 var(--ink);
  font: 800 0.75rem/1 var(--font-display); white-space: nowrap; transform: rotate(5deg);
}
.grip { width: 12px; height: 18px; flex: none; margin-right: 4px;
  background: radial-gradient(circle, var(--ink-dots) 1.5px, transparent 1.7px) 0 0 / 6px 6px; }

/* A sticker star (StickerStar in src/ui/art/Art.tsx) */
.star { width: 1em; height: 1em; overflow: visible; }

/* ---------- The holographic foil (src/ui/Holo.tsx) ----------
   A rainbow band 1.8x the card's width that moves with the light, over fine
   white lines at 22 degrees. --light runs from -1 to 1 and follows the pointer. */
.foil { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.foil__band {
  position: absolute; top: 0; bottom: 0; left: 0; width: 180%;
  background: linear-gradient(112deg,
    rgba(255, 79, 110, 0) 18%, rgba(255, 79, 110, 0.32) 29%, rgba(255, 196, 61, 0.36) 38%,
    rgba(46, 211, 160, 0.32) 47%, rgba(61, 123, 255, 0.32) 56%, rgba(142, 91, 255, 0.3) 65%, rgba(142, 91, 255, 0) 76%);
  transform: translateX(calc(-22.2% + (var(--light, 0) + var(--phase, 0)) * 14.4%));
  transition: transform 0.5s var(--ease-out);
}
.foil::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(112deg, transparent 0 5px, rgba(255, 255, 255, 0.55) 5px 6px);
}

/* ---------- Sections ---------- */
.section { padding-block: var(--space-7); }
.section__title { font-size: var(--step-3); line-height: 1.04; letter-spacing: -0.02em; }
.section__lead { font-size: var(--step-1); line-height: 1.55; max-width: 34em; }
.on-dark { color: var(--white); }

/* ---------- Home: hero (the table) ---------- */
.hero { padding-block: var(--space-3) var(--space-6); overflow: clip; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: var(--space-5) clamp(2rem, 5vw, 5rem); align-items: center; }
.hero__copy { display: flex; flex-direction: column; gap: var(--space-3); max-width: 600px; }
.hero__title { font-size: var(--display); line-height: 0.94; letter-spacing: -0.035em; }
.hero__lead { font-size: var(--step-1); line-height: 1.55; max-width: 31em; }
.hero__note { font-size: var(--step--1); color: var(--slate); }
.hero__note strong { color: var(--ink); font-weight: 600; }
@media (max-width: 1023px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .hero__copy { max-width: 640px; justify-self: start; }
}

/* ---------- The deal ---------- */
.deal { --card-h: 72px; --gap: 8px; --pitch: calc(var(--card-h) + var(--gap)); width: 100%; max-width: 470px; position: relative; }
.deal__head { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; }
.deal__table { position: relative; }
.deal__axis { display: flex; align-items: center; gap: 6px; margin: 0 0 8px 4px; font: 700 0.9375rem/1 var(--font-display); color: var(--deck-label); }
.deal__axis--end { margin: 10px 0 0 4px; }
.deal__axis svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.deal__column {
  position: relative; list-style: none; margin: 0; padding: 0;
  height: calc(var(--n, 5) * var(--pitch) - var(--gap) + var(--depth));
}
.deal__status { min-height: 3em; margin: 20px 0 14px; text-align: center; font: 700 1.125rem/1.4 var(--font-display); display: flex; align-items: center; justify-content: center; text-wrap: balance; }
.deal__actions { display: flex; gap: 12px; }
.deal__actions .button { flex: 1; }
.deal__check { font-size: 1.625rem; min-height: 60px; }
.deal__noscript { margin-top: 14px; text-align: center; font: 600 1rem/1.4 var(--font-display); color: var(--slate); }
.js .deal__noscript { display: none; }
:root:not(.js) .deal [data-js-only] { display: none; }

/* Checks left, as dots on the Check button */
.dots { display: inline-flex; gap: 5px; margin-left: 6px; }
.dots i { width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid var(--ink); }
.dots i.is-on { background: var(--ink); }

/* One card in the column. Without JS the cards stack in normal flow. */
.card { position: relative; height: var(--card-h); margin-bottom: var(--gap); list-style: none; }
.js .deal .card { position: absolute; left: 0; right: 0; top: 0; margin: 0; transform: translate3d(0, var(--y, 0), 0); }
.card__face {
  position: relative; height: 100%; display: flex; align-items: center; gap: 13px; padding: 0 12px 0 13px;
  background: var(--white); border: var(--line) solid var(--edge, var(--ink)); border-radius: var(--radius-card);
  box-shadow: 0 var(--depth) 0 var(--edge, var(--ink));
}
.card__face > :not(.foil) { position: relative; z-index: 1; }
.card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.card__name { font: 800 1.125rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.card__detail { font: 600 0.9rem/1.25 var(--font-display); color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__end { flex: none; display: flex; align-items: center; }
.card .out-tag { position: absolute; right: 18px; top: -13px; z-index: 3; pointer-events: none; }
.card__hit {
  position: absolute; inset: 0; z-index: 2; width: 100%; padding: 0; margin: 0; border: 0; background: none;
  border-radius: var(--radius-card); cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent;
}
.card__hit:focus-visible { outline-offset: 4px; }
.card.is-locked .card__hit { cursor: default; }
.deal.is-over .card__hit { cursor: pointer; touch-action: auto; }
.card.is-out { --edge: var(--cherry); }
.card.is-flash { --edge: var(--cherry); }
.card.is-dragging { z-index: 50; }
.card.is-dragging .card__face { box-shadow: 0 var(--depth) 0 var(--edge, var(--ink)), 0 18px 30px -12px rgba(28, 30, 58, 0.45); }
.card.is-held .card__face { outline: 3px dashed var(--grape); outline-offset: 5px; }

/* Where the dragged card will land */
.deal__slot {
  position: absolute; left: 0; right: 0; top: 0; height: var(--card-h); border-radius: var(--radius-card);
  border: 3px dashed rgba(28, 30, 58, 0.28); transform: translate3d(0, var(--y, 0), 0); opacity: 0; pointer-events: none;
}
.deal__slot.is-on { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .js .deal .card { transition: transform 0.32s var(--spring); }
  .js .deal .card.is-dragging { transition: none; }
  .deal__slot { transition: transform 0.25s var(--spring), opacity 0.12s; }
  .card__face { transition: border-color 0.25s, box-shadow 0.25s; }
  .card.is-dragging .card__face { transform: translate(6px, -9px) rotate(-2.5deg) scale(1.02); }
  .card .card__face { transition: transform 0.16s var(--ease-out), border-color 0.25s, box-shadow 0.25s; }
  .js .deal:not(.is-ready) .card { opacity: 0; }
  .card.is-entering .card__face { animation: deal-in 0.62s var(--spring) both; animation-delay: calc(80ms + var(--i, 0) * 55ms); }
  .card.is-flipping .card__face { animation: flip-back 0.34s ease-in-out, shake 0.22s 0.34s linear; }
  .card.is-pulsing .card__face { animation: pulse 0.35s ease-out both; animation-delay: var(--delay, 0ms); }
  .card.is-locking .foil { animation: sweep 0.65s var(--ease-out) both; animation-delay: var(--delay, 0ms); }
  .card.is-locking .badge { animation: pop 0.45s var(--spring) both; animation-delay: calc(var(--delay, 0ms) + 120ms); }
  .card .out-tag { animation: tag-pop 0.4s var(--spring) 0.38s both; }
}
@keyframes deal-in { from { opacity: 0; transform: translateY(-42px) rotate(-5deg); } to { opacity: 1; transform: none; } }
@keyframes flip-back { 0% { transform: perspective(700px) rotateX(0); } 50% { transform: perspective(700px) rotateX(88deg); } 100% { transform: perspective(700px) rotateX(0); } }
@keyframes shake { 0% { translate: 0; } 25% { translate: -7px 0; } 50% { translate: 7px 0; } 75% { translate: -4px 0; } 100% { translate: 0; } }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
@keyframes tag-pop { from { opacity: 0; transform: rotate(5deg) scale(0); } to { opacity: 1; transform: rotate(5deg) scale(1); } }

/* The result, under the column once the deal is over */
.result { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; position: relative; }
.result__title {
  font: 800 clamp(3rem, 2.4rem + 2.4vw, 4rem)/1 var(--font-display); letter-spacing: -0.01em;
  color: var(--sun); -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink); transform: rotate(-4deg); padding: 0 0.1em;
}
.result--lost .result__title { color: var(--white); font-size: clamp(2.25rem, 1.9rem + 1.6vw, 3rem); }
.result__stars { display: flex; gap: 6px; font-size: 44px; }
.result__stars .star:nth-child(2) { transform: translateY(-8px); font-size: 52px; }
.result__line { font: 700 1.0625rem/1.4 var(--font-display); }
.result__hint { font: 600 0.9375rem/1.4 var(--font-display); color: var(--slate); }
.result .deal__actions { align-self: stretch; margin-top: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .result__title { animation: title-pop 0.55s var(--spring) both; }
  .result__stars .star { animation: star-pop 0.5s var(--spring) both; }
  .result__stars .star:nth-child(1) { animation-delay: 0.25s; }
  .result__stars .star:nth-child(2) { animation-delay: 0.4s; }
  .result__stars .star:nth-child(3) { animation-delay: 0.55s; }
}
@keyframes title-pop { from { opacity: 0; transform: rotate(-4deg) scale(0.3); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }
@keyframes star-pop { from { opacity: 0; transform: scale(0) rotate(-30deg); } to { opacity: 1; } }

/* A one-off burst of confetti behind the title */
.confetti { position: absolute; left: 50%; top: 30px; width: 0; height: 0; pointer-events: none; z-index: -1; }
.confetti i { position: absolute; width: 12px; height: 12px; border: 2.5px solid var(--ink); border-radius: 4px; background: var(--c); opacity: 0; }
.confetti i:nth-child(3n) { border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) {
  .confetti i { animation: burst 0.9s var(--ease-out) var(--d, 0s) both; }
}
@keyframes burst {
  0% { opacity: 0; transform: translate(0, 0) rotate(0) scale(0.4); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); }
}

/* A card's story, after the deal (the app's fact sheet) */
.story {
  width: min(100% - 2rem, 420px); padding: 0; border: var(--line) solid var(--ink); border-radius: 22px;
  background: var(--white); color: var(--ink); box-shadow: 0 6px 0 var(--ink);
}
.story::backdrop { background: rgba(28, 30, 58, 0.5); }
.story__body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.story__head { display: flex; align-items: center; gap: 14px; }
.story__head .tile { --size: 52px; }
.story__name { font: 800 1.375rem/1.15 var(--font-display); }
.story__detail { font: 600 1rem/1.3 var(--font-display); color: var(--slate); }
.story__fact { font-size: 1.0625rem; line-height: 1.55; }
.story__source { font-size: 0.9375rem; color: var(--slate); }
.story__source a { color: var(--grape); font-weight: 600; }
.story .button { width: 100%; }

/* ---------- Home: the rules card ---------- */
.rules { position: relative; }
.rules__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-5) clamp(2rem, 6vw, 6rem); align-items: start; }
.rules__intro { display: flex; flex-direction: column; gap: var(--space-3); position: sticky; top: var(--space-4); }
.rules__card {
  position: relative; isolation: isolate;
  background: var(--white); border: var(--line) solid var(--ink); border-radius: 28px; box-shadow: 0 8px 0 var(--ink);
  padding: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
}
.rules__card::before, .rules__card::after {
  content: ""; position: absolute; inset: calc(-1 * var(--line)); z-index: -1; border: var(--line) solid var(--ink); border-radius: 28px; box-shadow: 0 8px 0 var(--ink);
}
.rules__card::before { background: var(--sun); transform: rotate(3deg) translate(14px, 8px); }
.rules__card::after { background: var(--white); }
.rules__list { list-style: none; margin: 0; padding: 0; counter-reset: rule; display: flex; flex-direction: column; }
.rules__item { counter-increment: rule; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 16px; padding: 22px 0; border-bottom: 2px dashed var(--cloud-deep); }
.rules__item:first-child { padding-top: 4px; }
.rules__item:last-child { border-bottom: 0; padding-bottom: 4px; }
.rules__item::before {
  content: counter(rule); grid-row: span 3; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sun); border: var(--line) solid var(--ink); font: 800 1.375rem/1 var(--font-display);
}
.rules__step { font-size: var(--step-2); line-height: 1.15; }
.rules__text { color: var(--ink); }
.rules__show { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.rules__show .rule-pill { font-size: 1.125rem; padding: 4px 16px 6px; box-shadow: 0 3px 0 var(--ink); border-radius: 13px; }
.rules__show .button { font-size: 1.25rem; min-height: 48px; pointer-events: none; }
.rules__show .stars-row { display: inline-flex; align-items: center; gap: 4px; font: 800 1.0625rem/1 var(--font-display); }
.rules__show .stars-row .star { font-size: 26px; }
.rules__show .stars-row + .stars-row { margin-left: 8px; }
.pin-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 14px;
  background: var(--white); border: var(--line) solid var(--ink); box-shadow: 0 4px 0 var(--ink); font: 800 1.125rem/1 var(--font-display); position: relative;
}
.pin-chip svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pin-chip__count {
  position: absolute; right: -10px; top: -12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mint); border: 2.5px solid var(--ink); font: 800 0.875rem/1 var(--font-display);
}
.mini-card {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 10px 0 9px; position: relative;
  background: var(--white); border: var(--line) solid var(--edge, var(--ink)); border-radius: 14px; box-shadow: 0 3px 0 var(--edge, var(--ink)); overflow: visible;
}
.mini-card > :not(.foil):not(.out-tag) { position: relative; z-index: 1; }
.mini-card .tile { --size: 30px; border-width: 2px; }
.mini-card__name { font: 800 1rem/1 var(--font-display); }
.mini-card .badge { height: 26px; font-size: 0.9375rem; }
.mini-card .badge__dot { width: 17px; height: 17px; }
.mini-card--out { --edge: var(--cherry); margin-top: 12px; }
.mini-card--out .out-tag { position: absolute; right: -14px; top: -15px; }
.mini-card .foil { border-radius: 11px; }
@media (max-width: 899px) {
  .rules__grid { grid-template-columns: minmax(0, 1fr); }
  .rules__intro { position: static; }
  .rules__card::before { transform: rotate(2deg) translate(6px, 6px); }
}

/* ---------- Home: the daily deal (on felt) ---------- */
.daily { background: var(--felt); color: var(--white); position: relative; overflow: clip; }
.daily::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M16 9l1.8 5.2L23 16l-5.2 1.8L16 23l-1.8-5.2L9 16l5.2-1.8z' fill='%232E3266'/%3E%3Ccircle cx='47' cy='45' r='2.4' fill='%232E3266'/%3E%3C/svg%3E");
  background-size: 64px 64px;
}
.daily__grid { position: relative; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--space-5) clamp(2rem, 6vw, 6rem); align-items: center; }
.daily__copy { display: flex; flex-direction: column; gap: var(--space-3); }
.daily__copy .section__lead { color: var(--felt-text); }
.daily__facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.daily__facts li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; color: var(--felt-text); }
.daily__facts strong { color: var(--white); font-weight: 600; }
.daily__facts svg { width: 26px; height: 26px; margin-top: 1px; }

/* The fan of seven foil cards, as on the app's home screen */
.fan { --w: clamp(100px, 6.5vw + 72px, 168px); --spread: 1; display: flex; flex-direction: column; align-items: center; gap: clamp(24px, 3vw, 40px); }
.fan__cards { position: relative; width: 100%; height: calc(var(--w) * 1.4 + var(--w) * 0.5); }
.fan__card {
  position: absolute; bottom: 0; left: calc(50% - var(--w) / 2); width: var(--w); aspect-ratio: 5 / 7;
  border: var(--line) solid var(--ink); border-radius: 16px; background: var(--white); box-shadow: 0 5px 0 #0F1030;
  transform-origin: 50% 165%; transform: rotate(calc(var(--r) * var(--spread))) translateY(var(--lift, 0));
  display: grid; place-items: center; overflow: hidden;
}
@media (max-width: 599px) { .fan { --spread: 0.78; } }
.fan__mark { position: relative; z-index: 1; width: 46%; aspect-ratio: 1; border-radius: 50%; background: var(--white); border: 2.5px solid var(--ink); display: grid; place-items: center; }
.fan__mark svg { width: 58%; height: 58%; fill: none; stroke: var(--ink); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.fan__label { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: calc(var(--w) * 0.22); }
.fan__deck { display: inline-flex; align-items: center; gap: 8px; font: 800 1.125rem/1 var(--font-display); color: var(--white); }
.fan__deck .tile { --size: 26px; border-width: 2px; }
.fan__rule { display: inline-flex; padding: 6px 18px 8px; border-radius: 14px; background: var(--white); color: var(--ink); border: var(--line) solid var(--ink); box-shadow: 0 4px 0 #0F1030; font: 800 1.1875rem/1 var(--font-display); }
@media (prefers-reduced-motion: no-preference) {
  .js .fan__card { transition: transform 0.9s var(--spring); transition-delay: calc(var(--i) * 45ms); }
  .js .fan:not(.is-open) .fan__card { transform: rotate(0deg) translateY(0); }
}

/* The share message */
.share { align-self: flex-start; max-width: 360px; background: var(--white); color: var(--ink); border-radius: 22px 22px 22px 6px; padding: 16px 20px 18px; box-shadow: 0 5px 0 #0F1030; }
.share__label { font: 700 0.875rem/1.3 var(--font-display); color: var(--slate); margin-bottom: 8px; }
.share__text { font: 800 1.125rem/1.35 var(--font-display); }
.share__text .star { display: inline-block; vertical-align: -3px; font-size: 22px; }
.share__deck { font: 600 1rem/1.35 var(--font-display); }
.share__rows { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.share__row { display: flex; gap: 5px; }
.share__row i { width: 26px; height: 26px; border-radius: 6px; border: 2px solid rgba(28, 30, 58, 0.25); }
.share__row i.y { background: #34C759; }
.share__row i.n { background: #FF3B30; }
.share__caption { margin-top: 12px; font-size: 0.9375rem; line-height: 1.45; color: var(--slate); }
@media (max-width: 899px) {
  .daily__grid { grid-template-columns: minmax(0, 1fr); }
  .daily__art { order: -1; }
}

/* ---------- Home: decks ---------- */
.decks__head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-3) clamp(2rem, 6vw, 6rem); align-items: start; margin-bottom: var(--space-6); }
.decks__head p + p { margin-top: var(--space-2); }
.decks__title { font-size: clamp(2.75rem, 1.7rem + 4.4vw, 5.25rem); line-height: 0.96; letter-spacing: -0.03em; }
.decks__head > div { padding-top: 0.6em; }
.decks__open { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px; margin: 0 0 var(--space-6); padding: 0 14px 14px 0; list-style: none; }
.deck-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; background: var(--white);
  border: var(--line) solid var(--ink); border-radius: var(--radius-card);
  /* Two more cards squared up behind, so each one reads as a deck */
  box-shadow:
    0 var(--depth) 0 0 var(--ink),
    7px 7px 0 -3px var(--tile), 7px 7px 0 0 var(--ink),
    14px 14px 0 -3px var(--white), 14px 14px 0 0 var(--ink),
    14px 18px 0 0 var(--ink);
}
.deck-card .tile { --size: 48px; }
.deck-card__title { font: 800 1.25rem/1.15 var(--font-display); }
.deck-card__rule { font: 600 1rem/1.3 var(--font-display); color: var(--slate); }
.deck-card__count { margin-top: auto; padding-top: 6px; font: 700 0.9375rem/1 var(--font-display); color: var(--deck-label); }
.deck-card__open { position: absolute; top: -13px; right: 14px; padding: 4px 10px; border-radius: 10px; background: var(--mint); border: 2.5px solid var(--ink); font: 800 0.8125rem/1 var(--font-display); transform: rotate(4deg); }
.decks__group-title { font: 800 var(--step-2)/1.15 var(--font-display); margin-bottom: var(--space-3); }
.decks__later { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(2rem, 5vw, 4rem); }
.deck-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 2px solid var(--cloud-deep); }
.deck-row .tile { --size: 40px; }
.deck-row__title { font: 800 1.125rem/1.2 var(--font-display); }
.deck-row__rule { display: block; font: 600 0.9375rem/1.3 var(--font-display); color: var(--slate); }
.deck-row__stars { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px 0 8px; border-radius: 16px; background: var(--white); border: 2px solid var(--cloud-deep); font: 800 1rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.deck-row__stars .star { font-size: 20px; }
@media (max-width: 1023px) {
  .decks__open { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 34px; }
  .decks__head { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 719px) {
  .decks__later { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .decks__open { gap: 24px; row-gap: 30px; }
  .deck-card { padding: 14px 14px 12px; }
  .deck-card__title { font-size: 1.125rem; }
  .deck-card__rule { font-size: 0.9375rem; }
}

/* ---------- Home: get the app (the icon's gold) ---------- */
.get { background: var(--sun); position: relative; overflow: clip; }
.get::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 2200px; height: 2200px; translate: -50% -50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 228, 138, 0.55) 0deg 9deg, rgba(255, 228, 138, 0) 9deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.6) 30%, transparent 62%);
  mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.6) 30%, transparent 62%);
}
.get__grid { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-5) clamp(2rem, 6vw, 6rem); align-items: center; }
.get__icon { width: clamp(150px, 12vw + 80px, 240px); height: auto; aspect-ratio: 1; border-radius: 22.5%; border: 4px solid var(--ink); box-shadow: 0 9px 0 var(--ink); transform: rotate(-5deg); }
.get__copy { display: flex; flex-direction: column; gap: var(--space-3); max-width: 640px; }
.get__made { font-size: var(--step--1); }
.get .store { box-shadow: none; }
@media (max-width: 719px) {
  .get__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Site footer ---------- */
.site-footer { background: var(--ink); color: var(--cloud); padding-block: var(--space-6) var(--space-4); }
.site-footer a { color: var(--white); }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.site-footer .brand { color: var(--white); }
.site-footer__tag { margin-top: 12px; color: #B9C3EA; max-width: 30em; }
.site-footer__title { font: 800 1.125rem/1.2 var(--font-display); color: var(--white); margin-bottom: 10px; }
.site-footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; font-weight: 600; }
.site-footer__links a:hover { text-decoration: underline; }
.site-footer__legal { margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid rgba(233, 241, 255, 0.16); font-size: 0.875rem; color: #B9C3EA; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }
@media (max-width: 719px) {
  .site-footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-footer__about { grid-column: 1 / -1; }
}

/* ---------- Document pages (privacy, support) ---------- */
.doc-hero { padding-block: var(--space-4) var(--space-5); }
.doc-hero__title { font-size: var(--step-4); line-height: 1; letter-spacing: -0.025em; }
.doc-hero__title .out-tag { font-size: 0.24em; height: auto; padding: 0.35em 0.6em; vertical-align: 0.9em; margin-left: 0.3em; border-radius: 12px; letter-spacing: 0; white-space: nowrap; }
.doc-hero__lead { margin-top: var(--space-3); font-size: var(--step-1); line-height: 1.55; max-width: 36em; }
.doc-hero__meta { margin-top: var(--space-2); font-size: var(--step--1); color: var(--slate); }
.doc { padding-bottom: var(--space-7); }
.doc__grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-5) clamp(2rem, 5vw, 5rem); align-items: start; }
.toc { position: sticky; top: var(--space-3); }
.toc__title { font: 800 1rem/1.2 var(--font-display); margin-bottom: 8px; }
.toc__list { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--cloud-deep); }
.toc__list a { display: block; padding: 6px 0 6px 14px; margin-left: -3px; border-left: 3px solid transparent; text-decoration: none; font: 700 0.9375rem/1.3 var(--font-display); color: var(--deck-label); }
.toc__list a:hover { color: var(--ink); border-left-color: var(--sun); }
@media (max-width: 899px) {
  .doc__grid { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; background: var(--white); border: 2px solid var(--cloud-deep); border-radius: 16px; padding: 16px 18px; }
  .toc__list { border-left: 0; columns: 2; column-gap: 20px; }
  .toc__list a { padding-left: 0; border-left: 0; margin-left: 0; }
}
@media (max-width: 420px) { .toc__list { columns: 1; } }

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--step-2); line-height: 1.15; margin-top: 2.4em; padding-top: 0.2em; scroll-margin-top: 24px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.25rem; line-height: 1.25; margin-top: 1.8em; scroll-margin-top: 24px; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--deck-label); }
.prose a:not(.button) { color: var(--grape); font-weight: 600; }
.prose strong { font-weight: 600; }
.prose em { font-style: normal; font-weight: 600; }
.prose .table-wrap { overflow-x: auto; margin-top: 1.2em; border: 2px solid var(--cloud-deep); border-radius: 16px; background: var(--white); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.45; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--cloud-deep); }
.prose tr:last-child td { border-bottom: 0; }
.prose th { font: 800 0.9375rem/1.3 var(--font-display); background: var(--faded); }
.prose dl { margin: 0; }

/* A contact card on the support page */
.contact {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; margin-bottom: var(--space-5);
  background: var(--white); border: var(--line) solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink); padding: clamp(1.25rem, 0.8rem + 1.6vw, 2rem);
}
.contact__title { font-size: var(--step-2); line-height: 1.15; }
.contact__text { margin-top: 8px; color: var(--ink); }
.contact__text + .contact__text { margin-top: 6px; color: var(--slate); font-size: 0.9375rem; }
@media (max-width: 719px) { .contact { grid-template-columns: minmax(0, 1fr); } .contact .button { justify-self: start; } }

/* Questions on the support page */
.faq { border-top: 2px solid var(--cloud-deep); margin-top: 1em; }
.faq__item { border-bottom: 2px solid var(--cloud-deep); }
.faq__q { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; font: 800 1.1875rem/1.3 var(--font-display); }
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: ""; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1E3A' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v10M7 12h10'/%3E%3C/svg%3E") center / 18px no-repeat; transition: transform 0.2s var(--ease-out); }
.faq__item[open] .faq__q::after { transform: rotate(45deg); background-color: var(--sun); }
.faq__a { padding: 0 0 18px; }
.faq__a > * + * { margin-top: 0.8em; }

/* ---------- 404 ---------- */
.lost { min-height: 62vh; display: grid; align-content: center; padding-block: var(--space-6); }
.lost__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: var(--space-5); align-items: center; }
.lost__title { font-size: var(--step-4); line-height: 1; letter-spacing: -0.025em; }
.lost__text { margin-top: var(--space-3); font-size: var(--step-1); max-width: 28em; }
.lost__actions { margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: 14px; }
.lost__cards { --card-h: 72px; --gap: 12px; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; }
.page-lost { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.page-lost main { flex: 1; display: grid; }
.site-footer--slim { padding-block: var(--space-3); }
.lost__cards .card { margin: 0; }
.lost__cards .card:nth-child(2) { transform: translateX(26px) rotate(3deg); }
@media (max-width: 799px) { .lost__grid { grid-template-columns: minmax(0, 1fr); } .lost__cards { max-width: 420px; } }

/* ---------- Reduced motion: everything in its final state ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Small screens: the deal ---------- */
@media (max-width: 480px) {
  .deal { --card-h: 64px; }
  .card__face { gap: 11px; padding: 0 10px 0 10px; }
  .card .tile { --size: 36px; }
  .card__name { font-size: 1.0625rem; }
  .card__detail { font-size: 0.84rem; }
  .badge, .year-pill { font-size: 0.9375rem; height: 28px; }
  .deal__check { font-size: 1.5rem; }
}
@media (max-width: 359px) {
  .card__detail { display: none; }
}
