:root {
  --yellow: #FDEE20;
  --gold: #FDB91C;
  --purple: #23072F;
  --wheel: min(58vw, calc(100dvh - 300px), 600px);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Poppins", Arial, sans-serif;
  background: var(--purple);
}

button {
  font: inherit;
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--purple);
}

.game-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("images/background.jpg") center/cover no-repeat;
  opacity: 0.4;
}

.shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(
    90deg,
    #23072fdd,
    #23072f55 35%,
    #23072f55 65%,
    #23072fdd
  );
}

/* TOP LOGO */

header {
  position: fixed;
  z-index: 9;
  top: 8px;
  left: 50%;
  width: min(220px, 30vw);
  transform: translateX(-50%);
  text-align: center;
}

header img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 7px 7px #0009);
}

/* GAME */

.game {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 95px 8px 42px;
}

.wolf {
  position: relative;
  z-index: 6;
  flex: none;
  width: auto;
  height: clamp(68px, 13dvh, 125px);
  margin-bottom: -24px;
  filter: drop-shadow(0 7px 10px #0009);
}

.wheel-stage {
  position: relative;
  flex: none;
  width: var(--wheel);
  height: var(--wheel);
  filter: drop-shadow(0 14px 13px #000b);
}

.pointer {
  position: absolute;
  z-index: 8;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  border-top: 40px solid var(--yellow);
  border-right: 17px solid transparent;
  border-left: 17px solid transparent;
  filter: drop-shadow(0 2px var(--purple));
}

/* WHEEL */

.wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border: 11px solid var(--purple);
  border-radius: 50%;
  outline: 5px solid var(--gold);
  background: conic-gradient(
    var(--purple) 0deg 36deg,
    var(--gold) 36deg 72deg,
    var(--purple) 72deg 108deg,
    var(--gold) 108deg 144deg,
    var(--purple) 144deg 180deg,
    var(--gold) 180deg 216deg,
    var(--purple) 216deg 252deg,
    var(--gold) 252deg 288deg,
    var(--purple) 288deg 324deg,
    var(--gold) 324deg 360deg
  );
  box-shadow:
    inset 0 0 0 5px var(--yellow),
    0 0 0 8px #16021f;
  transition: transform 4.4s cubic-bezier(0.13, 0.65, 0.08, 1);
}

.wheel span {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 39%;
  height: 44px;
  font: 900 clamp(8px, calc(var(--wheel) * 0.025), 15px) / 1.04
    "Poppins", Arial, sans-serif;
  text-align: center;
  transform-origin: left center;
  transform:
    translateY(-50%)
    rotate(calc(var(--i) * 36deg - 72deg))
    translateX(22%);
}

.wheel span b {
  display: block;
  width: 100%;
}

.wheel span:nth-of-type(odd) b {
  color: var(--yellow);
}

.wheel span:nth-of-type(even) b {
  color: var(--purple);
}

.wheel span::after {
  content: "";
  position: absolute;
  right: 0;
  width: clamp(8px, 2.2%, 13px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff9a7;
  box-shadow:
    0 0 8px var(--yellow),
    0 0 14px var(--gold);
}

/* CENTER BZ LOGO */

.hub {
  position: absolute;
  z-index: 5;
  inset: 38%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  overflow: hidden;
  border: 5px solid var(--yellow);
  border-radius: 50%;
  background: var(--purple);
  box-shadow: inset 0 0 20px #120018;
}

.hub > img {
  position: static;
  display: block;
  width: 80%;
  height: 80%;
  max-width: 80%;
  max-height: 80%;
  margin: 0;
  object-fit: contain;
  transform: none;
  animation: none;
}

/* STATUS AND SPIN BUTTON */

#status {
  flex: none;
  margin: clamp(9px, 1.5dvh, 15px) 0 clamp(12px, 2dvh, 20px);
  color: var(--yellow);
  font-size: clamp(11px, 1.4vw, 17px);
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 2px 3px #000;
}

#start {
  flex: none;
  min-width: 185px;
  padding: 8px 28px;
  border: 3px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(#704a25, #3a241e);
  box-shadow:
    inset 0 0 0 2px #8f642c,
    0 0 12px #fdb91c99,
    0 5px 0 var(--purple);
  color: var(--yellow);
  font-size: clamp(19px, 2vw, 26px);
  font-weight: 900;
  cursor: pointer;
}

#start:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
}

/* HIDDEN POPUPS */

#bonus[hidden],
.modal[hidden] {
  display: none !important;
}

/* REWARD SCREEN */

.modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(42px, 7dvh, 65px);
  padding: 20px 14px;
  overflow-y: auto;
  background: rgba(6, 2, 10, 0.84);
  backdrop-filter: blur(4px);
}

/* PUSH NOTIFICATION POPUP */

#bonus {
  position: relative;
  z-index: 1002;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: min(430px, calc(100vw - 28px));
  min-height: 68px;
  padding: 12px 42px 12px 16px;
  flex-shrink: 0;
  border: 2px solid var(--gold);
  border-radius: 16px;
  background: var(--purple);
  box-shadow:
    0 10px 28px #000b,
    0 0 16px #fdb91c66;
  color: #fff;
  pointer-events: auto;
}

#bonus .gift {
  font-size: 28px;
}

#bonus strong {
  font-size: clamp(14px, 3.5vw, 18px);
  font-weight: 900;
  line-height: 1.1;
}

#yes {
  position: relative;
  z-index: 1003;
  min-width: 72px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 4px var(--gold);
  color: var(--purple);
  font-weight: 900;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

#yes:hover {
  filter: brightness(1.08);
}

#yes:active {
  transform: translateY(3px);
  box-shadow: 0 1px var(--gold);
}

#close {
  position: absolute;
  z-index: 1003;
  top: 2px;
  right: 8px;
  padding: 2px 5px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

/* REWARD CARD */

.reward-card {
  position: relative;
  z-index: 1001;
  width: min(430px, calc(100vw - 28px));
  padding: 88px 25px 28px;
  flex-shrink: 0;
  border: 4px solid var(--yellow);
  border-radius: 26px;
  text-align: center;
  background: linear-gradient(160deg, #3b0b50, #190221);
  box-shadow: 0 22px 60px #000c;
  color: #fff;
}

.reward-card img {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(230px, 60vw);
  transform: translate(-50%, -45%);
  filter: drop-shadow(0 9px 8px #0008);
  animation: float 2.4s ease-in-out infinite;
  pointer-events: none;
}

.reward-card small {
  color: var(--yellow);
  font-weight: 800;
  letter-spacing: 3px;
}

.reward-card h2 {
  margin: 12px 0 22px;
  font-size: clamp(24px, 6vw, 38px);
  line-height: 1.05;
}

.reward-card button {
  border: 3px solid var(--gold);
  border-radius: 999px;
  padding: 13px 21px;
  background: linear-gradient(#704a25, #3a241e);
  box-shadow: 0 5px var(--purple);
  color: var(--yellow);
  font-weight: 900;
  font-size: 17px;
  cursor: pointer;
  touch-action: manipulation;
}

@keyframes float {
  50% {
    transform: translate(-50%, -52%) rotate(-2deg);
  }
}

/* FOOTER */

footer {
  position: fixed;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 7px 10px;
  text-align: center;
  background: #23072fe8;
  color: #fff;
  font-size: clamp(8px, 1.2vw, 11px);
}

/* TABLETS */

@media (max-width: 850px) {
  :root {
    --wheel: min(92vw, calc(100dvh - 270px), 460px);
  }

  header {
    top: 5px;
    width: min(165px, 43vw);
  }

  .game {
    padding: 82px 5px 35px;
  }

  .wolf {
    height: clamp(58px, 10dvh, 88px);
    margin-bottom: -18px;
  }

  .wheel span {
    font-size: clamp(7px, 2.25vw, 11px);
  }

  #status {
    margin: 9px 0 12px;
    letter-spacing: 1px;
  }

  #start {
    min-width: 165px;
    padding: 7px 22px;
    font-size: clamp(18px, 5vw, 23px);
  }

  footer {
    padding: 5px;
  }
}

/* SHORT DESKTOP SCREENS */

@media (max-height: 650px) and (min-width: 851px) {
  :root {
    --wheel: min(42vw, calc(100dvh - 225px), 390px);
  }

  header {
    width: 145px;
  }

  .game {
    padding: 68px 5px 30px;
  }

  .wolf {
    height: 64px;
    margin-bottom: -15px;
  }

  #status {
    margin: 6px 0 9px;
  }

  .modal {
    justify-content: flex-start;
    gap: 42px;
    padding-top: 12px;
  }

  #bonus {
    min-height: 58px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .reward-card {
    padding-top: 65px;
    padding-bottom: 18px;
  }

  .reward-card img {
    width: 165px;
  }

  .reward-card h2 {
    margin: 8px 0 13px;
    font-size: 25px;
  }
}

/* MOBILE */

@media (max-width: 430px) {
  :root {
    --wheel: min(94vw, calc(100dvh - 255px), 410px);
  }

  header {
    width: 135px;
  }

  .game {
    padding-top: 70px;
  }

  .wolf {
    height: 64px;
  }

  .wheel {
    border-width: 8px;
    outline-width: 3px;
    box-shadow:
      inset 0 0 0 3px var(--yellow),
      0 0 0 6px #16021f;
  }

  .hub {
    border-width: 3px;
  }

  .wheel span {
    height: 34px;
    font-size: clamp(6.5px, 2.1vw, 9px);
  }

  .wheel span::after {
    width: 8px;
  }

  .modal {
    gap: 46px;
    padding: 14px;
  }

  #bonus {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    min-height: 60px;
    padding: 9px 38px 9px 11px;
  }

  #bonus .gift {
    font-size: 23px;
  }

  #yes {
    min-width: 60px;
    padding: 8px 13px;
  }

  .reward-card {
    padding: 70px 16px 22px;
  }

  .reward-card img {
    width: min(185px, 53vw);
  }

  .reward-card small {
    font-size: 11px;
    letter-spacing: 2px;
  }

  .reward-card h2 {
    margin: 10px 0 17px;
    font-size: clamp(22px, 7vw, 30px);
  }

  .reward-card button {
    padding: 11px 16px;
    font-size: 14px;
  }
}

/* VERY SHORT MOBILE SCREENS */

@media (max-width: 430px) and (max-height: 700px) {
  .modal {
    justify-content: flex-start;
    gap: 36px;
    padding-top: 10px;
  }

  #bonus {
    min-height: 54px;
  }

  .reward-card {
    padding-top: 57px;
    padding-bottom: 15px;
  }

  .reward-card img {
    width: 145px;
  }

  .reward-card h2 {
    margin: 7px 0 12px;
    font-size: 22px;
  }
}


#install-app {
  display: block;
  width: fit-content;
  margin: 18px auto 0;
  padding: 11px 26px;
  border: 3px solid #FDB91C;
  border-radius: 999px;
  background: #23072F;
  box-shadow:
    0 4px 0 #FDB91C,
    0 0 16px #FDEE2088;
  color: #FDEE20;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

#install-app[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  #install-app {
    margin-top: 14px;
    padding: 9px 16px;
    font-size: 13px;
  }
}