/* ============================================================
   Spin & Win wheel — home page only (frontEnd/home/index.blade.php)
   Floating button opens a popup with a 4-segment wheel.
   ============================================================ */
.spin-fab[hidden], .spin-modal[hidden], .spin-go[hidden], .spin-result[hidden], .spin-retry[hidden]{ display: none !important; }

/* ---- floating button (opposite corner to the WhatsApp button) ---- */
.spin-fab{
  position: fixed; z-index: 998;
  bottom: 22px; inset-inline-start: 22px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 15px; color: #030641;
  background: linear-gradient(135deg, #f8e39a, #f5d77a 55%, #e2b84a);
  box-shadow: 0 14px 34px -12px rgba(3,6,65,.55), 0 0 0 1px rgba(255,255,255,.5) inset;
  transition: transform .25s ease, box-shadow .25s ease;
}
.spin-fab i{ font-size: 18px; animation: spinFabWiggle 2.6s ease-in-out infinite; }
.spin-fab:hover{ transform: translateY(-3px); box-shadow: 0 20px 40px -12px rgba(3,6,65,.6), 0 0 0 1px rgba(255,255,255,.6) inset; }
.spin-fab:focus-visible, .spin-close:focus-visible, .spin-go:focus-visible, .spin-claim:focus-visible{
  outline: 3px solid #4f8cff; outline-offset: 3px;
}
@keyframes spinFabWiggle{
  0%, 70%, 100%{ transform: rotate(0); }
  78%{ transform: rotate(-16deg); }
  86%{ transform: rotate(14deg); }
  94%{ transform: rotate(-8deg); }
}

/* ---- popup ---- */
.spin-modal{
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto;
  background: rgba(3,6,40,.72);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: spinFade .25s ease;
}
@keyframes spinFade{ from{ opacity: 0; } to{ opacity: 1; } }
.spin-dialog{
  position: relative; width: 100%; max-width: 420px; margin: auto;
  padding: 30px 24px 26px; border-radius: 24px; text-align: center; color: #fff;
  background: radial-gradient(120% 90% at 50% 0%, #17409c 0%, #0a1f6b 45%, #030641 100%);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.12) inset;
}
.spin-close{
  position: absolute; top: 12px; inset-inline-end: 12px;
  width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgba(255,255,255,.12); font-size: 16px;
  transition: background .2s ease;
}
.spin-close:hover{ background: rgba(255,255,255,.24); }
.spin-title{ margin: 0 0 6px; padding: 0 34px; font-size: 24px; font-weight: 800; line-height: 1.3; color: #fff; }
.spin-sub{ margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: rgba(255,255,255,.78); }

/* ---- wheel ---- */
.spin-stage{
  --size: min(300px, 74vw);
  position: relative; width: var(--size); height: var(--size); margin: 0 auto 22px;
  direction: ltr;                      /* geometry is the same in ar and en */
}
.spin-wheel{
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#f5d77a 0 72deg, #2950bd 72deg 144deg, #ffffff 144deg 216deg, #0e3789 216deg 288deg, #aab8e6 288deg 360deg);
  border: 8px solid #f5d77a;
  box-shadow: 0 0 0 4px #030641, 0 0 0 6px rgba(245,215,122,.55), 0 22px 50px -18px rgba(0,0,0,.8);
  transform: rotate(0deg);
  transition: transform 5.2s cubic-bezier(.16,.84,.22,1);
  will-change: transform;
}
.spin-wheel.no-anim{ transition: none; }
.spin-seg{
  position: absolute; top: 50%; left: 50%;
  width: 36%; margin-left: -18%;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 800; line-height: 1.2; text-align: center;
  transform-origin: 50% 0;
}
.spin-seg i{ font-size: 18px; }
.spin-seg b{ font-weight: 800; overflow-wrap: anywhere; }
/* each label sits in the middle of its 72deg slice; s5 is the "Try again" slice */
.spin-seg.s1{ transform: rotate(36deg)  translateY(calc(var(--size) * -.41)); color: #030641; }
.spin-seg.s2{ transform: rotate(108deg) translateY(calc(var(--size) * -.41)); color: #ffffff; }
.spin-seg.s3{ transform: rotate(180deg) translateY(calc(var(--size) * -.41)); color: #030641; }
.spin-seg.s4{ transform: rotate(252deg) translateY(calc(var(--size) * -.41)); color: #ffffff; }
.spin-seg.s5{ transform: rotate(324deg) translateY(calc(var(--size) * -.41)); color: #030641; }
.spin-hub{
  position: absolute; top: 50%; left: 50%; width: 19%; height: 19%;
  transform: translate(-50%, -50%); border-radius: 50%;
  display: grid; place-items: center; color: #030641; font-size: 18px;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #f5d77a 60%, #d9a93a);
  box-shadow: 0 0 0 4px #030641, 0 6px 14px rgba(0,0,0,.45);
}
.spin-pointer{
  position: absolute; z-index: 2; top: -12px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 15px solid transparent; border-right: 15px solid transparent;
  border-top: 30px solid #ff4d5e;
  filter: drop-shadow(0 4px 5px rgba(0,0,0,.5));
}

/* ---- buttons + result ---- */
.spin-go, .spin-claim{
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 200px; padding: 14px 28px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 800; text-decoration: none; color: #030641;
  background: linear-gradient(135deg, #f8e39a, #f5d77a 55%, #e2b84a);
  box-shadow: 0 14px 30px -12px rgba(245,215,122,.7);
  transition: transform .2s ease, opacity .2s ease;
}
.spin-go:hover, .spin-claim:hover{ transform: translateY(-2px); color: #030641; }
.spin-go:disabled{ opacity: .6; cursor: default; transform: none; }
.spin-result, .spin-retry{ animation: spinFade .4s ease; }
.spin-retry{ margin: -6px 0 14px; font-size: 15px; font-weight: 700; color: #f5d77a; }
.spin-result-label{ display: block; font-size: 14px; color: rgba(255,255,255,.8); }
.spin-result-gift{ display: block; margin: 4px 0 16px; font-size: 26px; font-weight: 800; color: #f5d77a; }

@media (max-width: 640px){
  .spin-fab{ bottom: 14px; inset-inline-start: 14px; padding: 11px 16px; font-size: 13.5px; }
  .spin-dialog{ padding: 26px 16px 22px; }
  .spin-title{ font-size: 21px; }
  .spin-seg{ font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce){
  .spin-wheel{ transition-duration: .01s; }
  .spin-fab i, .spin-modal, .spin-result{ animation: none; }
}
