:root {
  /* Brand palette — same family as the QR codes themselves so the landing page
     feels like an extension of the printed card, not a separate website. */
  --bg: #f6c057;          /* page background — mid amber */
  --fg-dark: #6b2e00;     /* deepest text / strokes */
  --fg-mid: #a04500;      /* secondary text */
  --accent: #fcad1d;      /* highlight for claimable rewards */
  --surface: #fff0c2;     /* cards on top of the amber bg — warm cream, not white */
  --surface-soft: #fde2a0;/* gentle separator / inactive card tint */
  --success: #16a34a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg-dark);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: 24px 16px;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
}

a { color: var(--fg-dark); }

.hero { text-align: center; margin-bottom: 24px; }
.hero h1 { font-size: 2rem; margin: 0; }
.subtitle { color: var(--fg-mid); margin: 4px 0 0; }
.hint { text-align: center; color: var(--fg-mid); }

/* Footer actions: a row holding the play button + the FB button, anchored to
   the right edge of the content. Scrolls with the page. */
.footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin: 24px 0 0 auto;
}

/* Small circular play button — flat amber, matches the brand palette. */
.play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--fg-dark);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(107, 46, 0, 0.18);
  transition: transform 0.12s ease, filter 0.12s ease;
  padding: 0;
}
.play-button:hover, .play-button:focus-visible {
  transform: scale(1.08);
  filter: brightness(1.05);
}
.play-button:active { transform: scale(0.95); }

/* FB button no longer carries the margin/alignment — its parent
   (.footer-actions) handles positioning. */
.fb-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--fg-dark);
  padding: 6px 8px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(107, 46, 0, 0.18);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.fb-button:hover, .fb-button:focus-visible {
  transform: scale(1.05);
  filter: brightness(1.08);
}
.fb-button img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}
.fb-caption {
  font-size: 0.75em;
  font-weight: 600;
  color: var(--fg-mid);
  white-space: nowrap;
}

.qr-block {
  background: var(--surface);
  padding: 16px;
  border-radius: 16px;
  text-align: center;
  margin: 24px auto;
  max-width: 320px;
}
.qr-block .qr {
  width: 100%;
  max-width: 240px;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto;
}
.code { font-family: monospace; margin: 8px 0 0; }

.grid {
  max-width: 480px;
  margin: 24px auto;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vw, 14px);
}
/* 4 equal proportional columns (the 4th is now a stamp-like reward day,
   not a wide reward block). minmax(0, 1fr) lets cells shrink below their
   intrinsic content width — otherwise inline images would force them wider. */
.row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1.6vw, 12px);
  align-items: center;
}
.stamp {
  width: 100%;
  aspect-ratio: 1;       /* always a circle, regardless of column width */
  max-width: 84px;       /* don't bloat on wide windows */
  margin: 0 auto;        /* centered when max-width caps it */
  border-radius: 50%;
  border: 2px dashed var(--fg-mid);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Filled stamp: no border, no fill — let the transparent Stamp.png sit
   directly on the page bg so its own design (designed against amber) reads
   correctly without a white halo. */
.stamp.filled {
  background: transparent;
  border: none;
}
.stamp.filled img { width: 100%; height: 100%; object-fit: contain; }

/* Reward-day cell — the 4th column of each row. Holds the reward icon
   (always visible, faint in the background), an optional stamp overlay once
   the row hits 4 stamps, and an optional "CLAIMED" banner when the tier
   bit is set. Read-only on this customer-facing page. */
.reward-day {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  max-width: 84px;
  margin: 0 auto;
}
.reward-day.empty   { border: 2px dashed var(--fg-mid); background: transparent; }
.reward-day.stamped { border: 2px solid  var(--fg-dark); background: var(--surface); }
.reward-day.claimed { border: 2px solid  var(--fg-dark); background: var(--surface); }
/* Reward icon: faint behind everything else, fills most of the cell so the
   customer can always see what's being worked toward. */
.reward-day-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 70%;
  height: 70%;
  object-fit: contain;
  opacity: 0.35;
}
/* Stamp overlay — sits between the icon and the banner. */
.reward-day-stamp {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 85%;
  height: 85%;
  object-fit: contain;
  z-index: 1;
}
/* "CLAIMED" banner — diagonal pill, in front of both icon and stamp. */
.reward-day-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-size: 0.7em;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--fg-dark);
  background: var(--accent);
  padding: 1px 7px;
  border-radius: 4px;
  border: 1.5px solid var(--fg-dark);
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
}

.next {
  text-align: center;
  font-size: 1.05em;
  font-weight: 600;
  max-width: 480px;
  margin: 24px auto 8px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 12px;
}

.error, .loading {
  text-align: center;
  color: var(--fg-mid);
  padding: 24px;
}

/* Narrow viewports: nothing to override — the base layout already keeps
   the 4 circular cells the right size via aspect-ratio. The CLAIMED banner
   scales down with the cell because its font-size is in `em`. */
