:root {
  --phone-w: min(92vw, 450px);
  --phone-h: min(94vh, 860px);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  background: #dcdcdc;
  display: grid;
  place-items: center;
  overflow: hidden;
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
}

a {
  text-decoration: none;
}

.page {
  width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 14px;
}

.phone-shell {
  width: var(--phone-w);
  height: var(--phone-h);
  position: relative;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f9c6ae;
  box-shadow: var(--shadow);
}

.bg-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(0, 0, 0, 0.14) 100%
  );
}

.spin-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%);
  width: min(88%, 410px);
  padding: 28px 18px 22px;
  border-radius: 26px;
}

.wheel-wrap {
  position: relative;
  margin: 18px auto 0;
  width: min(100%, 365px);
  aspect-ratio: 1;
  overflow: visible;
  border-radius: 50%;
  isolation: isolate;
  display: grid;
  place-items: center;
}

.wheel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 5.9s cubic-bezier(0.12, 0.8, 0.18, 1);
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.25));
}

.wheel-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(255, 210, 53, 0.9);
  z-index: 2;
  pointer-events: none;
}

.wheel-wrap::after {
  content: "";
  position: absolute;
  inset: 3.2%;
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgba(255, 184, 0, 0.18);
  z-index: 1;
  pointer-events: none;
}

.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #ffb400;
  color: #000;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.18),
    inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

.spin-btn::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid #ffb400;
}

.spin-btn:hover {
  transform: translate(-50%, -50%) scale(1.03);
}

.spin-btn:active {
  transform: translate(-50%, -50%) scale(0.97);
}

.spin-btn:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

.pointer-highlight {
  position: absolute;
  right: 10.5%;
  top: 50%;
  transform: translateY(-50%);
  width: 12%;
  aspect-ratio: 1;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 224, 101, 0.55) 35%,
    rgba(255, 208, 0, 0) 72%
  );
  filter: blur(2px);
  z-index: 1;
  pointer-events: none;
}

/* EFFECTS */
.effects-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

.firework-burst {
  position: absolute;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
}

.firework-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  opacity: 0;
  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.4),
    0 0 24px rgba(255, 221, 87, 0.25);
  animation: explode 1.15s ease-out forwards;
}

.firework-particle.gold { background: #ffd54a; }
.firework-particle.red { background: #ff5f6d; }
.firework-particle.blue { background: #4ea8ff; }
.firework-particle.green { background: #39d98a; }
.firework-particle.white { background: #ffffff; }
.firework-particle.pink { background: #ff7de9; }
.firework-particle.orange { background: #ff9f43; }

.money-float {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1;
  color: #fff34f;
  letter-spacing: 1px;
  -webkit-text-stroke: 2px #8a5a00;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.22),
    0 6px 18px rgba(0, 0, 0, 0.22),
    0 0 12px rgba(255, 245, 120, 0.75),
    0 0 28px rgba(255, 213, 74, 0.7),
    0 0 44px rgba(255, 213, 74, 0.55);
  white-space: nowrap;
  opacity: 0;
  filter: saturate(1.12) brightness(1.08);
  animation: moneyFly 2.8s ease-out forwards;
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 9999;
  transition: opacity 0.2s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-panel {
  position: relative;
  width: min(92vw, 540px);
  background: #ffffff;
  border-radius: 24px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
  animation: popIn 0.28s ease;
}

.close-modal {
  position: absolute;
  top: 6px;
  right: 12px;
  background: transparent;
  color: #8b8b8b;
  font-size: 42px;
  line-height: 1;
  padding: 0;
  z-index: 2;
}

.modal-image-link {
  display: block;
  width: 100%;
}

.modal-prize-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.modal-image-link:hover .modal-prize-image {
  transform: scale(1.02);
  filter: brightness(1.03);
}

.modal-image-link:active .modal-prize-image {
  transform: scale(0.99);
}

@keyframes popIn {
  from {
    transform: scale(0.86);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes explode {
  0% {
    transform: translate(0, 0) scale(0.35);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x), var(--y)) scale(1.15);
    opacity: 0;
  }
}

@keyframes moneyFly {
  0% {
    transform: translate(-50%, -50%) scale(0.45);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--mx)), calc(-50% + var(--my))) scale(1.2);
    opacity: 0;
  }
}

@media (max-width: 520px) {
  body {
    background: #d9d9d9;
  }

  .page {
    padding: 0;
  }

  .phone-shell {
    width: 100vw;
    height: 100vh;
  }

  .spin-card {
    width: calc(100% - 34px);
    top: 52%;
    padding-inline: 14px;
  }

  .modal-panel {
    width: calc(100vw - 18px);
    border-radius: 16px;
    padding: 16px;
  }

  .close-modal {
    font-size: 34px;
    right: 8px;
    top: 4px;
  }

  .spin-btn {
    width: 82px;
    height: 82px;
    font-size: 13px;
  }

  .spin-btn::after {
    right: -12px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #ffb400;
  }

  .money-float {
    font-size: clamp(34px, 9vw, 58px);
    -webkit-text-stroke: 1.5px #8a5a00;
  }
}