/* Container */
.fw-wrap {
  display: grid;
  gap: 0.75rem;
  place-items: center;
  max-width: 520px;
  margin: 1rem auto;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.fw-stage {
  position: relative;
  width: var(--fw-size, 360px);
  height: var(--fw-size, 360px);
}

.fw-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0,0,0,.12), inset 0 0 0 6px #fff;
  background: #e5e7eb;
  overflow: hidden;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 5s cubic-bezier(.1,.9,.2,1.04);
  position: relative;
  z-index: 1;
}

/* Pointer: top, pointing DOWN, golden yellow */
.fw-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 0;
  border-top: 34px solid #f8d24b; /* golden yellow */
  transform: translateX(-50%);
  z-index: 4;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.25));
}

.fw-spin {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 38%;
  height: 38%;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #fff;
  font-size: clamp(14px, 2.6vw, 18px);
  font-weight: 700;
  cursor: pointer;
  z-index: 3;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

.fw-spin[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

.fw-spin.fw-hidden {
  display: none;
}

.fw-result {
  min-height: 1.5em;
  font-weight: 600;
  text-align: center;
}

.fw-result-link {
  color: #e11d48;
  font-weight: 700;
  text-decoration: none;
}
.fw-result-link:hover {
  text-decoration: underline;
}

/* Center logo overlay (stays upright) */
.fw-center-logo {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 2;
  border-radius: 999px;
  pointer-events: none;
}

/* Segment text (SVG mode) */
.fw-seg-label {
  font-size: 12px;
  fill: #0f172a;
  font-weight: 700;
  dominant-baseline: middle;
  text-anchor: middle;
}

/* Image mode */
.fw-wheel img.fw-wheel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Modal styling ---- */

.fw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.fw-modal-dialog {
  width: min(420px, 94vw);
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(circle at top, #ff2f92 0%, #3b0a3d 60%, #050014 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  color: #fff;
  position: relative;
}

.fw-modal-inner {
  padding: 2rem 1.75rem 2.25rem;
  display: grid;
  gap: 1.5rem;
}

.fw-modal-header {
  text-align: center;
  display: grid;
  gap: 0.35rem;
}

.fw-modal-eyebrow {
  font-size: 0.8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .85;
}

.fw-modal-title {
  font-size: 1.7rem;
  font-weight: 800;
}

.fw-modal-subtitle {
  font-size: 0.95rem;
  opacity: .9;
}

/* Modal close button */
.fw-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  border: none;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  color: #fff;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Email gate */

.fw-email-form {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.fw-email-form.fw-email-inline {
  max-width: 360px;
  margin: 0 auto 0.75rem;
}

.fw-email-input {
  border-radius: 999px;
  border: none;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  outline: none;
}

.fw-email-submit {
  border-radius: 999px;
  border: none;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: #ec4899;
  color: #fff;
}

.fw-email-submit:hover {
  background: #db2777;
}

.fw-email-error {
  min-height: 1em;
  font-size: 0.8rem;
  color: #fecaca;
}

/* When email is accepted */
.fw-email-form.fw-email-complete {
  opacity: 0.6;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 480px) {
  .fw-stage {
    width: 90vw;
    height: 90vw;
  }
}

/* ---- Win highlight overlay ---- */

.fw-modal-dialog {
  position: relative; /* ensure win overlay positions correctly */
}

/* Overlay that sits over the modal content */
.fw-win-highlight {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  z-index: 10000; /* above .fw-modal-inner */
}

/* Visible state */
.fw-win-highlight.fw-win-visible {
  opacity: 1;
  pointer-events: auto;
}

/* The card itself */
.fw-win-card {
  width: min(360px, 90vw);
  border-radius: 20px;
  padding: 1.6rem 1.4rem 1.4rem;
  background: radial-gradient(circle at top, #f97316 0%, #be185d 55%, #4c1d95 100%);
  box-shadow: 0 18px 50px rgba(0,0,0,.6);
  color: #fff;
  text-align: center;
  display: grid;
  gap: 0.6rem;
  font-family: inherit; /* will pick up theme_font_family when applied to modal/wrap */
}

/* Eyebrow + title */
.fw-win-eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  opacity: .9;
}

.fw-win-title {
  font-size: 1.4rem;
  font-weight: 800;
}

/* CTA button */
.fw-win-cta {
  margin-top: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: #22c55e;
  color: #0f172a;
}

/* Blur and slightly shrink modal content behind the overlay */
.fw-modal-inner.fw-win-blur {
  filter: blur(4px);
  transform: scale(0.98);
  transition: filter .35s ease, transform .35s ease;
}
