* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;

  display: flex;
  justify-content: center;
  align-items: center;

  font-family: "Lato", sans-serif;

  background:
    radial-gradient(
      circle at center,
      #ffffff 0%,
      #eeeeee 45%,
      #bdbdbd 100%
    );

  overflow-x: hidden;
}


/* =========================================
   PAGE
========================================= */

.page {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 20px;
}


/* =========================================
   WHEEL SECTION
========================================= */

.wheel-section {
  width: 100%;
  max-width: 720px;

  display: flex;
  flex-direction: column;
  align-items: center;

  position: relative;
}


/* =========================================
   WHEEL
========================================= */

#spin_the_wheel {
  position: relative;

  width: min(50vw, 500px);
  aspect-ratio: 1 / 1;

  display: flex;
  justify-content: center;
  align-items: center;
}


#wheel {
  display: block;

  width: 100%;
  height: 100%;

  border-radius: 50%;

  filter:
    drop-shadow(0 12px 20px rgba(0, 0, 0, 0.25));

  transform-origin: center center;
}


/* =========================================
   CENTER SPIN BUTTON
========================================= */

#spin {
  font-family: "Lato", sans-serif;
  font-size: clamp(15px, 3vw, 28px);
  font-weight: 900;

  user-select: none;
  cursor: pointer;

  position: absolute;

  top: 50%;
  left: 50%;

  width: 28%;
  aspect-ratio: 1 / 1;

  transform: translate(-50%, -50%);

  display: flex;
  justify-content: center;
  align-items: center;

  background: #ffffff;
  color: #333333;

  border-radius: 50%;

  box-shadow:
    0 0 0 7px currentColor,
    0 6px 18px rgba(0, 0, 0, 0.45);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.4s ease;

  z-index: 5;
}


#spin:hover {
  transform: translate(-50%, -50%) scale(1.06);
}


#spin:active {
  transform: translate(-50%, -50%) scale(0.95);
}


#spin::after {
  content: "";

  position: absolute;

  top: -16px;
  left: 50%;

  transform: translateX(-50%);

  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 18px solid currentColor;
}


/* =========================================
   MUSIC BUTTON
========================================= */

.music-toggle {
  position: absolute;

  right: 0;
  bottom: 50px;

  width: 48px;
  height: 48px;

  border: none;
  border-radius: 50%;

  background: #ffffff;

  font-size: 21px;

  cursor: pointer;

  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);

  transition: 0.2s ease;
}


.music-toggle:hover {
  transform: scale(1.08);
}


.music-toggle:active {
  transform: scale(0.95);
}


/* =========================================
   DEVELOPER CREDIT
========================================= */

.developer-credit {
  margin-top: 20px;

  font-size: 13px;
  color: #555;

  text-align: center;
}


.developer-credit strong {
  color: #222;
}


/* =========================================
   WINNER OVERLAY
========================================= */

.winner-overlay {
  position: fixed;

  inset: 0;

  width: 100%;
  height: 100%;

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 20px;

  background: rgba(0, 0, 0, 0.65);

  backdrop-filter: blur(8px);

  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;

  z-index: 9999;
}


.winner-overlay.active {
  opacity: 1;
  visibility: visible;
}


/* =========================================
   POPUP
========================================= */

.winner-popup {
  width: min(92vw, 470px);

  padding: 40px 25px 30px;

  position: relative;

  text-align: center;

  background: #ffffff;

  border-radius: 25px;

  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.4);

  transform: scale(0.6) translateY(30px);

  opacity: 0;

  transition:
    transform 0.5s cubic-bezier(.17,.67,.3,1.3),
    opacity 0.4s ease;
}


.winner-overlay.active .winner-popup {
  transform: scale(1) translateY(0);
  opacity: 1;
}


/* =========================================
   CLOSE
========================================= */

.close-popup {
  position: absolute;

  top: 12px;
  right: 15px;

  width: 36px;
  height: 36px;

  border: none;

  border-radius: 50%;

  background: #eeeeee;

  color: #333;

  font-size: 25px;

  cursor: pointer;

  line-height: 1;
}


/* =========================================
   CELEBRATION
========================================= */

.celebration-icon {
  font-size: clamp(55px, 12vw, 90px);

  animation: celebrationBounce 1s ease infinite;
}


@keyframes celebrationBounce {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-10px) rotate(-8deg);
  }

  75% {
    transform: translateY(-5px) rotate(8deg);
  }
}


.winner-small-title {
  margin-top: 5px;

  font-size: 14px;
  font-weight: 900;

  letter-spacing: 2px;

  color: #ff5a10;
}


.winner-popup h2 {
  margin-top: 5px;

  font-size: clamp(30px, 7vw, 48px);

  font-weight: 900;

  color: #222;
}


/* =========================================
   RESULT
========================================= */

.winner-result {
  margin: 20px auto;

  width: 100%;

  padding: 16px;

  border-radius: 15px;

  background:
    linear-gradient(
      135deg,
      #ffbc03,
      #ff5a10
    );

  color: #ffffff;

  box-shadow:
    0 8px 20px rgba(255, 90, 16, 0.3);
}


#winnerText {
  display: block;

  font-size: clamp(25px, 7vw, 42px);

  font-weight: 900;

  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2);
}


.winner-message {
  color: #666;

  font-size: 15px;

  margin-bottom: 22px;
}


/* =========================================
   SPIN AGAIN
========================================= */

.spin-again {
  width: 100%;

  border: none;

  padding: 15px 20px;

  border-radius: 12px;

  background: #222;

  color: #ffffff;

  font-family: inherit;

  font-size: 17px;

  font-weight: 900;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    background 0.2s ease;
}


.spin-again:hover {
  background: #ff5a10;

  transform: translateY(-2px);
}


.spin-again:active {
  transform: scale(0.97);
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {

  .page {
    padding: 15px;
  }


  #spin_the_wheel {
    width: min(92vw, 500px);
  }


  .music-toggle {
    position: fixed;

    right: 15px;
    bottom: 55px;

    width: 42px;
    height: 42px;

    font-size: 18px;
  }


  .developer-credit {
    margin-top: 15px;

    font-size: 11px;
  }


  .winner-popup {
    padding: 30px 20px 22px;

    border-radius: 20px;
  }

}


/* =========================================
   VERY SMALL MOBILE
========================================= */

@media (max-width: 360px) {

  #spin_the_wheel {
    width: 94vw;
  }


  #spin {
    box-shadow:
      0 0 0 5px currentColor,
      0 5px 12px rgba(0, 0, 0, 0.4);
  }


  .winner-popup {
    padding: 25px 16px 20px;
  }

}