/* Spin To Win - CP Campaign
   Ported design from the original wheel app: simple background, wheel as
   the focal point, four labelled segments, card-style panel below. */

.stw-root {
  --stw-bg: #f7f7f8;
  --stw-fg: #18181b;
  --stw-muted: #6b7280;
  --stw-card: #ffffff;
  --stw-border: #e5e7eb;
  --stw-input: #e5e7eb;
  --stw-ring: #18181b;
  --stw-primary: #18181b;
  --stw-primary-fg: #ffffff;
  --stw-destructive: #dc2626;
  --stw-wheel-1: #cce1f9;
  --stw-wheel-2: #99c3f2;
  --stw-wheel-3: #66a5ec;
  --stw-wheel-4: #3388e5;
  --stw-wheel-rim: #18181b;
  --stw-wheel-label: #18181b00;
  --stw-pointer: #18181b;
  --stw-shadow-wheel: 0 20px 45px -20px rgb(0 0 0 / 0.35);
  --stw-shadow-card: 0 10px 30px -18px rgb(0 0 0 / 0.25);

  position: relative;
  isolation: isolate; /* keeps the wave's z-index scoped to this component */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  min-height: 100dvh;
  background: var(--stw-bg);
  color: var(--stw-fg);
  padding: 3rem 1.25rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  overflow: hidden; /* keeps the full-bleed wave from causing horizontal scroll */
}
.stw-root * { box-sizing: border-box; }

/* Full-bleed decorative wave, pinned to the bottom edge, sitting behind
   the form/panel content. Waiting on the actual SVG markup to fill in -
   this scaffolding is ready to receive it (edge-to-edge, low z-index). */
.stw-waves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  /* Bottom band only - roughly a quarter to a third of the viewport,
     with a floor so it doesn't vanish on short screens and a ceiling
     so it doesn't dominate on tall desktop viewports. */
  height: clamp(140px, 30vh, 340px);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.stw-waves svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* Everything else sits above the wave layer */
.stw-header, .stw-wheel-wrap, .stw-panel, .stw-legal {
  position: relative;
  z-index: 1;
}

.stw-header { max-width: 28rem; text-align: center; }
.stw-eyebrow {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--stw-muted); margin: 0;
}
.stw-title { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.01em; margin: 0.75rem 0 0; }
@media (min-width: 640px) { .stw-title { font-size: 2.25rem; } }
.stw-subtitle { font-size: 0.875rem; color: var(--stw-muted); margin: 0.75rem 0 0; }
@media (min-width: 640px) { .stw-subtitle { font-size: 1rem; } }

.stw-wheel-wrap {
  position: relative;
  width: min(88vw, 26rem);
  aspect-ratio: 1 / 1;
}

.stw-pointer {
  position: absolute; left: 50%; top: 0; z-index: 10;
  transform: translate(-50%, -4px); color: var(--stw-pointer);
}

.stw-wheel {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 9999px;
  border: 10px solid var(--stw-wheel-rim);
  box-shadow: var(--stw-shadow-wheel);
  transform: rotate(0deg);
  transition: transform 4s cubic-bezier(0.15, 0.9, 0.12, 1);
}

.stw-segment-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 0.25rem;
}
.stw-segment-label img {
  margin-top: 10%;
  width: 5.25rem;
  height: 5.25rem;
  object-fit: contain;
  border-radius: 6px;
  padding: 3px;
}
.stw-segment-label span {
  width: 46%; padding: 0 0.25rem; text-align: center;
  font-size: 0.8rem; font-weight: 600; line-height: 1.15;
  color: var(--stw-wheel-label);
}
@media (min-width: 640px) { .stw-segment-label span { font-size: 0.95rem; } }

.stw-hub {
  pointer-events: none;
  position: absolute; left: 50%; top: 50%;
  width: 3.5rem; height: 3.5rem;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  border: 6px solid var(--stw-wheel-rim);
  background: var(--stw-card);
}

.stw-panel { width: min(88vw, 26rem); }

.stw-form, .stw-result, .stw-ended {
  border: 1px solid var(--stw-border);
  background: var(--stw-card);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--stw-shadow-card);
  text-align: center;
}
.stw-form { text-align: left; }

.stw-label { display: block; font-size: 0.875rem; font-weight: 500; }
.stw-input {
  margin-top: 0.5rem; width: 100%;
  border: 1px solid var(--stw-input); border-radius: 0.75rem;
  background: var(--stw-bg); padding: 0.75rem 1rem;
  font-size: 1rem; color: var(--stw-fg); outline: none;
  transition: border-color 0.15s ease;
}
.stw-input:focus { border-color: var(--stw-ring); }

.stw-consent {
  display: flex; align-items: flex-start; gap: 0.5rem;
  margin-top: 0.75rem; cursor: pointer;
}
.stw-consent input[type="checkbox"] {
  margin-top: 0.2rem; width: 1rem; height: 1rem; flex-shrink: 0;
  accent-color: var(--stw-primary);
}
.stw-consent span { font-size: 0.8rem; color: var(--stw-muted); line-height: 1.4; }
.stw-consent a { color: var(--stw-fg); text-decoration: underline; }

.stw-button {
  margin-top: 0.75rem; width: 100%;
  border: none; border-radius: 0.75rem;
  background: var(--stw-primary); color: var(--stw-primary-fg);
  padding: 0.75rem 1rem; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s ease;
}
.stw-button:hover:not(:disabled) { opacity: 0.9; }
.stw-button:disabled { opacity: 0.5; cursor: not-allowed; }

.stw-error { margin-top: 0.75rem; font-size: 0.875rem; color: var(--stw-destructive); }
.stw-fineprint { margin-top: 0.75rem; font-size: 0.75rem; color: var(--stw-muted); }

.stw-result-eyebrow { margin: 0; font-size: 0.875rem; color: var(--stw-muted); }
.stw-result-prize { margin: 0.5rem 0 0; font-size: 1.5rem; font-weight: 700; }
.stw-result-code-label {
  margin: 1rem 0 0; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.15em; color: var(--stw-muted);
}
.stw-result-code {
  margin: 0.25rem 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.125rem; font-weight: 600;
}
.stw-result-note { margin-top: 1rem; font-size: 0.875rem; color: var(--stw-muted); }

.stw-legal { font-size: 0.75rem; color: var(--stw-muted); text-align: center; }
.stw-legal a { color: inherit; margin: 0 0.15rem; }

/* Simple reveal pop for the result card */
.stw-result[data-visible="true"], .stw-ended[data-visible="true"] {
  animation: stw-pop 0.35s ease;
}
@keyframes stw-pop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
