/* ==========================================================================
   Wheel of Fortune (گردونه شانس) — dedicated stylesheet
   --------------------------------------------------------------------------
   Stylesheet of js/wheel.js. Everything the module injects (top-bar button,
   full-screen page, modal panels, toasts) is styled here and nowhere else, so
   the widget can be dropped into any page without touching shared CSS.

   VISUAL LANGUAGE — "luxury casino" (ref: luck-spin.html.ini)
     · deep midnight-navy stage, max 400px column, 24/20px gutters
     · metallic gold: multi-stop gradients for every border, bevel, hairline
     · wheel = beveled outer ring + 6 gold screws + jewel center cap +
       diamond pointer leaning over the ring
     · segments: maroon · emerald · gold · cream
     · primary action   = glossy emerald pill with gold rim + halo
     · secondary action = dark pill with a thin gold outline
     · status plaque    = diamond ❖ flanked line (replaces the plain hint)
     · timer panel      = clock + track + gold fill

   Conventions
     • prefix        wheel*   (BEM-ish, matches the markup in wheel.js)
     • layout        direction: rtl
     • colour        wheel-local `--lux-*` tokens, re-mapped for "Patok Day";
                     structural colours (--pk-*) stay shared so upstream theme
                     work keeps flowing in
     • z-index       950 = chrome, 1150 = page, 1160/1170 = panels, 1180 = toasts
   ========================================================================== */

/* ==========================================================================
   0. Tokens + layers
   ========================================================================== */
#ui_wheel,
.wheelTopBtn {
  /* --- midnight stage --- */
  --lux-ink: #050914;
  --lux-panel: #0b111d;
  --lux-panel-2: #131c2e;
  --lux-panel-3: #1a2437;

  /* --- metals --- */
  --lux-gold-1: #fdf5c9;
  --lux-gold-2: #fcf6ba;
  --lux-gold-3: #d4af37;
  --lux-gold-4: #b38728;
  --lux-gold-5: #8a6d3b;
  --lux-gold-line: rgba(212, 175, 55, 0.6);
  --lux-gold-line-2: rgba(212, 175, 55, 0.3);
  --lux-gold-rgb: 212, 175, 55;

  /* --- emerald CTA --- */
  --lux-green-1: #12a16e;
  --lux-green-2: #054d35;
  --lux-green-rgb: 18, 161, 110;

  /* --- ink --- */
  --lux-text: #e2e8f0;
  --lux-text-2: #c7d2e0;
  --lux-muted: #94a3b8;

  /* --- wheel metal --- */
  --lux-ring-1: #fdf5c9;
  --lux-ring-2: #e7c964;
  --lux-ring-3: #b38728;
  --lux-ring-4: #6b4f16;
  --lux-screw: radial-gradient(circle at 34% 30%, #fffbe4, #d4af37 45%, #6b4f16 100%);

  /* --- layers --- */
  --wheel-z-chrome: 950;
  --wheel-z-page: 1150;
  --wheel-z-panel: 1160;
  --wheel-z-modal: 1170;
  --wheel-z-toast: 1180;

  --wheel-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --wheel-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   1. Top-bar entry button (injected next to #obtain_coin)
   ========================================================================== */
.wheelTopBtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* هم‌ارتفاع با pill «دریافت سکه» (۳۴px) تا نوار بالای منو یکدست
     بماند. قبلاً ۳۶px بود و با نوار ۳۶px هم‌اندازه می‌شد. */
  height: 34px;
  min-width: 0;
  padding: 0 12px;
  box-sizing: border-box;
  flex-shrink: 0;
  border: 1px solid var(--lux-gold-line);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--lux-panel-2), var(--lux-panel));
  color: var(--lux-gold-2);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.2px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    transform 0.18s var(--wheel-ease),
    box-shadow 0.18s var(--wheel-ease),
    filter 0.18s var(--wheel-ease);
}
.wheelTopBtn__icon {
  font-size: 15px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(var(--lux-gold-rgb), 0.65));
}
.wheelTopBtn__label {
  overflow: hidden;
  text-overflow: ellipsis;
  /* دکمه‌ها از UA مقدار `unicode-bidi: isolate` می‌گیرند. در RTL این
     باعث می‌شد کاراکترهای خنثای متن جابه‌جا شوند و «،شانس گردونه»
     دیده شود. `direction: rtl` + `unicode-bidi: normal` ترتیب منطقی
     فارسی را حفظ می‌کند. */
  direction: rtl;
  unicode-bidi: normal;
  text-align: center;
  min-width: 0;
}
.wheelTopBtn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow:
    0 4px 16px rgba(var(--lux-gold-rgb), 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.wheelTopBtn:active {
  transform: translateY(0) scale(0.97);
}
.wheelTopBtn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--lux-panel),
    0 0 0 4px rgba(var(--lux-gold-rgb), 0.75);
}

/* آمادهٔ چرخش → درخشش طلایی */
.wheelTopBtn.is-ready {
  border-color: var(--lux-gold-3);
  color: #1a1408;
  background: linear-gradient(135deg, #fdf5c9 0%, #d4af37 46%, #b38728 100%);
  animation: wheelTopPulse 2.2s ease-in-out infinite;
}
.wheelTopBtn.is-ready .wheelTopBtn__icon {
  filter: none;
}
.wheelTopBtn.is-disabled {
  opacity: 0.85;
}

/* نشانگر (تعداد تبلیغ باقی‌مانده) */
.wheelTopBtn__badge {
  position: absolute;
  top: -5px;
  inset-inline-end: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 1px solid var(--lux-panel);
  border-radius: 999px;
  background: linear-gradient(180deg, #14b87d, #0a7c53);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

@keyframes wheelTopPulse {
  0%,
  100% {
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.6),
      0 0 0 0 rgba(var(--lux-gold-rgb), 0.55);
  }
  50% {
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.6),
      0 0 0 7px rgba(var(--lux-gold-rgb), 0);
  }
}

/* ==========================================================================
   2. Page shell  (#ui_wheel)
   JS toggles display = none | flex and the `wheelPage--open` class.
   ========================================================================== */
#ui_wheel.wheelPage {
  position: fixed;
  inset: 0;
  z-index: var(--wheel-z-page);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  direction: rtl;
  color: var(--lux-text);
  font-family: inherit;
  overflow: hidden;
  background-color: #02040a;
  -webkit-tap-highlight-color: transparent;
}

/* قابِ اصلی — عرض ۴۰۰px، روی دسکتاپ وسط‌چین مثل یک «اپ موبایل» */
#ui_wheel .wheelPage__inner {
  position: relative;
  flex: 0 1 auto;
  width: 100%;
  max-width: 400px;
  min-height: 0;
  max-height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 20px
    calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  background-color: var(--lux-ink);
  background-image:
    radial-gradient(circle at 50% 16%, #1b2740 0%, transparent 58%),
    radial-gradient(circle at 50% 48%, #131e33 0%, transparent 62%),
    radial-gradient(circle at 50% 94%, var(--lux-panel) 0%, var(--lux-ink) 100%);
  box-shadow:
    0 0 60px rgba(0, 0, 0, 0.85),
    inset 0 0 120px rgba(0, 0, 0, 0.55);
}

/* ---------- هدر: دکمهٔ گرد بازگشت | کپسول سکه | دکمهٔ گرد راهنما ---------- */
#ui_wheel .wheelPage__head {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  margin-bottom: 14px;
}

/* دکمهٔ گرد طلایی (بازگشت) */
#ui_wheel .wheelPage__back {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--lux-gold-3);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lux-panel-3), var(--lux-panel));
  color: var(--lux-gold-3);
  font-family: inherit;
  font-size: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 3px rgba(255, 255, 255, 0.1);
  transition:
    transform 0.16s var(--wheel-ease),
    box-shadow 0.16s var(--wheel-ease),
    border-color 0.16s var(--wheel-ease);
}
#ui_wheel .wheelPage__back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* در RTL فلش را به سمت راست (جهت بازگشت) می‌چرخانیم */
#ui_wheel .wheelPage__back svg {
  transform: scaleX(-1);
}
/* متن «بازگشت» برای صفحه‌خوان‌ها می‌ماند، بصری پنهان */
#ui_wheel .wheelPage__back span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
#ui_wheel .wheelPage__back:hover {
  border-color: var(--lux-gold-2);
  box-shadow:
    0 6px 16px rgba(var(--lux-gold-rgb), 0.35),
    inset 0 1px 3px rgba(255, 255, 255, 0.16);
}
#ui_wheel .wheelPage__back:active {
  transform: scale(0.94);
}
#ui_wheel .wheelPage__back:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--lux-ink),
    0 0 0 4px rgba(var(--lux-gold-rgb), 0.8);
}

/* عنوان — بین دو دکمهٔ گرد، ریز و مجلل */
#ui_wheel .wheelPage__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 44%;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--lux-gold-3);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 14px rgba(var(--lux-gold-rgb), 0.45);
  pointer-events: none;
}

/* کپسول سکه (وسط هدر) */
#ui_wheel .wheelPage__coins {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--lux-gold-line);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--lux-panel-2), var(--lux-panel));
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
#ui_wheel .wheelPage__coins span {
  font-size: 15px;
  line-height: 1;
  filter: drop-shadow(0 0 5px rgba(var(--lux-gold-rgb), 0.7));
}
#ui_wheel .wheelPage__coins b {
  font-variant-numeric: tabular-nums;
  color: var(--lux-gold-1);
}

/* ==========================================================================
   3. Stage — beveled gold ring, screws, jewel cap, diamond pointer, SPIN hub
   --------------------------------------------------------------------------
   Markup:  .wheelStage > (.wheelStage__pointer, .wheelStage__ring > 6×screw
                              + .wheelDisc > svg.wheelDisc__svg, .wheelHub)
   Geometry: wheel.js paints wedge i in a 0..200 SVG viewBox spanning
   [i*seg, (i+1)*seg) CLOCKWISE FROM 12 O'CLOCK, and the pointer sits at
   12 O'CLOCK. `rotate()` is purely visual, so RTL/LTR never mirrors the disc
   and slotIndex stays aligned with the pointer.
   ========================================================================== */
#ui_wheel .wheelStage {
  position: relative;
  flex-shrink: 0;
  width: min(calc(100vw - 64px), calc(100vh - 300px), 340px);
  aspect-ratio: 1 / 1;
  margin: 2px auto 0;
  display: grid;
  place-items: center;
  isolation: isolate;
}

/* هالهٔ طلایی پشت گردونه
   ⚡ به‌جای `filter: blur()` (گران روی GPU ضعیف) از گرادیان شعاعیِ نرم
   استفاده می‌کنیم؛ ظاهر تقریباً یکسان، اما بدون هزینهٔ هر فریم. */
#ui_wheel .wheelStage__glow {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(var(--lux-gold-rgb), 0.2) 0%,
    rgba(var(--lux-gold-rgb), 0.12) 38%,
    rgba(var(--lux-gold-rgb), 0.05) 56%,
    transparent 72%
  );
}

/* حلقهٔ فلزی بیرونی (با تراشِ برجسته) */
#ui_wheel .wheelStage__ring {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    #6b4f16 0deg, #e7c964 22deg, #fdf5c9 38deg, #b38728 62deg,
    #fdf5c9 82deg, #96722a 104deg, #e7c964 128deg, #6b4f16 152deg,
    #fdf5c9 176deg, #b38728 200deg, #fdf5c9 222deg, #96722a 246deg,
    #e7c964 270deg, #6b4f16 292deg, #fdf5c9 316deg, #b38728 338deg,
    #6b4f16 360deg
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.85),
    0 14px 34px -14px rgba(0, 0, 0, 0.95),
    0 0 34px rgba(var(--lux-gold-rgb), 0.28),
    inset 0 2px 4px rgba(255, 255, 255, 0.5),
    inset 0 -3px 6px rgba(70, 45, 0, 0.7);
}

/* براقیِ چرخان روی حلقه — حس فلزِ واقعی
   ⚡ این لایه فقط گاهی یک چرخش کامل ۳۶۰° می‌زند و بین آن‌ها ساکن است؛
   یک چرخش پیوستهٔ بی‌پایان، هر فریم گرادیان مخروطی را دوباره رنگ می‌کرد
   و روی موبایل ضعیف باعث افت فریم می‌شد. */
#ui_wheel .wheelStage__ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.55) 14deg,
    transparent 44deg,
    transparent 180deg,
    rgba(255, 255, 255, 0.4) 196deg,
    transparent 226deg,
    transparent 360deg
  );
  mix-blend-mode: screen;
  opacity: 0.55;
  will-change: opacity;
  animation: wheelRingShine 11s ease-in-out infinite;
}

@keyframes wheelRingShine {
  0%,
  62% {
    transform: rotate(0deg);
    opacity: 0.5;
  }
  63% {
    opacity: 0.7;
  }
  100% {
    transform: rotate(360deg);
    opacity: 0.5;
  }
}
/* لبهٔ داخلی حلقه (پشت دیسک) */
#ui_wheel .wheelStage__ring::after {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background: linear-gradient(180deg, #4a3a14, #1b1408 40%, #4a3a14 100%);
  box-shadow:
    inset 0 3px 8px rgba(0, 0, 0, 0.9),
    inset 0 -1px 2px rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.7);
}

/* پیچ‌های طلایی روی حلقه (۶ عدد، هر ۶۰ درجه) */
#ui_wheel .wheelStage__screw {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6.2%;
  aspect-ratio: 1 / 1;
  margin: -3.1% 0 0 -3.1%;
  border-radius: 50%;
  background: var(--lux-screw);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    inset 0 1px 1px rgba(255, 255, 255, 0.65),
    inset 0 -1px 1px rgba(70, 45, 0, 0.8);
  transform: rotate(calc(var(--screw-i) * 60deg)) translateY(-46.9%);
}
#ui_wheel .wheelStage__screw::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: #6b4f16;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.9);
}

/* اشاره‌گر الماسی بالای گردونه */
#ui_wheel .wheelStage__pointer {
  position: absolute;
  top: -3.4%;
  left: 50%;
  z-index: 4;
  width: 8.6%;
  aspect-ratio: 1 / 1.35;
  transform: translateX(-50%);
  pointer-events: none;
}
#ui_wheel .wheelStage__pointer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #fdf5c9 0%, #d4af37 46%, #8a6320 100%);
  clip-path: polygon(50% 100%, 0 32%, 26% 0, 74% 0, 100% 32%);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.75));
}
#ui_wheel .wheelStage__pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8%;
  width: 22%;
  height: 74%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), transparent 72%);
  clip-path: polygon(50% 0, 100% 24%, 100% 100%, 0 100%, 0 24%);
  opacity: 0.75;
}

/* دیسکِ چرخان — rotation از JS روی همین المان ست می‌شود.
   `direction` را عوض نمی‌کنیم: rotate() آینه‌ای نمی‌شود و تغییر direction
   باعث بازچیدگی مقادیر inherited داخل دیسک و اسلات‌ها می‌شود.

   ⚡ عملکرد (دستگاه‌های ضعیف):
   دیسک در لایهٔ مستقل کامپوزیت می‌شود (translateZ/backface) تا چرخش فقط
   روی GPU انجام شود و در هر فریم، SVG دوباره رَستِرش (rasterize) نشود.
   از will-change استفاده نمی‌کنیم چون در بعضی مرورگرهای موبایل حافظهٔ
   بافت گران می‌سازد؛ translateZ(0) همان ارتقا را با هزینهٔ کمتر می‌دهد. */
#ui_wheel .wheelDisc {
  position: relative;
  z-index: 2;
  width: 82%;
  height: 82%;
  border-radius: 50%;
  transform: rotate(0deg) translateZ(0);
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: radial-gradient(circle at 50% 50%, #1a1408 0%, #0a0906 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.9),
    0 6px 18px rgba(0, 0, 0, 0.85),
    inset 0 0 22px rgba(0, 0, 0, 0.75);
}

/* در حین چرخش، افکت‌های گرانِ صفحه خاموش می‌شوند تا فریم‌ریت حفظ شود.
   (JS کلاس is-spinning را روی .wheelStage می‌گذارد.) */
#ui_wheel .wheelStage.is-spinning .wheelStage__ring::before,
#ui_wheel .wheelStage.is-spinning .wheelStage__glow {
  animation: none;
}
#ui_wheel .wheelStage.is-spinning .wheelStage__glow {
  filter: none;
  opacity: 0.55;
}
/* اشاره‌گر و پیچ‌ها روی لایهٔ ثابت می‌مانند */
#ui_wheel .wheelStage.is-spinning .wheelStage__pointer {
  filter: none;
}

#ui_wheel .wheelDisc__svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  /* ⚡ overflow:hidden (نه visible) → مرورگر می‌تواند SVG را یک‌بار رَستِرش
     کند و در چرخش فقط بافت را جابه‌جا کند. visible باعث می‌شد کادرِ
     نامحدود در نظر گرفته شود و هر فریم دوباره رسم شود. */
  overflow: hidden;
  /* متن‌های SVG سریع‌تر رَستِرش شوند (برچسب‌ها ریز هستند) */
  text-rendering: optimizeSpeed;
}

/* برچسب جوایز روی قطاع‌ها — داخل نوارِ تیرهٔ زیر قاب تصویر */
#ui_wheel .wheelDisc__label {
  fill: #fffaf0;
  font-family: inherit;
  font-size: 6.6px;
  font-weight: 800;
  letter-spacing: -0.2px;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: rgba(8, 4, 0, 0.95);
  stroke-width: 1.4px;
  stroke-linejoin: round;
  stroke-linecap: round;
}
/* روی قطاع‌های طلایی/کرم متن تیره شود */
#ui_wheel .wheelDisc__label--dark {
  fill: #2b1d07;
  stroke: rgba(255, 250, 235, 0.55);
}

#ui_wheel .wheelDisc__empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 50%;
  color: var(--lux-muted);
  font-size: 0.8rem;
  text-align: center;
  animation: wheelFadePulse 1.6s ease-in-out infinite;
}

/* ---------- دکمهٔ مرکزی (SPIN) — نگینِ طلایی ---------- */
#ui_wheel .wheelHub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  width: 25%;
  min-width: 58px;
  max-width: 88px;
  aspect-ratio: 1 / 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fdf5c9;
  border-radius: 50%;
  background: radial-gradient(
    circle at 36% 28%,
    #fffbe4 0%,
    #e7c964 26%,
    #b38728 62%,
    #6b4f16 100%
  );
  color: #3a2a08;
  font-family: inherit;
  font-size: clamp(10px, 2.6vw, 13px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.85),
    inset 0 2px 3px rgba(255, 255, 255, 0.75),
    inset 0 -3px 6px rgba(70, 45, 0, 0.75),
    0 0 0 3px rgba(10, 8, 4, 0.5);
  transition:
    transform 0.16s var(--wheel-ease),
    filter 0.16s var(--wheel-ease),
    box-shadow 0.2s var(--wheel-ease);
}
#ui_wheel .wheelHub__text {
  display: block;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
#ui_wheel .wheelHub:hover:not([disabled]) {
  filter: brightness(1.1);
}
#ui_wheel .wheelHub:active:not([disabled]) {
  transform: translate(-50%, -50%) scale(0.94);
}
#ui_wheel .wheelHub:focus-visible {
  outline: none;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.85),
    0 0 0 3px rgba(var(--lux-gold-rgb), 0.85);
}
#ui_wheel .wheelHub[disabled] {
  cursor: not-allowed;
  color: rgba(58, 42, 8, 0.62);
  filter: grayscale(0.55) brightness(0.72);
}

/* آمادهٔ چرخش → تپش طلایی */
#ui_wheel .wheelHub.is-ready {
  animation: wheelHubReady 1.7s ease-in-out infinite;
}

/* چرخش در جریان */
#ui_wheel .wheelHub.is-spinning {
  filter: brightness(0.82);
}

/* در حین چرخش، هالهٔ طلاییِ اشاره‌گر روشن‌تر می‌شود (حس انتظار) */
#ui_wheel .wheelStage::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 5;
  width: 46%;
  height: 46%;
  transform: translate(-50%, -22%);
  pointer-events: none;
  opacity: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(255, 245, 200, 0.55) 0%,
    rgba(var(--lux-gold-rgb), 0.18) 42%,
    transparent 70%
  );
  transition: opacity 0.4s var(--wheel-ease);
}
#ui_wheel .wheelStage:has(.wheelHub.is-spinning)::after {
  opacity: 1;
}

@keyframes wheelHubReady {
  0%,
  100% {
    box-shadow:
      0 6px 14px rgba(0, 0, 0, 0.85),
      inset 0 2px 3px rgba(255, 255, 255, 0.75),
      inset 0 -3px 6px rgba(70, 45, 0, 0.75),
      0 0 0 3px rgba(10, 8, 4, 0.5),
      0 0 0 0 rgba(var(--lux-gold-rgb), 0.6);
  }
  50% {
    box-shadow:
      0 6px 14px rgba(0, 0, 0, 0.85),
      inset 0 2px 3px rgba(255, 255, 255, 0.75),
      inset 0 -3px 6px rgba(70, 45, 0, 0.75),
      0 0 0 3px rgba(10, 8, 4, 0.5),
      0 0 0 12px rgba(var(--lux-gold-rgb), 0);
  }
}

@keyframes wheelFadePulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* ==========================================================================
   4. Stats strip  (تبلیغ | چرخش امروز | ریست تا)
   ========================================================================== */
#ui_wheel .wheelPage__stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex-shrink: 0;
  margin-top: 14px;
}
#ui_wheel .wheelStat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 4px 6px;
  border: 1px solid var(--lux-gold-line-2);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(19, 28, 46, 0.9), rgba(11, 17, 29, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 6px rgba(0, 0, 0, 0.45);
  text-align: center;
}
#ui_wheel .wheelStat span {
  font-size: 10px;
  line-height: 1.3;
  color: var(--lux-muted);
  white-space: nowrap;
}
#ui_wheel .wheelStat b {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--lux-gold-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

/* ==========================================================================
   5. Status plaque — جایگزین بصریِ .wheelHint  (❖ متن ❖)
   ========================================================================== */
#ui_wheel .wheelHint {
  position: relative;
  align-self: center;
  width: auto;
  max-width: 100%;
  margin: 16px auto 0;
  padding: 7px 24px;
  border: 1px solid var(--lux-gold-line);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(26, 36, 55, 0.92), rgba(11, 17, 29, 0.92));
  color: var(--lux-text-2);
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-wrap: balance;
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
/* الماس‌های تزئینی دو طرف متن (❖) */
#ui_wheel .wheelHint::before,
#ui_wheel .wheelHint::after {
  content: "❖";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8px;
  color: var(--lux-gold-3);
  text-shadow: 0 0 6px rgba(var(--lux-gold-rgb), 0.6);
  pointer-events: none;
}
#ui_wheel .wheelHint::before {
  left: 9px;
}
#ui_wheel .wheelHint::after {
  right: 9px;
}
/* پیش از اولین wheel:state متن خالی است → پلاک دیده نشود */
#ui_wheel .wheelHint:empty {
  display: none;
}

/* ==========================================================================
   6. Actions — glossy emerald CTA + dark gold-outline pill
   ========================================================================== */
#ui_wheel .wheelActions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  flex-shrink: 0;
  margin-top: 12px;
}

#ui_wheel .wheelBtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--lux-gold-line);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--lux-panel-2), var(--lux-panel));
  color: var(--lux-gold-2);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition:
    transform 0.16s var(--wheel-ease),
    filter 0.16s var(--wheel-ease),
    box-shadow 0.16s var(--wheel-ease);
}
#ui_wheel .wheelBtn__icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
#ui_wheel .wheelBtn__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#ui_wheel .wheelBtn:hover:not([disabled]) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
#ui_wheel .wheelBtn:active:not([disabled]) {
  transform: translateY(0) scale(0.985);
}
#ui_wheel .wheelBtn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--lux-ink),
    0 0 0 4px rgba(var(--lux-gold-rgb), 0.8);
}
#ui_wheel .wheelBtn[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(0.75) brightness(0.8);
}

/* --- دکمهٔ اصلی: «تماشای تبلیغ» → سبزِ براق با رینگ طلایی --- */
#ui_wheel .wheelBtn--primary {
  min-height: 54px;
  border: 2px solid var(--lux-gold-3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 46%),
    linear-gradient(180deg, var(--lux-green-1) 0%, var(--lux-green-2) 100%);
  color: #f4fffa;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  box-shadow:
    0 6px 18px -6px rgba(var(--lux-green-rgb), 0.75),
    0 0 22px rgba(var(--lux-green-rgb), 0.22),
    inset 0 1px 2px rgba(255, 255, 255, 0.45),
    inset 0 -4px 10px rgba(0, 0, 0, 0.35);
}
#ui_wheel .wheelBtn--primary:hover:not([disabled]) {
  filter: brightness(1.08);
}
/* وقتی در دسترس است، درخشش ملایم */
#ui_wheel .wheelBtn--primary:not([disabled]) {
  animation: wheelCtaGlow 2.6s ease-in-out infinite;
}
/* غیرفعال: سبزِ خفه‌شده (نه خاکستریِ بی‌هویت) — مثل مرجع */
#ui_wheel .wheelBtn--primary[disabled] {
  opacity: 1;
  border-color: rgba(var(--lux-gold-rgb), 0.45);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 46%),
    linear-gradient(180deg, #2a4a41 0%, #17352c 100%);
  color: rgba(226, 240, 232, 0.62);
  text-shadow: none;
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  filter: none;
}
#ui_wheel .wheelBtn--primary[disabled] .wheelBtn__icon {
  opacity: 0.55;
}

/* --- دکمهٔ ثانویه: «جوایز من» → شیشهٔ تیره با دور طلایی نازک --- */
#ui_wheel .wheelBtn--ghost {
  min-height: 44px;
  border-color: var(--lux-gold-line-2);
  background: linear-gradient(180deg, rgba(26, 36, 55, 0.75), rgba(11, 17, 29, 0.85));
  color: var(--lux-gold-2);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
#ui_wheel .wheelBtn--ghost:hover:not([disabled]) {
  border-color: var(--lux-gold-3);
  color: var(--lux-gold-1);
}

@keyframes wheelCtaGlow {
  0%,
  100% {
    box-shadow:
      0 6px 18px -6px rgba(var(--lux-green-rgb), 0.75),
      0 0 22px rgba(var(--lux-green-rgb), 0.18),
      inset 0 1px 2px rgba(255, 255, 255, 0.45),
      inset 0 -4px 10px rgba(0, 0, 0, 0.35);
  }
  50% {
    box-shadow:
      0 6px 18px -6px rgba(var(--lux-green-rgb), 0.9),
      0 0 34px rgba(var(--lux-green-rgb), 0.4),
      inset 0 1px 2px rgba(255, 255, 255, 0.45),
      inset 0 -4px 10px rgba(0, 0, 0, 0.35);
  }
}

/* ==========================================================================
   7. Prize chips  ("جوایز این گردونه")
   ========================================================================== */
#ui_wheel .wheelSlotsList {
  width: 100%;
  flex-shrink: 0;
  margin-top: 14px;
}
#ui_wheel .wheelSlotsList__title {
  margin: 0 0 7px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--lux-muted);
  text-align: center;
}
#ui_wheel .wheelSlotsList__title::before,
#ui_wheel .wheelSlotsList__title::after {
  content: "✦";
  margin: 0 6px;
  font-size: 7px;
  color: var(--lux-gold-4);
  vertical-align: middle;
}
#ui_wheel .wheelSlotsList__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
}
#ui_wheel .wheelSlotChip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--lux-gold-line-2);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(19, 28, 46, 0.86), rgba(11, 17, 29, 0.86));
  font-size: 0.72rem;
  color: var(--lux-text-2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 6px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* --- بندانگشتی تصویر جایزه --- */
#ui_wheel .wheelSlotChip__art {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--lux-gold-line-2);
  background: radial-gradient(circle at 50% 35%, rgba(var(--lux-gold-rgb), 0.22), rgba(4, 8, 16, 0.9));
}
#ui_wheel .wheelSlotChip__art img {
  width: 100%;
  height: 100%;
  display: block;
}
/* فریم/آواتار → دایره با contain (حلقه‌ها شفاف‌اند) */
#ui_wheel .wheelSlotChip--round .wheelSlotChip__art {
  border-radius: 50%;
}
#ui_wheel .wheelSlotChip--round .wheelSlotChip__art img {
  object-fit: contain;
  padding: 2px;
}
/* بنر → مستطیل گرد با cover (تصویر افقی) */
#ui_wheel .wheelSlotChip--wide .wheelSlotChip__art {
  border-radius: 8px;
}
#ui_wheel .wheelSlotChip--wide .wheelSlotChip__art img {
  object-fit: cover;
}
/* نبود تصویر → شکل تعویضی */
#ui_wheel .wheelSlotChip__art.is-missing::after {
  content: "🎁";
  font-size: 15px;
}

#ui_wheel .wheelSlotChip__meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}
#ui_wheel .wheelSlotChip__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--lux-text);
}
#ui_wheel .wheelSlotChip__cat {
  font-size: 9.5px;
  color: var(--lux-muted);
}
#ui_wheel .wheelSlotChip__num {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(4, 8, 16, 0.85);
  border: 1px solid var(--lux-gold-line-2);
  color: var(--lux-gold-2);
  font-size: 8.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ==========================================================================
   8. Panels — history sheet + prize modal
   JS toggles display = none | flex on both hosts.
   ========================================================================== */
#ui_wheel .wheelHistory,
#ui_wheel .wheelPrize {
  position: absolute;
  inset: 0;
  direction: rtl;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 4, 10, 0.82);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: wheelFadeIn 0.2s ease both;
}
#ui_wheel .wheelHistory {
  z-index: var(--wheel-z-panel);
}
#ui_wheel .wheelPrize {
  z-index: var(--wheel-z-modal);
}

/* ---------- «جوایز من» ---------- */
#ui_wheel .wheelHistory__head {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(100% - 32px, 360px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#ui_wheel .wheelHistory__head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--lux-gold-3);
  text-shadow: 0 0 14px rgba(var(--lux-gold-rgb), 0.4);
}
#ui_wheel .wheelHistory__close {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--lux-gold-3);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lux-panel-3), var(--lux-panel));
  color: var(--lux-gold-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 3px rgba(255, 255, 255, 0.1);
  transition:
    transform 0.16s var(--wheel-ease),
    border-color 0.16s var(--wheel-ease);
}
#ui_wheel .wheelHistory__close:hover {
  border-color: var(--lux-gold-2);
  color: var(--lux-gold-2);
}
#ui_wheel .wheelHistory__close:active {
  transform: scale(0.94);
}

#ui_wheel .wheelHistory__body {
  width: min(100%, 360px);
  max-height: min(70vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--lux-gold-line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--lux-panel-2), var(--lux-panel));
  box-shadow:
    0 20px 50px -20px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#ui_wheel .wheelHistory__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--lux-gold-line-2);
  border-radius: 11px;
  background: rgba(5, 9, 20, 0.55);
}
#ui_wheel .wheelHistory__art {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--lux-gold-line-2);
  background: radial-gradient(circle at 50% 35%, rgba(var(--lux-gold-rgb), 0.2), rgba(5, 9, 20, 0.8));
}
#ui_wheel .wheelHistory__art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 2px;
}
#ui_wheel .wheelHistory__art--round {
  border-radius: 50%;
}
#ui_wheel .wheelHistory__art--wide img {
  object-fit: cover;
  padding: 0;
}
#ui_wheel .wheelHistory__art.is-missing::after {
  content: "🎁";
  font-size: 1.1rem;
}
#ui_wheel .wheelHistory__emoji {
  font-size: 1.2rem;
  line-height: 1;
}
#ui_wheel .wheelHistory__meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#ui_wheel .wheelHistory__meta b {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--lux-gold-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#ui_wheel .wheelHistory__meta span {
  font-size: 0.68rem;
  color: var(--lux-muted);
}
#ui_wheel .wheelHistory__badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border: 1px solid rgba(var(--lux-green-rgb), 0.55);
  border-radius: 999px;
  background: rgba(var(--lux-green-rgb), 0.16);
  color: #3ee0a5;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
#ui_wheel .wheelHistory__empty {
  padding: 22px 12px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--lux-muted);
}

/* ---------- مودال جایزه ---------- */
#ui_wheel .wheelPrize__box {
  position: relative;
  width: min(100%, 320px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 20px 18px;
  border: 1px solid var(--lux-gold-line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% -6%, rgba(var(--lux-gold-rgb), 0.24), transparent 58%),
    linear-gradient(180deg, var(--lux-panel-2), var(--lux-panel));
  text-align: center;
  box-shadow:
    0 24px 60px -24px rgba(0, 0, 0, 0.95),
    0 0 40px rgba(var(--lux-gold-rgb), 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: wheelPrizePop 0.44s var(--wheel-pop) both;
}
/* خط تزئینی طلایی بالای کارت */
#ui_wheel .wheelPrize__box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 2px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--lux-gold-3),
    var(--lux-gold-1),
    var(--lux-gold-3),
    transparent
  );
  box-shadow: 0 0 16px rgba(var(--lux-gold-rgb), 0.7);
}

#ui_wheel .wheelPrize__art {
  position: relative;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid var(--lux-gold-3);
  background: radial-gradient(circle at 50% 34%, rgba(var(--lux-gold-rgb), 0.34), rgba(5, 9, 20, 0.85) 74%);
  box-shadow:
    0 0 0 6px rgba(var(--lux-gold-rgb), 0.1),
    0 14px 30px -14px rgba(0, 0, 0, 0.95),
    inset 0 2px 4px rgba(255, 255, 255, 0.18);
}
#ui_wheel .wheelPrize__art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 8px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.65));
}
#ui_wheel .wheelPrize__emoji {
  font-size: 2.9rem;
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
}

/* بنر: قاب افقی پهن (نسبت سینمایی) با تصویر cover */
#ui_wheel .wheelPrize__art--wide {
  width: 100%;
  max-width: 260px;
  height: 132px;
  border-radius: 16px;
}
#ui_wheel .wheelPrize__art--wide img {
  object-fit: cover;
  padding: 0;
  filter: none;
}

/* نبود تصویر → شکل تعویضی */
#ui_wheel .wheelPrize__art.is-missing::after {
  content: "🎁";
  font-size: 3rem;
}

/* برچسب دستهٔ جایزه (فریم / بنر) */
#ui_wheel .wheelPrize__cat {
  margin-top: 8px;
  padding: 3px 10px;
  border: 1px solid var(--lux-gold-line);
  border-radius: 999px;
  background: rgba(var(--lux-gold-rgb), 0.14);
  color: var(--lux-gold-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1.6;
}

#ui_wheel .wheelPrize__title {
  margin: 6px 0 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--lux-gold-1);
  text-wrap: balance;
  text-shadow: 0 0 18px rgba(var(--lux-gold-rgb), 0.45);
}
#ui_wheel .wheelPrize__sub {
  margin: 0 0 6px;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--lux-text-2);
  text-wrap: balance;
}
#ui_wheel .wheelPrize__box .wheelBtn {
  width: 100%;
  margin-top: 4px;
}

@keyframes wheelFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes wheelPrizePop {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }
  62% {
    transform: translateY(-2px) scale(1.015);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   9. Toasts
   ========================================================================== */
#ui_wheel .wheelToastHost {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  z-index: var(--wheel-z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  pointer-events: none;
}
#ui_wheel .wheel-toast {
  max-width: min(100%, 340px);
  padding: 9px 16px;
  border: 1px solid var(--lux-gold-line);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(19, 28, 46, 0.97), rgba(5, 9, 20, 0.97));
  color: var(--lux-gold-1);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 10px 26px -12px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: wheelToastIn 0.24s var(--wheel-ease) both;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
#ui_wheel .wheel-toast.is-out {
  opacity: 0;
  transform: translateY(8px);
}
#ui_wheel .wheel-toast--success {
  border-color: rgba(var(--lux-green-rgb), 0.65);
  color: #3ee0a5;
}
#ui_wheel .wheel-toast--warning {
  border-color: var(--lux-gold-line);
  color: var(--lux-gold-2);
}
#ui_wheel .wheel-toast--error {
  border-color: rgba(224, 106, 106, 0.65);
  color: #ff9b9b;
}

@keyframes wheelToastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   10. Light palette ("Patok Day")
   --------------------------------------------------------------------------
   The wheel object itself (metal ring, segments, jewel) is artwork and keeps
   the same luxe inks in both palettes. Only the *surfaces* re-skin to paper so
   the page doesn't read as a black slab on a light client.
   ========================================================================== */
html[data-theme="light"] #ui_wheel .wheelPage__inner {
  background-color: #f4f1ea;
  background-image:
    radial-gradient(circle at 50% 16%, rgba(11, 125, 132, 0.1) 0%, transparent 58%),
    radial-gradient(circle at 50% 48%, rgba(176, 140, 72, 0.1) 0%, transparent 62%),
    linear-gradient(180deg, #f7f4ed 0%, #f1ece1 52%, #ece5d7 100%);
  box-shadow:
    0 0 50px rgba(90, 72, 40, 0.18),
    inset 0 0 90px rgba(90, 72, 40, 0.06);
}
html[data-theme="light"] #ui_wheel {
  --lux-text: #4f4a3f;
  --lux-text-2: #6a5c3c;
  --lux-muted: #7d7669;
  --lux-panel: #f7f3ea;
  --lux-panel-2: #ffffff;
  --lux-panel-3: #f1ece1;
  --lux-gold-1: #3a2f1b;
  --lux-gold-2: #6f5320;
  --lux-gold-3: #8a6a2f;
  --lux-gold-4: #a8863f;
  --lux-gold-5: #b08c48;
  --lux-gold-line: rgba(120, 90, 40, 0.45);
  --lux-gold-line-2: rgba(120, 90, 40, 0.24);
  --lux-gold-rgb: 138, 106, 47;
  background-color: #ece5d7;
}
html[data-theme="light"] .wheelTopBtn {
  background: linear-gradient(180deg, #ffffff, #f4efe4);
  color: #3a2f1b;
  border-color: var(--lux-gold-line);
}
html[data-theme="light"] .wheelTopBtn__badge {
  color: #fff;
}
html[data-theme="light"] #ui_wheel .wheelPage__coins {
  background: linear-gradient(180deg, #ffffff, #f4efe4);
  color: #2a2418;
}
html[data-theme="light"] #ui_wheel .wheelPage__coins b {
  color: #3a2f1b;
}
html[data-theme="light"] #ui_wheel .wheelPage__back,
html[data-theme="light"] #ui_wheel .wheelHistory__close {
  background: linear-gradient(135deg, #ffffff, #f1ece1);
  color: #8a6a2f;
}
html[data-theme="light"] #ui_wheel .wheelStat {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 239, 228, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 6px rgba(90, 72, 40, 0.12);
}
html[data-theme="light"] #ui_wheel .wheelStat b {
  color: #6f5320;
}
html[data-theme="light"] #ui_wheel .wheelHint {
  background: linear-gradient(180deg, #ffffff, #f4efe4);
  color: #6a5c3c;
  box-shadow:
    0 3px 10px rgba(90, 72, 40, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme="light"] #ui_wheel .wheelHint::before,
html[data-theme="light"] #ui_wheel .wheelHint::after {
  color: #a8863f;
  text-shadow: none;
}
html[data-theme="light"] #ui_wheel .wheelBtn--ghost {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 239, 228, 0.95));
  color: #6f5320;
  box-shadow:
    0 3px 10px rgba(90, 72, 40, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme="light"] #ui_wheel .wheelSlotChip {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 239, 228, 0.9));
  color: #5c5445;
}
html[data-theme="light"] #ui_wheel .wheelSlotsList__title {
  color: #7d7669;
}
html[data-theme="light"] #ui_wheel .wheelHistory,
html[data-theme="light"] #ui_wheel .wheelPrize {
  background: rgba(58, 47, 27, 0.5);
}
/* در پالت روز، متن‌های طلایی باید «مرکب» باشند نه «فلز» */
html[data-theme="light"] #ui_wheel .wheelHistory__head h2,
html[data-theme="light"] #ui_wheel .wheelPage__title {
  color: #6f5320;
  text-shadow: none;
}
html[data-theme="light"] #ui_wheel .wheelSlotChip__num {
  color: #5c4416;
  border-color: rgba(120, 90, 40, 0.3);
  background: rgba(176, 140, 72, 0.14);
}
html[data-theme="light"] #ui_wheel .wheelHistory__body,
html[data-theme="light"] #ui_wheel .wheelPrize__box {
  background: linear-gradient(180deg, #ffffff, #f4efe4);
  box-shadow:
    0 20px 46px -20px rgba(90, 72, 40, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme="light"] #ui_wheel .wheelHistory__row {
  background: rgba(244, 239, 228, 0.9);
}
html[data-theme="light"] #ui_wheel .wheelPrize__title {
  color: #3a2f1b;
  text-shadow: none;
}
html[data-theme="light"] #ui_wheel .wheelPrize__sub {
  color: #6a5c3c;
}
html[data-theme="light"] #ui_wheel .wheelHistory__meta b {
  color: #3a2f1b;
}
html[data-theme="light"] #ui_wheel .wheelHistory__badge {
  color: #0f7a4c;
  border-color: rgba(15, 122, 76, 0.45);
  background: rgba(15, 122, 76, 0.12);
}
html[data-theme="light"] #ui_wheel .wheel-toast {
  background: rgba(255, 255, 255, 0.96);
  color: #3a2f1b;
  box-shadow:
    0 10px 26px -12px rgba(90, 72, 40, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
#ui_wheel .wheelHub,
html[data-theme="light"] #ui_wheel .wheelHub.is-ready {
  /* نگین طلایی در هر دو پالت یکسان می‌ماند (اثر هنری است، نه سطح) */
  border-color: #fdf5c9;
}

/* ==========================================================================
   11. Responsive + accessibility
   ========================================================================== */

/* صفحه‌های کوتاه — گردونه کوچک‌تر می‌شود تا CTA همیشه در دید بماند */
@media (max-height: 720px) {
  #ui_wheel .wheelPage__inner {
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  }
  #ui_wheel .wheelStage {
    width: min(calc(100vw - 64px), calc(100vh - 340px), 300px);
  }
  #ui_wheel .wheelPage__stats,
  #ui_wheel .wheelSlotsList {
    display: none;
  }
  #ui_wheel .wheelHint {
    margin-top: 12px;
  }
}

/* صفحه‌های بسیار کوتاه (موبایل افقی) — دو ستون: گردونه | کنترل‌ها */
@media (max-height: 560px) {
  #ui_wheel .wheelPage__inner {
    width: 100%;
    max-width: 660px;
    height: 100%;
    max-height: 100%;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px
      calc(env(safe-area-inset-bottom, 0px) + 8px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "stage side";
    gap: 6px 14px;
    align-content: center;
    align-items: center;
    justify-items: center;
    overflow: hidden;
  }
  #ui_wheel .wheelPage__head {
    grid-area: head;
    margin-bottom: 2px;
  }
  #ui_wheel .wheelStage {
    grid-area: stage;
    width: min(100%, calc(100vh - 96px), 280px);
    margin: 0;
  }
  #ui_wheel .wheelHint {
    grid-area: side;
    align-self: start;
    justify-self: center;
    margin: 0 0 8px;
    max-width: 100%;
    font-size: 0.7rem;
    white-space: normal;
  }
  #ui_wheel .wheelActions {
    grid-area: side;
    align-self: start;
    justify-self: center;
    width: 100%;
    max-width: 260px;
    margin-top: 52px;
  }
  #ui_wheel .wheelBtn--primary {
    min-height: 46px;
    font-size: 0.86rem;
  }
  #ui_wheel .wheelBtn--ghost {
    min-height: 40px;
  }
  /* هدر + آمار + چیپها در این حالت جا نمی‌شوند */
  #ui_wheel .wheelPage__stats,
  #ui_wheel .wheelSlotsList {
    display: none;
  }
}

/* صفحه‌های باریک */
@media (max-width: 360px) {
  #ui_wheel .wheelPage__inner {
    padding-left: 14px;
    padding-right: 14px;
  }
  #ui_wheel .wheelStage {
    width: min(calc(100vw - 44px), calc(100vh - 300px), 340px);
  }
  #ui_wheel .wheelPage__title {
    font-size: 0.7rem;
    max-width: 52%;
  }
  #ui_wheel .wheelStat span {
    font-size: 9.5px;
  }
  #ui_wheel .wheelSlotsList__grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  }
}

/* هدف لمسی ۴۴px (WCAG 2.5.5) */
@media (pointer: coarse) {
  #ui_wheel .wheelPage__back,
  #ui_wheel .wheelHistory__close,
  #ui_wheel .wheelBtn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* احترام به prefers-reduced-motion — چرخشِ دیسک با JS انجام می‌شود و
   دست‌نخورده می‌ماند؛ فقط تزئینات خاموش می‌شوند. */
@media (prefers-reduced-motion: reduce) {
  .wheelTopBtn.is-ready,
  #ui_wheel .wheelHub.is-ready,
  #ui_wheel .wheelBtn--primary:not([disabled]),
  #ui_wheel .wheelDisc__empty,
  #ui_wheel .wheelStage__ring::before {
    animation: none;
  }
  #ui_wheel .wheelPrize__box,
  #ui_wheel .wheelHistory,
  #ui_wheel .wheelPrize,
  #ui_wheel .wheel-toast {
    animation: none;
  }
}

/* High-contrast / forced-colors: استخوان‌بندی باید دیده شود */
@media (forced-colors: active) {
  #ui_wheel.wheelPage,
  .wheelTopBtn,
  #ui_wheel .wheelBtn,
  #ui_wheel .wheelHub,
  #ui_wheel .wheelStat,
  #ui_wheel .wheelHint,
  #ui_wheel .wheelHistory__body,
  #ui_wheel .wheelPrize__box,
  #ui_wheel .wheelStage__ring {
    border: 1px solid CanvasText;
  }
  #ui_wheel .wheelDisc__label {
    fill: CanvasText;
    stroke: none;
  }
  #ui_wheel .wheelStage__pointer::before {
    background: CanvasText;
  }
}




/* ============================================================
   ۹-الف) Toast وسط صفحه
   ============================================================ */
#ui_wheel .wheelToastHost {
  top: 50%;
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  width: min(100%, 400px);
  padding: 0 20px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#ui_wheel .wheel-toast {
  max-width: 360px;
}

/* ورود/خروج از حالت وسط بهتر است scale باشد نه slide */
@keyframes wheelToastIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1);    }
}
#ui_wheel .wheel-toast.is-out {
  opacity: 0;
  transform: scale(0.94);
}



/* ============================================================
   ۹-ب) بزرگ‌نمایی متن‌ها
   ============================================================ */

/* --- دکمهٔ نوار بالا --- */
.wheelTopBtn {
  font-size: 13.5px;
  /* هم‌ارتفاع با pill «دریافت سکه». قبلاً 40px بود و از نوار 48px
     بیرون می‌زد، چون .ui_topMenu فقط 48px ارتفاع دارد و دکمه‌ها
     باید با ۷px تنفس در آن جا شوند. */
  height: 34px;
  min-width: 0;
  padding: 0 12px;
}
.wheelTopBtn__icon { font-size: 17px; }
.wheelTopBtn__badge {
  font-size: 11.5px;
  min-width: 18px;
  height: 18px;
  line-height: 16px;
}

/* --- هدر صفحه --- */
#ui_wheel .wheelPage__title {
  font-size: 0.92rem;
  letter-spacing: 0.8px;
}
#ui_wheel .wheelPage__coins {
  font-size: 15px;
  height: 38px;
  padding: 0 16px;
}
#ui_wheel .wheelPage__coins span { font-size: 17px; }

/* --- آمار (تبلیغ / چرخش / ریست) --- */
#ui_wheel .wheelStat { padding: 9px 5px 8px; }
#ui_wheel .wheelStat span { font-size: 11.5px; }
#ui_wheel .wheelStat b    { font-size: 1rem;   }

/* --- پلاک راهنما (❖ متن ❖) --- */
#ui_wheel .wheelHint {
  font-size: 0.86rem;
  padding: 9px 26px;
}
#ui_wheel .wheelHint::before,
#ui_wheel .wheelHint::after { font-size: 10px; }

/* --- دکمه‌های اصلی --- */
#ui_wheel .wheelBtn {
  font-size: 0.95rem;
  min-height: 50px;
  padding: 0 18px;
}
#ui_wheel .wheelBtn__icon { font-size: 1.15rem; }
#ui_wheel .wheelBtn--primary { font-size: 1.05rem; min-height: 58px; }
#ui_wheel .wheelBtn--ghost   { font-size: 0.92rem; min-height: 48px; }

/* --- لیست جوایز --- */
#ui_wheel .wheelSlotsList__title { font-size: 0.8rem; }
#ui_wheel .wheelSlotChip {
  font-size: 0.82rem;
  padding: 7px 9px;
  gap: 9px;
}
#ui_wheel .wheelSlotChip__art {
  width: 38px;
  height: 38px;
}
#ui_wheel .wheelSlotChip__cat { font-size: 10.5px; }
#ui_wheel .wheelSlotChip__num {
  font-size: 10px;
  min-width: 16px;
  height: 16px;
}

/* --- دکمهٔ مرکزی (بچرخون) --- */
#ui_wheel .wheelHub {
  font-size: clamp(11px, 3vw, 15px);
}

/* --- پنل «جوایز من» --- */
#ui_wheel .wheelHistory__head h2 { font-size: 1.1rem; }
#ui_wheel .wheelHistory__meta b  { font-size: 0.92rem; }
#ui_wheel .wheelHistory__meta span { font-size: 0.78rem; }
#ui_wheel .wheelHistory__badge   { font-size: 11px; padding: 4px 9px; }
#ui_wheel .wheelHistory__empty   { font-size: 0.88rem; }
#ui_wheel .wheelHistory__art     { width: 48px; height: 48px; }

/* --- مودال جایزه --- */
#ui_wheel .wheelPrize__title { font-size: 1.25rem; }
#ui_wheel .wheelPrize__sub   { font-size: 0.92rem; }
#ui_wheel .wheelPrize__cat   { font-size: 11px; }

/* --- خود toast --- */
#ui_wheel .wheel-toast {
  font-size: 0.88rem;
  padding: 11px 18px;
  line-height: 1.6;
}


@media (max-height: 560px) {
  #ui_wheel .wheelBtn--primary { min-height: 50px; font-size: 0.98rem; }
  #ui_wheel .wheelBtn--ghost   { min-height: 42px; font-size: 0.88rem; }
  #ui_wheel .wheelHint         { font-size: 0.8rem; padding: 7px 20px; }
  #ui_wheel .wheelHub          { font-size: 11px; }
}