/* FragranceBox Daily Rewards — wheel + result card styles.
   Loaded by /rewards (the page) and any embed. Reuses the .fb-promo-modal*
   chrome tokens (dark gold accents on deep black). Dark-mode aware through
   [data-theme="dark"]; reduced-motion aware through prefers-reduced-motion. */

/* ════════════════════════════════════════════════════════════════
   FRAGRANCE BOX — Daily Rewards wheel
   Rebuilt onto the site's own system: the off-white canvas from
   luxury-bg.css, the 1120px module width and section rhythm from
   preorder.css, and the 48px/999px button spec from .po-btn. No new
   tokens, no black card, no third-party widget feel.
   ════════════════════════════════════════════════════════════════ */

/* Page level: the site canvas is light (--fb-bg-base #fbfbfa), so page copy
   is dark ink. Only the wheel card inverts, and it re-declares these locally. */
.fb-rewards-page{
  --rw-ease: cubic-bezier(.16,1,.3,1);
  --rw-ink:     #000;
  --rw-muted:   rgba(0,0,0,.62);
  --rw-faint:   rgba(0,0,0,.45);
  --rw-line:    rgba(0,0,0,.1);
  --rw-line-soft: rgba(0,0,0,.07);
  --rw-gold:    #8a6a00;
  --rw-gold-2:  #b8860b;
}

/* Card level: a white panel on the off-white canvas, hairline separated. */
.fb-rewards-wheel-card{
  --rw-surface: #ffffff;
  --rw-ink:     #000;
  --rw-muted:   rgba(0,0,0,.62);
  --rw-faint:   rgba(0,0,0,.48);
  --rw-line:    rgba(0,0,0,.1);
  --rw-line-soft: rgba(0,0,0,.07);
  --rw-gold:    #8a6a00;
  --rw-gold-2:  #b8860b;
}

/* Same measure and gutter as every other module on the site. */
.fb-rw-shell{
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem,4vw,2.5rem) clamp(3rem,7vw,5rem);
  color: var(--rw-ink);
}

/* ── Hero: eyebrow / h1 / lead, matching .po-eyebrow + .po-lead ── */
.fb-rewards-hero{
  max-width: 40rem; margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}
.fb-rewards-eyebrow{
  margin: 0 0 .9rem;
  font-size: .6875rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--rw-muted);   /* .45 measured 3.33:1 and failed AA */
}
.fb-rewards-hero h1{
  margin: 0;
  font-size: clamp(1.75rem,4.5vw,2.75rem);
  font-weight: 300; line-height: 1.15; letter-spacing: -.01em;
  color: var(--rw-ink);
}
.fb-rewards-lede{
  margin: .85rem 0 0;
  font-size: clamp(.95rem,1.6vw,1.0625rem); font-weight: 300; line-height: 1.6;
  color: var(--rw-muted);
}
.fb-rewards-facts{
  list-style: none; margin: 1.25rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
}
.fb-rewards-facts li{
  padding: 8px 12px; border: 1px solid var(--rw-line-soft); border-radius: 999px;
  font-size: .8125rem; line-height: 1.3; color: var(--rw-muted);
}

/* ── States (paused / signed out) ── */
.fb-rewards-state{
  max-width: 36rem; margin: 0 auto; text-align: center;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--rw-line); border-radius: 14px; background: var(--rw-surface);
}
.fb-rewards-state strong{display: block; font-weight: 500; font-size: 1rem}
.fb-rewards-state span{display: block; margin-top: .4rem; color: var(--rw-muted); font-size: .875rem; line-height: 1.6}

/* ── The wheel module: a card, exactly like .po-card ── */
.fb-rewards-wheel-card{
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--rw-line);
  border-radius: 18px;
  background: var(--rw-surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px -24px rgba(0,0,0,.28);
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
  justify-items: center;
  grid-template-columns: minmax(0, 1fr);   /* mobile first */
}
@media (min-width: 56rem){
  .fb-rewards-wheel-card{
    grid-template-columns: minmax(0, 27rem) minmax(0, 1fr);
    align-items: center;
  }
}

.fb-rewards-wheel-stage{
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
  display: grid; place-items: center;
}
.fb-rewards-wheel{
  width: 100%; height: 100%;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 14px 30px rgba(0,0,0,.16));
  transition: transform 4.5s var(--rw-ease);
}
.fb-rewards-wheel.is-spinning{
  transition: transform var(--fb-rewards-spin-duration, 4500ms) var(--rw-ease);
}
.fb-rewards-wheel.is-spinning .fb-rewards-wedge-ico{opacity:1}

/* Pointer sits on the rim, not floating over the card. */
.fb-rewards-wheel-pointer{
  position: absolute; top: -.25rem; left: 50%;
  width: 1.5rem; height: 1.5rem; margin-left: -.75rem;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--rw-line);
  box-shadow: 0 4px 12px rgba(0,0,0,.14);
  z-index: 3;
}
.fb-rewards-wheel-pointer::after{
  content: ""; position: absolute; inset: 0; margin: auto;
  width: .4rem; height: .4rem; border-radius: 50%;
  background: var(--rw-gold-2);
}

/* ── Wedges: soft gradients in the site palette, never flat black ── */
/* Separators are what make adjacent segments readable, so they are drawn on
   top of the fills rather than left to the colour contrast. */
.fb-rewards-wheel path{
  stroke: rgba(255,255,255,.85);
  stroke-width: 1.5;
  transition: opacity .2s ease;
}
/* Hovering a legend row lifts its wedge and recedes the rest. */
.fb-rewards-wheel-card.has-legend-focus .fb-rewards-wheel path{ opacity:.35 }
.fb-rewards-wheel-card.has-legend-focus .fb-rewards-wheel path.is-focus{ opacity:1 }

/* ── The hub is the button. One control, sized like .po-btn. ── */
.fb-rewards-wheel-center{
  position: absolute; inset: 0;
  display: grid; place-items: center;
  z-index: 2; pointer-events: none;
}
.fb-rewards-hub{
  pointer-events: auto;
  width: 30%; aspect-ratio: 1;
  border-radius: 50%;
  display: grid; place-items: center; align-content: center; gap: .1rem;
  font-family: inherit; cursor: pointer;
  background: #000;
  border: 0;
  color: #fff;
  box-shadow: 0 10px 28px -12px rgba(0,0,0,.5);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease, background .18s ease;
}
.fb-rewards-hub-label{
  font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
}
.fb-rewards-hub[data-state="eligible"]{ animation: fbRewardsHubPulse 2.6s var(--rw-ease) infinite }
.fb-rewards-hub:hover{ transform: scale(1.04); box-shadow: 0 14px 34px -10px rgba(0,0,0,.6) }
.fb-rewards-hub:active{ transform: scale(.99) }
.fb-rewards-hub:focus-visible{ outline: 2px solid var(--rw-gold-2); outline-offset: 4px }
.fb-rewards-hub[aria-busy="true"]{ opacity: .7; cursor: progress; animation: none }
.fb-rewards-hub-count{ font-size: .9rem; font-weight: 500; font-variant-numeric: tabular-nums }
.fb-rewards-hub-sub{ font-size: .625rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rw-faint) }
.fb-rewards-hub.is-locked{ cursor: default; background: var(--fb-bg-soft, #f5f5f3); color: var(--rw-muted); box-shadow: none }

@keyframes fbRewardsHubPulse{
  0%,100%{ box-shadow: 0 10px 28px -12px rgba(0,0,0,.5) }
  50%    { box-shadow: 0 12px 36px -10px rgba(0,0,0,.65) }
}

/* ── Reward legend: readable chips, same idiom as .po-hero .po-trust li ── */
/* A payout table, not a badge row: swatch, prize, and the real odds. The
   percentages are computed from the live weights, so the legend cannot
   overstate what the wheel actually gives away. */
.fb-rewards-legend{
  list-style: none; margin: 0; padding: 0;
  width: 100%; max-width: 30rem;
  display: grid; gap: 0;
}
.fb-rewards-legend-item{
  display: grid;
  grid-template-columns: 1.1rem 1fr auto;
  align-items: center; gap: .75rem;
  padding: .6rem .25rem;
  border-bottom: 1px solid var(--rw-line-soft);
  font-size: .8125rem; line-height: 1.3;
  transition: color .18s ease;
}
.fb-rewards-legend-item:last-child{ border-bottom: 0 }
.fb-rewards-legend-item:hover{ color: var(--rw-ink) }
.fb-rewards-legend-swatch{
  width: .85rem; height: .85rem; border-radius: 3px; flex: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.fb-rewards-legend-label{ color: inherit }

.fb-rewards-next{
  margin: 0; text-align: center;
  font-size: .75rem; line-height: 1.6; color: var(--rw-faint);
}

/* ── Result: same card idiom, revealed after the spin ── */
.fb-rewards-result{display: none}
.fb-rewards-result.is-visible{ display: block; display: grid; justify-items: center; animation: fbRewardsResultIn .5s var(--rw-ease) both }
@keyframes fbRewardsResultIn{ from{ opacity: 0; transform: translateY(8px) } to{ opacity: 1; transform: none } }
.fb-rewards-result-card{
  max-width: 26rem; width: 100%; text-align: center;
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--rw-line); border-radius: 14px; background: var(--fb-bg-soft, #f5f5f3);
}
.fb-rewards-result-kind{
  display: inline-block; font-size: .625rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--rw-faint);
}
.fb-rewards-result-headline{ margin: .4rem 0 0; font-size: 1.125rem; font-weight: 500; line-height: 1.35 }
.fb-rewards-result-desc{ margin: .35rem 0 0; font-size: .875rem; line-height: 1.6; color: var(--rw-muted) }
.fb-rewards-coupon-code{
  display: inline-block; margin-top: .8rem; padding: .35rem .7rem;
  border: 1px dashed var(--rw-line); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8125rem; letter-spacing: .06em;
}
.fb-rewards-result-actions{ display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1rem }

/* 48px / 999px / #000, identical to .po-btn. */
.fb-rewards-result-actions .fb-promo-modal-cta,
.fb-rewards-result-actions .fb-rewards-next-btn{
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 48px; padding: 0 1.5rem; border-radius: 999px;
  border: 1px solid #000; background: #000; color: #fff; text-decoration: none;
  font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  transition: opacity .18s ease, transform .18s ease;
}
.fb-rewards-result-actions .fb-promo-modal-cta:hover{ opacity: .86; transform: translateY(-1px) }
.fb-rewards-result-actions .fb-rewards-secondary,
.fb-rewards-result-actions a:not(.fb-promo-modal-cta){
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 1.5rem; border-radius: 999px;
  border: 1px solid var(--rw-line); background: #fff; color: var(--rw-ink); text-decoration: none;
  font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  transition: opacity .18s ease, transform .18s ease;
}
.fb-rewards-result-actions .fb-rewards-secondary:hover{ opacity: .86; transform: translateY(-1px) }
.fb-rewards-coupon-copy{
  height: 48px; padding: 0 1.25rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rw-line); background: transparent; color: var(--rw-ink);
  font-family: inherit; font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  transition: opacity .18s ease;
}
.fb-rewards-coupon-copy:hover{ opacity: .8 }

/* ── Sections below: the site's rhythm, border-top, generous air ── */
.fb-rewards-history{
  max-width: 46rem; margin: 0 auto;
  padding: clamp(2.75rem,7vw,5rem) 0 0;
  border-top: 1px solid var(--rw-line-soft);
  text-align: left;
}
.fb-rewards-history + .fb-rewards-history{
  padding: clamp(2rem,5vw,3rem) 0 0;
  border-top: 1px solid var(--rw-line-soft);
  margin-top: clamp(2rem,5vw,3rem);
}
.fb-rewards-history h2{
  margin: 0 0 1.1rem;
  font-size: .6875rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--rw-faint);
}
.fb-rewards-history ul, .fb-rewards-history ol{margin: 0; padding-left: 1.1rem; color: var(--rw-muted); font-size: .8125rem; line-height: 1.65}
.fb-rewards-history li{margin-bottom: .5rem}
.fb-rewards-history-list{list-style: none; padding: 0}
.fb-rewards-history-row{
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .7rem 0; border-bottom: 1px solid var(--rw-line-soft);
}

/* ── Responsive: real layout changes, not a shrunken desktop ── */
@media (max-width: 640px){
  .fb-rewards-wheel-stage{ width: min(100%, 320px) }
  .fb-rewards-facts{ gap: .4rem }
  .fb-rewards-facts li{ font-size: .6875rem; padding: .5rem .6rem }
  .fb-rewards-legend{ gap: .4rem }
  .fb-rewards-legend-item{ font-size: .6875rem; padding: .4rem .6rem }
  .fb-rewards-result-actions{ flex-direction: column; align-items: stretch }
  .fb-rewards-result-actions > *{ width: 100% }
}
@media (max-width: 380px){
  .fb-rewards-wheel-stage{ width: min(100%, 280px) }
}

@media (prefers-reduced-motion: reduce){
  .fb-rewards-wheel,
  .fb-rewards-wheel.is-spinning{ transition: none !important }
  .fb-rewards-hub{ animation: none !important; transition: none !important }
  .fb-rewards-result.is-visible{ animation: none !important }
}

/* ── Retained aliases ──────────────────────────────────────────────────────
   .fb-rewards-spin-btn is the signed-out "Continue with Google" link and
   .fb-rewards-muted is referenced by the history/terms markup. Both keep the
   same 48px/999px button and muted-ink specs so nothing regressed when the
   dark card was replaced. */
.fb-rewards-muted{ color: var(--rw-muted, rgba(0,0,0,.62)) }
.fb-rewards-spin-btn{
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 48px; padding: 0 1.5rem; border-radius: 999px;
  border: 1px solid #000; background: #000; color: #fff; text-decoration: none; cursor: pointer;
  font-family: inherit; font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  transition: opacity .18s ease, transform .18s ease;
}
.fb-rewards-spin-btn:hover{ opacity: .86; transform: translateY(-1px) }
.fb-rewards-spin-btn:focus-visible{ outline: 2px solid #000; outline-offset: 3px }

/* ── Legend section ────────────────────────────────────────────────────────
   A titled table reads as information; the previous pill row read as chrome. */
.fb-rewards-legend-wrap{ width: 100%; max-width: 24rem; }
.fb-rewards-legend-title{
  margin: 0 0 .35rem;
  font-size: .6875rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--rw-faint); margin-bottom: 12px;
}
@media (min-width: 56rem){ .fb-rewards-legend-title{ text-align: left } }
.fb-rewards-legend-note{
  margin: 12px 0 0; font-size: .75rem; line-height: 1.5; color: var(--rw-faint);
}
@media (min-width: 56rem){ .fb-rewards-legend-note{ text-align: left } }
@media (max-width: 640px){
  .fb-rewards-legend{ max-width: none }
  .fb-rewards-legend-item{ grid-template-columns: 1rem 1fr auto; gap: .6rem; font-size: .75rem }
}

/* ── Hub countdown ────────────────────────────────────────────────────────
   The hub is the wheel's centre control. When the window opens the countdown
   gives way to a "Spin now" control, which needs to read as actionable rather
   than as a static label. */

.fb-rewards-hub[data-state="eligible"] .fb-rewards-hub-sub {
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.fb-rewards-hub[role="button"] { cursor: pointer; }
.fb-rewards-hub[role="button"]:hover { transform: scale(1.04); }
.fb-rewards-hub[role="button"]:focus-visible { outline: 2px solid var(--rw-gold-2); outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
    .fb-rewards-hub[role="button"]:hover { transform: none; }
}
