* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", Arial, sans-serif;
  background: #080d22;
  color: #ffffff;
}

body {
  overflow-x: hidden;
  opacity: 1;
}

.page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding-top: 11vh;
  background: var(--bg-url) center / cover no-repeat;
}

.hero-content {
  width: min(1180px, calc(100% - 48px));
  text-align: center;
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.hero-content.is-hiding {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-22px) scale(0.98);
}

html.wheel-completed .hero-content {
  display: none;
}

.hero-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(45px, 5.6vw, 94px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.08em;
  text-align: center;
  text-shadow:
    0 4px 0 rgba(10, 14, 36, 0.72),
    0 18px 48px rgba(0, 0, 0, 0.58),
    0 0 34px rgba(96, 217, 255, 0.24);
}

.hero-subtitle {
  margin: 26px auto 0;
  max-width: 1120px;
  color: #e8e9f5;
  font-size: clamp(17px, 2.125vw, 34px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
  text-shadow:
    0 4px 0 rgba(7, 10, 27, 0.5),
    0 18px 44px rgba(0, 0, 0, 0.62);
}

.hero-subtitle span {
  color: #ff86f7;
  text-shadow:
    0 0 22px rgba(255, 89, 237, 0.52),
    0 4px 0 rgba(60, 17, 78, 0.48);
}

.hero-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  width: min(760px, 72%);
  margin: 34px auto 0;
  color: #a75aff;
}

.hero-divider span {
  position: relative;
  display: block;
  height: 3px;
  background: linear-gradient(90deg, transparent, #9d54f8 18%, #9d54f8 82%, transparent);
  box-shadow: 0 0 14px rgba(167, 90, 255, 0.46);
}

.hero-divider span::before,
.hero-divider span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 3px solid #a75aff;
  transform: translateY(-50%) rotate(45deg);
  box-shadow: 0 0 14px rgba(167, 90, 255, 0.5);
}

.hero-divider span:first-child::before,
.hero-divider span:last-child::after {
  display: none;
}

.hero-divider span:first-child::after {
  right: -2px;
}

.hero-divider span:last-child::before {
  left: -2px;
}

.hero-divider svg {
  width: 76px;
  height: auto;
  fill: currentColor;
  filter: drop-shadow(0 0 16px rgba(167, 90, 255, 0.58));
  animation: crownFloat 3.4s ease-in-out infinite;
  transform-origin: center;
  will-change: transform, filter;
}

@keyframes crownFloat {
  0%,
  100% {
    filter: drop-shadow(0 0 14px rgba(167, 90, 255, 0.5));
    transform: translateY(0) rotate(-1deg) scale(1);
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(167, 90, 255, 0.78));
    transform: translateY(-5px) rotate(1deg) scale(1.03);
  }
}

.wheel-prompt {
  max-width: 760px;
  margin: 30px auto 0;
  color: #f7eaff;
  font-size: clamp(18px, 2.2vw, 36px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-align: center;
  text-shadow:
    0 4px 0 rgba(41, 7, 54, 0.48),
    0 0 26px rgba(255, 134, 247, 0.44),
    0 18px 42px rgba(0, 0, 0, 0.56);
}

.wheel-shell {
  position: relative;
  width: min(34vw, 390px);
  height: min(34vw, 390px);
  margin: calc(26px + 3vh) auto 0;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.38));
}

.wheel-area {
  position: absolute;
  inset: 0;
}

.wheel-halo {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  pointer-events: none;
  animation: wheelHaloBreath 2.4s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes wheelHaloBreath {
  from {
    box-shadow:
      0 0 40px rgba(255, 134, 247, 0.32),
      0 0 80px rgba(167, 90, 255, 0.12);
  }
  to {
    box-shadow:
      0 0 70px rgba(255, 134, 247, 0.58),
      0 0 130px rgba(167, 90, 255, 0.24),
      0 0 200px rgba(255, 0, 255, 0.1);
  }
}

.wheel-arrow {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid #ff86f7;
  filter:
    drop-shadow(0 0 6px #ff86f7)
    drop-shadow(0 0 14px #ff86f7)
    drop-shadow(0 0 22px rgba(255, 0, 255, 0.55));
  z-index: 5;
}

#wheelCanvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.spin-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  width: 30%;
  height: 30%;
  min-width: 88px;
  min-height: 88px;
  transform: translate3d(-50%, -50%, 0);
  border: none;
  border-radius: 50%;
  background:
    linear-gradient(135deg, #ffd3fb 0%, #ff86f7 32%, #e440d7 72%, #ffb6fb 100%);
  background-size: 200%;
  color: #280025;
  cursor: pointer;
  font-family: "Inter", Arial, sans-serif;
  font-size: clamp(11px, 1.15vw, 14px);
  font-weight: 900;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  box-shadow:
    0 0 28px rgba(255, 134, 247, 0.58),
    0 12px 30px rgba(0, 0, 0, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.15s ease, opacity 0.3s ease;
  animation: spinBtnGlow 2.2s ease-in-out infinite;
}

.spin-btn:hover:not(:disabled) {
  transform: translate3d(-50%, -50%, 0) scale(1.05);
}

.spin-btn:active:not(:disabled) {
  transform: translate3d(-50%, -50%, 0) scale(0.98);
}

.spin-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  animation: none;
}

.spin-btn.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0) scale(0.82);
}

@keyframes spinBtnGlow {
  0%,
  100% {
    box-shadow:
      0 0 28px rgba(255, 134, 247, 0.58),
      0 12px 30px rgba(0, 0, 0, 0.28),
      inset 0 2px 0 rgba(255, 255, 255, 0.55);
  }
  50% {
    box-shadow:
      0 0 50px rgba(255, 134, 247, 0.9),
      0 18px 44px rgba(0, 0, 0, 0.34),
      inset 0 2px 0 rgba(255, 255, 255, 0.65);
  }
}

.result-msg {
  min-height: 32px;
  margin-top: 18px;
  color: #ffd700;
  font-size: clamp(14px, 1.45vw, 19px);
  font-weight: 900;
  letter-spacing: 1.4px;
  text-align: center;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  text-shadow:
    0 0 16px rgba(255, 215, 0, 0.65),
    0 0 34px rgba(255, 0, 255, 0.28);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-msg.is-empty {
  color: #ffffff;
  text-shadow:
    0 4px 0 rgba(10, 14, 36, 0.58),
    0 14px 34px rgba(0, 0, 0, 0.52),
    0 0 24px rgba(255, 134, 247, 0.34);
}

.result-msg.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.win-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: max(28px, env(safe-area-inset-top, 0px)) 22px max(36px, env(safe-area-inset-bottom, 0px));
  text-align: center;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 134, 247, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(8, 13, 34, 0.68), rgba(5, 6, 18, 0.92));
  opacity: 0;
  pointer-events: none;
  transform: translateY(60px);
  transition:
    opacity 0.78s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.78s cubic-bezier(0.34, 1.15, 0.64, 1);
}

.win-screen.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

html.wheel-completed .win-screen {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: none;
}

.win-prize-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.win-trophy {
  font-size: clamp(54px, 8vw, 86px);
  line-height: 1;
  filter:
    drop-shadow(0 0 18px rgba(255, 134, 247, 0.78))
    drop-shadow(0 0 42px rgba(167, 90, 255, 0.56));
  animation: winTrophyFloat 1.6s ease-in-out infinite;
}

@keyframes winTrophyFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-7px) scale(1.08);
  }
}

.win-eyebrow {
  margin: 0;
  color: #e8e9f5;
  font-size: clamp(17px, 2.125vw, 34px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
  text-shadow:
    0 4px 0 rgba(7, 10, 27, 0.5),
    0 18px 44px rgba(0, 0, 0, 0.62);
}

.win-total {
  color: #ff86f7;
  font-size: clamp(78px, 12vw, 132px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.08em;
  text-shadow:
    0 4px 0 rgba(70, 10, 90, 0.58),
    0 0 34px rgba(255, 134, 247, 0.82),
    0 0 90px rgba(255, 0, 255, 0.42);
  animation: winTotalPulse 1.55s ease-in-out infinite;
}

@keyframes winTotalPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

.win-cta-hint-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 460px);
  margin-top: 4px;
}

.win-tg-badge {
  display: grid;
  place-items: center;
  width: clamp(50px, 6vw, 64px);
  height: clamp(50px, 6vw, 64px);
  margin-top: 14px;
  filter:
    drop-shadow(0 0 18px rgba(42, 171, 238, 0.72))
    drop-shadow(0 0 36px rgba(77, 199, 255, 0.44));
  animation: winTelegramFloat 1.6s ease-in-out infinite;
}

@keyframes winTelegramFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-7px) scale(1.08);
  }
}

.win-tg-icon {
  display: block;
  width: 100%;
  height: 100%;
}

.win-cta-hint {
  margin: 0;
  color: #f7eaff;
  font-size: clamp(15px, 1.7vw, 20px);
  font-weight: 800;
  line-height: 1.36;
  text-shadow:
    0 4px 0 rgba(41, 7, 54, 0.42),
    0 0 24px rgba(255, 134, 247, 0.34);
}

.win-divider {
  width: min(420px, 66vw);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 134, 247, 0.78), transparent);
  box-shadow: 0 0 18px rgba(255, 134, 247, 0.48);
}

.win-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(74vw, 344px);
  min-height: 68px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #6fd6ff 0%, #2aabee 42%, #168bd0 78%, #4dc7ff 100%);
  color: #ffffff;
  cursor: pointer;
  font-family: "Inter", Arial, sans-serif;
  font-size: clamp(16px, 1.95vw, 21px);
  font-weight: 900;
  letter-spacing: 1.1px;
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 58, 105, 0.38);
  box-shadow:
    0 0 34px rgba(42, 171, 238, 0.58),
    0 14px 38px rgba(0, 0, 0, 0.34),
    inset 0 2px 0 rgba(255, 255, 255, 0.58);
  animation: winButtonGlow 1.9s ease-in-out infinite;
}

.win-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  transform: skewX(-18deg) translateX(-130%);
  animation: winButtonSheen 2.2s ease-in-out infinite;
}

@keyframes winButtonGlow {
  0%,
  100% {
    box-shadow:
      0 0 34px rgba(42, 171, 238, 0.58),
      0 14px 38px rgba(0, 0, 0, 0.34),
      inset 0 2px 0 rgba(255, 255, 255, 0.58);
  }
  50% {
    box-shadow:
      0 0 58px rgba(42, 171, 238, 0.92),
      0 18px 46px rgba(0, 0, 0, 0.38),
      inset 0 2px 0 rgba(255, 255, 255, 0.68);
  }
}

@keyframes winButtonSheen {
  0%,
  42% {
    transform: skewX(-18deg) translateX(-130%);
  }
  100% {
    transform: skewX(-18deg) translateX(130%);
  }
}

@media (max-width: 768px) {
  .page {
    min-height: 100svh;
    padding: 5vh 24px 28px;
    background-image: var(--bg-mobile-url);
    background-position: center;
    background-size: cover;
  }

  .hero-title {
    font-size: clamp(35px, 11.2vw, 58px);
    max-width: 92vw;
  }

  .hero-subtitle {
    margin-top: 20px;
    font-size: clamp(14px, 4.2vw, 22px);
  }

  .hero-divider {
    width: min(78vw, 330px);
    gap: 18px;
    margin-top: 26px;
  }

  .hero-divider svg {
    width: 58px;
  }

  .wheel-prompt {
    max-width: 330px;
    margin-top: 22px;
    font-size: clamp(15px, 4.4vw, 20px);
    line-height: 1.14;
  }

  .wheel-shell {
    width: min(78vw, 330px);
    height: min(78vw, 330px);
    margin-top: calc(24px + 2vh);
  }

  .spin-btn {
    min-width: 78px;
    min-height: 78px;
    font-size: 11px;
  }

  .win-screen {
    gap: 14px;
    padding-inline: 20px;
  }

  .win-eyebrow {
    letter-spacing: 2.6px;
  }

  .win-btn {
    min-height: 62px;
    letter-spacing: 0.7px;
  }
}
