/*
 * Quiz Premiado Purple Friday — tela do tablet.
 * Medidas em pixels do layout (prancheta 768x1024): calc(N * var(--u)).
 * O JS define --u para a prancheta caber inteira na tela (retrato ou paisagem).
 */
@font-face {
  font-family: "VivoType";
  src: url("../fontes/vivotype-light.woff2") format("woff2");
  font-weight: 300;
  font-display: block;
}
@font-face {
  font-family: "VivoType";
  src: url("../fontes/vivotype-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: "VivoType";
  src: url("../fontes/vivotype-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: block;
}
@font-face {
  font-family: "Poppins";
  src: url("../fontes/poppins-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --u: 1px;
  --roxo: #9b4f9b;
  --roxo-texto: #660099;
  --borda: #f3e6ff;
  --brilho: rgba(208, 140, 255, 0.8);
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1b0f24;
  overscroll-behavior: none;
}
body {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  font-family: "VivoType", "Helvetica Neue", Arial, sans-serif;
  color: #fff;
}

#app {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  /* telas muito compridas (celular): continua as cores do fundo acima e abaixo */
  background: linear-gradient(#1c1022 0%, #1c1022 55%, #6e3480 100%);
}

/* Prancheta 768x1024 centralizada */
.palco {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(768 * var(--u));
  height: calc(1024 * var(--u));
  transform: translate(-50%, -50%);
}

/* Fundo espacial: maior que a prancheta (mesma posição do .ai), cobre tablets em paisagem */
.fundo {
  position: absolute;
  left: calc(-529 * var(--u));
  top: calc(-243.7 * var(--u));
  width: calc(1826 * var(--u));
  height: calc(1528 * var(--u));
  background: url("../img/fundo.jpg") 0 0 / 100% 100% no-repeat;
}

/* Cabeçalho: grande na tela inicial, menor nas perguntas, escondido nos resultados
   (a arte do resultado já traz o cabeçalho) */
.cabecalho {
  position: absolute;
  z-index: 4;
  left: calc(167 * var(--u));
  top: calc(58 * var(--u));
  width: calc(434 * var(--u));
  transform-origin: 50% 0;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
  pointer-events: none;
}
.modo-pergunta .cabecalho,
.modo-resultado .cabecalho {
  transform: scale(0.709);
}
.modo-resultado .cabecalho {
  opacity: 0;
}

/* ---------- Telas e transição ---------- */
.tela {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tela.entrando {
  opacity: 0;
  transform: translateY(calc(26 * var(--u)));
}
.tela.saindo {
  opacity: 0;
  transform: translateY(calc(-18 * var(--u)));
  pointer-events: none;
}
.tela-resultado.entrando,
.tela-resultado.saindo {
  transform: none;
}

/* ---------- Pílula neon (respostas e botões) ---------- */
.pilula {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: inherit;
  background: rgba(40, 14, 66, 0.16);
  border: calc(1.7 * var(--u)) solid rgba(246, 236, 255, 0.92);
  border-radius: calc(40 * var(--u));
  box-shadow: 0 0 calc(6 * var(--u)) rgba(214, 160, 255, 0.7), 0 0 calc(18 * var(--u)) rgba(170, 80, 235, 0.35),
    inset 0 0 calc(7 * var(--u)) rgba(214, 160, 255, 0.4);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.pilula:active {
  transform: scale(0.98);
}

/* ---------- Tela inicial ---------- */
.campo {
  position: absolute;
  left: calc(210 * var(--u));
  width: calc(348 * var(--u));
  height: calc(48 * var(--u));
  box-sizing: border-box;
  margin: 0;
  padding: 0 calc(17 * var(--u));
  border: calc(2 * var(--u)) solid transparent;
  border-radius: calc(6 * var(--u));
  background: #fff;
  color: #1d1d26;
  font: 400 calc(16.3 * var(--u)) / 1 "Poppins", Arial, sans-serif;
  letter-spacing: 0.04em;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  -webkit-appearance: none;
  appearance: none;
}
.campo::placeholder {
  color: #65707c;
  opacity: 1;
}
.campo:focus {
  border-color: #c58cff;
  box-shadow: 0 0 calc(12 * var(--u)) rgba(208, 140, 255, 0.8);
}
.campo[name="nome"] {
  top: calc(482 * var(--u));
}
.campo[name="telefone"] {
  top: calc(543 * var(--u));
}

.botao-entrar {
  position: absolute;
  left: calc(224 * var(--u));
  top: calc(627 * var(--u));
  width: calc(320 * var(--u));
  height: calc(68 * var(--u));
  padding-top: calc(3 * var(--u));
  font-size: calc(47.4 * var(--u));
  font-weight: 700;
  letter-spacing: 0.01em;
}
.botao-pular {
  position: absolute;
  z-index: 3;
  left: calc(284 * var(--u));
  top: calc(831 * var(--u));
  width: calc(199 * var(--u));
  height: calc(42 * var(--u));
  padding-top: calc(2 * var(--u));
  font-size: calc(35.3 * var(--u));
  font-weight: 700;
}

.aceite {
  position: absolute;
  left: calc(262 * var(--u));
  top: calc(709 * var(--u));
  display: flex;
  align-items: center;
  padding: calc(12 * var(--u));
  font-size: calc(21.4 * var(--u));
  font-weight: 300;
  cursor: pointer;
}
.aceite input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.aceite .caixa {
  position: relative;
  flex: none;
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
  margin-right: calc(16 * var(--u));
  box-sizing: border-box;
  border: calc(1.6 * var(--u)) solid #fff;
}
.aceite input:checked + .caixa {
  background: #fff;
}
.aceite input:checked + .caixa::after {
  content: "";
  position: absolute;
  left: 30%;
  top: 8%;
  width: 28%;
  height: 56%;
  border: solid var(--roxo-texto);
  border-width: 0 calc(3 * var(--u)) calc(3 * var(--u)) 0;
  transform: rotate(42deg);
}
.aceite a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  text-decoration-thickness: calc(1.4 * var(--u));
}

.erro {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(770 * var(--u));
  margin: 0;
  text-align: center;
  font-size: calc(21 * var(--u));
  font-weight: 400;
  color: #ffd2ec;
  text-shadow: 0 0 calc(8 * var(--u)) rgba(255, 80, 180, 0.6);
}
.tremer {
  animation: tremer 0.4s ease;
}
@keyframes tremer {
  20%,
  60% {
    transform: translateX(calc(-8 * var(--u)));
  }
  40%,
  80% {
    transform: translateX(calc(8 * var(--u)));
  }
}

/* Sem cadastro (desligado no painel): só o botão COMEÇAR */
.sem-cadastro .campo,
.sem-cadastro .aceite,
.sem-cadastro .botao-pular {
  display: none;
}
.sem-cadastro .botao-entrar {
  top: calc(560 * var(--u));
}

/* ---------- Pergunta ---------- */
.tela-pergunta .conteudo {
  position: absolute;
  left: calc(40 * var(--u));
  right: calc(40 * var(--u));
  top: calc(340 * var(--u));
  bottom: calc(40 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pergunta {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(120 * var(--u));
  max-width: calc(640 * var(--u));
  margin: 0;
  text-align: center;
  font-size: calc(var(--fs-p, 37) * var(--u));
  font-weight: 400;
  line-height: 1.22;
  white-space: pre-line;
  text-wrap: balance;
}
.respostas {
  flex: none;
  display: flex;
  flex-direction: column;
  width: calc(var(--largura, 552) * var(--u));
  margin-top: calc(var(--margem, 40) * var(--u));
  gap: calc(var(--gap, 22) * var(--u));
}
.resposta {
  justify-content: flex-start;
  width: 100%;
  min-height: calc(var(--alt, 78) * var(--u));
  padding: calc(var(--pad, 20) * var(--u)) calc(30 * var(--u)) calc(var(--pad, 20) * var(--u)) calc(30 * var(--u));
  text-align: left;
  font-size: calc(var(--fs, 24) * var(--u));
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.resposta .radio {
  position: relative;
  flex: none;
  width: calc(var(--radio, 50) * var(--u));
  height: calc(var(--radio, 50) * var(--u));
  margin-right: calc(var(--espaco, 22) * var(--u));
  border-radius: 50%;
  background: #fff;
}
.resposta .radio::after {
  content: "";
  position: absolute;
  top: 20%;
  right: 20%;
  bottom: 20%;
  left: 20%;
  border-radius: 50%;
  background: var(--roxo);
  transform: scale(0);
  transition: transform 0.22s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.resposta .texto {
  white-space: pre-line;
  text-wrap: balance;
}
.resposta.selecionada {
  background: rgba(155, 79, 155, 0.22);
  box-shadow: 0 0 calc(10 * var(--u)) calc(1 * var(--u)) rgba(225, 170, 255, 0.9), 0 0 calc(28 * var(--u)) rgba(190, 90, 255, 0.55),
    inset 0 0 calc(12 * var(--u)) rgba(225, 170, 255, 0.5);
}
.resposta.selecionada .radio::after {
  transform: scale(1);
}
.respondida .resposta:not(.selecionada) {
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

/* ---------- Resultado (arte inteira por cima do fundo) ---------- */
.tela-resultado .arte {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}

/* ---------- Texto da LGPD ---------- */
.lgpd {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 4, 22, 0.82);
}
.lgpd[hidden] {
  display: none;
}
.lgpd-caixa {
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  width: min(calc(620 * var(--u)), 92vw);
  max-height: 86vh;
  padding: calc(34 * var(--u)) calc(36 * var(--u)) calc(30 * var(--u));
  border: calc(2.2 * var(--u)) solid var(--borda);
  border-radius: calc(30 * var(--u));
  background: #24113a;
  box-shadow: 0 0 calc(18 * var(--u)) var(--brilho);
}
.lgpd h2 {
  margin: 0 0 calc(18 * var(--u));
  font-size: calc(30 * var(--u));
  font-weight: 400;
  text-align: center;
}
.lgpd-texto {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  font-size: calc(21 * var(--u));
  font-weight: 300;
  line-height: 1.4;
  white-space: pre-line;
  -webkit-user-select: text;
  user-select: text;
}
.lgpd-fechar {
  flex: none;
  width: calc(220 * var(--u));
  height: calc(56 * var(--u));
  margin-top: calc(26 * var(--u));
  padding-top: calc(3 * var(--u));
  font-size: calc(30 * var(--u));
  font-weight: 700;
}

/* ---------- Avisos ---------- */
.aviso-teste {
  position: fixed;
  z-index: 30;
  left: 8px;
  top: 8px;
  padding: 4px 10px;
  border-radius: 4px;
  background: #ffcc00;
  color: #1b0f24;
  font: 700 12px/1.4 Arial, sans-serif;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.aviso-erro {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font: 400 16px/1.4 Arial, sans-serif;
  text-align: center;
}
.aviso-teste[hidden],
.aviso-erro[hidden] {
  display: none;
}
