#quayNhanThuongModal {
  --blue: #0a7dff;
  --cyan: #19d4ff;
  --gold: #ffd166;
  --amber: #ff9f1c;
  --red: #ef476f;
  --ink: #031225;
  --panel: rgba(2, 14, 31, 0.62);
  --line: rgba(129, 213, 255, 0.38);
  --text: #f6fbff;
  --muted: rgba(229, 246, 255, 0.76);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  --viewport-height: 100vh;
}

@supports (height: 100dvh) {
  #quayNhanThuongModal {
    --viewport-height: 100dvh;
  }
}

#quayNhanThuongModal * {
  box-sizing: border-box;
}

#quayNhanThuongModal button {
  border: 0;
  font: inherit;
}

#quayNhanThuongModal .scene {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: var(--viewport-height);
  overflow: hidden;
}

#quayNhanThuongModal .scene::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 132, 255, 0.14), transparent 29rem),
    radial-gradient(circle at 50% 88%, rgba(255, 183, 77, 0.18), transparent 22rem),
    rgba(0, 0, 0, 0.1);
}

#quayNhanThuongModal .scene::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at center, transparent 0 23%, #000 68%);
}

#quayNhanThuongModal #sparkCanvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}

#quayNhanThuongModal .aurora {
  position: fixed;
  inset: auto -20vw -18vh;
  z-index: -1;
  height: 48vh;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 45% 45%, rgba(0, 126, 255, 0.35), transparent 42%),
    radial-gradient(ellipse at 60% 70%, rgba(255, 177, 66, 0.18), transparent 48%);
  filter: blur(28px);
  animation: auroraPulse 6s ease-in-out infinite alternate;
}

#quayNhanThuongModal .app-shell {
  --result-gap: clamp(12px, 1.8vh, 20px);
  --wheel-size: min(94vw, max(286px, min(34vw, 542px, calc(var(--viewport-height) - 154px))));
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  justify-content: center;
  align-content: center;
  min-height: 100vh;
  min-height: var(--viewport-height);
  padding: 0 clamp(16px, 4vw, 56px);
}

#quayNhanThuongModal .wheel-section {
  position: relative;
  display: grid;
  place-items: center;
  justify-content: center;
  align-content: center;
  width: var(--wheel-size);
}

#quayNhanThuongModal .wheel-wrap {
  position: relative;
  width: var(--wheel-size);
  aspect-ratio: 1;
  filter: drop-shadow(0 0 28px rgba(0, 154, 255, 0.55));
}

#quayNhanThuongModal .wheel-wrap::before,
#quayNhanThuongModal .wheel-wrap::after,
#quayNhanThuongModal .outer-glow {
  position: absolute;
  inset: -5%;
  border-radius: 50%;
  pointer-events: none;
  content: "";
}

#quayNhanThuongModal .wheel-wrap::before {
  border: 1px solid rgba(255, 217, 128, 0.55);
  box-shadow:
    0 0 26px rgba(255, 190, 73, 0.42),
    inset 0 0 28px rgba(255, 190, 73, 0.22);
  animation: ringBreath 2.8s ease-in-out infinite;
}

#quayNhanThuongModal .wheel-wrap::after {
  inset: -12%;
  border: 1px dashed rgba(55, 192, 255, 0.35);
  animation: orbit 20s linear infinite;
}

#quayNhanThuongModal .outer-glow {
  inset: -17%;
  background:
    conic-gradient(from 0deg, transparent, rgba(0, 180, 255, 0.4), transparent 31%, rgba(255, 199, 95, 0.42), transparent 64%, rgba(0, 180, 255, 0.4), transparent),
    radial-gradient(circle, transparent 57%, rgba(0, 133, 255, 0.12), transparent 68%);
  filter: blur(10px);
  animation: orbit 12s linear infinite reverse;
}

#quayNhanThuongModal .pointer {
  position: absolute;
  top: -4%;
  left: 50%;
  z-index: 6;
  width: clamp(42px, 5vw, 62px);
  height: clamp(54px, 6vw, 76px);
  transform: translateX(-50%);
  filter: drop-shadow(0 0 18px rgba(255, 190, 80, 0.86));
}

#quayNhanThuongModal .pointer::before {
  position: absolute;
  inset: 0;
  content: "";
  clip-path: polygon(50% 0, 100% 45%, 50% 100%, 0 45%);
  background: linear-gradient(180deg, #fff4b8, #ffab31 42%, #0e62ff 43%, #0bdcff);
}

#quayNhanThuongModal .pointer span {
  position: absolute;
  top: 17%;
  left: 50%;
  width: 35%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #ffffff, #12e4ff 48%, #0059ff 49%);
  box-shadow: 0 0 16px rgba(12, 218, 255, 0.95);
}

#quayNhanThuongModal .wheel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: clamp(8px, 1vw, 13px) solid rgba(255, 209, 102, 0.92);
  border-radius: 50%;
  background: conic-gradient(#0466ff, #101d42);
  box-shadow:
    inset 0 0 26px rgba(255, 255, 255, 0.22),
    inset 0 0 54px rgba(0, 0, 0, 0.38),
    0 0 0 7px rgba(0, 160, 255, 0.35),
    0 0 36px rgba(0, 173, 255, 0.72);
  transform: rotate(0deg);
  will-change: transform;
}

#quayNhanThuongModal .wheel::before {
  position: absolute;
  inset: 28%;
  z-index: 2;
  border: 4px solid rgba(255, 209, 102, 0.78);
  border-radius: 50%;
  content: "";
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.9) 0 2%, rgba(25, 212, 255, 0.75) 3% 16%, rgba(0, 76, 255, 0.55) 17% 34%, rgba(1, 12, 33, 0.9) 35% 58%, rgba(255, 209, 102, 0.74) 59% 63%, rgba(2, 18, 45, 0.72) 64% 100%),
    repeating-conic-gradient(from 0deg, rgba(42, 202, 255, 0.4) 0deg 16deg, rgba(255, 255, 255, 0.12) 16deg 18deg);
  box-shadow:
    0 0 20px rgba(255, 209, 102, 0.46),
    inset 0 0 34px rgba(0, 204, 255, 0.5);
  pointer-events: none;
}

#quayNhanThuongModal .wheel::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 50%;
  content: "";
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.32), transparent 12%),
    radial-gradient(circle, transparent 31%, rgba(0, 0, 0, 0.24) 32%, transparent 36%),
    radial-gradient(circle, transparent 70%, rgba(0, 213, 255, 0.22) 70.5%, rgba(255, 209, 102, 0.28) 72%, transparent 74%),
    repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.28) 0deg 0.8deg, transparent 0.8deg 30deg);
  pointer-events: none;
}

#quayNhanThuongModal .segment-label {
  position: absolute;
  inset: 0;
  z-index: 4;
  transform: rotate(var(--angle));
  pointer-events: none;
}

#quayNhanThuongModal .segment-prize {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#quayNhanThuongModal .segment-text {
  position: absolute;
  top: 4.6%;
  left: 50%;
  display: block;
  width: min(24%, 116px);
  color: #ffe58b;
  text-align: center;
  text-shadow:
    0 2px 0 rgba(20, 6, 0, 0.65),
    0 0 9px rgba(255, 196, 62, 0.36);
  font-size: clamp(0.6rem, 0.92vw, 0.83rem);
  font-weight: 950;
  line-height: 1.08;
  overflow-wrap: anywhere;
  transform: translateX(-50%) rotate(var(--readable-tilt));
  white-space: pre-line;
}

#quayNhanThuongModal .segment-icon {
  position: absolute;
  top: 15.8%;
  left: 50%;
  width: clamp(34px, 4.4vw, 58px);
  aspect-ratio: 1;
  object-fit: contain;
  filter:
    drop-shadow(0 5px 6px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 12px rgba(25, 212, 255, 0.22));
  transform: translateX(-50%) rotate(var(--readable-tilt));
}

#quayNhanThuongModal .spin-button {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 8;
  display: grid;
  place-items: center;
  width: clamp(92px, 10.5vw, 136px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 228, 154, 0.92);
  border-radius: 50%;
  color: #061326;
  cursor: pointer;
  background:
    radial-gradient(circle at 32% 24%, #ffffff, transparent 22%),
    linear-gradient(145deg, #fff2b0, #ffb33d 48%, #ff7a1a);
  box-shadow:
    0 0 24px rgba(255, 203, 91, 0.8),
    inset 0 -9px 14px rgba(142, 65, 0, 0.25);
  transform: translate(-50%, -50%);
  transition:
    transform 180ms ease,
    filter 180ms ease,
    box-shadow 180ms ease;
}

#quayNhanThuongModal .spin-button:hover {
  filter: brightness(1.08);
  transform: translate(-50%, -50%) scale(1.04);
}

#quayNhanThuongModal .spin-button:active {
  transform: translate(-50%, -50%) scale(0.98);
}

#quayNhanThuongModal .spin-button:disabled {
  cursor: progress;
  filter: saturate(0.85) brightness(0.92);
}

#quayNhanThuongModal .spin-button strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.12rem, 2vw, 1.7rem);
  line-height: 0.95;
}

#quayNhanThuongModal .spin-button span {
  margin-top: -16px;
  color: rgba(6, 19, 38, 0.72);
  font-size: clamp(0.7rem, 1vw, 0.82rem);
  font-weight: 900;
  text-transform: uppercase;
}

#quayNhanThuongModal .result-strip {
  position: absolute;
  top: calc(100% + var(--result-gap));
  left: 50%;
  width: min(94vw, 520px);
  min-height: 50px;
  padding: 13px 18px;
  border: 1px solid rgba(89, 205, 255, 0.38);
  border-radius: 8px;
  color: #ffffff;
  text-align: center;
  font-size: clamp(0.98rem, 1.5vw, 1.18rem);
  font-weight: 800;
  background: linear-gradient(90deg, rgba(1, 19, 43, 0.72), rgba(2, 37, 69, 0.72));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

#quayNhanThuongModal .winner-content p {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#quayNhanThuongModal .winner-content button {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  border-radius: 8px;
  color: #061326;
  cursor: pointer;
  background: linear-gradient(135deg, #fff2ac, #ffb13f 48%, #ff6f1d);
  box-shadow: 0 14px 34px rgba(255, 136, 35, 0.28);
  font-weight: 950;
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

#quayNhanThuongModal .winner-content button:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

#quayNhanThuongModal .winner-toast {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 7, 18, 0.42);
  backdrop-filter: blur(8px);
}

#quayNhanThuongModal .winner-toast[hidden] {
  display: none;
}

#quayNhanThuongModal .winner-content {
  position: relative;
  width: min(92vw, 540px);
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(255, 209, 102, 0.5);
  border-radius: 8px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 199, 95, 0.25), transparent 42%),
    linear-gradient(180deg, rgba(6, 31, 61, 0.94), rgba(2, 10, 25, 0.95));
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.62),
    0 0 34px rgba(0, 173, 255, 0.36);
  animation: toastIn 360ms cubic-bezier(0.2, 0.9, 0.18, 1) both;
}

#quayNhanThuongModal .winner-content h2 {
  margin: 20px 0;
  font-size: clamp(2rem, 6vw, 3.25rem);
  letter-spacing: 6px;
  color: #ffffff;
  text-transform: uppercase;
}

#quayNhanThuongModal .winner-content span {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

#quayNhanThuongModal .claim-form {
  margin-top: 18px;
  text-align: left;
}

#quayNhanThuongModal .claim-field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

#quayNhanThuongModal .claim-field span {
  color: rgba(229, 246, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

#quayNhanThuongModal .claim-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(129, 213, 255, 0.38);
  border-radius: 8px;
  outline: 0;
  color: #ffffff;
  font: inherit;
  font-weight: 750;
  background: rgba(1, 13, 31, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#quayNhanThuongModal .claim-field input:focus {
  border-color: rgba(255, 209, 102, 0.88);
  box-shadow:
    0 0 0 3px rgba(255, 209, 102, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#quayNhanThuongModal .claim-field input::placeholder {
  color: rgba(229, 246, 255, 0.42);
}

#quayNhanThuongModal .claim-thanks {
  margin-top: 18px;
  text-align: center;
}

#quayNhanThuongModal .claim-thanks strong {
  display: block;
  color: #ffffff;
  font-size: 1.04rem;
  line-height: 1.25;
}

#quayNhanThuongModal .claim-thanks span {
  margin-top: 9px;
  line-height: 1.5;
}

#quayNhanThuongModal .reward-code {
  display: grid;
  gap: 6px;
  margin: 16px 0 14px;
  padding: 13px 14px;
  border: 1px dashed rgba(255, 209, 102, 0.7);
  border-radius: 8px;
  background: rgba(255, 209, 102, 0.1);
}

#quayNhanThuongModal .reward-code span {
  margin: 0;
  color: rgba(255, 236, 174, 0.88);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

#quayNhanThuongModal .reward-code strong {
  color: #ffffff;
  font-size: clamp(1.08rem, 4.8vw, 1.52rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

#quayNhanThuongModal .confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 13;
  overflow: hidden;
  pointer-events: none;
}

#quayNhanThuongModal .confetti-piece {
  position: absolute;
  top: -16px;
  left: var(--x);
  width: var(--w);
  height: var(--h);
  border-radius: 2px;
  background: var(--c);
  opacity: 0;
  transform: translate3d(0, -20px, 0) rotate(0deg);
  animation: confettiFall var(--d) cubic-bezier(0.16, 0.64, 0.4, 1) forwards;
}

#quayNhanThuongModal .is-spinning .wheel-wrap {
  animation: stageShake 900ms ease-in-out infinite;
}

#quayNhanThuongModal .is-spinning .result-strip {
  color: #e9fbff;
  box-shadow: 0 0 26px rgba(25, 212, 255, 0.28);
}

@keyframes auroraPulse {
  from {
    opacity: 0.58;
    transform: scaleX(0.98);
  }
  to {
    opacity: 0.9;
    transform: scaleX(1.05);
  }
}

@keyframes ringBreath {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.99);
  }
  50% {
    opacity: 1;
    transform: scale(1.025);
  }
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes stageShake {
  0%,
  100% {
    filter: drop-shadow(0 0 28px rgba(0, 154, 255, 0.55));
  }
  50% {
    filter: drop-shadow(0 0 44px rgba(255, 200, 89, 0.72));
  }
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translate3d(0, -20px, 0) rotate(0deg);
  }
  100% {
    opacity: 0.95;
    transform: translate3d(var(--tx), 112vh, 0) rotate(var(--r));
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1180px) {
  #quayNhanThuongModal .app-shell {
    --result-gap: clamp(10px, 1.6vh, 18px);
    --wheel-size: min(94vw, max(276px, min(58vw, 500px, calc(var(--viewport-height) - 146px))));
  }

  #quayNhanThuongModal .wheel-section {
    width: var(--wheel-size);
  }
}

@media (max-width: 640px) {
  #quayNhanThuongModal .scene::after {
    background-size: 42px 42px;
  }

  #quayNhanThuongModal .app-shell {
    --result-gap: 10px;
    --wheel-size: max(160px, min(94vw, 390px, calc(var(--viewport-height) - 132px)));
    min-height: 100vh;
    min-height: var(--viewport-height);
    padding-inline: 12px;
  }

  #quayNhanThuongModal .wheel-wrap {
    width: var(--wheel-size);
  }

  #quayNhanThuongModal .segment-prize {
    inset: 0;
  }

  #quayNhanThuongModal .segment-text {
    top: 4.2%;
    width: 25%;
    font-size: clamp(0.48rem, 2.1vw, 0.62rem);
  }

  #quayNhanThuongModal .segment-icon {
    top: 15.8%;
    width: clamp(22px, 7.2vw, 32px);
  }

  #quayNhanThuongModal .result-strip {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #quayNhanThuongModal *,
  #quayNhanThuongModal *::before,
  #quayNhanThuongModal *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
