@import url("https://fonts.googleapis.com/css2?family=Girassol&display=swap");

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.text {
  color: #ffffff;
}

.deal-wheel {
  width: max-content;
  /* --size: clamp(250px, 80vmin, 700px); */
  --size: clamp(250px, 80vmin, 870px);
  --lg-hs: 0 3%;
  --lg-stop: 50%;
  --lg: linear-gradient(
    hsl(43.14deg 60.17% 55.94%) 0 var(--lg-stop),
    hsl(42.77deg 100% 63.14%) var(--lg-stop) 100%
  );
  position: relative;
  display: grid;
  grid-gap: calc(var(--size) / 20);
  align-items: center;
  grid-template-areas:
    "spinner"
    "trigger";
  font-family: "Girassol", sans-serif;
  font-size: calc(var(--size) / 21);
  line-height: 1;
  text-transform: lowercase;
  /* justify-items: center; */
}

.deal-wheel > * {
  grid-area: spinner;
}

.deal-wheel .btn-spin {
  grid-area: trigger;
  justify-self: center;
}

.spinner {
  padding-left: 0px;
  position: relative;
  display: grid;
  align-items: center;
  grid-template-areas: "spinner";
  width: var(--size);
  height: var(--size);
  /* transform: rotate(calc(var(--rotate, 25) * 1deg)); */
  transform: rotate(calc(var(--rotate, 20) * 1deg));
  border-radius: 50%;
  box-shadow: inset 0 0 0 calc(var(--size) / 40) hsl(0deg 0% 0% / 17%);
  border: 12px solid #61328c;
}

.spinner * {
  grid-area: spinner;
}

.prize {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 calc(var(--size) / 6) 0 calc(var(--size) / 20);
  width: 50%;
  height: 50%;
  transform-origin: center right;
  transform: rotate(var(--rotate));
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.cap {
  --cap-size: calc(var(--size) / 4);
  position: relative;
  justify-self: center;
  width: var(--cap-size);
  height: var(--cap-size);
}

/* Hide select dropdown from SVG import file */
.cap select {
  display: none;
}

.cap svg {
  width: 100%;
}

.ticker {
  position: fixed;
  margin-left: -39px !important;
  top: 42%;
  /* position: absolute; */
  /* margin: auto; */
  /* left: calc(var(--size) / -15); */
  width: calc(var(--size) / 8);
  height: calc(var(--size) / 13);
  background: var(--lg);
  z-index: 1;
  -webkit-clip-path: polygon(20% 0, 100% 50%, 20% 100%, 0% 50%);
  clip-path: polygon(20% 0, 100% 50%, 20% 100%, 0% 50%);
  transform-origin: center left;
  display: flex;
  align-items: center;
}

.btn-spin {
  /* width: 300px;
  height: 70px; */
  width: 300px;
  height: 100px;
  margin-top: 18px;
  color: rgb(70 28 28); /* background: var(--lg); */
  background: linear-gradient(
    90deg,
    rgb(254 231 92) 0%,
    rgb(255 211 77) 50%,
    rgb(254 198 65) 100%
  );
  border: 3px solid #bd7d41;
  /* font-family: inherit; */
  font-size: 40px;
  line-height: inherit;
  text-transform: inherit;
  /* padding: 0.9rem 2rem 1rem; */
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 200ms ease-out;
  font-family: "Anton SC", sans-serif !important;
}

.btn-spin:focus {
  outline-offset: 2px;
}

.btn-spin:active {
  transform: translateY(1px);
}

.btn-spin:disabled {
  cursor: progress;
  opacity: 0;
}

/* Spinning animation */
.is-spinning .spinner {
  transition: transform 8s cubic-bezier(0.1, -0.01, 0, 1);
}

.is-spinning .ticker {
  -webkit-animation: tick 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: tick 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@-webkit-keyframes tick {
  40% {
    transform: rotate(-12deg);
  }
}

@keyframes tick {
  40% {
    transform: rotate(-12deg);
  }
}

/* Selected prize animation */
.prize.selected .text {
  color: white;
  -webkit-animation: selected 800ms ease;
  animation: selected 800ms ease;
}

@-webkit-keyframes selected {
  25% {
    transform: scale(1.25);
    text-shadow: 1vmin 1vmin 0 hsla(0 0% 0% / 0.1);
  }
  40% {
    transform: scale(0.92);
    text-shadow: 0 0 0 hsla(0 0% 0% / 0.2);
  }
  60% {
    transform: scale(1.02);
    text-shadow: 0.5vmin 0.5vmin 0 hsla(0 0% 0% / 0.1);
  }
  75% {
    transform: scale(0.98);
  }
  85% {
    transform: scale(1);
  }
}

@keyframes selected {
  25% {
    transform: scale(1.25);
    text-shadow: 1vmin 1vmin 0 hsla(0 0% 0% / 0.1);
  }
  40% {
    transform: scale(0.92);
    text-shadow: 0 0 0 hsla(0 0% 0% / 0.2);
  }
  60% {
    transform: scale(1.02);
    text-shadow: 0.5vmin 0.5vmin 0 hsla(0 0% 0% / 0.1);
  }
  75% {
    transform: scale(0.98);
  }
  85% {
    transform: scale(1);
  }
}

.prize-image {
  /* width: 85px; */
  width: 120px;
  display: block;
  /* margin: 0 auto 5px; */
  margin: 0 auto 5px 0;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.emoji {
  display: inline-block;
  animation: bounce 0.5s infinite;
  font-size: 1.2em;
  margin-left: 5px;
}

[data-reaction="dancing"] .emoji {
  animation: bounce 0.5s infinite;
}

[data-reaction="shocked"] .emoji {
  animation: spin 1s infinite linear;
}

[data-reaction="laughing"] .emoji {
  animation: bounce 0.7s infinite;
}
.prize-image {
  /* width: 85px; */
  width: 110px;
  display: block;
  /* margin: 0 auto 5px; */
  margin: 0 auto 5px 0;
}
