/*
 * Body Collective — Mother's Day Giveaway Draw
 * Redesigned to match Design Guide For Giveaway Spinner.png
 * Very light/airy pastel pink — NOT saturated dark pink
 */

/* Always win over CSS display rules */
[hidden] { display: none !important; }

/* ── Google font loaded in HTML — Dancing Script for "Giveaway" ── */

/* ═══════════════════════════════════════════════════════════
   PAGE BASE — very light pastel pink, almost cream-pink
═══════════════════════════════════════════════════════════ */
.giveaway-page {
  --bg-flowers-tr: none;
  --bg-flowers-bl: none;

  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  background-image: url('/assets/images/background%20image.webp');
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  /* Fallback colour while image loads */
  background-color: #fde8f3;
  color: #1a1a1a;
  overflow-x: hidden;
  position: relative;
  padding-top: 0;
}

/* ── Generated background image slots (filled via JS/Replicate later) ── */
.deco-bg-tr {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 380px;
  background-image: var(--bg-flowers-tr);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top right;
  pointer-events: none;
  z-index: 0;
}

.deco-bg-bl {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 340px;
  height: 340px;
  background-image: var(--bg-flowers-bl);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom left;
  pointer-events: none;
  z-index: 0;
}

/* Bokeh and petal clusters hidden — background image handles decoration */
.bokeh-layer,
.deco-flowers { display: none; }

/* ═══════════════════════════════════════════════════════════
   PHASE 1 — IMPORT
═══════════════════════════════════════════════════════════ */
.import-phase {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  gap: 1.75rem;
}

.import-logo {
  height: 56px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(196,23,120,0.2));
}

.import-card {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 2rem;
  padding: 2.75rem 3rem;
  max-width: 780px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(196,23,120,0.14), 0 6px 20px rgba(0,0,0,0.04);
  border: 1px solid rgba(227,44,136,0.12);
  color: #1a1a1a;
}

.import-eyebrow {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e32c88;
  margin: 0 0 0.4rem;
}

.import-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  color: #1a1a1a;
  text-align: center;
  margin: 0 0 0.4rem;
}

.import-title span { color: #e32c88; }

.import-subtitle {
  text-align: center;
  color: #8b4a6e;
  margin: 0 0 2rem;
  font-size: 0.92rem;
}

/* Drop zone */
.csv-dropzone {
  position: relative;
  border: 2.5px dashed rgba(227,44,136,0.35);
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
  background: rgba(253,232,243,0.45);
}

.csv-dropzone:hover, .csv-dropzone.dragover {
  border-color: #e32c88;
  background: rgba(253,232,243,0.85);
}

.csv-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone-icon  { font-size: 2.5rem; display: block; margin-bottom: 0.65rem; }
.dropzone-label { font-size: 1rem; font-weight: 600; color: #1a1a1a; margin: 0 0 0.3rem; }
.dropzone-hint  { font-size: 0.8rem; color: #9d6b85; margin: 0; }

/* Table */
.entries-wrap { margin-top: 1.75rem; }

.entries-table-scroll {
  max-height: 340px;
  overflow-y: auto;
  border-radius: 1rem;
  border: 1px solid rgba(227,44,136,0.15);
}

.entries-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.entries-table thead th {
  background: #e32c88;
  color: #fff;
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 2;
}

.entries-table td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(227,44,136,0.07);
  color: #1a1a1a;
}

.entries-table tr:nth-child(even) td { background: rgba(253,232,243,0.35); }
.entries-table tr:hover td { background: rgba(251,208,232,0.55); }

.entry-num   { color: #b07090; font-size: 0.78rem; width: 36px; }
.masked-value { font-family: monospace; color: #7a4060; font-size: 0.8rem; }

.entry-count-label {
  text-align: center;
  color: #8b4a6e;
  font-size: 0.875rem;
  margin-top: 0.7rem;
  font-weight: 600;
}

.reveal-btn {
  background: rgba(227,44,136,0.08);
  border: 1px solid rgba(227,44,136,0.25);
  color: #e32c88;
  border-radius: 0.45rem;
  padding: 0.18rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-left: 0.35rem;
  font-family: inherit;
}

.reveal-btn:hover { background: #e32c88; color: #fff; border-color: #e32c88; }

.btn-load-wheel {
  display: block;
  margin: 2rem auto 0;
  background: linear-gradient(135deg, #e32c88 0%, #c4177a 100%);
  color: #fff;
  border: none;
  border-radius: 3rem;
  padding: 1rem 3.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(227,44,136,0.42);
  transition: transform 0.25s, box-shadow 0.25s, opacity 0.25s;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.btn-load-wheel:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(227,44,136,0.52);
}

.btn-load-wheel:disabled { opacity: 0.42; cursor: not-allowed; transform: none; box-shadow: none; }

/* ═══════════════════════════════════════════════════════════
   PHASE 2 — WHEEL (matches Design Guide layout)
   Left: copy/CTA on warm pink gradient panel
   Right: wheel with flying names
═══════════════════════════════════════════════════════════ */
.wheel-phase {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  padding: 2rem 3vw 2rem 4vw;
  gap: 0;
}

/* ── Left panel: left-aligned text ── */
.wheel-text-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 2rem 0.5rem 2rem 1rem;
  position: relative;
}

.wheel-text-col::before { display: none; }

.wheel-logo {
  height: 52px;
  width: auto;
  margin-bottom: 1.75rem;
  /* Natural colour — no more white invert needed */
  filter: drop-shadow(0 2px 6px rgba(196,23,120,0.2));
}

/* "CELEBRATING THE HEART OF EVERYTHING" — tiny eyebrow */
.gw-eyebrow {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(180, 80, 130, 0.7);
  margin: 0 0 0.55rem;
}

/* "$5,000" — very large, Tenor Sans serif, lighter feminine pink, italic */
.gw-amount {
  font-family: 'Tenor Sans', Georgia, 'Times New Roman', serif;
  font-size: clamp(5rem, 9.5vw, 7.5rem);
  font-weight: 400;
  font-style: italic;
  color: #e878b8;
  line-height: 1;
  margin: 0;
  letter-spacing: -0.02em;
}

/* "Mother's Day" — Tenor Sans, italic, dark maroon almost black */
.gw-event {
  font-family: 'Tenor Sans', Georgia, 'Times New Roman', serif;
  font-size: clamp(2.2rem, 4.2vw, 3.5rem);
  font-weight: 400;
  font-style: italic;
  color: #1a0812;
  margin: 0 0 -0.2rem;
  line-height: 1.1;
}

/* "Giveaway ♥" — Dancing Script, lighter pink, larger than Mother's Day */
.gw-script {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(4rem, 7.5vw, 6rem);
  font-weight: 700;
  color: #e878b8;
  margin: 0 0 0.3rem;
  line-height: 1.0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.gw-script .gw-heart {
  font-family: 'Inter', sans-serif;
  font-size: 0.7em;
  color: #e32c88;
}

/* "One amazing mum will win" */
.gw-one-winner {
  font-size: clamp(0.82rem, 1.3vw, 0.95rem);
  color: rgba(30, 10, 20, 0.7);
  margin: 0.9rem 0 0.2rem;
  font-weight: 500;
  line-height: 1.5;
}

/* "FIVE THOUSAND DOLLARS!" */
.gw-five-k {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 800;
  color: #1a0812;
  margin: 0 0 2rem;
  letter-spacing: 0.04em;
}

/* Spin button — glassmorphism, dark pink bg, frosted glass border */
.btn-spin-main {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(180, 20, 100, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1.5px solid rgba(255, 255, 255, 0.38);
  border-radius: 3rem;
  padding: 0.95rem 2.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 8px 32px rgba(180, 20, 100, 0.42),
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.12);
  transition: transform 0.25s, box-shadow 0.25s, opacity 0.25s;
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.btn-spin-main:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 14px 44px rgba(180, 20, 100, 0.52),
    inset 0 1px 0 rgba(255,255,255,0.35);
}

.btn-spin-main:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.spin-play-icon { width: 18px; height: 18px; fill: #fff; flex-shrink: 0; }

.spin-status-txt {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: rgba(30, 5, 20, 0.65);
  font-weight: 600;
  letter-spacing: 0.07em;
  min-height: 1.3em;
}

/* tagline removed per user request */
.gw-tagline { display: none; }

/* ── Right: Wheel column ──────────────────────────────── */
.wheel-col {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}

/* Outer glow ring behind wheel — light soft pink */
.wheel-glow {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,210,238,0.5) 0%, rgba(252,185,225,0.2) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(28px);
}

.wheel-wrap {
  position: relative;
  width: 470px;
  height: 470px;
  flex-shrink: 0;
  z-index: 1;
  overflow: visible;
}

.wheel-canvas {
  display: block;
  width: 470px;
  height: 470px;
  border-radius: 50%;
  filter:
    drop-shadow(0 20px 50px rgba(196,23,120,0.35))
    drop-shadow(0 6px 18px rgba(196,23,120,0.2));
}

/* Heart-pin pointer at top — LARGE */
.pointer-wrap {
  position: absolute;
  top: -56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 5px 12px rgba(196,23,120,0.65));
}

/* Ground shadow */
.wheel-shadow {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 58%;
  height: 22px;
  background: radial-gradient(ellipse, rgba(196,23,120,0.28) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Wheel pedestal — sits below the wheel like a cake stand ── */
.wheel-stand {
  position: absolute;
  bottom: -42px;
  left: 50%;
  transform: translateX(-50%);
  width: 78%;
  height: 30px;
  background: linear-gradient(180deg, #fad0e8 0%, #f0a8d0 25%, #e088bc 65%, #cc70a8 100%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  box-shadow:
    /* Stepped layered depth for clay-like pedestal */
    0 3px 0 #c868a0,
    0 6px 0 #b85890,
    0 9px 0 #a84880,
    /* Main ground shadow */
    0 12px 28px rgba(130, 40, 90, 0.45),
    0 20px 50px rgba(130, 40, 90, 0.2),
    /* Inner top highlight (rim shine) */
    inset 0 3px 8px rgba(255, 255, 255, 0.6),
    inset 0 -2px 5px rgba(0, 0, 0, 0.12);
}

/* Table surface shadow cast by the stand */
.wheel-stand::after {
  content: '';
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 110%;
  height: 20px;
  background: radial-gradient(ellipse, rgba(120, 40, 80, 0.22) 0%, transparent 70%);
  border-radius: 50%;
}

/* ── Flying name pills ─────────────────────────────────
   White pill cards, pink text, scattered all around wheel.
   Visible from the moment the wheel phase loads.
   Matches nameflying.png style exactly.
─────────────────────────────────────────────────────── */
.flying-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  overflow: visible;
}

.fname {
  position: absolute;
  top: 50%;
  left: 50%;
  background: #fff;
  color: #e32c88;
  border-radius: 2rem;
  padding: 0.28rem 0.85rem 0.28rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow:
    0 4px 14px rgba(196,23,120,0.18),
    0 1px 4px rgba(0,0,0,0.06);
  border: 1.5px solid rgba(227,44,136,0.15);
  /* Start at centre, invisible */
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  transition: none;
}

/* Active/floating state — gentle continuous drift */
.fname.is-active {
  transform: translate(-50%, -50%) translate(var(--tx,0px), var(--ty,0px)) rotate(var(--rot,0deg));
  opacity: 1;
  animation: fnameDrift var(--dur, 2.4s) ease-in-out infinite;
}

@keyframes fnameDrift {
  0%   { transform: translate(-50%,-50%) translate(var(--tx),var(--ty)) rotate(var(--rot)); }
  30%  { transform: translate(-50%,-50%) translate(calc(var(--tx) + var(--ox,10px)), calc(var(--ty) + var(--oy,-8px))) rotate(calc(var(--rot) + 2deg)); }
  65%  { transform: translate(-50%,-50%) translate(calc(var(--tx) - var(--ox2,8px)), calc(var(--ty) + var(--oy2,10px))) rotate(calc(var(--rot) - 1.5deg)); }
  100% { transform: translate(-50%,-50%) translate(var(--tx),var(--ty)) rotate(var(--rot)); }
}

/* SUPER FAST chaos during spin — names burst in and orbit wildly */
.fname.is-spinning {
  opacity: 1;
  animation: fnameSpinning var(--sdur, 0.35s) linear infinite;
}

@keyframes fnameSpinning {
  0%   { transform: translate(-50%,-50%) translate(var(--tx), var(--ty)) rotate(var(--rot)); }
  20%  { transform: translate(-50%,-50%) translate(calc(var(--tx)*1.18), calc(var(--ty)*0.78)) rotate(calc(var(--rot) + 22deg)); }
  40%  { transform: translate(-50%,-50%) translate(calc(var(--tx)*0.82), calc(var(--ty)*1.22)) rotate(calc(var(--rot) - 18deg)); }
  60%  { transform: translate(-50%,-50%) translate(calc(var(--tx)*1.12), calc(var(--ty)*1.08)) rotate(calc(var(--rot) + 14deg)); }
  80%  { transform: translate(-50%,-50%) translate(calc(var(--tx)*0.90), calc(var(--ty)*0.85)) rotate(calc(var(--rot) - 10deg)); }
  100% { transform: translate(-50%,-50%) translate(var(--tx), var(--ty)) rotate(var(--rot)); }
}

/* Pop-in animation from centre */
@keyframes fnamePopIn {
  from { transform: translate(-50%,-50%) scale(0); opacity: 0; }
  to   { transform: translate(-50%,-50%) translate(var(--tx),var(--ty)) rotate(var(--rot)); opacity: 1; }
}

.fname.popping-in {
  animation: fnamePopIn 0.55s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

/* ── Full-page fade overlay — same background image for seamless transition ── */
.page-fade-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background-image: url('/assets/images/background%20image.webp');
  background-size: cover;
  background-position: right center;
  background-color: #fde8f3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

.page-fade-overlay.fading {
  opacity: 1;
  pointer-events: all;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 3 — WINNER
═══════════════════════════════════════════════════════════ */
.winner-phase {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-image: url('/assets/images/background%20image.webp');
  background-size: cover;
  background-position: right center;
  background-color: #fde8f3;
  padding: 2rem 1.25rem;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 201;
}

/* Winner card — large white card, prominent name */
.winner-card {
  position: relative;
  z-index: 202;
  background: #fff;
  border-radius: 2.5rem;
  padding: 2.75rem 3.5rem;
  text-align: center;
  max-width: 500px;
  width: 100%;
  box-shadow:
    0 32px 80px rgba(196,23,120,0.22),
    0 8px 28px rgba(0,0,0,0.05);
  border: 1.5px solid rgba(227,44,136,0.12);
  animation: winnerBounceIn 0.8s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes winnerBounceIn {
  from { transform: scale(0.35) translateY(80px); opacity: 0; }
  to   { transform: scale(1) translateY(0);        opacity: 1; }
}

/* "We Have a Winner!" row — hearts + pink badge */
.winner-hearts-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.w-heart { color: #e32c88; font-size: 1.2rem; line-height: 1; }

/* Pink WINNER badge */
.w-badge {
  background: #e32c88;
  color: #fff;
  border-radius: 3rem;
  padding: 0.3rem 1.3rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Winner name — very prominent */
.w-name {
  font-size: clamp(2.4rem, 6.5vw, 4rem);
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  margin: 0.3rem 0 0.75rem;
  line-height: 1.05;
}

/* "$5,000" */
.w-prize-amt   { font-size: 1.75rem; font-weight: 900; color: #e32c88; margin: 0 0 0.15rem; }
.w-prize-label { font-size: 0.9rem; color: #9d6b85; margin: 0 0 1.75rem; font-weight: 500; }

/* Contact reveal panel */
.w-contact {
  background: linear-gradient(135deg, rgba(253,232,243,0.85) 0%, rgba(251,208,232,0.5) 100%);
  border-radius: 1.25rem;
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(227,44,136,0.1);
}

.w-contact-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.875rem;
}

.w-contact-label {
  font-weight: 700;
  color: #9d174d;
  min-width: 50px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.w-contact-val {
  flex: 1;
  text-align: left;
  font-family: monospace;
  color: #1a1a1a;
  font-size: 0.85rem;
  word-break: break-all;
}

.w-congrats {
  color: #9d6b85;
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.5;
}

.btn-draw-again {
  display: inline-block;
  margin-top: 1.5rem;
  background: linear-gradient(135deg, #e32c88 0%, #c4177a 100%);
  color: #fff;
  border: none;
  border-radius: 3rem;
  padding: 0.75rem 2.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 7px 24px rgba(227,44,136,0.38);
  transition: transform 0.25s, box-shadow 0.25s;
  font-family: inherit;
}

.btn-draw-again:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(227,44,136,0.48);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .wheel-phase {
    grid-template-columns: 1fr;
    padding: 3rem 1.5rem 2rem;
    gap: 2rem;
    text-align: center;
  }

  .wheel-text-col { align-items: center; text-align: center; order: 1; padding: 0 1rem; }
  .wheel-col      { order: 0; }
  .wheel-glow     { width: 400px; height: 400px; }

  .wheel-wrap   { width: 380px; height: 380px; }
  .wheel-canvas { width: 380px; height: 380px; }
}

@media (max-width: 520px) {
  .import-card  { padding: 2rem 1.5rem; }

  .wheel-glow   { width: 320px; height: 320px; }
  .wheel-wrap   { width: 300px; height: 300px; }
  .wheel-canvas { width: 300px; height: 300px; }

  .winner-card  { padding: 2rem 1.5rem; border-radius: 1.75rem; }
}
