/* Promotion Wheel — storefront modal + wheel UI */
.yayboost-promotion-wheel {
  --ypw-background: #ffffff;
  --ypw-foreground: #09090b;
  --ypw-muted: #71717a;
  --ypw-border: #e4e4e7;
  --ypw-primary: #18181b;
  --ypw-primary-hover: #27272a;
  --ypw-success: #16a34a;
  --ypw-success-bg: rgba(22, 163, 74, 0.1);
  --ypw-radius: 12px;

  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ypw-foreground);
}

.yayboost-promotion-wheel *,
.yayboost-promotion-wheel *::before,
.yayboost-promotion-wheel *::after {
  box-sizing: border-box;
}

.yayboost-promotion-wheel__overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.8);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.yayboost-promotion-wheel__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--ypw-background);
  border-radius: var(--ypw-radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.yayboost-promotion-wheel.is-open .yayboost-promotion-wheel__overlay {
  opacity: 1;
}

.yayboost-promotion-wheel.is-open .yayboost-promotion-wheel__dialog {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .yayboost-promotion-wheel__overlay,
  .yayboost-promotion-wheel__dialog,
  .yayboost-promotion-wheel__wheel {
    transition: none !important;
  }
}

.yayboost-promotion-wheel__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ypw-muted);
  cursor: pointer;
}

.yayboost-promotion-wheel__close:hover {
  background: #f4f4f5;
  color: var(--ypw-foreground);
}

.yayboost-promotion-wheel__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 28px 24px 24px;
  overflow-x: hidden;
}

.yayboost-promotion-wheel__header {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.yayboost-promotion-wheel__title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.yayboost-promotion-wheel__description {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ypw-muted);
  line-height: 1.5;
  white-space: pre-line;
}

.yayboost-promotion-wheel__email {
  width: 100%;
  max-width: 320px;
}

.yayboost-promotion-wheel__email-input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--ypw-border);
  border-radius: 8px;
  background: #fff;
  color: var(--ypw-foreground);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
}

.yayboost-promotion-wheel__email-input:focus {
  outline: none;
  border-color: var(--ypw-primary);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}

.yayboost-promotion-wheel__email-input.is-invalid {
  border-color: #dc2626;
}

.yayboost-promotion-wheel__email-error {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: #b91c1c;
  text-align: left;
}

.yayboost-promotion-wheel__wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
  min-width: 0;
}

.yayboost-promotion-wheel__pointer {
  position: relative;
  z-index: 2;
  margin-bottom: -2px;
  color: var(--ypw-primary);
  flex-shrink: 0;
}

.yayboost-promotion-wheel__wheel-outer {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  overflow: hidden;
}

.yayboost-promotion-wheel__wheel {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
}

.yayboost-promotion-wheel__spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--ypw-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.yayboost-promotion-wheel__spin-btn:hover:not(:disabled) {
  background: var(--ypw-primary-hover);
}

.yayboost-promotion-wheel__spin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.yayboost-promotion-wheel__result {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 16px;
  text-align: center;
  border-radius: 10px;
  border: 1px solid var(--ypw-border);
  background: #fafafa;
  overflow-wrap: anywhere;
}

.yayboost-promotion-wheel__result--win {
  border-color: rgba(22, 163, 74, 0.35);
  background: var(--ypw-success-bg);
}

.yayboost-promotion-wheel__result-message {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ypw-muted);
  white-space: pre-line;
}

.yayboost-promotion-wheel__result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.yayboost-promotion-wheel__result-btn {
  appearance: none;
  border: 1px solid var(--ypw-border);
  background: #fff;
  color: var(--ypw-foreground);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.yayboost-promotion-wheel__result-btn:hover:not(:disabled) {
  background: #f4f4f5;
}

.yayboost-promotion-wheel__result-btn--primary {
  border-color: var(--ypw-primary);
  background: var(--ypw-primary);
  color: #fff;
}

.yayboost-promotion-wheel__result-btn--primary:hover:not(:disabled) {
  background: var(--ypw-primary-hover);
}

.yayboost-promotion-wheel__result-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.yayboost-promotion-wheel__result-notice {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: #b91c1c;
}

@media (max-width: 480px) {
  .yayboost-promotion-wheel__dialog {
    max-width: 100%;
  }

  .yayboost-promotion-wheel__content {
    padding: 24px 16px 20px;
  }

  .yayboost-promotion-wheel__wheel-wrap,
  .yayboost-promotion-wheel__wheel-outer,
  .yayboost-promotion-wheel__wheel {
    max-width: min(280px, 100%);
  }

  .yayboost-promotion-wheel__spin-btn {
    width: 48px;
    height: 48px;
    font-size: 0.625rem;
  }
}
