/* ============================================
   REWARDS REFIT — Rankings · Surveys · Zap+
   Fresh build for the 3 tabs that were rebuilt.
   Streak / Milestones / Referral / Promo / Watch & Earn
   still live entirely in rewards.css — untouched.

   No new palette: every color here is one of the tokens
   in variables.css. Distinctiveness comes from layout and
   motion, not a second color system living inside one app.
   ============================================ */

/* ---------- Shared: panel intro card ---------- */
.refit-intro {
  display: flex; gap: var(--space-sm); align-items: flex-start;
  padding: var(--card-padding);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}
.refit-intro__icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.refit-intro__icon svg { width: 18px; height: 18px; }
.refit-intro__title { font-size: var(--text-sm); font-weight: var(--font-semi); color: var(--text-primary); margin-bottom: 2px; }
.refit-intro__body { font-size: var(--text-xs); color: var(--text-secondary); line-height: var(--leading-normal); }

.refit-skeleton {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 37%, var(--bg-card) 63%);
  background-size: 400% 100%;
  animation: refit-shimmer 1.4s ease infinite;
}
@keyframes refit-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.refit-error {
  text-align: center; padding: var(--space-xl) var(--space-md);
  color: var(--text-secondary); font-size: var(--text-sm);
}
.refit-error__icon { color: var(--danger); margin: 0 auto var(--space-sm); width: 28px; height: 28px; }
.refit-error__icon svg { width: 100%; height: 100%; }


/* ============================================
   RANKINGS (formerly Leaderboard)
   ============================================ */

.board-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-md); font-size: var(--text-xs); color: var(--text-muted);
}
.board-meta strong { color: var(--text-secondary); font-weight: var(--font-medium); }

/* Podium — top 3, signature element for this panel */
.board-podium {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  align-items: end; gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}
.board-podium__slot {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-xs);
  padding: var(--space-sm) var(--space-xs) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
}
.board-podium__slot--1 { order: 2; padding-top: var(--space-lg); border-color: var(--text-primary); }
.board-podium__slot--2 { order: 1; }
.board-podium__slot--3 { order: 3; }
.board-podium__crown { position: absolute; top: -22px; color: var(--text-primary); width: 20px; height: 20px; }
.board-podium__crown svg { width: 100%; height: 100%; }
.board-podium__avatar {
  width: 44px; height: 44px; border-radius: var(--radius-full);
  background: var(--bg-elevated); border: 2px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-md); font-weight: var(--font-bold); color: var(--text-secondary);
  position: relative; overflow: hidden;
}
.board-podium__avatar img, .board-row__avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: inherit;
}
.board-podium__slot--1 .board-podium__avatar { border-color: var(--text-primary); width: 52px; height: 52px; font-size: var(--text-lg); }
.board-podium__name { font-size: 11px; font-weight: var(--font-medium); color: var(--text-primary); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-podium__pts { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); }
.board-podium__bar {
  width: 100%; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--bg-elevated); margin-top: var(--space-xs);
}
.board-podium__slot--1 .board-podium__bar { height: 40px; background: var(--bg-hover); }
.board-podium__slot--2 .board-podium__bar { height: 26px; }
.board-podium__slot--3 .board-podium__bar { height: 16px; }

/* Your rank card */
.board-you {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--card-padding);
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); margin-bottom: var(--space-lg);
}
.board-you__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.06), transparent 60%);
}
.board-you__ring { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.board-you__ring svg { transform: rotate(-90deg); }
.board-you__ring-num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.1;
}
.board-you__ring-num strong { font-family: var(--font-mono); font-size: var(--text-md); color: var(--text-primary); }
.board-you__ring-num span { font-size: 9px; color: var(--text-muted); letter-spacing: 0.04em; }
.board-you__main { flex: 1; min-width: 0; }
.board-you__eyebrow { font-size: 10.5px; color: var(--text-muted); margin-bottom: 2px; }
.board-you__line { font-size: var(--text-sm); color: var(--text-primary); font-weight: var(--font-medium); }
.board-you__line strong { color: var(--text-primary); }
.board-you__prizes { display: flex; gap: var(--space-md); margin-top: var(--space-xs); }
.board-you__prize-label { font-size: 10px; color: var(--text-muted); }
.board-you__prize-val { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--font-semi); color: var(--profit); }

/* List rows (rank 4+) */
.board-row {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-xs);
  border-bottom: 1px solid var(--border-subtle);
}
.board-row:last-child { border-bottom: none; }
.board-row.is-me { background: var(--bg-hover); border-radius: var(--radius-sm); }
.board-row__rank { width: 26px; text-align: center; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); flex-shrink: 0; }
.board-row__avatar {
  width: 30px; height: 30px; border-radius: var(--radius-full); flex-shrink: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: var(--font-semi); color: var(--text-secondary);
  position: relative; overflow: hidden;
}
.board-row__name { flex: 1; min-width: 0; font-size: var(--text-sm); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row__pts { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-secondary); flex-shrink: 0; }

/* Activity feed — now a <button> per row (tappable → detail modal) */
.board-activity-row {
  display: flex; align-items: center; gap: var(--space-sm);
  width: 100%; text-align: left; background: none; border: none;
  padding: var(--space-sm) 0; border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.board-activity-row:last-child { border-bottom: none; }
.board-activity-row:hover { background: var(--bg-hover); }

.board-activity-more { margin-top: 10px; }
.board-activity-more [data-icon] { width: 12px; height: 12px; }

.board-activity-row__icon {
  width: 30px; height: 30px; border-radius: var(--radius-full); flex-shrink: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
}
.board-activity-row__icon svg { width: 14px; height: 14px; }
.board-activity-row__main { flex: 1; min-width: 0; }
.board-activity-row__title { font-size: var(--text-sm); color: var(--text-primary); font-weight: var(--font-medium); }
.board-activity-row__time { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.board-activity-row__pts { font-family: var(--font-mono); font-weight: var(--font-bold); font-size: var(--text-sm); color: var(--profit); }

/* History — past-months browsing (list of months → one month's result +
   activity). Rows/subheader reuse the same tokens as the rest of this
   panel; icons in here mount via icon-loader.js like everywhere else
   in this file, and (unlike the .board-activity-row__icon svg rule
   above) several of those source SVGs carry no width/height of their
   own, so every new icon slot below gets an explicit size. */
.board-subheader { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); }
.board-subheader__title { font-size: var(--text-md); font-weight: var(--font-semi); color: var(--text-primary); }
.board-subheader .icon-btn svg { width: 16px; height: 16px; }

.board-history-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  width: 100%; text-align: left; background: none; border: none;
  padding: var(--space-md) 2px; border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.board-history-row:last-child { border-bottom: none; }
.board-history-row:hover { background: var(--bg-hover); }
.board-history-row__main { flex: 1; min-width: 0; }
.board-history-row__month { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-primary); }
.board-history-row__sub { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }
.board-history-row svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }

#board-activity-modal-close svg { width: 14px; height: 14px; }


/* ============================================
   SURVEYS (Quest engine)
   ============================================ */

.quest-tabs { display: flex; gap: 6px; margin-bottom: var(--space-md); }
.quest-tab {
  font-family: var(--font-ui); font-size: var(--text-xs); font-weight: var(--font-semi);
  padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-full);
  border: 1px solid var(--border-soft); background: none; color: var(--text-secondary);
  cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast);
}
.quest-tab.is-active { background: var(--text-primary); color: var(--bg-base); border-color: var(--text-primary); }

.quest-card {
  display: flex; flex-direction: column; gap: var(--space-sm);
  padding: var(--card-padding); margin-bottom: var(--space-sm);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); cursor: pointer;
  transition: border-color var(--transition-fast);
}
.quest-card:active { border-color: var(--border-active); }
.quest-card--done { cursor: default; }
.quest-card__top { display: flex; gap: var(--space-sm); align-items: center; }
.quest-card__icon {
  width: 34px; height: 34px; border-radius: var(--radius-md); flex-shrink: 0;
  background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.quest-card__icon svg { width: 16px; height: 16px; }
.quest-card__tag { font-size: 10.5px; color: var(--text-muted); text-transform: capitalize; margin-bottom: 1px; }
.quest-card__title { font-size: var(--text-sm); font-weight: var(--font-semi); color: var(--text-primary); }
.quest-card__row { display: flex; justify-content: space-between; align-items: center; }
.quest-card__meta { font-size: 11px; color: var(--text-muted); display: flex; gap: var(--space-sm); align-items: center; }
.quest-card__meta svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }
.quest-card__reward { font-family: var(--font-mono); font-weight: var(--font-bold); font-size: var(--text-sm); color: var(--profit); }
.quest-card__social { font-size: 10.5px; color: var(--text-muted); }

.quest-progress-track { height: 5px; border-radius: var(--radius-full); background: var(--bg-elevated); overflow: hidden; }
.quest-progress-fill { height: 100%; background: var(--text-primary); border-radius: var(--radius-full); transition: width var(--transition-normal); }

.quest-nudge {
  display: flex; gap: var(--space-sm); align-items: center;
  padding: var(--space-sm) var(--card-padding);
  background: var(--bg-elevated); border-radius: var(--radius-lg);
  margin-top: var(--space-sm);
}
.quest-nudge__icon { color: var(--text-muted); width: 20px; height: 20px; flex-shrink: 0; }
.quest-nudge__icon svg { width: 100%; height: 100%; }
.quest-nudge__title { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-primary); }
.quest-nudge__sub { font-size: var(--text-xs); color: var(--text-secondary); }

/* Taking a survey */
.quest-flow-header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.quest-flow-title { font-size: var(--text-sm); font-weight: var(--font-semi); color: var(--text-primary); }
.quest-flow-meta { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: var(--space-xs); }
.quest-q-progress { display: flex; gap: 4px; margin-bottom: var(--space-lg); }
.quest-q-dot { flex: 1; height: 3px; border-radius: var(--radius-full); background: var(--border-soft); }
.quest-q-dot.is-done { background: var(--profit); }
.quest-q-dot.is-active { background: var(--text-primary); }
.quest-q-title { font-size: var(--text-lg); font-weight: var(--font-semi); color: var(--text-primary); line-height: var(--leading-tight); margin-bottom: var(--space-lg); }
.quest-option {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--card-padding); margin-bottom: var(--space-xs);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.quest-option:active { background: var(--bg-hover); }
.quest-option.is-selected { border-color: var(--text-primary); background: var(--bg-elevated); }
.quest-option__dot { width: 16px; height: 16px; border-radius: var(--radius-full); border: 2px solid var(--border-active); flex-shrink: 0; }
.quest-option.is-selected .quest-option__dot { border-color: var(--text-primary); background: var(--text-primary); }
.quest-option span { font-size: var(--text-sm); color: var(--text-primary); }

.quest-complete { text-align: center; padding: var(--space-xl) 0 var(--space-md); }
.quest-complete__icon { width: 56px; height: 56px; margin: 0 auto var(--space-md); color: var(--profit); }
.quest-complete__icon svg { width: 100%; height: 100%; }
.quest-complete__title { font-size: var(--text-lg); font-weight: var(--font-bold); color: var(--text-primary); }
.quest-complete__sub { font-size: var(--text-sm); color: var(--text-secondary); margin: var(--space-xs) 0 var(--space-lg); }
.quest-complete__amount { font-family: var(--font-mono); font-size: var(--text-3xl); font-weight: var(--font-bold); color: var(--profit); margin-bottom: var(--space-sm); }
.quest-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: var(--space-xs) var(--space-md); border-radius: var(--radius-full);
  background: var(--success-soft); color: var(--success); font-size: var(--text-xs); font-weight: var(--font-medium);
  margin-bottom: var(--space-xs);
}
.quest-chip svg { width: 12px; height: 12px; }
.quest-chip--pending { background: var(--pending-soft); color: var(--pending); }
.quest-chip--points { background: var(--bg-elevated); color: var(--text-secondary); display: block; margin: var(--space-xs) auto 0; width: fit-content; }
.quest-complete .quest-nudge { text-align: left; margin: var(--space-lg) 0; }


/* ============================================
   ZAP+ (formerly Premium)
   ============================================ */

.plus-hero {
  position: relative; overflow: hidden;
  padding: var(--space-lg) var(--card-padding);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.08), transparent 55%),
    var(--bg-card);
  border: 1px solid var(--border-soft);
  margin-bottom: var(--space-lg);
}
.plus-hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-full);
  background: var(--text-primary); color: var(--text-inverse);
  font-size: var(--text-xs); font-weight: var(--font-bold); letter-spacing: 0.02em;
  margin-bottom: var(--space-md);
}
.plus-hero__badge svg { width: 13px; height: 13px; }
.plus-hero__price { font-size: var(--text-2xl); font-weight: var(--font-bold); color: var(--text-primary); font-family: var(--font-mono); }
.plus-hero__price span { font-size: var(--text-sm); font-weight: var(--font-normal); color: var(--text-secondary); font-family: var(--font-ui); }
.plus-hero__active-since { font-size: var(--text-sm); color: var(--success); font-weight: var(--font-medium); display: flex; align-items: center; gap: 6px; }
.plus-hero__active-since svg { width: 15px; height: 15px; }

.plus-perks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.plus-perk {
  display: flex; flex-direction: column; gap: var(--space-xs);
  padding: var(--space-md); background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.plus-perk__icon { color: var(--text-muted); width: 18px; height: 18px; }
.plus-perk__icon svg { width: 100%; height: 100%; }
.plus-perk__label { font-size: var(--text-xs); color: var(--text-primary); font-weight: var(--font-medium); line-height: var(--leading-tight); }

.plus-compare {
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: var(--space-lg);
}
.plus-compare__row { display: grid; grid-template-columns: 1fr 60px 60px; align-items: center; padding: var(--space-sm) var(--card-padding); border-bottom: 1px solid var(--border-subtle); }
.plus-compare__row:last-child { border-bottom: none; }
.plus-compare__row--head { background: var(--bg-elevated); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.plus-compare__label { font-size: var(--text-xs); color: var(--text-secondary); }
.plus-compare__val { text-align: center; font-size: var(--text-xs); color: var(--text-muted); }
.plus-compare__val--yes { color: var(--success); font-weight: var(--font-bold); }

.plus-active-perks { display: flex; flex-direction: column; gap: var(--space-xs); margin-bottom: var(--space-lg); }
.plus-active-perk { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--text-sm); color: var(--text-primary); }
.plus-active-perk svg { width: 15px; height: 15px; color: var(--success); flex-shrink: 0; }

/* ============================================
   TIERS (formerly Milestones) — see js/pages/rewards/tiers.panel.js
   ============================================ */

.tier-ladder { display: flex; flex-direction: column; overflow: hidden; }

.tier-claim-banner {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--card-padding); margin-bottom: var(--space-md);
  background: var(--bg-elevated); border: 1px solid var(--border-active); border-radius: var(--radius-lg);
}
.tier-claim-banner__icon { color: var(--text-primary); width: 20px; height: 20px; flex-shrink: 0; }
.tier-claim-banner__text { font-size: var(--text-sm); font-weight: var(--font-semi); color: var(--text-primary); }

.tier-card { display: flex; gap: var(--space-sm); }

.tier-card__rail { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }

.tier-card__badge {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.tier-card__badge svg { width: 18px; height: 18px; }

.tier-card__badge--locked    { background: var(--bg-elevated); color: var(--text-muted); opacity: 0.5; }
.tier-card__badge--unlocked  { background: var(--text-primary); color: var(--text-inverse); border-color: var(--text-primary); }
.tier-card__badge--claimed   { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.tier-card__badge--expired   { background: var(--bg-elevated); color: var(--text-muted); opacity: 0.5; }
.tier-card.is-next .tier-card__badge--locked { opacity: 1; border-color: var(--border-active); }

.tier-card__connector {
  width: 2px; flex: 1; min-height: 24px;
  background: var(--border-soft);
  margin: 4px 0;
}
.tier-card__connector.is-filled { background: var(--success); }

.tier-card__body { flex: 1; padding-bottom: var(--space-lg); position: relative; }

.tier-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-sm); margin-bottom: 4px; }
.tier-card__title { font-size: var(--text-base); font-weight: var(--font-semi); color: var(--text-primary); }
.tier-card--locked .tier-card__title,
.tier-card--expired .tier-card__title { color: var(--text-secondary); }
.tier-card__sub { font-size: var(--text-sm); color: var(--text-secondary); }

.tier-card__reward { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: var(--font-semi); color: var(--profit); flex-shrink: 0; }
.tier-card__reward--locked  { color: var(--text-muted); }
.tier-card__reward--claimed { color: var(--success); }
.tier-card__reward--expired { color: var(--text-muted); }

.tier-progress { background: var(--bg-elevated); border-radius: var(--radius-full); height: 4px; overflow: hidden; margin-top: 6px; }
.tier-progress__fill { height: 100%; border-radius: var(--radius-full); background: var(--text-primary); transition: width 0.4s ease; }

.tier-card__status { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 4px; }
.tier-card.is-next .tier-card__status { color: var(--text-primary); font-weight: var(--font-medium); }
.tier-card__status--claimed { color: var(--success); font-weight: var(--font-medium); display: flex; align-items: center; gap: 4px; }
.tier-card__status--claimed svg { width: 13px; height: 13px; }
.tier-card__status--expired { color: var(--text-muted); }

.tier-card__expiry { font-size: var(--text-xs); color: var(--text-primary); font-weight: var(--font-semi); margin-top: 4px; }

.tier-card__claim-row { margin-top: var(--space-sm); }
.tier-card__claim-btn {
  font-family: var(--font-ui); font-size: var(--text-sm); font-weight: var(--font-bold);
  color: var(--text-inverse); background: var(--text-primary);
  border: none; border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-md); cursor: pointer;
  transition: background var(--transition-fast);
}
.tier-card__claim-btn:active { background: #E0E0E0; }
.tier-card__claim-btn:disabled { opacity: 0.6; cursor: not-allowed; }


/* ============================================
   REFERRAL LIST — "who I referred" (js/pages/rewards.js)
   ============================================ */

.referral-list { display: flex; flex-direction: column; gap: var(--space-xs); }

.referral-row {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--card-padding);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.referral-row__avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: var(--font-semi);
}

.referral-row__main { flex: 1; min-width: 0; }
.referral-row__name { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-primary); }
.referral-row__time { font-size: var(--text-xs); color: var(--text-muted); }
.referral-row__earned { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: var(--font-semi); color: var(--profit); flex-shrink: 0; }

/* ---------- Level header + Sparks meter + rewards tray (Sparks/Level system — see tier-engine.js) ---------- */

.level-header {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.level-header__top { display: flex; align-items: center; gap: var(--space-sm); }

.level-header__badge {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: var(--text-lg); font-weight: var(--font-bold);
  color: var(--text-primary);
}

.level-header__meta { flex: 1; min-width: 0; }
.level-header__eyebrow { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.level-header__label   { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 2px; }

.level-header__count {
  font-family: var(--font-mono); font-size: var(--text-md); font-weight: var(--font-bold);
  color: var(--text-primary); flex-shrink: 0; white-space: nowrap;
}
.level-header__count span { color: var(--text-muted); font-weight: var(--font-medium); }

.level-header__bar {
  height: 8px; background: var(--bg-elevated); border-radius: var(--radius-full);
  overflow: hidden; margin-top: var(--space-sm);
}
.level-header__bar-fill {
  height: 100%; background: var(--text-primary); border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.level-header__hint {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-sm);
}
.level-header__hint-icon { display: flex; flex-shrink: 0; color: var(--pending); }
.level-header__hint-icon svg { width: 13px; height: 13px; }

.level-header__chips { display: flex; gap: var(--space-sm); margin-top: var(--space-md); }
.level-header__chip {
  flex: 1; display: flex; align-items: center; gap: var(--space-sm);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 9px 12px; min-width: 0;
}
.level-header__chip-icon { display: flex; flex-shrink: 0; color: var(--text-secondary); }
.level-header__chip-icon svg { width: 15px; height: 15px; }
.level-header__chip-label { font-size: 10px; color: var(--text-muted); line-height: 1.3; }
.level-header__chip-value { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: var(--font-semi); color: var(--text-primary); }

.level-header__caption { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-sm); }

/* Unopened Level-up rewards tray */

.rewards-tray { margin-bottom: var(--space-md); }
.rewards-tray__title {
  font-size: var(--text-sm); font-weight: var(--font-semi); color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-sm);
}

.rewards-tray__card {
  display: flex; align-items: center; gap: var(--space-sm);
  background: var(--success-glow);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  position: relative;
}
.rewards-tray__icon {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--radius-md);
  background: var(--success); display: flex; align-items: center; justify-content: center;
  color: var(--text-inverse);
}
.rewards-tray__icon svg { width: 18px; height: 18px; }

.rewards-tray__body { flex: 1; min-width: 0; }
.rewards-tray__label  { font-size: var(--text-sm); font-weight: var(--font-semi); color: var(--text-primary); }
.rewards-tray__reward { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--success); margin-top: 2px; }
.rewards-tray__expiry { font-size: var(--text-xs); color: var(--text-primary); font-weight: var(--font-semi); margin-top: 2px; }

.rewards-tray__open-btn {
  background: var(--success); color: var(--text-inverse); border: none;
  border-radius: var(--radius-sm); padding: 8px 14px;
  font-size: var(--text-sm); font-weight: var(--font-semi); cursor: pointer; flex-shrink: 0;
}
.rewards-tray__open-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Sparks badge on tier cards */

.tier-card__reward-group {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0;
}
.tier-card__sparks {
  display: flex; align-items: center; gap: 3px;
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--font-semi);
  color: var(--pending);
}
.tier-card__sparks svg { width: 11px; height: 11px; }

/* Floating "+reward"/"+N Sparks" pills — the claim-feedback animation, matching the original preview artifact 1:1 */

.reward-flash {
  position: absolute;
  right: 0;
  font-family: var(--font-mono); font-weight: var(--font-semi); font-size: var(--text-xs);
  padding: 3px 10px; border-radius: var(--radius-full);
  opacity: 0;
  animation: reward-flash-float 1.3s ease forwards;
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
}
.reward-flash--reward { background: var(--success); color: var(--text-inverse); }
.reward-flash--sparks { background: var(--pending); color: var(--text-inverse); }

@keyframes reward-flash-float {
  0%   { opacity: 0; transform: translateY(6px); }
  15%  { opacity: 1; transform: translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-16px); }
}
