/* =============================================================================
   RASPADINHA DA COPA — CSS v5
   Fundo: verde escuro elegante + canvas com partículas e bandeira SVG
   Grade 3×3 com canvas de scratch real (dedo/mouse)
   Cupom premium tema escuro integrado
   ============================================================================= */

:root {
  --verde:        #009C3B;
  --verde-dark:   #004d1a;
  --verde-mid:    #006622;
  --verde-light:  #00C94C;
  --amarelo:      #FFDF00;
  --amarelo-dark: #D4B800;
  --azul:         #002776;
  --branco:       #FFFFFF;
  --ouro:         #C9A227;
  --font: 'Plus Jakarta Sans','Segoe UI',system-ui,-apple-system,sans-serif;
  --radius: 16px;
  --radius-lg: 24px;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
img{display:block;max-width:100%}
button{cursor:pointer;font-family:var(--font)}
a{text-decoration:none;color:inherit}

/* ── Página ─────────────────────────────────────────────────────────── */
.rasp-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%,   #004d1a 0%,  transparent 70%),
    radial-gradient(ellipse 60% 50% at 10% 80%,  #003d14 0%,  transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 70%,  #002a0e 0%,  transparent 60%),
    linear-gradient(180deg, #001f0a 0%, #003014 40%, #005520 70%, #002a10 100%);
  font-family: var(--font);
  color: var(--branco);
  overflow-x: hidden;
  position: relative;
}

/* Canvas de fundo */
#rasp-bg-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Canvas de celebração */
#rasp-confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Vinheta */
.rasp-body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 75% 65% at 50% 38%,
    transparent 20%,
    rgba(0, 12, 4, 0.60) 100%
  );
}

.rasp-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  position: relative;
  z-index: 1;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.rasp-header { text-align: center; padding: 20px 0 28px; }

.rasp-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 8px 20px;
  margin-bottom: 20px;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--branco);
  transition: background .2s;
  text-decoration: none;
}
.rasp-logo-badge:hover { background: rgba(255,255,255,.14); }

.rasp-logo-img {
  height: 50px;
  width: auto;
  filter: brightness(0) invert(1);
  display: inline-block;
}

.rasp-bandeira {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.rasp-bandeira-svg {
  width: 110px;
  height: 86px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.45);
  flex-shrink: 0;
  object-fit: cover;
}

.rasp-titulo {
  font-size: clamp(2rem,7vw,3rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
}
.rasp-titulo span { color: var(--amarelo); display: block; }

.rasp-subtitulo {
  margin-top: 12px;
  font-size: clamp(.95rem,3vw,1.1rem);
  color: rgba(255,255,255,.75);
  font-weight: 600;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

/* ── Card ────────────────────────────────────────────────────────────── */
.rasp-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.13);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
  padding: clamp(20px,5vw,36px);
  margin-bottom: 24px;
}

/* ── Steps ───────────────────────────────────────────────────────────── */
.rasp-step { animation: fadeUp .4s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rasp-step-title {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--amarelo);
  display: flex;
  align-items: center;
  gap: 10px;
}
.rasp-step-desc {
  font-size: .98rem;
  color: rgba(255,255,255,.72);
  margin-bottom: 22px;
  font-weight: 600;
}

/* ── Input CPF ───────────────────────────────────────────────────────── */
.rasp-input-group { display: flex; gap: 10px; flex-wrap: wrap; }
.rasp-input {
  flex: 1;
  min-width: 200px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 2px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  color: var(--branco);
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font);
  letter-spacing: 2px;
  outline: none;
  transition: border-color .25s, background .25s;
}
.rasp-input::placeholder { color: rgba(255,255,255,.40); letter-spacing: 1px; font-weight: 600; }
.rasp-input:focus { border-color: var(--amarelo); background: rgba(255,255,255,.15); }
.rasp-input.erro { border-color: #ff4d4d; }

/* ── Botões ──────────────────────────────────────────────────────────── */
.rasp-btn {
  padding: 16px 24px;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .5px;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  white-space: nowrap;
}
.rasp-btn:disabled { opacity: .55; cursor: not-allowed; }

.rasp-btn-primary {
  background: linear-gradient(135deg, var(--amarelo) 0%, var(--ouro) 100%);
  color: var(--azul);
  box-shadow: 0 6px 24px rgba(255,223,0,.30);
}
.rasp-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(255,223,0,.40);
}

.rasp-btn-verde {
  background: linear-gradient(135deg, var(--verde-light) 0%, var(--verde) 100%);
  color: var(--branco);
  box-shadow: 0 6px 24px rgba(0,156,59,.30);
  width: 100%;
  font-size: 1.1rem;
  justify-content: center;
}
.rasp-btn-verde:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0,156,59,.40);
}

.rasp-btn-export {
  background: linear-gradient(135deg, #FFD700, #C9A227);
  color: #1a1a1a;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 6px 24px rgba(0,0,0,.15);
  width: 100%;
  font-size: 1.05rem;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.rasp-btn-export::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 60%);
}
.rasp-btn-export:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0,0,0,.45);
  border-color: rgba(255,255,255,.35);
}
.rasp-btn-export .rasp-spinner {
  border-top-color: var(--branco);
  border-color: rgba(255,255,255,.3);
}

.rasp-erro-msg {
  margin-top: 10px;
  color: #ff8080;
  font-size: .92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}

/* ═══════════════════════════════════════════════════════════════════════
   GRADE 3×3 — SCRATCH REAL
   ═══════════════════════════════════════════════════════════════════════ */
.rasp-instrucao {
  text-align: center;
  margin-bottom: 14px;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: pulse 2.2s ease infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

.rasp-grade {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 480px;
  margin: 0 auto 8px;
}

.rasp-celula {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.38);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Ccircle cx='18' cy='18' r='15' fill='%23C9A227' stroke='%23A87F1A' stroke-width='2'/%3E%3Ccircle cx='18' cy='18' r='9' fill='none' stroke='%23A87F1A' stroke-width='1.5'/%3E%3C/svg%3E") 18 18, crosshair;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.rasp-celula-premio {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px;
  text-align: center;
  background: linear-gradient(135deg, #fff8e0 0%, #fffde7 60%, #fff5cc 100%);
}
.celula-icone { font-size: clamp(1.5rem,4.5vw,2.2rem); line-height: 1; }
.celula-label {
  font-size: clamp(.52rem,1.6vw,.7rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--azul);
  line-height: 1.2;
}
.celula-valor {
  font-size: clamp(.9rem,3vw,1.35rem);
  font-weight: 900;
  color: var(--verde-dark);
  line-height: 1;
  letter-spacing: -1px;
}

.rasp-celula canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.rasp-celula.revelada canvas {
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESULTADO
   ═══════════════════════════════════════════════════════════════════════ */
.rasp-resultado { display: none; animation: fadeUp .5s ease both; }
.rasp-resultado.ativo { display: block; }

.rasp-resultado-emoji {
  font-size: 4rem;
  margin-bottom: 10px;
  display: block;
  animation: bounce 1.2s ease infinite;
}
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }

.rasp-resultado-titulo {
  font-size: clamp(1.5rem,5vw,2rem);
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--amarelo);
  text-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.rasp-resultado-subtitulo {
  font-size: 1rem;
  color: rgba(255,255,255,.78);
  font-weight: 600;
  margin-bottom: 28px;
}

/* ═══════════════════════════════════════════════════════════════════════
   CUPOM PREMIUM — Tema escuro integrado
   ═══════════════════════════════════════════════════════════════════════ */
.rasp-cupom-box {
  position: relative;
  margin: 32px 0;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(0, 20, 10, 0.95) 0%, rgba(0, 32, 16, 0.98) 100%);
  border: 1px solid rgba(255, 215, 0, 0.12);
}

/* ── Topo: logo + badge ──────────────────────────────────────────── */
.rasp-cupom-topo {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rasp-cupom-logo {
  height: 26px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  flex-shrink: 0;
}

.rasp-cupom-badge-topo {
  padding: 5px 14px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #FFD700;
  white-space: nowrap;
}

/* ── Destaque do desconto ────────────────────────────────────────── */
.rasp-cupom-destaque {
  padding: 36px 24px 32px;
  text-align: center;
  position: relative;
  background: radial-gradient(circle at 50% 40%, rgba(255, 215, 0, 0.06) 0%, transparent 60%);
}

.rasp-cupom-pct {
  font-size: clamp(4rem, 10vw, 5.5rem);
  font-weight: 900;
  line-height: 0.85;
  color: #FFD700;
  text-shadow: 
    0 0 30px rgba(255, 215, 0, 0.25),
    0 0 60px rgba(255, 215, 0, 0.1);
  letter-spacing: -2px;
  margin-bottom: 6px;
}

.rasp-cupom-pct-sym {
  font-size: 0.5em;
  vertical-align: super;
  margin-left: -4px;
}

.rasp-cupom-pct-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
  letter-spacing: 0.3px;
}

/* ── Separador pontilhado ────────────────────────────────────────── */
.rasp-cupom-perf {
  position: relative;
  height: 16px;
  margin: 0 28px;
  display: flex;
  align-items: center;
}

.rasp-cupom-perf-line {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 215, 0, 0.2) 0px,
    rgba(255, 215, 0, 0.2) 5px,
    transparent 5px,
    transparent 10px
  );
}

.rasp-cupom-perf-circle {
  display: none;
}

/* ── Área do código ──────────────────────────────────────────────── */
.rasp-cupom-codigo-area {
  padding: 24px 24px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.rasp-cupom-codigo-label {
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 14px;
}

.rasp-cupom-codigo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 18px;
}

.rasp-cupom-codigo {
  flex: 1;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 5px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
}

.rasp-cupom-copy-btn {
  padding: 10px 18px;
  background: linear-gradient(135deg, #FFD700, #C9A227);
  border: none;
  border-radius: 10px;
  color: #1a1a1a;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.rasp-cupom-copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #FFE44D, #D4B800);
}

.rasp-cupom-copy-btn.copied {
  background: var(--verde);
  color: white;
}

/* ── Rodapé ──────────────────────────────────────────────────────── */
.rasp-cupom-rodape {
  padding: 18px 24px 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.rasp-cupom-rodape-validade {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ═══════════════════════════════════════════════════════════════════════
   SEM PRÊMIO / JÁ PARTICIPOU
   ═══════════════════════════════════════════════════════════════════════ */
.rasp-resultado-semprize { text-align: center; padding: 8px 0; }
.rasp-semprize-emoji { font-size: 3.5rem; margin-bottom: 8px; display: block; }
.rasp-semprize-titulo { font-size: 1.6rem; font-weight: 900; color: rgba(255,255,255,.9); margin-bottom: 8px; }
.rasp-semprize-sub {
  color: rgba(255,255,255,.62);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  max-width: 42ch;
  margin-left: auto;
  margin-right: auto;
}

.rasp-ja-participou { text-align: center; padding: 10px 0; display: none; animation: fadeUp .4s ease both; }
.rasp-ja-participou.ativo { display: block; }
.rasp-ja-emoji { font-size: 2.8rem; margin-bottom: 10px; display: block; }
.rasp-ja-titulo { font-size: 1.25rem; font-weight: 900; color: var(--amarelo); margin-bottom: 8px; }
.rasp-ja-sub { font-size: .98rem; color: rgba(255,255,255,.72); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   SPINNER / RODAPÉ
   ═══════════════════════════════════════════════════════════════════════ */
.rasp-spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(0,39,118,.3);
  border-top-color: var(--azul);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.rasp-footer-info {
  text-align: center;
  padding: 16px 0 0;
  font-size: .82rem;
  color: rgba(255,255,255,.45);
  font-weight: 600;
  line-height: 1.6;
}
.rasp-footer-info a { color: rgba(255,255,255,.65); text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVO
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 520px) {
  .rasp-input-group { flex-direction: column; }
  .rasp-btn-primary { width: 100%; justify-content: center; }
  .rasp-grade { gap: 7px; }
  .rasp-celula { border-radius: 9px; }

  /* Cupom responsivo */
  .rasp-cupom-box {
    margin: 24px 0;
    border-radius: 16px;
  }
  
  .rasp-cupom-topo {
    padding: 16px 18px;
  }
  
  .rasp-cupom-destaque {
    padding: 28px 18px 24px;
  }
  
  .rasp-cupom-perf {
    margin: 0 20px;
  }
  
  .rasp-cupom-codigo-area {
    padding: 20px 18px 18px;
  }
  
  .rasp-cupom-codigo {
    letter-spacing: 2px;
  }
  
  .rasp-cupom-codigo-row {
    padding: 12px 14px;
    gap: 10px;
  }
  
  .rasp-cupom-copy-btn {
    padding: 8px 12px;
    font-size: 0.68rem;
  }
  
  .rasp-cupom-rodape {
    padding: 14px 18px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rasp-instrucao, .rasp-resultado-emoji, .rasp-step { animation: none !important; }
  .rasp-btn:hover { transform: none !important; }
}

.rasp-body .container { padding-left: 0; padding-right: 0; }