/* ══════════════════════════════════════════════════════════════════════════
   Tap Play Win — consumer flow
   Design source: "Win 15000 Mobile Flow.dc.html" (claude.ai/design)
   Brand: hot pink #F2245C · yellow #FFD400 · purple #5B2EAE · white
   Display: Baloo 2 (bubble) · Body: Nunito · Sunburst ray backgrounds
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --pink:        #F2245C;
  --pink-dark:   #B01243;
  --yellow:      #FFD400;
  --yellow-dark: #D9A800;
  --purple:      #5B2EAE;
  --purple-deep: #3D1E77;
  --white:       #FFFFFF;
  --ink:         #3A3546;
  --ink-soft:    #5A5566;
  --ink-muted:   #8A8798;
  --line:        #E6E1F0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

/* Hide scrollbars (mobile overlay feel) — scrolling still works */
html, body { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

body {
  font-family: 'Nunito', -apple-system, 'Segoe UI', sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--white);
  transition: background 0.35s ease;
  overflow-x: hidden;
}

/* ── Sunburst backgrounds — slowly rotating rays ─────────────────────────────
   The .rays wrapper is viewport-sized with overflow:hidden, so the huge
   spinning .rays__spin layer inside can never inflate the page width. The
   spinner rotates via a GPU transform (no gradient repaints); 16° repeat loops
   seamlessly. Ray origin and intensity vary per page theme. */
html, body { overflow-x: clip; }
.rays {
  position: fixed; inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}
.rays__spin {
  position: absolute;
  width: 280vmax; height: 280vmax;
  left: 50%; top: -20vh;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(rgba(255,255,255,0.08) 0deg 8deg, transparent 8deg 16deg);
  animation: rays-spin 90s linear infinite;
  transform-origin: center center;
}
@keyframes rays-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .rays__spin { animation: none; }
}

body.bg-pink { background-color: var(--pink); }
body.bg-yellow { background-color: var(--yellow); color: var(--ink); }
body.bg-yellow-rays { background-color: var(--yellow); color: var(--ink); }
body.bg-purple { background-color: var(--purple); }

body.bg-yellow .rays__spin { top: 32vh; background: repeating-conic-gradient(rgba(255,255,255,0.35) 0deg 8deg, transparent 8deg 16deg); }
body.bg-yellow-rays .rays__spin { background: repeating-conic-gradient(rgba(255,255,255,0.4) 0deg 8deg, transparent 8deg 16deg); }
body.bg-purple .rays__spin { top: 22vh; background: repeating-conic-gradient(rgba(255,255,255,0.07) 0deg 8deg, transparent 8deg 16deg); }

#app {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.view { display: flex; flex-direction: column; align-items: center; animation: pop-in 0.35s ease both; flex: 1; width: 100%; }
.hidden { display: none !important; }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Centered views (win / no-win / done / retry / loading) */
.view-центred, .view-c {
  justify-content: center;
  padding: 28px 28px 104px;
  text-align: center;
  gap: 18px;
  max-width: 430px;
  margin: 0 auto;
}

/* ── WIN logotype (sticker type: stroke outline + hard offset copies) ────── */
.logotype {
  width: 100%;
  text-align: center;
  transform: rotate(-3deg);
  padding-top: 56px;   /* clears the phone status bar + camera island (per design) */
  flex-shrink: 0;
}
.logo-win, .logo-amount, .logo-sub { position: relative; font-family: 'Baloo 2', cursive; font-weight: 800; }
.logo-win::after, .logo-amount::after, .logo-sub::after {
  content: attr(data-text);
  position: absolute; left: 50%; top: 0;
  transform: translateX(-50%);
  z-index: -1; -webkit-text-stroke: 0;
  white-space: nowrap;
}
.logo-win {
  font-size: clamp(38px, 12vw, 44px);
  line-height: 0.9;
  color: var(--purple);
  -webkit-text-stroke: 6px #fff;
  paint-order: stroke fill;
}
.logo-win::after { color: var(--yellow); margin-left: 5px; margin-top: 6px; }
.logo-amount {
  font-size: clamp(42px, 13vw, 48px);
  line-height: 1;
  color: var(--white);
}
.logo-amount::after { color: var(--pink-dark); margin-left: 4px; margin-top: 4px; }
.logo-sub {
  font-size: 16px;
  color: var(--yellow);
  transform: rotate(-2deg);
}
.logo-sub::after { color: var(--pink-dark); margin-left: 2px; margin-top: 2px; }
/* Yellow-page variant (invalid screens) */
.logotype--onyellow .logo-amount { color: var(--pink); font-size: clamp(36px, 11vw, 40px); }
.logotype--onyellow .logo-amount::after { color: var(--purple); }
.logotype--onyellow .logo-win::after { color: var(--pink); }

/* ── Bottom sheet (white card sliding from under the hero) ────────────────── */
.sheet {
  background: var(--white);
  color: var(--ink);
  border-radius: 22px 22px 0 0;
  margin-top: 16px;
  padding: 16px 20px 104px;
  width: 100%;
  max-width: 520px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.2);
}

.sheet-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 17px;
  color: var(--purple);
  text-align: center;
  margin-bottom: 2px;
}

/* ── Form fields (light, 2px lilac borders, 12px radius) ──────────────────── */
.field input, .field select, .sheet input[type="text"], .sheet input[type="tel"], .sheet input[type="email"], .sheet select {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 15px;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  outline: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sheet input::placeholder { color: var(--ink-muted); font-weight: 600; }
.sheet select:invalid, .sheet select option[value=""] { color: var(--ink-muted); }
.sheet select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%235B2EAE' stroke-width='2.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.sheet input:focus, .sheet select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(242,36,92,0.14);
}
.sheet input.invalid, .sheet select.invalid { border-color: var(--pink); background: #FFF3F6; }

.check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.4;
  cursor: pointer;
}
.check input {
  width: 17px; height: 17px;
  margin-top: 2px;
  accent-color: var(--pink);
  flex-shrink: 0;
}
.check a { color: var(--pink); font-weight: 700; text-decoration: none; }

.form-error {
  background: #FFE9EF;
  color: var(--pink-dark);
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 14px;
  text-align: center;
}

/* ── Pill buttons (Baloo, hard offset shadows) ────────────────────────────── */
.btn {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  width: 100%;
  transition: transform 0.12s ease, filter 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-yellow { background: var(--yellow); color: var(--purple); box-shadow: 0 4px 0 var(--yellow-dark); }
.btn-pink   { background: var(--pink); color: var(--white); box-shadow: 0 4px 0 var(--pink-dark); }
.btn-purple { background: var(--purple); color: var(--yellow); box-shadow: 0 5px 0 var(--purple-deep); }
.btn-ghost-yellow { background: transparent; border: 3px solid var(--yellow); color: var(--yellow); box-shadow: none; padding: 9px 24px; }

.btn-big { font-size: 20px; letter-spacing: 2px; padding: 13px 30px; }
.btn-stack { width: 100%; max-width: 250px; display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }

/* ── Result headlines (rotated sticker type: stroke outline + hard offset) ──
   Built with -webkit-text-stroke + a ::after offset copy — the multi-layer
   text-shadow outline misrenders long headlines in Chromium. */
.headline {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  line-height: 1.05;
  transform: rotate(-3deg);
  position: relative;
  white-space: nowrap;
}
.headline::after {
  content: attr(data-text);
  position: absolute;
  left: 4px; top: 5px;
  z-index: -1;
  -webkit-text-stroke: 0;
}
.headline--congrats-yellowpage {
  font-size: clamp(22px, 8vw, 32px);
  color: var(--pink);
  -webkit-text-stroke: 6px #fff;
  paint-order: stroke fill;
  animation: congrats-in 0.7s cubic-bezier(0.18, 0.9, 0.3, 1.35) both,
             congrats-pulse 2.8s ease-in-out 0.7s infinite;
}
.headline--congrats-yellowpage::after { color: var(--purple); }
@keyframes congrats-in {
  0%   { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  55%  { transform: scale(1.12) rotate(1deg);  opacity: 1; }
  75%  { transform: scale(0.96) rotate(-5deg); }
  100% { transform: scale(1) rotate(-3deg); }
}
@keyframes congrats-pulse {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50%      { transform: scale(1.045) rotate(-1.5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .headline--congrats-yellowpage,
  .prize-card--image-only .prize-img { animation: none; }
}
.headline--congrats-pinkpage {
  font-size: clamp(24px, 8.4vw, 32px);
  color: var(--yellow);
  transform: rotate(-2deg);
}
.headline--congrats-pinkpage::after { color: var(--pink-dark); left: 3px; top: 4px; }
.headline--clawagain {
  font-size: clamp(34px, 11vw, 44px);
  color: var(--yellow);
  -webkit-text-stroke: 7px #fff;
  paint-order: stroke fill;
}
.headline--clawagain::after { color: var(--pink); }

.sub-baloo { font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 21px; line-height: 1.3; }
.bg-yellow .sub-baloo { color: var(--purple); }
.sub-copy { font-size: 14.5px; font-weight: 600; line-height: 1.5; max-width: 280px; color: rgba(255,255,255,0.9); }

/* ── Prize card (dark navy, slightly rotated) ─────────────────────────────── */
.prize-card {
  background: #232F3E;
  border-radius: 16px;
  padding: 24px 30px;
  width: 250px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
  transform: rotate(2deg);
  text-align: center;
}
.prize-card--mini { width: 210px; padding: 16px 24px; transform: none; box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
.prize-img { max-width: 100%; max-height: 110px; border-radius: 10px; object-fit: contain; margin-bottom: 8px; }

/* Win reveal with an uploaded image: show the image alone, no dark box */
.prize-card--image-only {
  background: transparent;
  box-shadow: none;
  padding: 0;
  width: auto;
  transform: none;
}
.prize-card--image-only .prize-value,
.prize-card--image-only .prize-name,
.prize-card--image-only .prize-kind { display: none; }
.prize-card--image-only .prize-img {
  max-width: min(300px, 82vw);
  max-height: 300px;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
  margin: 0;
  transform: rotate(-3deg);   /* stylish tilt */
  animation: prize-reveal 0.6s cubic-bezier(0.18, 0.9, 0.3, 1.35) 0.25s both;
}
@keyframes prize-reveal {
  0%   { transform: scale(0.6) rotate(9deg);  opacity: 0; }
  65%  { transform: scale(1.06) rotate(-6deg); opacity: 1; }
  100% { transform: scale(1) rotate(-3deg); }
}
.prize-value {
  color: var(--yellow);
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
}
.prize-card--mini .prize-value { font-size: 26px; }
.prize-name {
  color: var(--white);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-top: 2px;
}
.prize-card--mini .prize-name { font-size: 19px; }
.prize-kind {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-top: 6px;
  text-transform: uppercase;
}

/* ── KEEP CLAWIN' box (end page) ──────────────────────────────────────────── */
.cheer-box {
  background: var(--purple);
  border-radius: 16px;
  padding: 14px 22px;
  transform: rotate(-1deg);
  box-shadow: 0 6px 0 var(--purple-deep);
}
.cheer-box .cheer {
  color: var(--yellow);
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
  text-align: center;
}
.cheer-plain {
  color: var(--white);
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 32px;
  line-height: 1.15;
  text-align: center;
}

/* ── Redemption choices (radio cards) ─────────────────────────────────────── */
.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.choice.selected { border-color: var(--pink); background: #FFF0F4; }
.choice-radio {
  width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0;
  border: 2px solid var(--line); border-radius: 50%;
  position: relative;
}
.choice.selected .choice-radio { border-color: var(--pink); }
.choice.selected .choice-radio::after {
  content: ''; position: absolute; inset: 3px;
  border-radius: 50%; background: var(--pink);
}
.choice-label { font-size: 14.5px; color: var(--ink); line-height: 1.4; b { font-weight: 800; } }
.choice-label .masked { color: var(--ink-muted); font-weight: 600; }

/* ── Invalid page warning icon (rounded triangle, centred !) ──────────────── */
.warn-icon { display: block; margin: 4px auto 0; filter: drop-shadow(0 3px 0 rgba(217,168,0,0.55)); }
.invalid-title { font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 24px; color: var(--pink); }
.invalid-copy { font-size: 14px; color: var(--ink-soft); font-weight: 600; line-height: 1.5; max-width: 280px; }
.invalid-contact-label { font-size: 13px; color: var(--ink-muted); font-weight: 700; margin-top: 6px; }
.invalid-contact { font-size: 14px; color: var(--purple); font-weight: 800; line-height: 1.6; a { color: var(--purple); text-decoration: none; } }

/* ── Site footer wordmark ─────────────────────────────────────────────────── */
.site-mark {
  color: rgba(255,255,255,0.75);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 8px;
}
.bg-yellow .site-mark, .bg-yellow-rays .site-mark { color: rgba(58,53,70,0.6); }

/* ── Loader ────────────────────────────────────────────────────────────────── */
#view-loading { justify-content: center; min-height: 70dvh; gap: 16px; }
.loader-claw { font-size: 56px; animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.loader-text { font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 17px; letter-spacing: 1px; }

/* ── Confetti (win page) — falls BEHIND the headline, prize card & button ─── */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
#view-win > *:not(.confetti) { position: relative; z-index: 1; }
.confetti i {
  position: absolute; top: -4vh;
  width: 10px; height: 16px; border-radius: 3px; opacity: 0.95;
  animation: fall linear infinite;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ── Terms overlay ────────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30,30,36,0.72);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.overlay-card {
  background: var(--white); color: var(--ink);
  width: 100%; max-width: 520px; max-height: 82dvh;
  border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column;
  animation: slide-up 0.28s ease both;
}
@keyframes slide-up { from { transform: translateY(40%); } to { transform: none; } }
.overlay-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 2px solid #F1EDF8;
}
.overlay-head h2 { font-family: 'Baloo 2', cursive; font-weight: 800; color: var(--purple); font-size: 17px; }
.overlay-close {
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: #F1EDF8; color: var(--purple);
  font-size: 15px; font-weight: 800; cursor: pointer;
}
.overlay-body { padding: 16px 20px 28px; overflow-y: auto; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }

/* Hero (homepage, no code) */
.hero-copy { font-size: 15px; font-weight: 600; max-width: 300px; line-height: 1.6; color: rgba(255,255,255,0.9); }
