/*
 * RobloxPets — Wheel of Rewards (rebuilt Phase B, visual pass 2).
 * Support/homepage design system: navy gradient, grid+diagonal texture,
 * .rbp-card panels, shared tokens. Centrepiece: a layered, glossy prize wheel.
 */

body.rbp-wheel-spin-body,
body.rbp-wheel-page {
  background:
    radial-gradient(1000px 600px at 50% -8%, rgba(96, 165, 250, .16), transparent 62%),
    radial-gradient(900px 620px at 0% 4%, rgba(59, 130, 246, .12), transparent 58%),
    radial-gradient(900px 640px at 100% 2%, rgba(139, 92, 246, .13), transparent 58%),
    linear-gradient(180deg, #040912 0%, #050d1f 60%, #060f22 100%);
  background-attachment: fixed;
}

.rbp-wheel-spin-template,
.rp-spin-centre { position: relative; }

.rp-spin-centre,
.rp-spin-centre * { box-sizing: border-box; }

.rp-spin-centre {
  --line: rgba(96, 165, 250, .16);
  --line-strong: rgba(96, 165, 250, .34);
  --text: #e6edf7;
  --muted: #9aa9c2;
  --blue: #3b82f6;
  --blue-2: #5bb7ff;
  --green: #10b981;
  --gold: #ffd76a;
  --gold-2: #e6a700;

  position: relative;
  min-height: 80vh;
  /* NOTE: the theme already reserves the fixed-header height as padding-top on
     the parent <main class="rbp-wheel-spin-template">, so we must NOT re-add it
     here or the top spacing doubles. Just a little breathing room. */
  padding-top: clamp(10px, 2vw, 22px);
  padding-bottom: clamp(40px, 6vw, 80px);
  color: var(--text);
  font-family: Manrope, Chivo, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
  isolation: isolate;
  width: 100%;
  max-width: 100vw;
}
.rp-spin-centre :where(section, div, header, p, h1, h2, h3, h4) { min-width: 0; }
/* Doubled class defeats Breakdance's .breakdance h2 { color:var(--bde-heading-color) } tie. */
.rp-spin-centre.rp-spin-centre :is(h1, h2, h3, h4, h5, h6) { color: #fff !important; margin: 0; }

.rp-spin-centre::before,
.rp-spin-centre::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.rp-spin-centre::before {
  background-image:
    linear-gradient(to right, rgba(96, 165, 250, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(96, 165, 250, .05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 12%, #000 34%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 12%, #000 34%, transparent 78%);
}
.rp-spin-centre::after { background-image: repeating-linear-gradient(135deg, rgba(96, 165, 250, .035) 0 1px, transparent 1px 18px); }

.rp-spin-shell { position: relative; z-index: 1; width: min(100%, 1140px); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

.rbp-card {
  position: relative; border: 1px solid var(--line); border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 38, 80, .55), rgba(10, 21, 48, .55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 20px 54px -30px rgba(2, 6, 18, .95);
  backdrop-filter: blur(8px);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.rp-spin-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #8ec3ff; background: rgba(59, 130, 246, .12); border: 1px solid var(--line-strong); }
.rp-spin-eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(16, 185, 129, .18); }
.rp-spin-hero { text-align: center; padding: clamp(4px, 1.5vw, 14px) 0 clamp(18px, 2.6vw, 30px); }
.rp-spin-hero h1 { font-size: clamp(32px, 6vw, 56px); line-height: 1.02; letter-spacing: -.025em; margin: 16px 0 14px; }
.rp-spin-gradient-text { background: linear-gradient(90deg, #5bb7ff, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rp-spin-hero p { color: var(--muted); font-size: clamp(14px, 1.6vw, 17px); max-width: 580px; margin: 0 auto; line-height: 1.55; }

/* ── Layout: wheel + side ──────────────────────────────────────────────── */
.rp-spin-main { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 20px; align-items: stretch; }
@media (max-width: 900px) { .rp-spin-main { grid-template-columns: 1fr; } }
.rp-spin-wheelcard, .rp-spin-sidecard { padding: clamp(20px, 2.6vw, 32px); }
.rp-spin-wheelcard { display: flex; flex-direction: column; align-items: center; gap: 20px; overflow: hidden; }
/* subtle radial glow behind the wheel so it feels lit, not pasted */
.rp-spin-wheelcard::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(460px 460px at 50% 44%, rgba(91, 183, 255, .12), transparent 66%);
}
.rp-spin-wheelcard > * { position: relative; z-index: 1; }
.rp-spin-order-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; border-radius: 999px; font-size: 13px; color: #cfe0ff; background: rgba(2, 6, 18, .4); border: 1px solid var(--line); }
.rp-spin-order-pill strong { color: #fff; }

/* ── The wheel ─────────────────────────────────────────────────────────── */
.rbp-wheel { position: relative; width: min(100%, 420px); filter: drop-shadow(0 30px 60px rgba(2, 6, 18, .6)); }
.rbp-wheel__stage { position: relative; width: 100%; aspect-ratio: 1 / 1; }

.rbp-wheel__pointer {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 6;
  width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent;
  border-top: 30px solid var(--gold);
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .55));
}
.rbp-wheel__pointer::after {
  content: ""; position: absolute; left: 50%; top: -34px; transform: translateX(-50%);
  width: 15px; height: 15px; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fff2c8, var(--gold-2));
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5), inset 0 0 3px rgba(255, 255, 255, .6);
}

/* Outer polished bezel + ring of gold "bulbs" */
.rbp-wheel__ring {
  position: absolute; inset: -10px; border-radius: 50%;
  background:
    conic-gradient(from 0deg, #101f3d, #2b4a80, #101f3d, #2b4a80, #101f3d);
  box-shadow:
    0 30px 80px -28px rgba(59, 130, 246, .55),
    inset 0 0 0 2px rgba(255, 255, 255, .06),
    inset 0 6px 18px rgba(0, 0, 0, .5);
}
.rbp-wheel__ring::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 215, 120, .95) 0 1.4deg, rgba(255, 215, 120, 0) 1.4deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 0 47.5%, #000 47.5% 50%, transparent 50.5%);
  mask: radial-gradient(circle, transparent 0 47.5%, #000 47.5% 50%, transparent 50.5%);
  opacity: .8;
}
.rbp-wheel.is-spinning .rbp-wheel__ring { box-shadow: 0 30px 90px -22px rgba(91, 183, 255, .8), inset 0 0 0 2px rgba(255, 255, 255, .1), inset 0 6px 18px rgba(0, 0, 0, .5); }

.rbp-wheel__disc {
  position: absolute; inset: 6px; border-radius: 50%;
  /* base slices — 8 × 45deg from -22.5deg, seg 5 (225–270) = gold jackpot */
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, .32) 100%),
    conic-gradient(
      from -22.5deg,
      #23478a 0deg 45deg,
      #172f5e 45deg 90deg,
      #23478a 90deg 135deg,
      #1d2c4d 135deg 180deg,
      #23478a 180deg 225deg,
      #e6a700 225deg 270deg,
      #172f5e 270deg 315deg,
      #23478a 315deg 360deg
    );
  box-shadow:
    inset 0 0 0 2px rgba(255, 215, 120, .38),
    inset 0 0 0 6px rgba(6, 14, 32, .55),
    inset 0 0 70px -18px rgba(0, 0, 0, .78);
  transition: transform 5.4s cubic-bezier(.16, .84, .3, 1);
  will-change: transform;
}
/* beveled slice dividers: a dark shadow edge + a bright gold line, offset ~1deg
   so each join reads as a crisp raised seam rather than a flat line. */
.rbp-wheel__disc::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-conic-gradient(from -21.6deg, rgba(0, 0, 0, .45) 0 2px, transparent 2px 45deg),
    repeating-conic-gradient(from -22.5deg, rgba(255, 236, 180, .95) 0 2.2px, transparent 2.2px 45deg);
  filter: drop-shadow(0 0 3px rgba(255, 215, 120, .45));
}
/* jackpot slice sheen accent */
.rbp-wheel__disc::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from -22.5deg, transparent 0 225deg, rgba(255, 255, 255, .22) 225deg 270deg, transparent 270deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 0 30%, #000 30% 100%);
  mask: radial-gradient(circle, transparent 0 30%, #000 30% 100%);
}

/* static top-lit gloss (does NOT rotate) */
.rbp-wheel__stage::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%; z-index: 2; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -6%, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 46%),
    radial-gradient(100% 100% at 50% 120%, rgba(0, 0, 0, .28), transparent 44%);
}

.rbp-wheel__labels { position: absolute; inset: 0; z-index: 3; }
.rbp-wheel__seg {
  position: absolute; left: 50%; top: 50%; transform-origin: 0 0;
  transform: rotate(calc(var(--i) * 45deg)) translate(-50%, -50%);
  width: 0; height: 0;
}
.rbp-wheel__seg span {
  position: absolute; left: 50%; transform: translate(-50%, -138px);
  font-size: 12.5px; font-weight: 900; color: #f2f7ff; white-space: nowrap; letter-spacing: .02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}
.rbp-wheel__seg.is-jackpot span { color: #2a1a00; font-size: 13px; text-shadow: 0 1px 1px rgba(255, 255, 255, .35); }
.rbp-wheel__seg.is-none span { color: #aab8d6; }

.rbp-wheel__hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5;
  width: 30%; height: 30%; border-radius: 50%; display: grid; place-items: center;
  background:
    radial-gradient(circle at 42% 34%, #34579a 0%, #16294f 55%, #0a1631 100%);
  border: 3px solid rgba(255, 255, 255, .14);
  box-shadow:
    0 14px 30px -10px rgba(0, 0, 0, .85),
    inset 0 3px 8px rgba(255, 255, 255, .18),
    inset 0 -6px 12px rgba(0, 0, 0, .5),
    0 0 0 8px rgba(2, 8, 22, .55);
  font-size: clamp(12px, 2.6vw, 15px); font-weight: 900; letter-spacing: .14em; color: #dbe8ff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.rbp-wheel__hub::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid rgba(255, 215, 120, .45);
  -webkit-mask: linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0);
}
.rbp-wheel.is-spinning .rbp-wheel__hub { color: var(--gold); }

/* Spin button */
.rp-spin-btn {
  border: 0; border-radius: 14px; padding: 16px 40px; font: inherit; font-size: 16px; font-weight: 800;
  color: #fff; cursor: pointer; letter-spacing: .01em;
  background: linear-gradient(180deg, #5bb7ff, #3b82f6);
  box-shadow: 0 18px 40px -14px rgba(59, 130, 246, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.rp-spin-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.rp-spin-btn:active:not(:disabled) { transform: translateY(0); }
.rp-spin-btn:disabled { opacity: .5; cursor: default; filter: grayscale(.3); }
.rp-spin-btn__pill { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(255, 255, 255, .22); color: #fff; }

/* Anchor CTAs styled as buttons — force white text in every link state so the
   theme's default a:hover / a:visited colour can't grey them out. */
a.rp-spin-btn, a.rp-spin-btn:link, a.rp-spin-btn:visited, a.rp-spin-btn:hover, a.rp-spin-btn:focus, a.rp-spin-btn:active,
.rp-spin-reveal__primary, .rp-spin-reveal__primary:link, .rp-spin-reveal__primary:visited, .rp-spin-reveal__primary:hover, .rp-spin-reveal__primary:focus, .rp-spin-reveal__primary:active,
.rp-spin-apply-coupon, .rp-spin-apply-coupon:link, .rp-spin-apply-coupon:visited, .rp-spin-apply-coupon:hover, .rp-spin-apply-coupon:focus, .rp-spin-apply-coupon:active {
  color: #fff !important; text-decoration: none !important;
}
a.rp-spin-btn:hover, .rp-spin-reveal__primary:hover, .rp-spin-apply-coupon:hover { filter: brightness(1.06); }
.rp-spin-secondary-btn, .rp-spin-secondary-btn:link, .rp-spin-secondary-btn:visited, .rp-spin-secondary-btn:hover, .rp-spin-secondary-btn:focus { color: #cfe0ff !important; text-decoration: none !important; }

/* ── Side panel (status / spins / rewards) ─────────────────────────────── */
.rp-spin-sidecard { display: flex; flex-direction: column; gap: 15px; }
.rp-spin-sidecard h3 { font-size: 15px; letter-spacing: .01em; }
.rp-spin-statrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rp-spin-stat { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 16px; background: linear-gradient(180deg, rgba(59, 130, 246, .1), rgba(2, 6, 18, .32)); border: 1px solid var(--line); }
.rp-spin-stat b { font-size: 30px; line-height: 1; color: #fff; letter-spacing: -.02em; }
.rp-spin-stat span { font-size: 12.5px; color: var(--muted); }
.rp-spin-hint { font-size: 13px; color: var(--muted); line-height: 1.55; }
.rp-spin-wheelcard .rp-spin-hint { text-align: center; }
.rp-spin-sidecard hr, .rp-spin-divider { border: 0; height: 1px; background: var(--line); margin: 2px 0; }

/* Reward / coupon chips in the side panel */
.rp-spin-reward { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(2, 18, 14, .38); border: 1px solid rgba(16, 185, 129, .22); }
.rp-spin-reward__amt { font-weight: 800; color: #7ff0c2; font-size: 14px; }
.rp-spin-reward__code { margin-left: auto; font-family: ui-monospace, monospace; font-size: 12px; color: #cfe0ff; background: rgba(96, 165, 250, .12); padding: 3px 8px; border-radius: 7px; }

/* ── Guest state ───────────────────────────────────────────────────────── */
.rp-spin-guest { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 3.4vw, 48px); align-items: center; }
@media (max-width: 900px) { .rp-spin-guest { grid-template-columns: 1fr; } }
.rp-spin-guest__copy { text-align: center; }
.rp-spin-guest__copy h1 { font-size: clamp(30px, 5.4vw, 50px); line-height: 1.04; letter-spacing: -.02em; margin: 16px 0 14px; }
.rp-spin-guest__copy > p { color: var(--muted); font-size: clamp(14px, 1.6vw, 17px); line-height: 1.6; }
@media (min-width: 901px) { .rp-spin-guest__copy { text-align: left; } .rp-spin-guest__copy .rp-spin-guest__actions { justify-content: flex-start; } .rp-spin-guest__copy .rp-spin-guest__perks { margin-left: 0; } }
.rp-spin-guest__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 24px; }
.rp-spin-secondary-btn, .rp-spin-guest__actions .rp-spin-btn { text-decoration: none; display: inline-flex; align-items: center; }
.rp-spin-secondary-btn { padding: 15px 28px; border-radius: 14px; font-weight: 700; color: #cfe0ff; background: rgba(96, 165, 250, .1); border: 1px solid var(--line-strong); }
.rp-spin-guest__perks { list-style: none; margin: 26px auto 0; padding: 0; max-width: 460px; display: grid; gap: 9px; text-align: left; }
.rp-spin-guest__perks li { position: relative; padding-left: 26px; font-size: 14px; color: var(--muted); }
.rp-spin-guest__perks li::before { content: "\2726"; position: absolute; left: 0; color: var(--blue-2); }
.rp-spin-wheelcard--locked { position: relative; justify-content: center; }
.rp-spin-guest__lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(2, 6, 18, .5); backdrop-filter: blur(2px); border-radius: inherit; text-align: center; z-index: 2; }
.rp-spin-guest__lock-glyph { font-size: 30px; }
.rp-spin-guest__lock strong { color: #fff; font-size: 17px; }
.rp-spin-guest__lock span { color: var(--muted); font-size: 13px; }

/* ── Result reveal (modal) ─────────────────────────────────────────────── */
/* The modal is portaled to <body>, OUTSIDE .rp-spin-centre, so it must carry
   its own tokens and font — otherwise var(--gold)/var(--muted) resolve to
   nothing (empty badge, wrong text colours) and Breakdance styles leak in. */
.rp-spin-reveal {
  position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center; padding: 20px;
  --line: rgba(96, 165, 250, .16);
  --line-strong: rgba(96, 165, 250, .34);
  --muted: #9aa9c2;
  --blue: #3b82f6;
  --blue-2: #5bb7ff;
  --gold: #ffd76a;
  --gold-2: #e6a700;
  font-family: Manrope, Chivo, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.rp-spin-reveal.rp-spin-reveal :is(h1, h2, h3) { color: #fff !important; }
.rp-spin-reveal.is-open { display: flex; }
.rp-spin-reveal__scrim { position: absolute; inset: 0; background: rgba(2, 6, 18, .74); backdrop-filter: blur(4px); }
.rp-spin-reveal__card { position: relative; width: min(100%, 420px); text-align: center; padding: clamp(26px, 4vw, 38px); border-radius: 22px; animation: rp-pop .34s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes rp-pop { from { transform: scale(.9) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.rp-spin-reveal__badge { width: 78px; height: 78px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; font-weight: 900; color: #052e22; background: linear-gradient(180deg, var(--gold), var(--gold-2)); box-shadow: 0 12px 30px -12px rgba(230, 167, 0, .7); }
.rp-spin-reveal__card.is-none .rp-spin-reveal__badge { background: linear-gradient(180deg, #4a5878, #2b3654); color: #cfe0ff; }
.rp-spin-reveal__card h2 { font-size: 24px; margin: 0 0 6px; }
.rp-spin-reveal__amt { font-size: clamp(30px, 7vw, 46px); font-weight: 900; color: var(--gold); letter-spacing: -.02em; margin: 4px 0; }
.rp-spin-reveal__sub { color: var(--muted); font-size: 14px; }
.rp-spin-reveal__code { margin: 16px 0 6px; font-family: ui-monospace, monospace; font-size: 16px; font-weight: 800; color: #eaf3ff; background: rgba(96, 165, 250, .12); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px; }
.rp-spin-reveal__actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.rp-copy-inline, .rp-spin-reveal__secondary { padding: 11px 18px; border-radius: 11px; font: inherit; font-weight: 700; cursor: pointer; border: 1px solid var(--line-strong); background: rgba(96, 165, 250, .1); color: #cfe0ff; text-decoration: none; }
.rp-spin-reveal__primary { padding: 11px 22px; border-radius: 11px; font-weight: 800; text-decoration: none; color: #fff; background: linear-gradient(180deg, #5bb7ff, #3b82f6); }
.rp-copy-inline.is-done { background: rgba(16, 185, 129, .18); color: #7ff0c2; }

/* ── How it works strip ────────────────────────────────────────────────── */
.rp-spin-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
@media (max-width: 720px) { .rp-spin-how { grid-template-columns: 1fr; } }
.rp-spin-how__item { padding: 20px; }
.rp-spin-how__item h4 { margin: 0 0 6px; font-size: 15px; }
.rp-spin-how__item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

/* ── Reward history + active coupons ───────────────────────────────────── */
.rp-spin-history-wrap { margin-top: 26px; padding: clamp(20px, 2.6vw, 32px); border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(180deg, rgba(20, 38, 80, .5), rgba(10, 21, 48, .5)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 20px 54px -30px rgba(2, 6, 18, .95); backdrop-filter: blur(8px); }
.rp-spin-history-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.rp-spin-section-label { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #6db0ff; margin-bottom: 6px; }
.rp-spin-history-head h2 { font-size: clamp(20px, 3vw, 26px); letter-spacing: -.01em; }
.rp-spin-history-head p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; max-width: 560px; line-height: 1.5; }
.rp-spin-history-tabs { display: inline-flex; gap: 6px; padding: 5px; border-radius: 14px; background: rgba(2, 6, 18, .4); border: 1px solid var(--line); }
.rp-spin-history-tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 13px; padding: 9px 14px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background .18s, color .18s; }
.rp-spin-history-tabs button strong { color: inherit; background: rgba(96, 165, 250, .16); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.rp-spin-history-tabs button.is-active { background: linear-gradient(180deg, #5bb7ff, #3b82f6); color: #fff; }
.rp-spin-history-tabs button.is-active strong { background: rgba(255, 255, 255, .22); }
.rp-spin-history-panel { display: none; }
.rp-spin-history-panel.is-active { display: block; }

/* active coupon cards — cohesive navy/gold "voucher" look (no green/blue clash) */
.rp-spin-coupons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.rp-spin-coupon-card {
  position: relative; overflow: hidden;
  padding: 18px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(59, 130, 246, .1), rgba(6, 14, 32, .5));
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px;
}
.rp-spin-coupon-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--gold), var(--blue-2)); }
.rp-spin-coupon-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rp-spin-coupon-card__title { font-weight: 800; color: #fff; font-size: 17px; letter-spacing: -.01em; }
.rp-spin-coupon-card__expiry { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rp-spin-coupon-card__order { font-size: 11px; color: #cfe0ff; background: rgba(96, 165, 250, .14); border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; white-space: nowrap; }
/* code sits on its own row, ticket-style, with a ghost Copy on the right */
.rp-spin-coupon-card__code { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-coupon-code { flex: 1 1 auto; font-family: ui-monospace, monospace; font-size: 13.5px; font-weight: 800; color: #eaf3ff; background: rgba(2, 6, 18, .55); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; letter-spacing: .05em; text-align: center; }
.rp-copy-coupon { flex: none; border: 1px solid var(--line-strong); background: rgba(96, 165, 250, .1); color: #cfe0ff; font: inherit; font-weight: 700; font-size: 12.5px; padding: 10px 14px; border-radius: 10px; cursor: pointer; transition: background .18s, color .18s, border-color .18s; }
.rp-copy-coupon:hover { background: rgba(96, 165, 250, .18); }
.rp-copy-coupon.is-done { background: rgba(16, 185, 129, .16); color: #7ff0c2; border-color: rgba(16, 185, 129, .4); }
.rp-spin-apply-coupon { width: 100%; text-align: center; font-weight: 800; font-size: 13.5px; padding: 11px 14px; border-radius: 11px; color: #fff; background: linear-gradient(180deg, #5bb7ff, #3b82f6); box-shadow: 0 12px 26px -14px rgba(59, 130, 246, .85), inset 0 1px 0 rgba(255, 255, 255, .3); transition: filter .18s, transform .12s; }
.rp-spin-apply-coupon:hover { transform: translateY(-1px); }

/* empty states */
.rp-spin-empty-state { display: flex; gap: 14px; align-items: center; padding: 22px; border-radius: 16px; background: rgba(2, 6, 18, .3); border: 1px dashed var(--line-strong); }
.rp-spin-empty-state strong { color: #fff; display: block; margin-bottom: 4px; }
.rp-spin-empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.rp-spin-empty-state a { color: var(--blue-2); font-weight: 700; text-decoration: none; font-size: 13px; }
.rp-spin-empty-state__icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: rgba(96, 165, 250, .14); border: 1px solid var(--line); }

/* history table */
.rp-spin-section-title { font-size: 13px; font-weight: 800; color: #cfe0ff; margin-bottom: 12px; }
.rp-spin-history-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
.rp-spin-history-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.rp-spin-history-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; padding: 12px 14px; background: rgba(2, 6, 18, .42); border-bottom: 1px solid var(--line); }
.rp-spin-history-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: middle; }
.rp-spin-history-row:last-child td { border-bottom: 0; }
.rp-spin-history-row:hover td { background: rgba(96, 165, 250, .05); }
.rp-spin-dash { color: var(--muted); }
.rp-spin-expiry-rel { color: var(--muted); font-size: 12px; }
.rp-coupon-pill { display: inline-flex; align-items: center; gap: 6px; }
.rp-coupon-pill .rp-coupon-code { padding: 4px 8px; font-size: 12px; }
.rp-coupon-pill .rp-copy-coupon { padding: 5px 9px; font-size: 11.5px; }
.rp-spin-history-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--muted); }
.rp-spin-history-more-btn { border: 1px solid var(--line-strong); background: rgba(96, 165, 250, .1); color: #cfe0ff; font: inherit; font-weight: 700; font-size: 13px; padding: 9px 16px; border-radius: 10px; cursor: pointer; }
.rp-spin-small { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* result badge */
.rp-spin-result-badge { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.rp-spin-result-badge__icon { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; }
.rp-spin-result-badge.is-money .rp-spin-result-badge__icon { background: rgba(16, 185, 129, .2); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .4); }
.rp-spin-result-badge.is-money .rp-spin-result-badge__icon::before { content: "\00A3"; color: #7ff0c2; font-weight: 900; font-size: 12px; }
.rp-spin-result-badge.is-coupon .rp-spin-result-badge__icon { background: rgba(96, 165, 250, .2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.rp-spin-result-badge.is-coupon .rp-spin-result-badge__icon::before { content: "%"; color: #bcd6ff; font-weight: 900; font-size: 12px; }
.rp-spin-result-badge.is-priority .rp-spin-result-badge__icon { background: rgba(230, 167, 0, .2); box-shadow: inset 0 0 0 1px rgba(230, 167, 0, .4); }
.rp-spin-result-badge.is-priority .rp-spin-result-badge__icon::before { content: "!"; color: var(--gold); font-weight: 900; font-size: 12px; }
.rp-spin-result-badge.is-none .rp-spin-result-badge__icon { background: rgba(74, 88, 120, .3); box-shadow: inset 0 0 0 1px rgba(154, 169, 194, .3); }
.rp-spin-result-badge.is-none .rp-spin-result-badge__icon::before { content: "\2013"; color: var(--muted); font-weight: 900; }

@media (max-width: 620px) {
  .rp-spin-history-head { flex-direction: column; align-items: stretch; }
  .rp-spin-history-tabs { align-self: flex-start; }
}

/* ── Order-received / view-order box ───────────────────────────────────────
   Renders OUTSIDE .rp-spin-centre (echoed into the WooCommerce thank-you
   template), so it must carry its own tokens + font + heading override, and
   lay itself out as a self-contained 2-column card (wheel left, result right). */
.rp-spin-box {
  --line: rgba(96, 165, 250, .16);
  --line-strong: rgba(96, 165, 250, .34);
  --text: #e6edf7;
  --muted: #9aa9c2;
  --blue: #3b82f6;
  --blue-2: #5bb7ff;
  --green: #10b981;
  --gold: #ffd76a;
  --gold-2: #e6a700;
  font-family: Manrope, Chivo, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch; gap: 18px; margin: 24px auto; max-width: 960px;
}
.rp-spin-box.rp-spin-box :is(h1, h2, h3, h4) { color: #fff !important; margin: 0; }
@media (max-width: 820px) {
  /* Renders straight into the theme's thank-you column, which has no side
     gutter on mobile — add our own so it doesn't touch the screen edges. */
  .rp-spin-box { grid-template-columns: 1fr; max-width: 520px; box-sizing: border-box; padding-inline: clamp(14px, 4vw, 20px); }
}
.rp-spin-box .rp-spin-wheelcard { padding: clamp(20px, 3vw, 30px); gap: 18px; }

.rp-spin-panel { padding: clamp(22px, 2.8vw, 32px); display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.rp-spin-rp__eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #6db0ff; }
.rp-spin-panel h3 { font-size: clamp(20px, 2.6vw, 26px); line-height: 1.12; letter-spacing: -.01em; }
.rp-spin-rp__copy { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
.rp-spin-rp__copy strong { color: #dbe8ff; }
.rp-spin-rp__list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 9px; }
/* flex layout keeps the bullet and text as separate items, so a theme resetting
   li padding can't make them overlap. */
.rp-spin-rp__list li { display: flex; align-items: flex-start; gap: 10px; padding: 0; font-size: 14px; color: var(--muted); list-style: none; }
.rp-spin-rp__list li::before { content: "\2726"; flex: 0 0 auto; color: var(--blue-2); line-height: 1.5; }

/* won card inside the result panel */
.rp-spin-rp__won { padding: 16px; border-radius: 14px; background: linear-gradient(180deg, rgba(59, 130, 246, .1), rgba(6, 14, 32, .5)); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; margin-top: 2px; }
.rp-spin-rp__won.is-money { border-color: rgba(255, 215, 120, .32); background: linear-gradient(180deg, rgba(230, 167, 0, .14), rgba(6, 14, 32, .5)); }
.rp-spin-rp__won-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rp-spin-rp__won-amt { font-size: 18px; font-weight: 800; color: #fff; }
.rp-spin-rp__won.is-money .rp-spin-rp__won-amt { color: var(--gold); }
.rp-spin-rp__won-exp { font-size: 12px; color: var(--muted); }

/* ghost variant of the primary CTA (used for shop/continue links) */
.rp-spin-apply-coupon--ghost, .rp-spin-apply-coupon--ghost:link, .rp-spin-apply-coupon--ghost:visited, .rp-spin-apply-coupon--ghost:hover, .rp-spin-apply-coupon--ghost:focus {
  background: rgba(96, 165, 250, .1) !important; border: 1px solid var(--line-strong); box-shadow: none !important; color: #cfe0ff !important;
}

.rp-wheel-box { display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* ── Tiered wheels: card meta row, tier badge, and the "how it works" ladder ── */
.rp-spin-wheelcard__meta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }

.rp-spin-tier-badge {
  --tc: #c98a3a;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  color: #fff;
  background: color-mix(in srgb, var(--tc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent);
}
.rp-spin-tier-badge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 10px -1px var(--tc); }
.rp-spin-tier-badge.is-bronze { --tc: #c98a3a; }
.rp-spin-tier-badge.is-silver { --tc: #c3cede; }
.rp-spin-tier-badge.is-gold   { --tc: #ffcf4a; }

.rp-spin-tiers { margin-top: 22px; }
.rp-spin-tiers__head { text-align: center; max-width: 560px; margin: 0 auto 18px; }
.rp-spin-tiers__head h2 { font-size: clamp(20px, 3vw, 26px); margin: 2px 0 6px; color: #fff; }
.rp-spin-tiers__head p { color: #9aa9c2; font-size: 14px; line-height: 1.55; margin: 0; }
.rp-spin-tiers__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .rp-spin-tiers__grid { grid-template-columns: 1fr; } }

.rp-spin-tier {
  --tc: #c98a3a;
  position: relative; padding: 18px 18px 16px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 38, 80, .4), rgba(8, 18, 40, .5));
  border: 1px solid var(--line); border-top: 3px solid var(--tc);
}
.rp-spin-tier.is-bronze { --tc: #c98a3a; }
.rp-spin-tier.is-silver { --tc: #c3cede; }
.rp-spin-tier.is-gold   { --tc: #ffcf4a; }
.rp-spin-tier.is-current { box-shadow: inset 0 0 0 1.5px var(--tc), 0 0 50px -22px var(--tc); }
.rp-spin-tier__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rp-spin-tier__name { font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--tc); }
.rp-spin-tier__you { font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: #06101f; background: var(--tc); padding: 3px 9px; border-radius: 999px; }
.rp-spin-tier__req { margin-top: 6px; font-size: 20px; font-weight: 900; color: #fff; letter-spacing: -.01em; }
.rp-spin-tier__perks { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.rp-spin-tier__perks li { position: relative; padding-left: 20px; font-size: 13px; color: #c3d1ea; line-height: 1.4; }
.rp-spin-tier__perks li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--tc); background: color-mix(in srgb, var(--tc) 55%, transparent); }
.rp-spin-tier__perks li.is-jackpot strong { color: var(--tc); }
.rp-spin-tier__perks li.is-muted { color: #6f7fa2; }
.rp-spin-tier__perks li.is-muted::before { box-shadow: inset 0 0 0 2px #46506e; background: transparent; }
.rp-spin-tier__perks strong { color: #eaf3ff; }
