/* License OPL-1 — Abrak — گردونه شانس
   جهت بصری v3 «Aurora Night» (بازخورد مالک: تم کارناوالی قبلی به‌روز نبود):
   آسمان شب ایندیگو با گلوهای aurora از پالت برند (بنفش/تیل) + طلای جکپات؛
   گردونه‌ی SVG واقعی — رینگ فلزی و LED استاتیک، فقط روتور می‌چرخد؛
   کارت فرم شیشه‌ای (glass) بدون کج‌شدگی. توکن‌ها فقط زیر .aw-section اسکوپ‌اند. */
.aw-section {
  --aw-bg: #0c0a16;
  --aw-bg-2: #171129;
  --aw-violet: #8b5cf6;
  --aw-violet-deep: #6d4bd8;
  --aw-teal: #2dd4bf;
  --aw-gold: #f4c03c;
  --aw-gold-deep: #b8860b;
  --aw-ink: #f5f3ff;
  --aw-muted: #b9b3ce;
  --aw-glass: rgba(255, 255, 255, .05);
  --aw-glass-border: rgba(255, 255, 255, .13);
  --aw-grad-cta: linear-gradient(105deg, #8b5cf6 0%, #6366f1 48%, #2dd4bf 100%);

  position: relative;
  overflow: hidden;
  padding-block: 56px 96px;
  background: var(--aw-bg);
  color: var(--aw-ink);
  isolation: isolate;
}
/* آسمان شب — گلوهای aurora + ستاره‌های ریز؛ همه CSS gradient، صفر هزینه‌ی شبکه */
.aw-section::before {
  content: "";
  position: absolute; inset: 0;
  z-index: 0;
  background:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 255, 255, .5), transparent 100%),
    radial-gradient(1px 1px at 28% 64%, rgba(255, 255, 255, .35), transparent 100%),
    radial-gradient(1.5px 1.5px at 43% 12%, rgba(255, 255, 255, .4), transparent 100%),
    radial-gradient(1px 1px at 61% 42%, rgba(255, 255, 255, .3), transparent 100%),
    radial-gradient(1.5px 1.5px at 74% 8%, rgba(255, 255, 255, .45), transparent 100%),
    radial-gradient(1px 1px at 87% 58%, rgba(255, 255, 255, .35), transparent 100%),
    radial-gradient(1px 1px at 8% 84%, rgba(255, 255, 255, .25), transparent 100%),
    radial-gradient(1.5px 1.5px at 93% 30%, rgba(255, 255, 255, .4), transparent 100%),
    radial-gradient(52% 46% at 82% 6%, rgba(139, 92, 246, .34), transparent 70%),
    radial-gradient(46% 42% at 10% 30%, rgba(45, 212, 191, .2), transparent 70%),
    radial-gradient(64% 54% at 50% 108%, rgba(109, 75, 216, .3), transparent 72%),
    radial-gradient(30% 26% at 50% 46%, rgba(244, 192, 60, .07), transparent 70%),
    linear-gradient(180deg, var(--aw-bg) 0%, var(--aw-bg-2) 60%, #120d20 100%);
}
.aw-section::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 0;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.aw-section .ab-container { position: relative; z-index: 1; }

/* -------------------- اینترو -------------------- */
.aw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, .35);
  background: rgba(45, 212, 191, .08);
  color: var(--aw-teal);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}
.aw-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) {
  .aw-grid { grid-template-columns: 1fr; gap: 36px; }
}
/* جلوگیری از overflow افقی موبایل — min-content اینپوت‌ها ترک گرید را باز نکند */
.aw-grid > * { min-width: 0; }
.aw-form input, .aw-form select { width: 100%; min-width: 0; box-sizing: border-box; }
/* :not([hidden]) اجباری — display:flex وگرنه صفت hidden را باطل می‌کند (ترپ ثبت‌شده) */
.aw-form .ab-otp-row, .aw-form .ab-otp-verify:not([hidden]) { display: flex; gap: 8px; }
.aw-form .ab-otp-row input, .aw-form .ab-otp-verify input { flex: 1 1 auto; min-width: 0; }
.aw-form .ab-otp-btn { flex: none; }
.aw-intro { grid-column: 1 / -1; text-align: center; margin-bottom: 8px; }
.aw-intro .ab-page-title {
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  font-weight: 800;
  line-height: 1.18;
  margin: 16px 0 10px;
  background: linear-gradient(100deg, #ffffff 0%, #d9ccff 45%, var(--aw-teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.aw-sub { color: var(--aw-muted); font-size: 17px; line-height: 1.8; max-width: 580px; margin: 0 auto; }
.aw-trust-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.aw-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--aw-glass-border);
  background: var(--aw-glass);
  color: var(--aw-ink);
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.aw-chip svg { color: var(--aw-gold); flex: none; }

/* -------------------- صحنه‌ی گردونه -------------------- */
.aw-wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  position: relative;
  padding-top: 14px;
}
.aw-wheel-wrap::before {
  /* هاله‌ی نور پشت گردونه — بنفش/تیل برند */
  content: "";
  position: absolute;
  top: 44%; left: 50%;
  width: 540px; height: 540px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(139, 92, 246, .3) 0%, rgba(45, 212, 191, .14) 46%, transparent 72%);
  filter: blur(8px);
  z-index: 0;
  animation: aw-halo 5s ease-in-out infinite;
}
@keyframes aw-halo {
  0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}
.aw-wheel-shell {
  position: relative;
  z-index: 1;
  width: min(420px, 88vw);
  aspect-ratio: 1;
}
/* رینگ فلزی + LED — SVG استاتیک تمام‌سطح؛ JS پرش می‌کند */
.aw-rim, .aw-rim svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.aw-rim svg { display: block; }
/* روتور — تنها لایه‌ی چرخنده */
.aw-wheel {
  position: absolute;
  inset: 7.2%;
  border-radius: 50%;
  transform: rotate(0deg);
  will-change: transform;
  filter: drop-shadow(0 18px 44px rgba(0, 0, 0, .55));
}
.aw-wheel svg { display: block; width: 100%; height: 100%; }
.aw-wheel.is-spinning { filter: drop-shadow(0 18px 44px rgba(0, 0, 0, .55)) saturate(1.15); }
/* گلوی شیشه‌ای روی نیمه‌ی بالای گردونه — عمق سه‌بعدی */
.aw-gloss {
  position: absolute;
  inset: 7.2%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(120% 90% at 50% -18%, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .05) 38%, transparent 55%),
    radial-gradient(100% 100% at 50% 50%, transparent 62%, rgba(0, 0, 0, .28) 100%);
}
/* هاب مرکزی — شیشه‌ی تیره با رینگ طلایی */
.aw-hub {
  position: absolute;
  top: 50%; left: 50%;
  width: 23%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--aw-gold);
  background:
    radial-gradient(circle at 34% 28%, #2c2344, #171129 62%, #0c0a16 100%);
  border: 2px solid rgba(244, 192, 60, .75);
  box-shadow:
    0 0 0 4px rgba(12, 10, 22, .85),
    0 0 22px -2px rgba(244, 192, 60, .45),
    0 6px 16px rgba(0, 0, 0, .5),
    inset 0 1px 2px rgba(255, 255, 255, .22);
  z-index: 3;
}
.aw-wheel-pointer {
  position: absolute;
  top: -5.5%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .55));
}
/* LED ها — چشمک ملایم نامنظم (کلاس‌ها را JS ست می‌کند) */
.aw-rim .aw-led { animation: aw-twinkle 1.8s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes aw-twinkle {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

/* -------------------- دکمه‌ی چرخش -------------------- */
.aw-spin-btn {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-width: 240px;
  min-height: 56px;
  padding: 14px 34px;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  background: var(--aw-grad-cta);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 32px -8px rgba(139, 92, 246, .65), 0 4px 14px -4px rgba(45, 212, 191, .4);
  transition: transform .15s ease, box-shadow .15s ease;
}
.aw-spin-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -8px rgba(139, 92, 246, .8), 0 6px 18px -4px rgba(45, 212, 191, .55);
}
.aw-spin-btn:not(:disabled):active { transform: translateY(1px) scale(.99); }
/* جاروی نور — فقط وقتی فعال است */
.aw-spin-btn:not(:disabled)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: aw-shine 2.6s ease-in-out infinite;
}
@keyframes aw-shine {
  0% { transform: translateX(120%); }
  55%, 100% { transform: translateX(-120%); }
}
.aw-spin-btn:disabled {
  color: rgba(245, 243, 255, .68);
  background: var(--aw-glass);
  border: 1px solid var(--aw-glass-border);
  box-shadow: none;
  cursor: not-allowed;
}

/* -------------------- کارت فرم شیشه‌ای -------------------- */
.aw-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--aw-glass);
  border: 1px solid var(--aw-glass-border);
  border-radius: 24px;
  padding: 30px 26px 26px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.aw-form-badge {
  position: absolute;
  top: -13px; inset-inline-end: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(105deg, var(--aw-violet) 0%, var(--aw-violet-deep) 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 13px;
  border-radius: 999px;
  box-shadow: 0 6px 16px -4px rgba(139, 92, 246, .6);
}
.aw-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--aw-ink);
}
.aw-form input, .aw-form select {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--aw-glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  color: var(--aw-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.aw-form input::placeholder { color: rgba(245, 243, 255, .38); }
.aw-form input:focus-visible, .aw-choice-row button:focus-visible,
.aw-spin-btn:focus-visible, .aw-code:focus-visible, .aw-result-cta:focus-visible {
  outline: 2px solid var(--aw-teal);
  outline-offset: 2px;
}
.aw-form input:focus-visible { border-color: rgba(45, 212, 191, .6); box-shadow: 0 0 0 3px rgba(45, 212, 191, .15); outline: none; }
.aw-choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.aw-choice-row button {
  font: inherit;
  font-size: 14px;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--aw-glass-border);
  background: rgba(255, 255, 255, .04);
  color: var(--aw-ink);
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.aw-choice-row button:hover { border-color: rgba(139, 92, 246, .7); }
.aw-choice-row button.is-active {
  background: var(--aw-grad-cta);
  border-color: transparent;
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 6px 18px -6px rgba(139, 92, 246, .6);
}
.ab-otp-msg.is-ok { color: var(--aw-teal); }
.ab-otp-msg.is-err { color: #ff7d90; }

/* ورود مرحله‌ای فیلدها — یک لحظه‌ی هماهنگ */
.aw-form > * { animation: aw-rise .5s ease both; }
.aw-form > *:nth-child(1) { animation-delay: .05s; }
.aw-form > *:nth-child(2) { animation-delay: .1s; }
.aw-form > *:nth-child(3) { animation-delay: .15s; }
.aw-form > *:nth-child(4) { animation-delay: .2s; }
.aw-form > *:nth-child(5) { animation-delay: .25s; }
.aw-form > *:nth-child(6) { animation-delay: .3s; }
@keyframes aw-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------- نتیجه -------------------- */
.aw-result {
  grid-column: 1 / -1;
  position: relative;
  text-align: center;
  background: var(--aw-glass);
  border: 1px solid rgba(244, 192, 60, .4);
  color: var(--aw-ink);
  border-radius: 24px;
  padding: 44px 20px 36px;
  margin-top: 12px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px rgba(244, 192, 60, .1), 0 24px 60px -20px rgba(0, 0, 0, .8), 0 0 80px -14px rgba(139, 92, 246, .35);
  animation: aw-result-in .5s cubic-bezier(.2, .9, .3, 1.3) both;
}
@keyframes aw-result-in {
  from { opacity: 0; transform: scale(.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.aw-result-badge {
  position: absolute;
  top: -26px; left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  color: #1a1226;
  background: linear-gradient(180deg, #ffe9a8 0%, var(--aw-gold) 55%, var(--aw-gold-deep) 100%);
  box-shadow: 0 8px 22px -6px rgba(244, 192, 60, .7);
}
.aw-result-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--aw-gold);
}
.aw-code-box {
  background: rgba(244, 192, 60, .07);
  border: 1px dashed rgba(244, 192, 60, .55);
  border-radius: 14px;
  padding: 18px;
  max-width: 340px;
  margin: 0 auto 16px;
}
.aw-code-label { font-size: 12px; color: var(--aw-muted); }
.aw-code {
  font: inherit;
  font-size: 28px; font-weight: 800; letter-spacing: 2px; direction: ltr;
  background: transparent; border: 1px dashed rgba(244, 192, 60, .7); border-radius: 10px;
  color: #ffd76a; cursor: pointer; padding: 6px 16px; min-height: 44px; margin-top: 6px;
}
.aw-code:hover, .aw-code:focus-visible { background: rgba(244, 192, 60, .12); }
.aw-code-copied { font-size: 11px; margin-top: 4px; min-height: 14px; color: var(--aw-teal); }
.aw-code-expiry { font-size: 12px; margin-top: 4px; color: var(--aw-muted); }
.aw-result-note { color: var(--aw-muted); margin-bottom: 20px; }
.aw-result-cta {
  display: inline-block;
  padding: 13px 32px;
  border-radius: 999px;
  background: var(--aw-grad-cta);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 30px -8px rgba(139, 92, 246, .6);
  transition: transform .15s ease, box-shadow .15s ease;
}
.aw-result-cta:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 14px 38px -8px rgba(139, 92, 246, .75); }

.aw-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

@media (prefers-reduced-motion: reduce) {
  .aw-wheel-wrap::before, .aw-rim .aw-led { animation: none; }
  .aw-spin-btn:not(:disabled)::after { animation: none; display: none; }
  .aw-form > *, .aw-result { animation: none; }
}
/* منبع واحد حقیقت مدت transition گردونه در wheel.js ست می‌شود (inline style اولویت دارد)؛
   این فقط fallback بدون‌جاوااسکریپت است. */
.aw-wheel { transition: transform 4.5s cubic-bezier(.17, .67, .11, 1); }
