/* ============================================================
   Shared components — wallet card, stamp grid, toast, primitives.
   Used by both the customer and admin apps. Depends on tokens.css.
   ============================================================ */

/* ---- buttons ---- */
.btn {
  width: 100%;
  height: 54px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background var(--dur-base) var(--ease-standard);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--green-700);
  color: var(--cream-50);
}
.btn-primary:hover {
  background: var(--green-800);
}
.btn-primary:disabled {
  background: var(--ink-300);
  cursor: default;
}
.btn-gold {
  background: var(--gold-500);
  color: var(--ink-900);
}
.btn-gold:hover {
  background: var(--gold-600);
}
.btn:focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 2px;
}

.section-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--gold-800);
  text-transform: uppercase;
}

/* ---- wallet card (green hero, one per promotion) ---- */
.wallet {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--grad-green);
  box-shadow: var(--shadow-xl);
  padding: 22px 22px 24px;
}
.wallet-watermark {
  position: absolute;
  inset: 0;
  background-image: url(assets/pattern-cream.png);
  background-size: 230px;
  opacity: 0.045;
  pointer-events: none;
}
.wallet-inner {
  position: relative;
}
.wallet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wallet-wordmark {
  height: 26px;
  width: auto;
  opacity: 0.95;
}
.wallet-promo {
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold-400);
  text-transform: uppercase;
  text-align: right;
  max-width: 50%;
}
.stamp-grid {
  display: grid;
  gap: 14px;
  margin: 24px 4px 18px;
}
.cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cell-dash {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(204, 180, 132, 0.45);
}
.cell-empty {
  width: 54%;
  height: 54%;
  opacity: 0.08;
}
.cell-filled {
  width: 88%;
  height: 88%;
}
/* The stamp that just landed keeps a soft gold pulse for as long as the app
   holds `just`, so a member arriving from a banner can find it at a glance. */
.cell-just {
  width: 88%;
  height: 88%;
  animation:
    yeStamp 460ms var(--ease-out) both,
    yeGlow 1500ms ease-in-out 460ms infinite;
}
@keyframes yeGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 4px rgba(201, 162, 77, 0.55));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(201, 162, 77, 1));
  }
}
/* Already dropped: keep the glow, never replay the drop. */
.cell-just-settled {
  animation: yeGlow 1500ms ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .cell-just {
    animation: yeStamp 460ms var(--ease-out) both;
    filter: drop-shadow(0 0 8px rgba(201, 162, 77, 0.9));
  }
  .cell-just-settled {
    animation: none;
    filter: drop-shadow(0 0 8px rgba(201, 162, 77, 0.9));
  }
}
.cell-ring {
  position: absolute;
  width: 96%;
  height: 96%;
  border-radius: 50%;
  border: 2px solid var(--gold-500);
  animation: yeRing 640ms var(--ease-out) both;
}
.wallet-divider {
  height: 1px;
  background: rgba(204, 180, 132, 0.25);
  margin: 4px 0 14px;
}
.wallet-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.wallet-title {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1;
  color: var(--cream-50);
  text-transform: uppercase;
}
.wallet-sub {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--green-200);
  margin-top: 7px;
}
.wallet-count-wrap {
  text-align: right;
}
.wallet-count {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  color: var(--gold-500);
}
.wallet-stamps {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--green-200);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ---- toast ---- */
.toast {
  position: fixed;
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 95;
  transform: translateX(-50%);
  background: var(--ink-900);
  color: var(--cream-50);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  animation: yeToast var(--dur-base) var(--ease-out) both;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- spinner ---- */
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--cream-300);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: yeSpin 0.7s linear infinite;
}
.center-fill {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-500);
}

/* Offered when a new build is installed but the page still runs the old one.
   Fixed to the bottom so it never displaces content mid-task. */
#ye-update {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 78px);
  z-index: 60;
  display: flex;
  align-items: stretch;
  border-radius: 999px;
  overflow: hidden;
  background: var(--green-700);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
}
#ye-update button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--cream-50);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
}
.ye-update-go {
  padding: 11px 8px 11px 18px;
}
.ye-update-x {
  padding: 11px 15px 11px 8px;
  font-size: 17px;
  line-height: 1;
  opacity: 0.75;
}
#ye-update button:active {
  transform: translateY(1px);
}

/* Explicit dismissal for the reward splash. Sits low-centre: reachable with
   a thumb, far from the medallion and copy above, so it is hard to hit by
   accident while reading. */
.celebrate-close {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 40px);
  min-width: 132px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: var(--cream-50);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.celebrate-close:active {
  transform: translateX(-50%) translateY(1px);
}

/* A card with a reward banked invites the tap that opens the splash. */
.wallet-claimable {
  cursor: pointer;
  box-shadow:
    var(--shadow-md),
    0 0 0 2px var(--gold-500);
}
.wallet-claimable:active {
  transform: translateY(1px);
}
