/* ==========================================================================
   Recado do Noel · quiz
   A cena do vídeo fica sempre à vista e muda conforme a pessoa responde.
   ========================================================================== */

.quiz {
  position: relative;
  min-height: 100dvh;
  background:
    radial-gradient(70% 40% at 85% 12%, rgba(255, 154, 61, 0.16), transparent 70%),
    radial-gradient(60% 34% at 8% 0%, rgba(247, 220, 140, 0.12), transparent 70%),
    linear-gradient(180deg, #061711 0%, #0c2a1f 70%, #0a2118 100%) fixed;
}
.q-palco { position: relative; z-index: 1; }
.quiz.grao::before { position: fixed; }

/* topo e andamento ------------------------------------------------------------- */

.q-topo {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(5, 19, 14, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}
.q-topo__dentro { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.q-conta {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ouro-300);
  white-space: nowrap;
}
.q-barra {
  --p: 0%;
  position: relative;
  height: 5px;
  background: rgba(255, 255, 255, 0.09);
}
.q-barra span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p);
  background: linear-gradient(90deg, var(--ouro-700), var(--ouro-300));
  box-shadow: 0 0 14px rgba(247, 220, 140, 0.7);
  transition: width 0.7s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.q-barra i {
  position: absolute;
  top: 50%;
  left: clamp(12px, var(--p), calc(100% - 12px));
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  background: #fffbe8;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 6px var(--ouro-300));
  transition: left 0.7s cubic-bezier(0.3, 0.7, 0.2, 1);
  animation: gira-estrela 5s linear infinite;
}
@keyframes gira-estrela { to { transform: rotate(360deg); } }

/* palco ------------------------------------------------------------------------ */

.q-palco {
  display: grid;
  gap: 18px;
  padding-block: 16px 130px;
  align-content: start;
}

/* cenas: no celular é uma janela que "passeia" pelo papel */
.q-cenas {
  position: relative;
  height: clamp(172px, 30dvh, 270px);
  border-radius: 24px;
  overflow: hidden;
  background: #1b110a;
  box-shadow: 0 0 0 1px rgba(247, 220, 140, 0.4), 0 0 0 6px rgba(247, 220, 140, 0.06), 0 26px 50px -22px rgba(0, 0, 0, 0.9);
}
.modo-passo .q-cenas .cena {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-radius: 0;
  opacity: 0;
  transform: translateY(calc(var(--foco, 50) * -1%));
  transition: opacity 0.5s ease, transform 1s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.modo-passo .q-cenas .cena.ativa { opacity: 1; }
.q-cenas .espera { visibility: hidden; }

/* pergunta */
.q-bloco { display: grid; gap: 16px; }
/* a animação fica nos filhos (menos a barra de botões, que é fixa no celular:
   um pai animado com transform prenderia o "position: fixed" dentro dele) */
.q-bloco.entra-dir > :not(.q-nav) { animation: entra-dir 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.q-bloco.entra-esq > :not(.q-nav) { animation: entra-esq 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.q-bloco > :nth-child(2) { animation-delay: 0.05s; }
.q-bloco > :nth-child(3) { animation-delay: 0.1s; }
.q-bloco > :nth-child(n + 4) { animation-delay: 0.15s; }
@keyframes entra-dir {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: none; }
}
@keyframes entra-esq {
  from { opacity: 0; transform: translateX(-26px); }
  to { opacity: 1; transform: none; }
}

.papo { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.papo__noel {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ouro-300);
  box-shadow: 0 0 0 4px rgba(247, 220, 140, 0.14), 0 10px 20px -8px rgba(0, 0, 0, 0.8);
}
.papo__balao {
  position: relative;
  padding: 14px 18px;
  border-radius: 6px 22px 22px 22px;
  background: linear-gradient(175deg, #fdf6e3, #f0e0b9);
  color: var(--tinta);
  box-shadow: var(--sombra-papel);
}
.papo__fala {
  font-family: var(--f-titulo);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 700;
  font-size: clamp(1.25rem, 5vw, 1.7rem);
  line-height: 1.18;
  text-wrap: balance;
  outline: none;
}
.q-dica { font-size: 0.95rem; color: var(--texto-suave); padding-left: 2px; }

/* campo de texto */
.q-texto { display: grid; gap: 8px; }
.q-rotulo {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ouro-300);
}
.q-texto__linha { position: relative; }
.q-entrada {
  width: 100%;
  height: 64px;
  padding: 0 64px 0 20px;
  border-radius: 20px;
  border: 1.5px solid rgba(247, 220, 140, 0.45);
  background: rgba(0, 0, 0, 0.4);
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  caret-color: var(--ouro-300);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.q-entrada::placeholder { color: rgba(233, 240, 235, 0.42); font-weight: 600; }
.q-entrada:focus {
  outline: none;
  border-color: var(--ouro-300);
  box-shadow: 0 0 0 4px rgba(247, 220, 140, 0.18), 0 0 44px rgba(247, 220, 140, 0.22);
}
.q-conta-letras {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(233, 240, 235, 0.5);
}

.q-sugestoes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.q-sugestoes__rot { font-size: 0.85rem; font-weight: 700; color: var(--texto-suave); margin-right: 2px; }
.q-pilula {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--linha);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ouro-100);
  transition: background 0.2s, transform 0.15s;
}
.q-pilula:hover { background: rgba(247, 220, 140, 0.14); }
.q-pilula:active { transform: scale(0.96); }

/* opções */
.q-opcoes { display: grid; gap: 10px; }
.q-opcoes--colunas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.q-opcoes--grade { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.q-op {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 10px 14px 10px 18px;
  border-radius: 18px;
  border: 1.5px solid var(--linha);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.25;
  text-align: left;
  color: var(--texto);
  transition: transform 0.15s ease, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.q-op .ico {
  width: 26px;
  height: 26px;
  padding: 5px;
  border-radius: 50%;
  stroke-width: 3;
  color: transparent;
  background: rgba(255, 255, 255, 0.07);
  transition: background 0.2s, color 0.2s, transform 0.3s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.q-op:hover { border-color: rgba(247, 220, 140, 0.6); transform: translateY(-1px); }
.q-op:active { transform: scale(0.98); }
.q-op.marcada {
  border-color: var(--ouro-300);
  background: linear-gradient(180deg, rgba(247, 220, 140, 0.22), rgba(247, 220, 140, 0.08));
  box-shadow: 0 0 0 3px rgba(247, 220, 140, 0.14), 0 0 34px rgba(247, 220, 140, 0.16);
  color: #fff;
}
.q-op.marcada .ico { color: #2b1b06; background: var(--ouro-300); transform: scale(1.12); }
.q-opcoes--grade .q-op {
  justify-content: center;
  padding: 0;
  min-height: 62px;
  font-family: var(--f-titulo);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 1.45rem;
}
.q-opcoes--grade .q-op .ico { display: none; }
.q-opcoes--colunas .q-op { padding-right: 10px; font-size: 0.98rem; }
.q-op--escrever { border-style: dashed; color: var(--ouro-100); }
.q-opcoes--colunas .q-op--escrever { grid-column: 1 / -1; }
.q-op--escrever .ico { color: var(--ouro-300); background: rgba(247, 220, 140, 0.12); stroke-width: 2; }
.q-entrada--numero { font-size: 1.7rem; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.q-entrada--numero + .q-conta-letras { font-size: 1rem; color: rgba(233, 240, 235, 0.7); }

/* navegação: fica presa embaixo no celular */
.q-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 26px max(16px, env(safe-area-inset-left, 0px)) calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(5, 19, 14, 0), rgba(5, 19, 14, 0.95) 40%);
}
.q-nav .q-voltar { min-height: 58px; padding-inline: 18px; }
.q-voltar span { display: none; }

/* resumo ----------------------------------------------------------------------- */

.modo-resumo.q-palco { padding-bottom: 60px; }
.modo-resumo .q-cenas {
  height: auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(58vw, 250px);
  gap: 12px;
  margin-inline: -20px;
  padding: 8px 20px 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.modo-resumo .q-cenas::-webkit-scrollbar { display: none; }
.modo-resumo .q-cenas .cena {
  scroll-snap-align: center;
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(247, 220, 140, 0.4), 0 20px 34px -18px rgba(0, 0, 0, 0.9);
}

.roteiro { display: grid; gap: 10px; }
.roteiro li {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  font-family: var(--f-carta);
  font-style: italic;
  font-weight: 600;
  font-size: 1.14rem;
  line-height: 1.3;
}
.roteiro p::before { content: "“"; }
.roteiro p::after { content: "”"; }
.roteiro__fixa { color: var(--texto-suave); background: rgba(255, 255, 255, 0.04); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset; }
.roteiro__sua {
  color: var(--tinta);
  background: linear-gradient(175deg, #fdf6e3, #f0e0b9);
  box-shadow: var(--sombra-papel);
}
.roteiro__editar {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(168, 116, 31, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  font-family: var(--f-corpo);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 800;
  color: #7a4f10;
}
.roteiro__editar .ico { width: 15px; height: 15px; }
.roteiro__editar:hover { background: #fff; }

.q-zap { margin-top: 10px; }
.q-zap .q-entrada { padding-right: 20px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.q-zap__nota { font-size: 0.88rem; color: var(--texto-suave); }
.q-zap.treme { animation: treme 0.4s ease; }
.q-zap.treme .q-entrada { border-color: var(--vermelho-400); }
.q-ajuda { text-align: center; font-size: 0.92rem; color: var(--texto-suave); }
.q-ajuda a { color: var(--ouro-300); font-weight: 800; text-underline-offset: 4px; }

.aceite {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  margin-top: 6px;
  border-radius: 18px;
  border: 1.5px solid var(--linha);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
}
.aceite input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.aceite__marca {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 2px solid var(--ouro-300);
  color: transparent;
  transition: background 0.2s, color 0.2s;
}
.aceite__marca .ico { width: 18px; height: 18px; stroke-width: 3; }
.aceite input:checked + .aceite__marca { background: var(--ouro-300); color: #2b1b06; }
.aceite input:focus-visible + .aceite__marca { outline: 3px solid var(--ouro-300); outline-offset: 3px; }
.aceite.treme { animation: treme 0.4s ease; border-color: var(--vermelho-400); }
.aceite__aviso { font-size: 0.9rem; font-weight: 700; color: #ff9a94; }
@keyframes treme {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

.total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px 4px;
  border-top: 1px dashed var(--linha);
  font-weight: 700;
}
.total strong {
  font-family: var(--f-titulo);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--ouro-300);
  white-space: nowrap;
}
.q-seguro { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.86rem; color: var(--texto-suave); }
.q-resumo .q-voltar { justify-self: center; }
.q-resumo .q-voltar span { display: inline; }

/* aviso de pagamento ------------------------------------------------------------- */

.q-dialogo {
  width: min(92vw, 400px);
  padding: 28px 24px 22px;
  border: 0;
  border-radius: 28px;
  text-align: center;
  color: var(--tinta);
  background: linear-gradient(170deg, #fffbf0, #f3e4bf);
  box-shadow: 0 0 0 1px #d6b25c, 0 40px 90px rgba(0, 0, 0, 0.8);
}
.q-dialogo::backdrop { background: rgba(3, 12, 9, 0.78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.q-dialogo[open] { animation: carimbo-dlg 0.35s cubic-bezier(0.2, 1.3, 0.4, 1); }
@keyframes carimbo-dlg {
  from { opacity: 0; transform: scale(0.9) translateY(14px); }
  to { opacity: 1; transform: none; }
}
.q-dialogo svg { width: 54px; height: 54px; margin: 0 auto 12px; }
.q-dialogo .titulo { font-size: 1.5rem; margin-bottom: 10px; }
.q-dialogo p { color: var(--tinta-suave); }
.q-dialogo__nota { font-size: 0.88rem; margin-top: 8px; }
.q-dialogo form { margin-top: 20px; }
.q-dialogo form + .q-dialogo__nota { margin-top: 14px; }
.q-dialogo a { color: #7a4f10; font-weight: 800; text-underline-offset: 3px; }

/* telas largas ------------------------------------------------------------------- */

@media (min-width: 960px) {
  .q-palco {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 64px;
    align-items: start;
    padding-block: 48px 80px;
  }
  .q-pergunta { order: 1; }
  .q-cenas { order: 2; position: sticky; top: 104px; }
  .modo-passo .q-cenas { height: auto; aspect-ratio: 4 / 5; max-width: 440px; justify-self: center; width: 100%; }
  .modo-passo .q-cenas .cena { top: 0; transform: none; }
  .q-nav {
    position: static;
    padding: 8px 0 0;
    background: none;
    grid-template-columns: auto auto;
    justify-content: start;
  }
  .q-voltar span { display: inline; }
  .q-opcoes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-opcoes--grade { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .modo-resumo .q-cenas {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    overflow: visible;
    gap: 16px;
  }
  .modo-resumo.q-palco { padding-bottom: 80px; }
}
