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

.container {
  background-color: black;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.background {
  width: 450px;
  height: 100vh;
  overflow: hidden;
}

img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.characters {
  position: absolute;
  top: 90%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 450px;
}

.characters img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wheel-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 450px;
  height: 100vh;
}

.wheel-frame {
  position: absolute;
  top: 50.2%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 343px;
  z-index: 1;
}

.wheel-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wheel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 210px; /* keep it square for smooth rotation */
}

/* the spinning image */
.wheel .wheel-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 50%;
  will-change: transform;
  backface-visibility: hidden;
  /* no transform transition, animation controls it */
}

/* spinning state */
.wheel .wheel-image.spinning {
  animation: spin 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* spin keyframes: only rotate, no translate */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(var(--spin-angle, 1800deg));
  }
}

.spin-button {
  position: absolute;
  bottom: -10%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.spin-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.spin-button:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

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

.message-container {
  position: fixed;
  inset: 0;
  display: none;           /* hidden by default */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.message-container.show {
  display: flex;
  opacity: 1;
}

.message-win {
  text-align: center;
  margin-bottom: 20px;
}

.message-win .message-image {
  width: 400px;
  height: auto;
  object-fit: contain;
}

.claim-button {
  margin-top: 20px;
  width: min(60vw, 360px);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.claim-button:hover {
  transform: scale(1.05);
}

.claim-button:active {
  transform: scale(0.95);
}

.claim-button img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ===== Mobile responsive tweaks (no desktop changes) ===== */
@media (max-width: 600px) {
  /* Fill the viewport neatly */
  .container {
    width: 100vw;
    height: 100vh;
  }

  .background {
    width: 100vw;
    height: 100vh;
  }

  /* Logo: slightly smaller and a bit higher */
  .logo {
    top: 12%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28vw;          /* responsive size */
    max-width: 140px;     /* safety cap */
  }

  .characters {
    top: 90%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;         /* use full width for character art */
    max-width: 450px;     /* don’t exceed desktop art width */
  }

  /* Main container for wheel */
  .wheel-container {
    width: 100vw;
    height: 100vh;
  }

  /* Frame scales up relative to screen width to mimic desktop composition */
  .wheel-frame {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;          /* roughly similar framing as desktop */
    max-width: 350px;     /* cap to avoid oversize on small-large phones */
  }

  /* Wheel keeps a good proportion inside the frame */
  .wheel {
    top: 49%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 56vw;         /* keep it square */
    max-width: 238px;
    max-height: 238px;
  }

  /* Spin button: closer to the wheel, touch-friendly size */
  .spin-button {
    bottom: 8%;
    left: 50%;
    transform: translate(-50%, 0); /* place from bottom edge */
    width: 55vw;
    height: auto;         /* image controls aspect */
  }

  /* Neutralize hover/active translations to avoid jumpiness on mobile */
  .spin-button:hover {
    transform: translate(-50%, 0) scale(1.03);
  }
  .spin-button:active {
    transform: translate(-50%, 0) scale(0.97);
  }

  /* Popup overlay elements */
  .message-win .message-image {
    width: 86vw;          /* big but with margin on sides */
    max-width: 420px;
  }

  .claim-button {
    width: 70vw;          /* wider touch target */
    max-width: 360px;
    margin-top: 14px;
  }
}
@media (max-width: 430px) {
  /* Fill the viewport neatly */
  .container {
    width: 100vw;
    height: 100vh;
  }

  .background {
    width: 100vw;
    height: 100vh;
  }

  /* Logo: slightly smaller and a bit higher */
  .logo {
    top: 12%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28vw;          /* responsive size */
    max-width: 140px;     /* safety cap */
  }

  .characters {
    top: 90%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;         /* use full width for character art */
    max-width: 450px;     /* don’t exceed desktop art width */
  }

  /* Main container for wheel */
  .wheel-container {
    width: 100vw;
    height: 100vh;
  }

  /* Frame scales up relative to screen width to mimic desktop composition */
  .wheel-frame {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;          /* roughly similar framing as desktop */
    max-width: 350px;     /* cap to avoid oversize on small-large phones */
  }

  /* Wheel keeps a good proportion inside the frame */
  .wheel {
    top: 49%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50vw;
    height: 50vw;         /* keep it square */
    max-width: 238px;
    max-height: 238px;
  }

  /* Spin button: closer to the wheel, touch-friendly size */
  .spin-button {
    bottom: 8%;
    left: 50%;
    transform: translate(-50%, 0); /* place from bottom edge */
    width: 55vw;
    height: auto;         /* image controls aspect */
  }

  /* Neutralize hover/active translations to avoid jumpiness on mobile */
  .spin-button:hover {
    transform: translate(-50%, 0) scale(1.03);
  }
  .spin-button:active {
    transform: translate(-50%, 0) scale(0.97);
  }

  /* Popup overlay elements */
  .message-win .message-image {
    width: 86vw;          /* big but with margin on sides */
    max-width: 420px;
  }

  .claim-button {
    width: 70vw;          /* wider touch target */
    max-width: 360px;
    margin-top: 14px;
  }
}
