/* ── Emoji Match Scratch — glossy sticker-sheet pop ─────────────────
   Bubblegum-lavender gradient, die-cut sticker card with thick
   white border, holographic foil windows, puffy doodles. */

:root {
  --bubblegum: #ff9ad5;
  --lavender: #b79cff;
  --hotpink: #ff4fa8;
  --cyan: #4fd8ff;
  --ink: #4a3560;
  --ink-soft: #927fae;
  --card: #ffffff;
  --line: #efe8fb;
  --err: #e5478a;
  --font-display: 'Chewy', cursive;
  --font-body: 'Quicksand', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background: linear-gradient(160deg, var(--bubblegum) 0%, var(--lavender) 100%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page { position: relative; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }

.wrap { position: relative; width: 100%; max-width: 520px; margin: 0 auto; padding: 0 20px; z-index: 1; }

main { flex: 1 0 auto; padding-bottom: 70px; }

/* ── Floating doodles ─────────────────────────────────────────────── */
.doodles { position: absolute; inset: 0; pointer-events: none; }

.doodle {
  position: absolute;
  font-size: 1.9rem;
  filter: drop-shadow(2px 3px 0 rgba(74, 53, 96, 0.35));
  animation: bob 6.5s ease-in-out infinite;
}

.doodle.d1 { top: 8%; left: 6%; }
.doodle.d2 { top: 14%; right: 7%; animation-delay: 1.2s; }
.doodle.d3 { top: 46%; left: 4%; animation-delay: 2.4s; }
.doodle.d4 { top: 60%; right: 5%; animation-delay: 3.6s; }
.doodle.d5 { bottom: 12%; left: 10%; animation-delay: 4.8s; }

@keyframes bob {
  0%, 100% { translate: 0 0; rotate: -6deg; }
  50% { translate: 0 -14px; rotate: 6deg; }
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 48px 0 22px; }

.kicker {
  display: inline-block;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--hotpink);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 18px;
  margin-bottom: 14px;
  box-shadow: 0 6px 16px rgba(74, 53, 96, 0.25);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.7rem, 12vw, 4rem);
  line-height: 1;
  color: #fff;
  text-shadow: 3px 4px 0 var(--hotpink), 6px 8px 0 rgba(74, 53, 96, 0.3);
}

.hero .sub { margin-top: 14px; color: #fff; font-weight: 700; max-width: 340px; margin-left: auto; margin-right: auto; }

/* ── Notes ────────────────────────────────────────────────────────── */
.note {
  margin: 18px 0;
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
  font-weight: 600;
}

/* ── Sticker card ─────────────────────────────────────────────────── */
.pick-line { text-align: center; color: #fff; font-weight: 700; margin-bottom: 18px; }

.sticker-card {
  background: linear-gradient(150deg, #fff6fc, #f3edff);
  border: 8px solid #fff;
  border-radius: 28px;
  padding: 30px 22px 22px;
  box-shadow: 0 22px 50px rgba(74, 53, 96, 0.4);
  transform: rotate(-1.5deg);
}

.window-row { display: flex; justify-content: center; gap: 14px; }

.scratch-window {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 0 4px #fff, 0 8px 18px rgba(74, 53, 96, 0.25);
  background: #fff;
  flex-shrink: 0;
}

.window-symbol {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
}

.foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.sticker-caption {
  font-family: var(--font-display);
  text-align: center;
  color: var(--hotpink);
  font-size: 1.1rem;
  margin-top: 18px;
}

/* ── Card ─────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: 24px;
  padding: 26px 24px 28px;
  box-shadow: 0 18px 44px rgba(74, 53, 96, 0.35);
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 18px;
}

/* Fields */
.field { margin-bottom: 14px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

label {
  display: block;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 13px 15px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--ink);
  background: #fbf9ff;
  border: 2px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.15s ease;
}

input:focus { outline: none; border-color: var(--hotpink); }
input.error { border-color: var(--err); }
input::placeholder { color: var(--ink-soft); opacity: 0.7; }

.fine { margin-top: 12px; text-align: center; color: var(--ink-soft); font-size: 0.85rem; font-weight: 600; }

.form-error { color: var(--err); font-weight: 700; text-align: center; margin-top: 12px; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  padding: 14px 30px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1.2;
}

.btn:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(120deg, var(--hotpink), #d63384);
  color: #fff;
  box-shadow: 0 10px 26px rgba(255, 79, 168, 0.5);
}

.btn-ghost {
  background: #fbf9ff;
  color: var(--ink);
  border: 2px solid var(--line);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 20px;
}

.btn-block { width: 100%; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result ───────────────────────────────────────────────────────── */
.result-card { text-align: center; margin-top: 12px; }

.result-kicker {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--hotpink);
  margin-bottom: 8px;
}

.lose-kicker { color: var(--ink-soft); }

.result-card h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; }

.code-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 6px;
  flex-wrap: wrap;
}

.code {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  background: var(--ink);
  color: var(--cyan);
  padding: 10px 22px;
  border-radius: 12px;
}

.qr-wrap { margin: 16px 0 6px; }

.qr-wrap img { width: 150px; height: 150px; border-radius: 12px; border: 4px solid var(--ink); }

.qr-note { color: var(--ink-soft); font-size: 0.88rem; font-weight: 600; margin-top: 8px; }

.expiry { color: var(--err); font-weight: 700; font-size: 0.9rem; margin-top: 12px; }

.result-note { color: var(--ink-soft); font-weight: 600; margin-top: 12px; font-size: 0.92rem; }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 600;
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .field-grid { grid-template-columns: 1fr; }
  .scratch-window { width: 84px; height: 84px; }
  .window-symbol { font-size: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .doodles { display: none; }
}
