*,
*::after,
*::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
img {
  display: block;
  width: 100%;
  height: auto;
}

.page {
  position: relative;
  background-image: url(./img/bg.png);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.wrapper {
  position: relative;
  display: grid;
  grid-template: auto auto auto/ 1fr 1fr;
  text-align: center;
  height: 100%;
  z-index: 5;
  width: 100%;
  max-width: 1350px;
  padding: 20px;
  align-items: center;
}

.wheel {
  grid-row: 1/4;
  position: relative;
  align-self: center;
  width: 100%;
  max-width: 590px;
  justify-self: center;
  animation: wheelEntry 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes wheelEntry {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.wheel__inside {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.wheel__part {
  pointer-events: none;
  user-select: none;
}

.wheel__outer {
  position: relative;
  z-index: 2;
  width: 100%;
}

.wheel__inner {
  position: absolute;
  top: 5%;
  left: 5%;
  z-index: 1;
  width: 90%;
  transition: transform 4s cubic-bezier(0.2, 0.8, 0.1, 1);
}

.logo {
  grid-column: 2/3;
  max-width: 640px;
  align-self: center;
  width: 95%;
  justify-self: center;
  animation: scaling 4s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

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

.title {
  grid-column: 2/3;
  font-family: Inter, sans-serif;
  font-size: 48px;
  font-weight: 800;
  font-style: italic;
  color: white;
  -webkit-text-stroke: 2px #264265;
  text-shadow: 0px 4px 15px #264265;
  paint-order: stroke fill;
  text-align: center;
  line-height: 1.1;
  margin: 15px 0;
}

.button {
  grid-column: 2/3;
  max-width: 374px;
  align-self: center;
  min-width: 134px;
  justify-self: center;
  cursor: pointer;
  border: none;
  outline: none;
  border-radius: 100px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(61, 92, 0, 0.4);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.button:hover {
  transform: translateY(-3px) scale(1.02);
}

.button:active {
  transform: scale(0.98);
}

.button__main-bg {
  background-color: #3d5c00;
  border: 12px solid #3d5c00;
  border-radius: 100px;
}

.button__gradient-bg-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 100px;
  border: 9px solid transparent;
}

.button__gradient-bg {
  position: absolute;
  width: 200%;
  height: 500%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from 0deg,
    #8aca0c 0%,
    #ffffff 50%,
    rgba(170, 217, 79, 1) 100%
  );
  animation: gradientMove 5s linear infinite;
}

@keyframes gradientMove {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.button__inner {
  position: relative;
  background-color: #88aa45;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 25px 20px;
  border-radius: 100px;
  overflow: hidden;
}

.button__inner-shadow-box {
  z-index: 5;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 100px;
  width: 100%;
  height: 100%;
  box-shadow: inset 0px 0px 20px #201047, 0px 0px 20px rgba(32, 16, 71, 0.696);
}

.button__inner-shadow {
  position: absolute;
  top: 60%;
  left: 0;
  width: 100%;
  height: 150%;
  background: radial-gradient(
    #9de5ff 0%,
    rgba(157, 229, 255, 0.732) 45%,
    transparent 72%
  );
  transform: translateY(-50%);
  animation: blurTopDown 7s ease-in-out infinite;
}

@keyframes blurTopDown {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(15%);
  }
}

.button__decor {
  max-width: 66px;
  max-height: 66px;
  animation: wheelSpin 5s linear infinite;
}

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

.button__text {
  font-size: 32px;
  font-family: sans-serif;
  font-weight: 800;
  font-style: italic;
  color: white;
  line-height: 39px;
  animation: textTopDown 5s ease infinite;
}

@keyframes textTopDown {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-5%);
  }
  50% {
    transform: translateY(0);
  }
  75% {
    transform: translateY(-5%);
  }
}

.decoration {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: -1;
}

.decorations__top {
  top: -15%;
  left: -5%;
  width: 45%;
  animation: topdown 3s ease-in-out infinite;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.15));
}

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

.decorations-wrapper {
  z-index: 1;
  overflow: hidden;
  position: absolute;
  bottom: 0;
  left: 0;
  height: 50%;
  width: 100%;
  pointer-events: none;
}
.decorations__bottom {
  bottom: -5%;
  max-width: 1440px;
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  animation: downtop 3s ease-in-out infinite;
  filter: drop-shadow(0 -10px 15px rgba(0,0,0,0.15));
}

@keyframes downtop {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(12px);
  }
}

/* BACKDROP */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

/* POPUP */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  z-index: 100;
  display: none;
  opacity: 0;
  flex-direction: column;
  align-items: center;
  width: 90%;
  max-width: 540px;
  background-color: #ffffff;
  border: #88aa45 solid 20px;
  border-radius: 90px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), inset 0px 0px 20px rgba(0, 0, 0, 0.25);
  padding: 35px 30px;
  font-family: Inter, sans-serif;
  text-align: center;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.popup.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.popup__header {
  width: 80%;
  max-width: 320px;
  margin: 0 auto;
  margin-bottom: 15px;
}

.popup__icon {
  width: 90px;
  margin: 0 auto 15px auto;
  animation: scaling 3s ease-in-out infinite;
}

.title_popup {
  font-size: 38px;
  color: #88aa45;
  -webkit-text-stroke: 0px;
  text-shadow: none;
  margin: 10px 0 20px 0;
  font-weight: 800;
}

.popup__code {
  color: #1c4367c2;
  position: relative;
  margin: 15px 0 35px 0;
  padding: 10px 58px 10px 24px;
  font-size: 38px;
  font-weight: 600;
  line-height: 48px;
  font-style: italic;
  border: 2px dashed #000000;
  border-radius: 40px;
  cursor: pointer;
  background-color: #fafdf5;
  transition: background-color 0.2s ease, transform 0.1s ease;
  user-select: none;
}

.popup__code:hover {
  background-color: #f2f9e8;
  transform: scale(1.02);
}

.popup__code::before {
  position: absolute;
  text-align: center;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  content: "Enter during registration";
  font-size: 13px;
  font-weight: 400;
  color: #666;
  font-style: normal;
}

.popup__code::after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 24px;
  width: 22px;
  height: 22px;
  background-image: url(./img/copyIcon.svg);
  background-repeat: no-repeat;
  background-size: contain;
  content: "";
}

.popup__link {
  display: block;
  width: 80%;
  text-decoration: none;
  margin-top: 10px;
}

.popup-button {
  display: block;
  margin: 0 auto;
  width: 100%;
  cursor: pointer;
  border: none;
  outline: none;
  border-radius: 100px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(136, 170, 69, 0.4);
}

.popup-button__inner {
  position: relative;
  background-color: #88aa45;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 20px;
  border-radius: 100px;
  overflow: hidden;
}

.popup-button__decor {
  position: absolute;
  left: 15px;
  top: 0;
  width: 50px;
  height: 100%;
}

.popup-button__spark {
  position: absolute;
}
.popup-button__spark path {
  animation: sparkColor 6s ease infinite;
}

.popup-button__spark_one {
  top: 18px;
  left: 5px;
  width: 10px;
  height: 10px;
  animation: sparkOne 3s ease infinite;
}

.popup-button__spark_two {
  top: 22px;
  left: 20px;
  width: 15px;
  height: 18px;
  animation: sparks 3s ease 1s infinite;
}

.popup-button__spark_three {
  top: 32px;
  left: 10px;
  width: 13px;
  height: 13px;
  animation: sparks 5s ease 3s infinite;
}

@keyframes sparkOne {
  0%, 100% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.3) translate(2px, -2px); }
}

@keyframes sparks {
  0%, 100% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.5) translate(4px, 2px); }
}

@keyframes sparkColor {
  0%, 100% { fill: #bce765; }
  50% { fill: #ffffff; }
}

.popup-button__text {
  font-size: 24px;
  font-family: sans-serif;
  font-weight: 800;
  color: white;
  line-height: 29px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

/* TOAST COPY CODE BUBBLE */
.msg {
  position: absolute;
  transform: translateX(-50%);
  background-color: #88aa45;
  color: white;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  bottom: 110%;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  font-style: normal;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.msg.show {
  opacity: 1;
  bottom: 125%;
}

/* RESPONSIVE DESIGN */
@media screen and (max-width: 996px) {
  .title {
    font-size: 38px;
  }
  .button {
    width: 75%;
  }
  .button__inner {
    padding: 20px 5px;
  }
  .button__text {
    font-size: 25px;
    line-height: 28px;
  }
}

@media screen and (max-width: 768px) {
  .page {
    background-image: url(./img/bg-mobi.png);
  }
  
  .wrapper {
    grid-template: auto auto auto auto / 1fr;
    padding: 20px 10px;
    row-gap: 20px;
  }

  .logo {
    grid-column: 1/2;
    grid-row: 1/2;
    max-width: 320px;
  }

  .wheel {
    grid-row: 2/3;
    grid-column: 1/2;
    max-width: 440px;
    overflow: visible;
  }

  .title {
    grid-column: 1/2;
    grid-row: 3/4;
    margin: 10px 0;
    font-size: 32px;
  }

  .button {
    grid-column: 1/2;
    grid-row: 4/5;
    width: 75%;
  }

  .popup {
    max-width: 95%;
    padding: 25px 20px;
    border-radius: 60px;
    border-width: 15px;
  }

  .popup__code {
    font-size: 28px;
    margin: 15px 0 30px 0;
  }

  .decorations__top {
    width: 90%;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    animation: topdownMobile 3s ease-in-out infinite;
  }

  @keyframes topdownMobile {
    0%, 100% {
      transform: translateX(-50%) translateY(0);
    }
    50% {
      transform: translateX(-50%) translateY(-10px);
    }
  }
}

@media screen and (max-width: 576px) {
  .title {
    font-size: 24px;
  }
  .button__decor {
    width: 50px;
    height: 50px;
  }
  .button__text {
    font-size: 21px;
  }
  .popup {
    border-radius: 45px;
    border-width: 12px;
    padding: 20px 15px;
  }
  .popup__code {
    font-size: 22px;
    line-height: 29px;
  }
  .popup__code::before {
    font-size: 11px;
  }
  .popup__link {
    width: 95%;
  }
  .popup-button__inner {
    padding: 16px 15px;
  }
  .popup-button__text {
    font-size: 20px;
  }
}

@media screen and (max-width: 360px) {
  .button {
    width: 90%;
  }
  .popup {
    border-radius: 35px;
    border-width: 8px;
    padding: 15px 10px;
  }
  .popup-button__text {
    font-size: 18px;
  }
  .popup-button__decor {
    display: none;
  }
}
