/* Rewards tab, prize wheel, and coupon cards.
   Loaded after app.css and reuses its tokens (--brand-yellow, --card, …). */

/* ---------- generic card ---------- */
.rw-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rw-card-title { font-size: 1.05rem; }
.rw-fineprint { font-size: 0.76rem; color: var(--text-muted); line-height: 1.5; }
.rw-empty { font-size: 0.88rem; color: var(--text-muted); }
.rw-error { font-size: 0.82rem; font-weight: 600; color: #C6272C; }

/* ---------- hero (signed out) ---------- */
.rw-hero {
  background: linear-gradient(150deg, #000 0%, #23252b 100%);
  color: #fff;
  text-align: center;
  align-items: center;
  padding: 26px 20px;
}
.rw-hero-emoji { font-size: 2.2rem; line-height: 1; }
.rw-hero h2 { font-size: 1.25rem; }
.rw-hero h2::after {
  content: '';
  display: block;
  width: 46px;
  height: 4px;
  background: var(--brand-yellow);
  border-radius: 999px;
  margin: 10px auto 0;
}
.rw-hero p { color: rgba(255, 255, 255, 0.75); font-size: 0.88rem; line-height: 1.6; }

/* ---------- forms ---------- */
.rw-form { gap: 8px; }
.rw-label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); margin-top: 6px; }
.rw-form input[type="text"],
.rw-form input[type="tel"],
.rw-form input[type="number"] {
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
}
.rw-form input:focus-visible {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18);
}
.rw-form .btn { margin-top: 8px; }

.rw-money { display: flex; align-items: center; gap: 8px; }
.rw-money > span { font-size: 1.4rem; font-weight: 800; color: var(--text-muted); }

/* ---------- sign in / sign up switch ---------- */
.rw-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 12px;
}
.rw-tab {
  flex: 1;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 999px;
  padding: 10px;
  cursor: pointer;
}
.rw-tab-on {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ---------- account strip ---------- */
.rw-account { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.rw-account-hi { font-weight: 700; }
.rw-account-phone { font-size: 0.78rem; color: var(--text-muted); }
.rw-signout {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-blue);
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

/* ---------- progress ---------- */
.rw-progress-card { gap: 8px; }
.rw-progress-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); }
.rw-progress-amount { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.rw-progress-amount span { font-size: 0.95rem; font-weight: 600; color: var(--text-muted); }
.rw-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
  margin-top: 4px;
}
.rw-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-yellow) 0%, #FFB300 100%);
  transition: width 0.5s ease;
}
.rw-progress-note { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- the choice ---------- */
.rw-choice {
  border: 2px solid var(--brand-yellow);
  box-shadow: 0 6px 22px rgba(255, 206, 0, 0.35);
  gap: 6px;
}
.rw-choice-flag {
  align-self: flex-start;
  background: var(--brand-yellow);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 4px 10px;
}
.rw-choice-title { font-size: 1.3rem; margin-top: 4px; }
.rw-choice-sub { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 8px; }

.rw-option {
  font-family: inherit;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.rw-option:active { transform: scale(0.98); }
.rw-option:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }
.rw-busy { opacity: 0.6; }

.rw-banner { border-left: 5px solid #C6272C; }
.rw-option-safe { background: var(--brand-yellow-soft); }
.rw-option-safe:hover { border-color: var(--brand-yellow); }
.rw-option-risk { background: #000; color: #fff; }
.rw-option-risk:hover { border-color: var(--brand-yellow); }
.rw-option-emoji { font-size: 1.7rem; line-height: 1; flex-shrink: 0; }
.rw-option-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rw-option-text strong { font-size: 1rem; }
.rw-option-text small { font-size: 0.76rem; opacity: 0.72; }
.rw-option-arrow { font-size: 1.6rem; font-weight: 700; opacity: 0.5; flex-shrink: 0; }

.rw-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 4px 0;
}
.rw-or::before, .rw-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}

.rw-add { margin-bottom: 14px; }

/* ---------- coupons ---------- */
.rw-coupon-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.rw-coupon {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--brand-yellow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rw-coupon-dead { opacity: 0.5; border-left-color: rgba(0, 0, 0, 0.2); }
.rw-coupon-head { display: flex; gap: 12px; align-items: flex-start; }
.rw-coupon-emoji { font-size: 1.6rem; line-height: 1.1; flex-shrink: 0; }
.rw-coupon-reward { font-weight: 700; font-size: 0.95rem; line-height: 1.35; }
.rw-coupon-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.rw-coupon-code {
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  background: var(--bg);
  border: 1.5px dashed rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 12px 8px;
  user-select: all;
  overflow-wrap: anywhere;
}
.rw-coupon-how { font-size: 0.76rem; color: var(--text-muted); text-align: center; }
.rw-coupon .btn-ghost { padding: 10px 20px; font-size: 0.85rem; }

/* ---------- history ---------- */
.rw-history { display: flex; flex-direction: column; }
.rw-history-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 9px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.rw-history-row:last-child { border-bottom: none; }
.rw-history-row span { color: var(--text-muted); }

.rw-steps {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.rw-steps strong { color: var(--text); }

/* ---------- modal sheet ---------- */
body.rw-locked { overflow: hidden; }

.rw-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  animation: rw-fade 0.18s ease;
}

.rw-sheet {
  background: var(--card);
  border-radius: 22px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: rw-rise 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.rw-sheet-title { font-size: 1.25rem; text-align: center; }
.rw-sheet-sub { font-size: 0.86rem; color: var(--text-muted); text-align: center; line-height: 1.5; }
.rw-sheet .btn { margin-top: 6px; }
.rw-danger { background: #C6272C; box-shadow: 0 4px 14px rgba(198, 39, 44, 0.35); }

@keyframes rw-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rw-rise { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 560px) {
  .rw-backdrop { align-items: center; }
}

/* ---------- prize wheel ---------- */
.rw-wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 6px auto 4px;
}
.rw-wheel { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.22)); }
#rwWheelSpin { will-change: transform; }

.rw-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  z-index: 2;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid #C6272C;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

.rw-result { text-align: center; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.rw-result-emoji { font-size: 2.6rem; line-height: 1; animation: rw-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.rw-result-title { font-size: 1.2rem; font-weight: 800; }
.rw-result-sub { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 6px; }

@keyframes rw-pop { from { transform: scale(0.3); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .rw-backdrop, .rw-sheet, .rw-result-emoji { animation: none; }
  .rw-bar-fill { transition: none; }
}
