@font-face {
  font-family: "Benzin";
  src: url("../font/Benzin-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Benzin";
  src: url("../font/Benzin-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Benzin";
  src: url("../font/Benzin-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --orange: #f59e0b;
  --orange-dark: #e14b1d;
  --panel: #12161f;
  --wheel-size: min(96.5vh, 54.3vw);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  min-width: 320px;
  color: #fff;
  background: #090313;
  font-family: "Benzin", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.preloading {
  cursor: wait;
}

.preloader {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(106, 26, 151, 0.28), transparent 34%),
    #0b0215;
  opacity: 1;
  visibility: visible;
  transition: opacity 450ms ease, visibility 450ms;
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  display: grid;
  width: min(54vw, 280px);
  justify-items: center;
  gap: 28px;
}

.preloader-logo {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(245, 83, 48, 0.3));
  animation: preloader-logo-pulse 1.7s ease-in-out infinite;
}

.preloader-track {
  width: 72%;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.preloader-track span {
  display: block;
  width: 44%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f05a39, #f59e0b, #ba43ee);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.7);
  animation: preloader-progress 1.15s ease-in-out infinite;
}

img {
  display: block;
  user-select: none;
}

button,
a {
  font: inherit;
}

.scene {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 540px;
  overflow: hidden;
  isolation: isolate;
  background: #160422;
}

.background,
.character,
.gifts-center,
.gifts {
  position: absolute;
  pointer-events: none;
}

.background {
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character {
  z-index: 4;
  right: 0;
  top: 0;
  height: 100%;
  width: auto;
  max-width: 42%;
  object-fit: contain;
  object-position: right top;
  transform-origin: right bottom;
  will-change: transform, filter;
  animation: character-alive 5.5s ease-in-out infinite;
}

.gifts-center {
  z-index: 4;
  left: 13.75%;
  bottom: 0;
  width: 63.65%;
  height: 15.93%;
  object-fit: fill;
  object-position: center bottom;
}

.gifts {
  z-index: 5;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 55.2%;
  object-fit: fill;
  object-position: center bottom;
}

.gift-particles {
  position: absolute;
  z-index: 6;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.gift-particle {
  position: absolute;
  left: var(--left);
  bottom: var(--bottom);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--color);
  box-shadow:
    0 0 calc(var(--size) * 2.5) var(--color),
    0 0 calc(var(--size) * 5) rgba(255, 170, 30, 0.55);
  opacity: 0;
  will-change: transform, opacity;
  animation: gift-spark-rise var(--duration) var(--delay) ease-out infinite;
}

.gift-particle:nth-child(3n) {
  border-radius: 2px;
}

.content {
  position: absolute;
  z-index: 7;
  inset: 0 auto 0 0;
  width: 24%;
  pointer-events: none;
}

.logo {
  position: absolute;
  top: 6.7%;
  left: 4.17vw;
  width: min(11.05vw, 212px);
  height: auto;
}

.main-title {
  position: absolute;
  top: 23.4%;
  left: 4.17vw;
  font-size: min(5.93vh, 3.34vw);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

@media (min-width: 768px) {
  html[lang="uz"] .main-title,
  html[lang="kk"] .main-title {
    font-size: min(5vh, 2.65vw);
  }

  html[lang="tg"] .main-title {
    font-size: min(5.3vh, 2.9vw);
  }
}

.bonus-cards {
  position: absolute;
  top: 42.4%;
  left: 4.17vw;
  display: grid;
  gap: min(3.7vh, 40px);
  width: min(17.76vw, 341px);
}

.bonus-card {
  position: relative;
  display: flex;
  align-items: center;
  height: min(9.63vh, 104px);
  border: 1px solid var(--orange);
  border-radius: min(2.96vh, 32px);
  background: linear-gradient(90deg, #12161f, #2b0542 76%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-18px);
  transition: opacity 350ms ease, transform 350ms ease, visibility 350ms;
}

.bonus-card.revealed {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.bonus-card > img {
  flex: 0 0 auto;
  width: 37%;
  max-height: 128%;
  object-fit: contain;
  transform: translateX(-9%);
}

.bonus-card > div {
  display: grid;
  gap: 0.35em;
  margin-left: -2%;
}

.bonus-card strong {
  font-size: min(3.7vh, 2.08vw);
  line-height: 1;
}

.bonus-card span {
  font-family: Arial, sans-serif;
  font-size: min(1.48vh, 0.84vw);
}

.attempts {
  position: absolute;
  left: 4.17vw;
  bottom: 7.4%;
  display: flex;
  align-items: center;
  width: min(11.93vw, 229px);
  height: min(9.63vh, 104px);
  padding: min(0.74vh, 8px);
  border-radius: min(2.96vh, 32px);
  background: #050505;
}

.attempts-dot {
  display: grid;
  flex: 0 0 min(8.15vh, 85px);
  height: min(8.15vh, 88px);
  place-items: center;
  border-radius: min(2.22vh, 24px);
  background: linear-gradient(145deg, var(--orange), var(--orange-dark));
  font-size: min(3.7vh, 2.08vw);
  font-weight: 800;
}

.attempts-label {
  margin-left: min(1.25vw, 24px);
  font-family: Arial, sans-serif;
  font-size: min(1.48vh, 0.84vw);
  font-weight: 600;
  line-height: 1.05;
}

.wheel-wrap {
  position: absolute;
  z-index: 3;
  top: 2.3%;
  left: 49.8%;
  width: var(--wheel-size);
  height: var(--wheel-size);
  transform: translateX(-50%);
  will-change: filter;
  animation: wheel-pulse-glow 2.8s ease-in-out infinite;
}

.wheel-wrap::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 32, 0.28) 0%, rgba(255, 112, 0, 0.16) 50%, transparent 72%);
  filter: blur(calc(var(--wheel-size) * 0.035));
  opacity: 0.65;
  pointer-events: none;
  animation: wheel-aura 2.8s ease-in-out infinite;
}

.wheel-base,
.wheel-ring,
.wheel-img,
.wheel-rotor,
.wheel-labels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wheel-base {
  z-index: 0;
}

.wheel-base,
.wheel-ring {
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 300ms ease;
}

.wheel-wrap:hover .wheel-base,
.wheel-wrap:hover .wheel-ring {
  transform: scale(1.012);
  filter: brightness(1.06);
}

.wheel-wrap.spinning {
  animation: wheel-spin-glow 700ms ease-in-out infinite;
}

.wheel-wrap.spinning::before {
  animation-duration: 700ms;
  opacity: 0.9;
}

.wheel-rotor {
  z-index: 1;
  will-change: transform;
  transform-origin: 50% 50%;
}

.wheel-img {
  object-fit: contain;
}

.wheel-labels {
  pointer-events: none;
}

.wheel-ring {
  z-index: 2;
  pointer-events: none;
}

.sector {
  --angle: 0deg;
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: 17%;
  height: 10%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1em;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(var(--wheel-size) * -0.22));
  transform-origin: 50% 50%;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
}

.sector strong {
  font-size: calc(var(--wheel-size) * 0.0384);
  line-height: 1;
}

.sector span {
  font-size: calc(var(--wheel-size) * 0.0115);
  font-weight: 700;
  line-height: 1.05;
}

.sector--0 { --angle: 0deg; }
.sector--1 { --angle: 45deg; }
.sector--2 { --angle: 90deg; }
.sector--3 { --angle: 135deg; }
.sector--4 { --angle: 180deg; }
.sector--5 { --angle: 225deg; }
.sector--6 { --angle: 270deg; }
.sector--7 { --angle: 315deg; }

.spin-btn {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: 20.76%;
  height: 20.76%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: filter 180ms ease, transform 180ms ease;
}

.spin-btn img {
  width: 100%;
  height: 100%;
  animation: spin-button-breathe 2.2s ease-in-out infinite;
}

.spin-btn:hover:not(:disabled) {
  filter: brightness(1.08) drop-shadow(0 0 12px #ff8c00);
  transform: translate(-50%, -50%) scale(1.05);
}

.spin-btn:disabled {
  cursor: wait;
  filter: saturate(0.7);
}

.popup-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(25, 7, 47, 0.75);
  opacity: 0;
  backdrop-filter: blur(8px);
  transition: opacity 250ms ease;
}

.popup-overlay[hidden] {
  display: none;
}

.popup-overlay.is-visible {
  opacity: 1;
}

.popup-shell {
  position: relative;
  width: min(78vw, 860px);
  height: min(90svh, 828px);
}

.popup-money {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.popup {
  position: absolute;
  z-index: 1;
  top: 8.3%;
  left: 50%;
  width: min(59.1%, 508px);
  aspect-ratio: 632 / 781;
  overflow: hidden;
  border-radius: 32px;
  background: var(--panel);
  box-shadow: 0 0 40px rgba(255, 180, 114, 0.75);
  transform: translateX(-50%);
}

.popup-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.popup-inner {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  padding: 7% 8% 8%;
}

.popup-congrats {
  color: var(--orange);
  font-size: clamp(12px, 1.3vw, 15px);
  font-weight: 700;
}

.popup-title {
  margin-top: 2.5%;
  font-size: clamp(24px, 1.65vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.popup-prizes {
  display: flex;
  width: 100%;
  gap: 4%;
  justify-content: center;
  margin-top: 8%;
}

.popup-prize {
  position: relative;
  flex: 1;
  height: min(28vh, 260px);
  max-width: 195px;
  overflow: hidden;
  border: 1px solid var(--orange);
  border-radius: 32px;
  background: linear-gradient(215deg, #12161f 4%, #2b0542 52%);
  text-align: center;
}

.popup-prizes.is-single .popup-prize {
  flex: 0 0 220px;
  max-width: 220px;
}

.popup-prize strong,
.popup-prize span {
  position: relative;
  z-index: 2;
  display: block;
}

.popup-prize strong {
  margin-top: 8%;
  font-size: clamp(25px, 1.7vw, 32px);
  line-height: 1;
}

.popup-prize span {
  margin-top: 1%;
  font-family: Arial, sans-serif;
  font-size: clamp(12px, 0.75vw, 14px);
}

.popup-prize img {
  position: absolute;
  left: 50%;
  bottom: 2%;
  width: 78%;
  height: 62%;
  object-fit: contain;
  transform: translateX(-50%);
}

.popup-claim {
  display: grid;
  width: 72%;
  min-height: 58px;
  margin-top: auto;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(175deg, var(--orange), var(--orange-dark));
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: filter 150ms ease, transform 150ms ease;
}

.popup-claim:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

@keyframes wheel-pulse-glow {
  0%, 100% {
    filter: drop-shadow(0 8px 12px rgba(50, 0, 0, 0.28)) drop-shadow(0 0 10px rgba(255, 160, 0, 0.25));
  }
  50% {
    filter: drop-shadow(0 10px 16px rgba(50, 0, 0, 0.3)) drop-shadow(0 0 28px rgba(255, 190, 35, 0.72));
  }
}

@keyframes preloader-logo-pulse {
  0%, 100% {
    opacity: 0.78;
    transform: scale(0.985);
  }
  50% {
    opacity: 1;
    transform: scale(1.025);
  }
}

@keyframes preloader-progress {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(340%);
  }
}

@keyframes wheel-spin-glow {
  0%, 100% {
    filter: drop-shadow(0 0 18px rgba(255, 135, 0, 0.55));
  }
  50% {
    filter: drop-shadow(0 0 38px rgba(255, 218, 70, 0.95));
  }
}

@keyframes wheel-aura {
  0%, 100% {
    opacity: 0.48;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.045);
  }
}

@keyframes spin-button-breathe {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.055) rotate(5deg);
    filter: brightness(1.12) drop-shadow(0 0 8px rgba(255, 100, 0, 0.75));
  }
}

@keyframes character-alive {
  0%, 100% {
    transform: translateY(0) rotate(0deg) scale(1);
    filter: drop-shadow(0 0 0 rgba(183, 83, 255, 0));
  }
  35% {
    transform: translateY(-5px) rotate(-0.18deg) scale(1.006);
    filter: drop-shadow(-5px 8px 14px rgba(112, 28, 170, 0.18));
  }
  68% {
    transform: translateY(2px) rotate(0.12deg) scale(1.012);
    filter: drop-shadow(-8px 10px 20px rgba(183, 83, 255, 0.24));
  }
}

@keyframes gift-spark-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.35) rotate(0deg);
  }
  12% {
    opacity: 1;
  }
  62% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), calc(var(--rise) * -1), 0) scale(0.05) rotate(180deg);
  }
}

@keyframes popup-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.94); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.popup-overlay.is-visible .popup {
  animation: popup-in 380ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@media (max-width: 767px) {
  :root {
    --wheel-size: min(172vw, 680px);
  }

  .scene {
    min-height: 600px;
  }

  .background {
    object-position: center top;
  }

  .character {
    top: 1.3%;
    right: -13.7%;
    width: 73.1%;
    height: auto;
    max-width: none;
  }

  .gifts-center {
    display: none;
  }

  .gifts {
    z-index: 8;
    left: 50%;
    bottom: -1%;
    width: 116%;
    height: auto;
    transform: translateX(-50%);
  }

  .gift-particle:nth-child(n+15) {
    display: none;
  }

  .content {
    z-index: 9;
    width: 100%;
  }

  .logo {
    top: 3.1%;
    left: 6.7%;
    width: 33.1%;
  }

  .main-title {
    top: 11.9%;
    left: 6.7%;
    font-size: clamp(28px, 8.9vw, 36px);
    line-height: 1.18;
  }

  html[lang="uz"] .main-title,
  html[lang="kk"] .main-title {
    font-size: clamp(24px, 7.2vw, 30px);
  }

  html[lang="tg"] .main-title {
    font-size: clamp(26px, 7.8vw, 32px);
  }

  .bonus-cards {
    display: none;
  }

  .attempts {
    top: calc(38.5% - 34px);
    bottom: auto;
    left: 6.1%;
    width: 134px;
    height: 46px;
    padding: 5px 7px;
    border-radius: 24px;
  }

  .attempts-dot {
    flex-basis: 36px;
    height: 36px;
    border-radius: 14px;
    font-size: 18px;
  }

  .attempts-label {
    margin-left: 7px;
    font-size: 11px;
  }

  .wheel-wrap {
    z-index: 7;
    top: 38.5%;
    left: 50%;
  }

  .sector strong {
    font-size: calc(var(--wheel-size) * 0.0384);
  }

  .sector span {
    font-size: calc(var(--wheel-size) * 0.0115);
  }

  .popup-shell {
    width: 100vw;
    height: 100svh;
  }

  .popup-money {
    width: 130%;
    left: -15%;
  }

  .popup {
    top: 50%;
    width: min(88vw, 430px);
    max-height: 82svh;
    border-radius: 24px;
    transform: translate(-50%, -50%);
  }

  .popup-inner {
    padding: 8% 6% 7%;
  }

  .popup-title {
    font-size: clamp(21px, 6vw, 30px);
  }

  .popup-prize {
    height: min(42vw, 230px);
    border-radius: 20px;
  }

  .popup-prize strong {
    font-size: clamp(21px, 6vw, 30px);
  }

  .popup-prize span,
  .popup-claim {
    font-size: 12px;
  }

  .popup-claim {
    height: 48px;
  }

  @keyframes popup-in {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 20px)) scale(0.94); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .character,
  .popup-overlay.is-visible .popup,
  .wheel-wrap,
  .wheel-wrap::before,
  .spin-btn img,
  .gift-particle,
  .preloader-logo,
  .preloader-track span {
    animation: none;
  }

  .gift-particles {
    display: none;
  }
}
