/* ── Scratch Card Reveal — corner-store lotto ticket ────────────────
   Deep teal counter, scarlet ticket with gold pinstripes, starburst
   badge, brushed-silver foil, slab-serif ticket lettering. */

:root {
  --counter: #0f4c4c;
  --counter-deep: #082e2e;
  --scarlet: #c8362e;
  --scarlet-deep: #9c241e;
  --gold: #f2c14e;
  --ticket-cream: #fdf3e3;
  --ink: #33231c;
  --ink-soft: #82705f;
  --card: #fffaf0;
  --line: rgba(51, 35, 28, 0.16);
  --err: #c8362e;
  --font-slab: 'Alfa Slab One', serif;
  --font-body: 'Rubik', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(80% 60% at 50% 0%, var(--counter) 0%, var(--counter-deep) 100%);
  background-attachment: fixed;
  color: var(--ticket-cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page { display: flex; flex-direction: column; min-height: 100vh; }

.wrap { width: 100%; max-width: 520px; margin: 0 auto; padding: 0 20px; }

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

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

.kicker {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.hero h1 {
  font-family: var(--font-slab);
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

/* ── Notes ────────────────────────────────────────────────────────── */
.note {
  margin: 18px 0;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(253, 243, 227, 0.12);
  border: 1.5px solid rgba(242, 193, 78, 0.4);
  text-align: center;
}

/* ── Ticket ───────────────────────────────────────────────────────── */
.ticket {
  background: linear-gradient(160deg, var(--scarlet), var(--scarlet-deep));
  border: 3px solid var(--gold);
  outline: 6px solid var(--scarlet-deep);
  border-radius: 14px;
  padding: 22px 20px 16px;
  margin: 10px 0 22px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5);
}

.ticket-head { position: relative; text-align: center; padding-bottom: 16px; }

.burst {
  position: absolute;
  top: -34px;
  right: -28px;
  width: 74px;
  height: 74px;
  background: var(--gold);
  color: var(--scarlet-deep);
  font-family: var(--font-slab);
  font-size: 0.95rem;
  line-height: 1.05;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  clip-path: polygon(50% 0%, 61% 12%, 76% 6%, 79% 22%, 95% 25%, 88% 39%, 100% 50%, 88% 61%, 95% 75%, 79% 78%, 76% 94%, 61% 88%, 50% 100%, 39% 88%, 24% 94%, 21% 78%, 5% 75%, 12% 61%, 0% 50%, 12% 39%, 5% 25%, 21% 22%, 24% 6%, 39% 12%);
  transform: rotate(12deg);
}

.ticket-title {
  font-family: var(--font-slab);
  font-size: 1.7rem;
  color: var(--ticket-cream);
  letter-spacing: 0.02em;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.ticket-sub { color: rgba(253, 243, 227, 0.85); font-size: 0.9rem; font-weight: 500; margin-top: 2px; }

/* Scratch area */
.scratch-frame {
  position: relative;
  background: var(--ticket-cream);
  border: 3px dashed var(--gold);
  border-radius: 10px;
  overflow: hidden;
  touch-action: none;
}

.symbols {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 26px 10px;
}

.sym {
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: inset 0 -6px 0 rgba(51, 35, 28, 0.1);
}

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

.scratch-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-slab);
  font-size: 1.2rem;
  color: rgba(51, 35, 28, 0.55);
  pointer-events: none;
  animation: hintpulse 1.6s ease-in-out infinite;
}

@keyframes hintpulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}

.ticket-fine {
  text-align: center;
  color: rgba(253, 243, 227, 0.7);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 12px;
}

/* ── Card ─────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  color: var(--ink);
  border-radius: 14px;
  padding: 26px 24px 28px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}

.card h2 {
  font-family: var(--font-slab);
  font-size: 1.35rem;
  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.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

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

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

.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-slab);
  font-size: 1rem;
  letter-spacing: 0.03em;
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1.2;
}

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

.btn-primary {
  background: linear-gradient(120deg, var(--scarlet), var(--scarlet-deep));
  color: var(--ticket-cream);
  box-shadow: 0 6px 0 #6d1712;
}

.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 0 #6d1712; }

.btn-ghost {
  background: #fff;
  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(253, 243, 227, 0.4);
  border-top-color: var(--ticket-cream);
  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-slab);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--scarlet);
  margin-bottom: 8px;
}

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

.result-card h2 { font-family: var(--font-slab); font-size: 1.5rem; }

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

.code {
  font-family: var(--font-slab);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  background: var(--ink);
  color: var(--gold);
  padding: 10px 22px;
  border-radius: 8px;
}

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

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

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

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

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

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 20px;
  color: rgba(253, 243, 227, 0.6);
  font-size: 0.85rem;
}

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

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .field-grid { grid-template-columns: 1fr; }
  .sym { width: 70px; height: 70px; font-size: 2.4rem; }
  .burst { width: 62px; height: 62px; font-size: 0.8rem; top: -28px; right: -18px; }
}

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