/* Mock: welcome-bonus wheel (/test/rouletetest).
   Dark canvas + bottom sheet. The wheel sits on the sheet's top edge so exactly
   its top half shows, and a soft mask dissolves the lower half into the sheet
   colour before the copy begins. */

.rt-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #08090b;
  color: var(--color-text, #f7f5ef);
  font-family: var(--font-body, system-ui, sans-serif);
}

/* The main screen sits behind the overlay, blurred, as the entry context.
   A warm gradient stands in until the iframe has painted. */
.rt-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 55% at 50% 0%, rgba(120, 96, 30, .38), transparent 62%),
    radial-gradient(circle at 50% 62%, rgba(244, 191, 69, .14), transparent 45%),
    #0a0b0d;
}

.rt-bg-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #08090b;
  opacity: 0;
  transform: scale(1.12);
  filter: blur(18px) brightness(.5) saturate(.92);
  transition: opacity .7s ease, filter .9s ease, transform .9s ease;
  pointer-events: none;
}

.rt-bg.is-ready .rt-bg-frame { opacity: 1; }

.rt-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 62%, rgba(0, 0, 0, .35), rgba(4, 5, 7, .78));
  transition: opacity .9s ease;
}

.rt-ambient {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity .9s ease;
  background:
    radial-gradient(circle at 50% 62%, rgba(244, 191, 69, .16), transparent 40%),
    radial-gradient(circle at 14% 78%, rgba(173, 123, 255, .1), transparent 30%),
    radial-gradient(circle at 88% 72%, rgba(85, 215, 154, .06), transparent 28%);
}

.rt-grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: .5;
  transition: opacity .9s ease;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 4px 4px;
  mask-image: radial-gradient(circle at 50% 62%, #000, transparent 62%);
}

.rt-mock-badge {
  position: fixed;
  z-index: 40;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: 14px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  color: var(--color-muted, #9a9b9d);
  background: rgba(255, 255, 255, .04);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  backdrop-filter: blur(10px);
  transition: opacity .6s ease;
}

/* ---------- bottom sheet ---------- */

.rt-sheet {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0 22px calc(24px + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 -22px 72px rgba(0, 0, 0, .3);
  transform: translateX(-50%);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2, .9, .25, 1);
  animation: rt-sheet-up .62s cubic-bezier(.2, .9, .25, 1);
}

/* Opaque surface that the wheel tucks behind. Sits above the wheel layer but
   below the copy and the hub. */
.rt-sheet::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(180deg, #1b1d23 0%, #15161a 42%, #101114 100%);
  pointer-events: none;
}

/* The panel colour fades out over the wheel instead of a hard seam, so the
   wheel dissolves into the sheet. Sits above the wheel, below the hub. */
.rt-sheet::before {
  content: '';
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 100%;
  height: clamp(92px, 30vw, 148px);
  background: linear-gradient(
    180deg,
    rgba(27, 29, 35, 0) 0%,
    rgba(27, 29, 35, .05) 24%,
    rgba(27, 29, 35, .18) 44%,
    rgba(27, 29, 35, .4) 62%,
    rgba(27, 29, 35, .68) 79%,
    rgba(27, 29, 35, .9) 92%,
    #1b1d23 100%
  );
  pointer-events: none;
}

/* ---------- wheel (only the top half is shown) ---------- */

.rt-stage {
  position: absolute;
  inset: 0 0 auto;
  height: 0;
  z-index: 2;
}

.rt-wheel-glow {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(110vw, 560px);
  height: min(110vw, 560px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 191, 69, .3), rgba(244, 191, 69, 0) 62%);
  filter: blur(6px);
  transform: translate(-50%, -72%);
  pointer-events: none;
}

.rt-wheel-wrap {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}

.rt-wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* Full circle, no clipping — the lower half is simply covered by the sheet
     surface (`.rt-sheet::after`). */
  box-shadow:
    0 0 0 6px rgba(9, 10, 13, .9),
    0 0 0 7px rgba(244, 191, 69, .35),
    0 26px 60px rgba(0, 0, 0, .6),
    inset 0 0 46px rgba(0, 0, 0, .55);
  transition-property: transform;
  transition-timing-function: cubic-bezier(.12, .72, .04, 1);
  will-change: transform;
}

.rt-wheel-rim {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 10px rgba(8, 9, 11, .32), inset 0 0 34px rgba(0, 0, 0, .5);
  pointer-events: none;
}

.rt-sector {
  position: absolute;
  font-family: var(--font-display, "Arial Narrow", Impact, sans-serif);
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1;
  white-space: nowrap;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Raised, beveled numerals: a vertical shade gives the face volume, a light
   catch under the top edge and a soft cast shadow lift them off the sector. */
.rt-sector.is-dark {
  background-image: linear-gradient(180deg, #6d4c12 0%, #331f06 58%, #140d02 100%);
  filter:
    drop-shadow(0 1px 0 rgba(255, 236, 170, .6))
    drop-shadow(0 3px 4px rgba(0, 0, 0, .45));
}
.rt-sector.is-light {
  background-image: linear-gradient(180deg, #ffffff 0%, #ffeec4 48%, #e2b45c 100%);
  filter:
    drop-shadow(0 1px 0 rgba(0, 0, 0, .5))
    drop-shadow(0 3px 6px rgba(0, 0, 0, .55));
}

.rt-hub {
  position: absolute;
  z-index: 4;
  top: -18px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  color: #17130a;
  background: radial-gradient(circle at 35% 30%, #fff2bf, #f4bf45 52%, #b9821a 100%);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .5), inset 0 0 0 4px rgba(9, 10, 13, .82);
  transform: translate(-50%, -50%);
}

.rt-hub-core {
  display: grid;
  place-items: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35));
}

.rt-ticket-icon {
  display: block;
  width: 30px;
  height: 30px;
  color: #17130a;
}

.rt-hub-arrow {
  position: absolute;
  top: -16px;
  width: 0;
  height: 0;
  border-right: 11px solid transparent;
  border-left: 11px solid transparent;
  border-bottom: 17px solid #fff7e2;
  filter: drop-shadow(0 0 6px rgba(244, 191, 69, .9)) drop-shadow(0 3px 4px rgba(0, 0, 0, .6));
  animation: rt-hub-pulse 1.6s ease-in-out infinite;
}

@keyframes rt-hub-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ---------- copy ---------- */

.rt-copy {
  position: relative;
  z-index: 5;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(44px, 11vw, 58px);
  text-align: center;
}

.rt-title {
  margin: 0 0 8px;
  font-family: var(--font-display, "Arial Narrow", Impact, sans-serif);
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: .94;
  text-transform: uppercase;
  text-shadow: 0 12px 34px rgba(0, 0, 0, .55);
}

.rt-subtitle {
  max-width: 340px;
  margin: 0;
  color: var(--color-muted, #9a9b9d);
  font-size: 13.5px;
  line-height: 1.5;
}

.rt-cta {
  width: 100%;
  min-height: 58px;
  margin-top: clamp(24px, 6vw, 34px);
  border: 0;
  border-radius: 38px;
  color: #fff;
  background: linear-gradient(135deg, #ffe08a, #f4bf45 55%, #dfa42a);
  box-shadow: 0 14px 32px rgba(244, 191, 69, .26), inset 0 1px 0 rgba(255, 255, 255, .5);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.rt-cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 18px 38px rgba(244, 191, 69, .32); }
.rt-cta:active:not(:disabled) { transform: translateY(1px) scale(.995); }
.rt-cta:disabled {
  cursor: default;
  opacity: .55;
  background: rgba(255, 255, 255, .1);
  color: var(--color-muted, #9a9b9d);
  box-shadow: none;
}

/* ---------- result ---------- */

.rt-result {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 40%, rgba(244, 191, 69, .18), transparent 52%),
    rgba(5, 6, 8, .74);
  backdrop-filter: blur(13px);
  transition: opacity .55s ease;
  animation: rt-fade-in .32s ease;
}

.rt-result-card {
  display: grid;
  justify-items: center;
  width: min(100%, 380px);
  text-align: center;
  animation: rt-card-in .45s cubic-bezier(.2, .9, .25, 1) both;
}

.rt-ticket {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  width: 178px;
  height: 112px;
  color: #17130a;
  background: linear-gradient(150deg, #fff0b8, #f4bf45 52%, #cf9422);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .6);
  border-radius: 20px;
  overflow: hidden;
  animation: rt-ticket-drop .7s cubic-bezier(.16, 1.1, .3, 1) both;
}
.rt-ticket::before,
.rt-ticket::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0a0b0d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
  transform: translateY(-50%);
}
.rt-ticket::before { left: -11px; }
.rt-ticket::after { right: -11px; }

.rt-ticket-value {
  font-family: var(--font-display, Impact, sans-serif);
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: .9;
}
.rt-ticket-label {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(23, 19, 10, .72);
}

.rt-result-copy {
  display: grid;
  gap: 6px;
  margin: 22px 0 4px;
}

.rt-eyebrow {
  color: var(--color-gold, #f4bf45);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.rt-result-title {
  margin: 0;
  font-family: var(--font-display, Impact, sans-serif);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -.03em;
  text-transform: uppercase;
}

.rt-result-sub {
  margin: 0;
  color: rgba(247, 245, 239, .82);
  font-size: 15px;
}
.rt-result-sub b { color: var(--color-gold, #f4bf45); }

.rt-result-total {
  margin: 0;
  color: var(--color-muted, #9a9b9d);
  font-size: 12px;
}

.rt-cta--result { margin-top: 22px; }

/* ---------- closing: fade the overlay out and reveal the main screen ---------- */

.rt-page.is-closed .rt-bg-frame {
  filter: blur(0) brightness(1) saturate(1);
  transform: scale(1);
}

.rt-page.is-closed .rt-scrim,
.rt-page.is-closed .rt-ambient,
.rt-page.is-closed .rt-grain,
.rt-page.is-closed .rt-mock-badge {
  opacity: 0;
}

.rt-page.is-closed .rt-sheet {
  opacity: 0;
  transform: translate(-50%, 42px);
  pointer-events: none;
}

.rt-page.is-closed .rt-result {
  opacity: 0;
  pointer-events: none;
}

@keyframes rt-sheet-up {
  from { opacity: 0; transform: translate(-50%, 46px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes rt-fade-in { from { opacity: 0; } }
@keyframes rt-card-in {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rt-ticket-drop {
  0% { opacity: 0; transform: translateY(-30vh) scale(.62) rotate(-8deg); }
  62% { opacity: 1; transform: translateY(0) scale(1.05) rotate(2deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@media (max-height: 680px) {
  .rt-copy { padding-top: clamp(38px, 9vw, 50px); }
}

@media (prefers-reduced-motion: reduce) {
  .rt-sheet,
  .rt-result,
  .rt-result-card,
  .rt-ticket { animation: none !important; }
  .rt-hub-arrow { animation: none !important; }
}

/* Live Mini App: keep the reference wheel and sheet over the current page. */
body.starter-ticket-open,
body.starter-gift-open { overflow: hidden; }
#starterGift.rt-page {
  position: fixed;
  inset: 0;
  z-index: 20020;
  display: block;
  min-height: 0;
  padding: 0;
  opacity: 1;
  pointer-events: auto;
  background: transparent;
  isolation: isolate;
  font-family: Inter, system-ui, sans-serif;
}
#starterGift.rt-page:not(.open):not(.starter-gift--react) { display: none; }
#starterGift .rt-scrim { background: radial-gradient(circle at 50% 62%, rgba(0,0,0,.45), rgba(4,5,7,.88)); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); }
#starterGift .rt-sheet { width: min(100%, 460px); min-height: 272px; }
#starterGift .rt-sheet::after { border-radius: 22px 22px 0 0; }
#starterGift .rt-wheel-wrap { width: 100%; }
#starterGift .rt-sector { font-size: clamp(24px, 7vw, 34px); }
#starterGift .rt-copy { padding-top: clamp(46px, 11vw, 60px); }
#starterGift .rt-cta { color: #19150c; text-shadow: none; }
#starterGift .rt-kicker { display: block; margin: 0 0 7px; color: #f4bf45; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
#starterGift .rt-bonus { position: relative; z-index: 5; display: flex; justify-content: center; width: 100%; gap: 8px; margin: 16px 0 0; }
#starterGift .rt-bonus span { flex: 1; padding: 9px 6px; border: 1px solid rgba(244,191,69,.35); border-radius: 13px; background: rgba(244,191,69,.09); color: #f8d68a; font-size: 13px; font-weight: 900; text-align: center; }
#starterGift .rt-bonus small { display: block; margin-top: 2px; color: #9a9b9d; font-size: 9px; font-weight: 600; }
#starterGift .rt-footnote { position: relative; z-index: 5; margin: 10px 0 0; color: #8c8e91; font-size: 10px; text-align: center; }
#starterGift .rt-error { position: relative; z-index: 5; margin: 10px 0 0; color: #ff9fa9; font-size: 12px; text-align: center; }
#starterGift .rt-result { z-index: 30; }
#starterGift .rt-result[hidden] { display: none; }
#starterGift .rt-result-total { margin-top: 9px; }
#starterGift .rt-result-note { max-width: 285px; margin: 8px 0 0; color: #9a9b9d; font-size: 11px; line-height: 1.4; }
#starterGift .rt-close { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 8; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; background: rgba(20,22,27,.7); color: #f7f5ef; font-size: 23px; line-height: 1; cursor: pointer; }
#starterGift .rt-close:disabled { opacity: .4; }
@media (max-width: 560px) {
  #starterGift .rt-sheet { width: 100%; }
  #starterGift .rt-title { font-size: clamp(28px, 8vw, 38px); }
}
