/* ============================================================
 * Rewards — scratch card, floating reward icon, popup, sponsor
 * carousel, and the My Rewards page. Loaded only on the pages
 * that use it (order confirmation + /rewards/).
 * ========================================================== */

/* --- Floating reward icon — pinned middle-right ------------- */
.vh-rewardfab {
  position: fixed;
  right: var(--vh-space-3);
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  width: 60px; height: 60px;
  border: none; border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, var(--vh-secondary), #c9851d);
  box-shadow: 0 12px 28px -8px rgba(180, 120, 20, 0.65);
  animation: vh-rewardfab-pulse 2.6s ease-in-out infinite;
}
.vh-rewardfab svg { width: 28px; height: 28px; }
.vh-rewardfab__ping {
  position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid var(--vh-secondary);
  animation: vh-rewardfab-ping 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes vh-rewardfab-pulse {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50%      { transform: translateY(-50%) scale(1.07); }
}
@keyframes vh-rewardfab-ping {
  0%        { opacity: 0.7; transform: scale(1); }
  70%, 100% { opacity: 0;   transform: scale(1.7); }
}
@media (prefers-reduced-motion: reduce) {
  .vh-rewardfab { animation: none; }
  .vh-rewardfab__ping { display: none; }
}

/* --- Reward popup ------------------------------------------- */
.vh-rewardpop__scrim {
  position: fixed; inset: 0; z-index: 95;
  background: color-mix(in srgb, #000 55%, transparent);
  display: grid; place-items: center;
  padding: var(--vh-space-4);
}
.vh-rewardpop {
  width: min(92vw, 380px);
  background: var(--vh-bg-elevated);
  border: 1px solid var(--vh-border);
  border-radius: var(--vh-radius-2xl, 28px);
  box-shadow: var(--vh-shadow-4);
  padding: var(--vh-space-5);
  text-align: center;
  position: relative;
}
.vh-rewardpop__close {
  position: absolute; top: var(--vh-space-3); right: var(--vh-space-3);
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--vh-border); background: var(--vh-bg-muted);
  cursor: pointer; display: grid; place-items: center;
  color: var(--vh-text-muted);
}
.vh-rewardpop__eyebrow {
  font-size: var(--vh-text-2xs); font-weight: var(--vh-weight-bold);
  letter-spacing: var(--vh-tracking-wide); text-transform: uppercase;
  color: var(--vh-secondary);
}
.vh-rewardpop__head {
  font-size: var(--vh-text-lg); font-weight: var(--vh-weight-bold);
  margin: 4px 0 var(--vh-space-3);
}
.vh-rewardpop__foot {
  margin-top: var(--vh-space-3);
  font-size: var(--vh-text-xs);
}

/* --- Scratch card ------------------------------------------- */
.vh-scratch {
  position: relative;
  width: 100%; aspect-ratio: 16 / 10;
  border-radius: var(--vh-radius-xl, 20px);
  overflow: hidden;
  background: var(--vh-bg-muted);
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.vh-scratch__prize {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  padding: var(--vh-space-3);
  text-align: center;
  background:
    radial-gradient(72% 80% at 50% 0%,
      color-mix(in srgb, var(--vh-secondary) 24%, transparent), transparent 70%),
    var(--vh-bg-elevated);
}
.vh-scratch__icon {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--vh-secondary) 18%, var(--vh-bg-elevated));
  color: var(--vh-secondary);
}
.vh-scratch__icon svg { width: 26px; height: 26px; }
.vh-scratch__title { font-size: var(--vh-text-lg); font-weight: var(--vh-weight-bold); }
.vh-scratch__blurb { font-size: var(--vh-text-sm); color: var(--vh-text-muted); }
.vh-scratch__value {
  font-size: var(--vh-text-sm); font-weight: var(--vh-weight-bold);
  color: var(--vh-success, #1b9e5a);
}
.vh-scratch__code code {
  background: var(--vh-bg-muted); padding: 2px 8px; border-radius: 6px;
  font-weight: var(--vh-weight-bold); letter-spacing: 0.04em;
}
.vh-scratch__expiry { font-size: var(--vh-text-2xs); color: var(--vh-text-subtle); }
.vh-scratch__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  cursor: grab;
}
.vh-scratch__hint {
  position: absolute; left: 50%; bottom: 12px;
  transform: translateX(-50%);
  font-size: var(--vh-text-xs); font-weight: var(--vh-weight-semibold);
  color: #fff; pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.vh-scratch.is-revealed .vh-scratch__canvas,
.vh-scratch.is-revealed .vh-scratch__hint { display: none; }
.vh-scratch__expired {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--vh-bg-muted) 82%, transparent);
  font-weight: var(--vh-weight-bold); color: var(--vh-text-muted);
  letter-spacing: var(--vh-tracking-wide); text-transform: uppercase;
}

/* --- Sponsor carousel -------------------------------------- */
.vh-sponsors__viewport {
  overflow: hidden;
  border-radius: var(--vh-radius-xl, 20px);
  border: 1px solid var(--vh-border);
}
.vh-sponsors__track { display: flex; }
.vh-sponsors__slide { flex: 0 0 100%; display: block; }
.vh-sponsors__slide img {
  width: 100%; aspect-ratio: 16 / 7;
  object-fit: cover; display: block;
}
.vh-sponsors__dots {
  display: flex; gap: 6px; justify-content: center;
  margin-top: var(--vh-space-2);
}
.vh-sponsors__dot {
  width: 7px; height: 7px; border-radius: 50%; padding: 0;
  background: var(--vh-border-strong, #c7c7c7);
  border: none; cursor: pointer;
  transition: width var(--vh-dur-2, 0.2s) ease;
}
.vh-sponsors__dot.is-active {
  background: var(--vh-primary); width: 18px; border-radius: 4px;
}
.vh-sponsors__tag {
  font-size: var(--vh-text-2xs); color: var(--vh-text-subtle);
  text-align: center; margin-top: 4px;
}

/* --- My Rewards page --------------------------------------- */
.vh-rewardgrid {
  display: grid; gap: var(--vh-space-3);
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.vh-rewardcard { padding: var(--vh-space-3); }
.vh-rewardcard.is-expired { opacity: 0.65; }
.vh-rewardcard__status {
  display: inline-block; margin-bottom: var(--vh-space-2);
  font-size: var(--vh-text-2xs); font-weight: var(--vh-weight-bold);
  text-transform: uppercase; letter-spacing: var(--vh-tracking-wide);
}
.vh-rewardcard__status--open { color: var(--vh-secondary); }
.vh-rewardcard__status--won  { color: var(--vh-success, #1b9e5a); }
.vh-rewardcard__status--gone { color: var(--vh-text-muted); }
.vh-rewardcard__meta {
  margin-top: var(--vh-space-2);
  font-size: var(--vh-text-2xs); color: var(--vh-text-subtle);
}
