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

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

body {
  display: flex;
  justify-content: center;
  background-color: #000;
}

.page-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 100%;
  background-image: url("../images/bg.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.page-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.55);
  z-index: 5;
}

/* Header Banner */
.header-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background-color: #0c130c;
  z-index: 1001;
}

.header-banner__left {
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-banner__logo {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.header-banner__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: "PingFang TC", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.1;
  color: #fff;
}

.header-banner__title {
  font-weight: 400;
}

.header-banner__subtitle {
  font-weight: 400;
}

.header-banner__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 4px;
  background: linear-gradient(to right, #2ced88, #9ee871);
  box-shadow: 0px 1.125px 0px 0px #1cca6a;
  font-family: "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

/* Wheel Section */
.wheel-section {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  z-index: 10;
}

.wheel-title {
  width: 100%;
  text-align: center;
}

.wheel-title img {
  width: 100%;
  height: auto;
  display: block;
}

.wheel-wrapper {
  position: relative;
  width: 100%;
  margin-top: -2%;
}

.wheel-bg {
  position: relative;
  left: -14px;
  width: 100%;
  height: auto;
  display: block;
}

.wheel-disc-area {
  position: absolute;
  top: 3%;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
}

.wheel-disc {
  width: 100%;
  height: auto;
  display: block;
  transition: none;
}

.wheel-disc.spinning {
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.spin-btn {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 23%;
  cursor: pointer;
  z-index: 5;
}

.spin-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.spin-btn:active {
  transform: translate(-50%, -50%) scale(0.9);
}

/* Congratulation Overlay */
.congrats-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.congrats-overlay.hidden {
  display: none;
}

.congrats-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
  padding: 0 10px;
  animation: modalPopup 0.4s ease-out forwards;
}

.congrats-img {
  width: 95%;
  max-width: 460px;
  height: auto;
  display: block;
}

.receive-btn {
  width: 38%;
  max-width: 180px;
  margin-top: 4%;
  cursor: pointer;
  animation: shake 1.5s ease-in-out infinite;
}

.receive-btn:hover {
  animation:
    shake 1.5s ease-in-out infinite,
    scaleUp 0.2s ease forwards;
}

.receive-btn:active {
  animation: none;
  transform: scale(0.95);
  opacity: 0.9;
}

.receive-btn img {
  width: 100%;
  height: auto;
  display: block;
}

/* Loading State */
.receive-btn.loading {
  pointer-events: none;
  animation: none;
  position: relative;
}

.receive-btn.loading img {
  opacity: 0.7;
}

.receive-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  margin-left: -12px;
  border: 3px solid #ffb400;
  border-top-color: #ff0400;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes modalPopup {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shake {
  0%,
  30%,
  100% {
    transform: translateY(0);
  }
  10% {
    transform: translateY(-6px);
  }
  20% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-3px);
  }
}

@keyframes scaleUp {
  to {
    transform: scale(1.05);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
