@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url('../fonts/montserrat-latin-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/montserrat-latin-900i.woff2') format('woff2');
}

:root {
  --azul: #01295B;
  --azul-claro: #1B4A8C;
  --vermelho: #E3101F;
  --vermelho-escuro: #9E0914;
  --preto: #0D0D12;
  --fundo: #F3F4F8;
  --branco: #FFFFFF;
  --texto-suave: #4B5470;
  --borda-campo: #C3C9D8;
  --erro: #B4000F;
  --whatsapp: #25D366;
  --whatsapp-escuro: #0E7A40;
  --cromo: linear-gradient(180deg, #FFFFFF 0%, #C9CDD8 38%, #8E95A8 52%, #E6E8EE 70%, #A8AEBE 100%);
  --raio: 16px;
  --raio-campo: 12px;
  --sombra-cartao: 0 18px 40px -12px rgba(1, 41, 91, 0.35), 0 4px 12px rgba(1, 41, 91, 0.10);
  --ease-saida: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 500;
  color: var(--azul);
  background:
    radial-gradient(90% 50% at 70% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%),
    radial-gradient(70% 40% at 15% 75%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 70%),
    var(--fundo);
  overflow-x: hidden;
  caret-color: var(--vermelho);
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--azul); color: var(--branco); }

button, input { font: inherit; }

:focus-visible { outline: 3px solid var(--azul-claro); outline-offset: 3px; }

/* ---------- Ondas do banner ---------- */
.ondas { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.onda { position: absolute; display: block; }
.onda-topo { top: 0; left: 0; width: min(44vw, 260px); height: clamp(56px, 11vh, 110px); }
.onda-base { bottom: 0; left: 0; width: 100%; height: clamp(40px, 8vh, 90px); }

/* ---------- Estrutura ---------- */
.pagina {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
}

.topo { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 6px; }

.logo { display: block; height: clamp(74px, 15vh, 128px); width: auto; }

/* Placa BLACK FRIDAY: placa preta com filete vermelho e aro cromado, como no banner */
.selo-bf {
  margin: 0;
  padding: 6px 16px 7px;
  font-style: italic;
  font-weight: 900;
  font-size: clamp(19px, 5.4vw, 26px);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--branco);
  background: var(--preto);
  border-radius: 10px;
  transform: skewX(-6deg);
  box-shadow:
    0 0 0 2px var(--vermelho),
    0 0 0 4px #B9BECB,
    0 10px 20px -6px rgba(13, 13, 18, 0.45);
  white-space: nowrap;
}
.selo-friday { color: #FF2A36; }

/* ---------- Palco da roleta ---------- */
.palco { position: relative; z-index: 1; }

.roleta { position: relative; width: 100%; aspect-ratio: 1; }
.roleta svg { display: block; width: 100%; height: 100%; overflow: visible; }

.painel-jogo, .painel-premio, .painel-aviso { display: none; }

/* Etapa form: roleta grande atrás, desfocada; cartão na frente */
body[data-etapa="form"] .palco {
  position: absolute;
  left: 50%;
  top: clamp(150px, 27vh, 240px);
  width: min(122vw, 560px);
  transform: translateX(-50%);
  pointer-events: none;
}
body[data-etapa="form"] .roleta { filter: blur(1.2px); opacity: 0.88; }

/* ---------- Cartão-formulário ---------- */
.cartao-form {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 18px 18px 14px;
  background: var(--branco);
  border: 2px solid var(--azul);
  border-radius: var(--raio);
  box-shadow: var(--sombra-cartao);
  transition: opacity 260ms var(--ease-saida), transform 420ms var(--ease-saida);
}
body:not([data-etapa="form"]) .cartao-form { display: none; }

.titulo {
  margin: 0 0 4px;
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--azul);
}
.titulo em { font-style: normal; color: var(--vermelho); white-space: nowrap; }

.apoio { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--texto-suave); }

.campo { margin-bottom: 8px; }
.campo label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--azul); }
.campo input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--azul);
  background: var(--branco);
  border: 1.5px solid var(--borda-campo);
  border-radius: var(--raio-campo);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.campo input::placeholder { color: #5F6780; font-weight: 500; }
.campo input:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(27, 74, 140, 0.25); }
.campo input[aria-invalid="true"] { border-color: var(--erro); box-shadow: 0 0 0 3px rgba(180, 0, 15, 0.12); }
.erro { margin: 3px 2px 0; min-height: 0; font-size: 12px; font-weight: 700; color: var(--erro); }
.erro:empty { display: none; }

/* ---------- Botões ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 150ms ease;
}

.btn-principal {
  margin-top: 6px;
  min-height: 54px;
  color: var(--branco);
  background: linear-gradient(180deg, #E31C29 0%, #D20E1B 55%, #B20A16 100%);
  box-shadow: 0 5px 0 var(--vermelho-escuro), 0 12px 22px -6px rgba(227, 16, 31, 0.55);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.btn-principal:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--vermelho-escuro), 0 6px 12px -6px rgba(227, 16, 31, 0.55); }
.btn:disabled { cursor: default; opacity: 0.75; }

.btn .giro-carregando {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--branco);
  animation: girar-carregando 700ms linear infinite;
}
@keyframes girar-carregando { to { transform: rotate(360deg); } }

.letras-finas { margin: 10px 2px 0; font-size: 12px; line-height: 1.4; color: var(--texto-suave); text-align: center; }
.letras-finas strong { color: var(--azul); font-weight: 800; }

.btn-som {
  display: none;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 12px rgba(1, 41, 91, 0.18);
  color: var(--azul);
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ---------- Roleta (SVG gerado por js/roleta.js) ---------- */
.roleta .rotulo { font-family: 'Montserrat', system-ui, sans-serif; font-weight: 900; font-size: 46px; letter-spacing: -0.02em; }
.roleta .rotulo-pequeno { font-size: 19px; letter-spacing: 0.02em; }
.roleta .luz { fill: #FFE7A3; transition: fill 120ms linear, opacity 120ms linear; }
.roleta svg:not(.celebrando) .luz { animation: luz-corre 1.2s steps(1) infinite; }
.roleta svg:not(.celebrando) .luz-par { animation-delay: -0.6s; }
.roleta svg.rodando .luz { animation-duration: 0.36s; }
.roleta svg.rodando .luz-par { animation-delay: -0.18s; }
.roleta svg.celebrando .luz { animation: luz-pisca 0.25s steps(1) infinite; }
@keyframes luz-corre { 0% { fill: #FFF6D6; } 50% { fill: #6E7385; } }
@keyframes luz-pisca { 0% { fill: #FFFFFF; } 50% { fill: #FF2A36; } }
.roleta .ponteiro.bate path:last-of-type { transform-box: fill-box; transform-origin: 50% 0; animation: ponteiro-bate 90ms ease-out; }
@keyframes ponteiro-bate { 40% { transform: rotate(-9deg); } }
.roleta .disco { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .roleta svg .luz { animation: none !important; }
}

/* ---------- Etapa jogo ---------- */
body[data-etapa="jogo"] .palco {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 8px;
  animation: entra 520ms var(--ease-saida) both;
}
body[data-etapa="jogo"] .roleta { width: min(100%, 44vh, 420px); }
body:not([data-etapa="form"]) .logo { height: clamp(56px, 10vh, 110px); }
body:not([data-etapa="form"]) .selo-bf { font-size: clamp(17px, 4.6vw, 24px); }
body[data-etapa="jogo"] .painel-jogo { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
body:not([data-etapa="jogo"]):not([data-etapa="form"]) .palco { display: none; }

.placar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chances, .melhor {
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.chances { color: var(--branco); background: var(--azul); }
.melhor { color: var(--branco); background: var(--preto); box-shadow: 0 0 0 2px var(--vermelho) inset; }
.chances strong, .melhor strong { font-weight: 900; }
.melhor strong { color: #FF2A36; }

.mensagem-giro {
  margin: 0;
  min-height: 2.6em;
  font-size: clamp(16px, 4.6vw, 19px);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
  color: var(--azul);
}
#btn-girar { font-size: 19px; letter-spacing: 0.08em; }

/* ---------- Etapas prêmio e aviso ---------- */
body[data-etapa="premio"] .painel-premio,
body[data-etapa="aviso"] .painel-aviso {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: auto 0;
  padding: 16px 0 8px;
  animation: entra 520ms var(--ease-saida) both;
}

.cartao-premio {
  position: relative;
  padding: 22px 20px 20px;
  text-align: center;
  color: var(--branco);
  background: radial-gradient(120% 80% at 50% 0%, #23232D 0%, var(--preto) 60%);
  border-radius: 20px;
  box-shadow: 0 0 0 3px var(--vermelho), 0 0 0 7px #B9BECB, 0 24px 44px -14px rgba(13, 13, 18, 0.55);
}
.cartao-premio p { margin: 0; }
.cp-rotulo { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #C9CDD8; }
.cp-valor { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 6px 0 2px !important; line-height: 0.9; }
.cp-num { font-size: clamp(76px, 26vw, 112px); font-weight: 900; letter-spacing: -0.04em; color: #FF2A36; font-variant-numeric: tabular-nums; }
.cp-off { font-size: clamp(28px, 8vw, 40px); font-weight: 900; font-style: italic; }
.cp-escopo { font-size: 15px; font-weight: 700; }
.cp-nome { margin-top: 14px !important; font-size: 20px; font-weight: 900; }
.cp-codigo { margin-top: 4px !important; font-size: 15px; font-weight: 600; color: #C9CDD8; }
.cp-codigo strong { color: var(--branco); font-weight: 900; letter-spacing: 0.08em; }
.cp-validade { margin-top: 10px !important; display: inline-block; font-size: 13px; font-weight: 800; color: var(--preto); background: var(--branco); padding: 4px 10px; border-radius: 999px; }

.btn-whatsapp { color: var(--branco); background: var(--whatsapp-escuro); box-shadow: 0 5px 0 #0B6B38, 0 12px 22px -8px rgba(18, 140, 75, 0.6); }
.btn-whatsapp:active { transform: translateY(4px); box-shadow: 0 1px 0 #0B6B38; }
.btn-secundario { color: var(--azul); background: var(--branco); box-shadow: inset 0 0 0 2px var(--azul); }

.aviso-titulo { margin: 0; font-size: clamp(22px, 6.4vw, 28px); font-weight: 900; line-height: 1.1; text-align: center; text-wrap: balance; }
.aviso-texto { margin: 0 0 6px; font-size: 16px; line-height: 1.5; text-align: center; color: var(--texto-suave); }
body[data-etapa="aviso"] .painel-aviso { padding: 22px 18px; background: var(--branco); border: 2px solid var(--azul); border-radius: var(--raio); box-shadow: var(--sombra-cartao); }

@keyframes entra { from { opacity: 0; transform: translateY(18px) scale(0.98); } }

/* ---------- Confete, overlay do cartão, som ---------- */
canvas.confete { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 20; }

.overlay-cartao {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 16px max(20px, env(safe-area-inset-bottom));
  background: rgba(13, 13, 18, 0.92);
  color: var(--branco);
  text-align: center;
}
.overlay-cartao img { width: auto; max-width: 100%; max-height: 72vh; border-radius: 12px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); -webkit-touch-callout: default; user-select: auto; }
.overlay-cartao p { margin: 0; font-size: 16px; font-weight: 800; }
.overlay-cartao .btn { max-width: 320px; }

body[data-etapa="jogo"] .btn-som, body[data-etapa="premio"] .btn-som { display: grid; place-items: center; }
.btn-som svg { width: 22px; height: 22px; }
.premio-titulo { margin: 0 0 4px; font-size: clamp(22px, 6.2vw, 28px); font-weight: 900; line-height: 1.1; letter-spacing: -0.02em; text-align: center; text-wrap: balance; }
.btn .ico { width: 22px; height: 22px; flex: none; }
