.perfect-wheel-overlay {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background:
    radial-gradient(circle at top, rgba(255, 214, 102, 0.22), transparent 38%),
    rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(10px);
  animation: perfect-wheel-fade-in 0.24s ease;
}

.perfect-wheel-overlay--hide {
  opacity: 0;
  transition: opacity 0.22s ease;
}

.perfect-wheel-card {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  border-radius: 0;
  padding: max(28px, env(safe-area-inset-top, 0px)) 18px calc(0px + 28px);
  color: #1f2a44;
  background:
    linear-gradient(180deg, #fffdf8 0%, #f7efe1 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.perfect-wheel-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b7791f;
}

.perfect-wheel-title {
  margin: 8px 0 10px;
  font-size: 1.7rem;
  line-height: 1.1;
}

.perfect-wheel-copy {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.45;
  color: #4a5568;
}

.perfect-wheel-stage {
  position: relative;
  width: min(92vw, 430px);
  height: min(92vw, 430px);
  margin: 34px auto 28px;
}

.perfect-wheel-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid #9b2c2c;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.22));
}

.perfect-wheel {
  position: relative;
  width: 100%;
  height: 100%;
  transform: rotate(var(--wheel-rotation, 0deg));
  transition: transform 4.2s cubic-bezier(0.16, 0.95, 0.18, 1);
}

.perfect-wheel-surface {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 10px #fff7e6,
    inset 0 0 0 20px rgba(120, 53, 15, 0.16),
    0 20px 34px rgba(15, 23, 42, 0.18);
}

.perfect-wheel-marker {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transform: rotate(var(--marker-angle));
  pointer-events: none;
}

.perfect-wheel-marker-label {
  margin-top: 14px;
  min-width: 46px;
  padding: 6px 10px;
  border-radius: 14px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1c2342;
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.96) 0%, rgba(244, 223, 154, 0.94) 100%);
  border: 1px solid rgba(184, 137, 31, 0.32);
  box-shadow:
    0 8px 16px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.perfect-wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #fff8e8, #f0d08a);
  box-shadow:
    inset 0 0 0 7px rgba(120, 53, 15, 0.18),
    0 10px 20px rgba(15, 23, 42, 0.18);
  transform: translate(-50%, -50%);
}

.perfect-wheel-center img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.perfect-wheel-energy {
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #7b5e1b;
}

.perfect-wheel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  width: min(100%, 420px);
  margin: 24px auto 0;
}

.perfect-wheel-spin-btn,
.perfect-wheel-continue-btn {
  border: 0;
  border-radius: 18px;
  min-height: 54px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.perfect-wheel-spin-btn {
  color: #fff9f2;
  background: linear-gradient(180deg, #1c2342 0%, #2b355f 100%);
  box-shadow: 0 14px 28px rgba(28, 35, 66, 0.22);
}

.perfect-wheel-spin-btn:disabled {
  opacity: 0.86;
  cursor: default;
}

.perfect-wheel-continue-btn {
  color: #1c2342;
  background: linear-gradient(180deg, #fff8e5 0%, #f3df9a 100%);
  box-shadow: 0 14px 28px rgba(184, 137, 31, 0.18);
}

.perfect-wheel-spin-btn:hover,
.perfect-wheel-continue-btn:hover {
  transform: translateY(-1px);
}

.perfect-wheel-spin-btn:active,
.perfect-wheel-continue-btn:active {
  transform: translateY(0);
}

.hidden.perfect-wheel-continue-btn {
  display: none;
}

.hidden.perfect-wheel-spin-btn {
  display: none;
}

@keyframes perfect-wheel-fade-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 600px) {
  .perfect-wheel-card {
    padding: max(24px, env(safe-area-inset-top, 0px)) 14px calc(0px + 22px);
  }

  .perfect-wheel-title {
    font-size: 1.45rem;
  }

  .perfect-wheel-copy {
    font-size: 0.94rem;
  }

  .perfect-wheel-marker-label {
    margin-top: 12px;
    min-width: 40px;
    padding: 5px 8px;
    font-size: 0.76rem;
  }

  .perfect-wheel-stage {
    width: min(96vw, 382px);
    height: min(96vw, 382px);
    margin: 28px auto 24px;
  }
}
