/* =========================================================
   Simulador de Mensagens – Treino para a Melhor Idade
   style.css – toda a aparência da aplicação

   Dica para estudantes: quase todos os tamanhos usam "rem".
   1rem = tamanho da letra da página (começa em 18px).
   Quando a pessoa toca em A+ ou A-, o JavaScript muda esse
   valor e TUDO cresce ou diminui junto.
   ========================================================= */

/* ---------- 1. CORES E MEDIDAS (variáveis) ---------- */
:root {
  --verde-escuro: #075E54;      /* topo das telas */
  --verde: #25D366;             /* botões */
  --verde-medio: #128C7E;
  --verde-texto: #0E6B54;       /* verde escuro para textos (bom contraste) */
  --fundo-conversa: #ECE5DD;    /* fundo bege da conversa */
  --balao-enviado: #DCF8C6;     /* balão verde-claro (você) */
  --balao-recebido: #FFFFFF;    /* balão branco (contato) */
  --texto: #111B21;
  --texto-secundario: #4A5A61;
  --texto-sobre-verde: #06281F; /* texto escuro sobre o verde, para ler bem */
  --tique-cinza: #667781;
  --tique-azul: #1A8CD8;
  --amarelo-destaque: #FFD600;
  --vermelho: #E53935;
  --fundo-claro: #F4F1EC;
}

/* ---------- 2. BASE ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Garante que elementos com o atributo "hidden" fiquem sempre escondidos */
[hidden] {
  display: none !important;
}

html {
  font-size: 18px; /* tamanho mínimo da letra */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #CFD8DC;
  color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.4;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p {
  margin: 0;
}

/* Texto só para leitores de tela (invisível na tela) */
.so-leitor {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Ícones SVG */
.ico {
  width: 1.4rem;
  height: 1.4rem;
  fill: currentColor;
  flex-shrink: 0;
}

/* Contorno visível para quem navega pelo teclado */
:focus-visible {
  outline: 3px solid #1565C0;
  outline-offset: 2px;
}

/* ---------- 3. MOLDURA DO CELULAR ---------- */
.celular {
  position: relative;
  width: 400px;
  height: min(860px, calc(100vh - 40px));
  min-height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 12px solid #1D1D1F;
  border-radius: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* Em celulares: ocupa a tela inteira, sem moldura */
@media (max-width: 520px) {
  body {
    display: block;
    padding: 0;
    background: #fff;
  }

  .celular {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ---------- 4. FAIXA "MODO TREINO" ---------- */
.faixa-treino {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.75rem;
  background: #FFF3C4;
  color: #4E3B00;
  border-bottom: 1px solid #E6D38A;
}

.faixa-treino p {
  flex: 1;
  font-size: 1rem;
  line-height: 1.25;
}

.controle-letra {
  display: flex;
  gap: 0.35rem;
}

.botao-letra {
  min-width: 48px;
  min-height: 48px;
  padding: 0 0.4rem;
  background: #fff;
  color: #3B2F00;
  border: 2px solid #8A7300;
  border-radius: 10px;
  font-weight: 800;
}

/* ---------- 5. ÁREA DAS TELAS ---------- */
.area-telas {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Cada tela ocupa toda a área; só a que tem "ativa" aparece */
.tela {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  background: #fff;
}

.tela.ativa {
  display: flex;
}

/* Telas de conteúdo (início, quiz, resultados) rolam para baixo */
.tela-conteudo {
  background: var(--fundo-claro);
  overflow-y: auto;
}

.tela-conteudo.ativa {
  display: block;
}

.conteudo {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.25rem 1rem 2rem;
}

.conteudo.centro {
  align-items: stretch;
  text-align: center;
  padding-top: 2.5rem;
}

/* ---------- 6. BOTÕES GERAIS ---------- */
.botao-grande {
  width: 100%;
  min-height: 60px;
  padding: 0.6rem 1rem;
  background: var(--verde);
  color: var(--texto-sobre-verde);
  border: 2px solid #1DA851;
  border-radius: 14px;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 3px 0 #1A9E4B;
}

.botao-grande:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1A9E4B;
}

.botao-secundario {
  width: 100%;
  min-height: 52px;
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--verde-escuro);
  border: 2px solid var(--verde-medio);
  border-radius: 14px;
  font-weight: 700;
}

.botao-ouvir {
  align-self: flex-start;
  min-height: 48px;
  padding: 0 1rem;
  background: #E3F2FD;
  color: #0D47A1;
  border: 2px solid #90CAF9;
  border-radius: 24px;
  font-weight: 700;
  white-space: nowrap;
}

.botao-discreto {
  min-height: 48px;
  padding: 0 0.5rem;
  background: none;
  border: none;
  color: #5F6B70;
  text-decoration: underline;
  font-size: 1rem;
}

.botao-icone {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: #fff;
}

.botao-icone:active {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- 7. TELA INICIAL ---------- */
.capa {
  text-align: center;
  padding-top: 0.5rem;
}

.capa-icone {
  width: 88px;
  height: 88px;
  margin: 0 auto 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--verde-escuro);
  border-radius: 50%;
  font-size: 2.6rem;
}

.capa h1 {
  font-size: 1.6rem;
  color: var(--verde-escuro);
}

.subtitulo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--texto-secundario);
}

.texto-explicacao {
  font-size: 1.05rem;
}

.titulo-secao {
  margin-top: 0.5rem;
  font-size: 1.3rem;
  color: var(--verde-escuro);
}

.progresso {
  font-weight: 700;
  color: var(--texto-secundario);
}

.lista-missoes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.item-missao {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  text-align: left;
  background: #fff;
  border: 2px solid #D5D9D3;
  border-radius: 14px;
}

.item-missao.concluida {
  background: #EAF8EF;
  border-color: var(--verde);
}

.missao-numero {
  width: 2.2rem;
  height: 2.2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--verde-escuro);
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
}

.missao-texto {
  flex: 1;
  font-weight: 600;
}

.missao-status {
  font-size: 1.4rem;
}

.botoes-extras {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.rodape-inicio {
  text-align: center;
  margin-top: 1rem;
}

/* ---------- 8. TOPO VERDE DA LISTA DE CONVERSAS ---------- */
.topo-app {
  flex-shrink: 0;
  background: var(--verde-escuro);
  color: #fff;
}

.topo-linha {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
}

.topo-titulo {
  font-size: 1.4rem;
}

.botao-topo-texto {
  min-height: 48px;
  padding: 0 0.9rem;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  font-weight: 700;
}

.abas {
  display: flex;
}

.aba {
  flex: 1;
  min-height: 52px;
  padding: 0 0.25rem;
  background: none;
  border: none;
  border-bottom: 4px solid transparent;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
}

.aba.ativa {
  color: #fff;
  border-bottom-color: #fff;
}

.painel-aba {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: none;
}

.painel-aba.ativa {
  display: block;
}

.explicacao-aba {
  padding: 0.8rem 1rem;
  background: #F0F7F4;
  border-bottom: 1px solid #DDE7E2;
}

/* ---------- 9. LISTA DE CONVERSAS ---------- */
.lista-conversas {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-conversa {
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  text-align: left;
  background: #fff;
  border: none;
  border-bottom: 1px solid #E3E6E8;
}

.item-conversa:active {
  background: #F0F2F5;
}

.avatar {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
}

/* Contorno verde em volta da foto (status novo) */
.avatar.anel {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--verde);
}

.conversa-meio {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.conversa-nome {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversa-previa {
  display: block;
  color: var(--texto-secundario);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversa-previa.digitando {
  color: var(--verde-texto);
  font-weight: 700;
}

.conversa-lado {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}

.conversa-hora {
  color: var(--texto-secundario);
}

.tem-naolidas .conversa-hora {
  color: var(--verde-texto);
  font-weight: 700;
}

/* Bolinha verde com o número de mensagens não lidas */
.contador {
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--verde);
  color: var(--texto-sobre-verde);
  border-radius: 1rem;
  font-weight: 800;
}

.subtitulo-lista {
  padding: 0.8rem 1rem 0.4rem;
  font-weight: 700;
  color: var(--verde-texto);
}

.item-chamada {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #E3E6E8;
}

.item-chamada .ico {
  color: var(--verde-medio);
}

.seta-ok {
  color: var(--verde-texto);
  font-weight: 800;
}

.seta-perdida {
  color: var(--vermelho);
  font-weight: 800;
}

.vazio {
  padding: 1.25rem 1rem;
  color: var(--texto-secundario);
}

/* ---------- 10. TOPO DA CONVERSA ---------- */
.topo-chat {
  flex-shrink: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.3rem;
  background: var(--verde-escuro);
  color: #fff;
}

.topo-chat .avatar {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
}

.chat-info {
  flex: 1;
  min-width: 0;
  padding-left: 0.3rem;
}

.chat-info h2 {
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-info p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-info p.digitando {
  font-style: italic;
  color: #B9F6CA;
}

/* ---------- 11. MENSAGENS (BALÕES) ---------- */
.lista-mensagens {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem 0.6rem;
  background: var(--fundo-conversa);
}

.linha-msg {
  display: flex;
}

.linha-msg.enviada {
  justify-content: flex-end;
}

.balao {
  position: relative;
  max-width: 85%;
  padding: 0.45rem 0.65rem 0.3rem;
  border-radius: 10px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  overflow-wrap: anywhere;
}

.enviada .balao {
  background: var(--balao-enviado);
  border-top-right-radius: 2px;
}

.recebida .balao {
  background: var(--balao-recebido);
  border-top-left-radius: 2px;
}

/* Mensagens de golpe: não deixar selecionar texto ao segurar o dedo */
.balao[data-golpe] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}

.balao.pressionado {
  background: #E3E8EA;
}

.autor {
  display: block;
  font-weight: 800;
}

.balao-info {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.15rem;
  color: var(--texto-secundario);
  font-size: 1rem;
}

/* Tiques: ✓ enviado, ✓✓ cinza entregue, ✓✓ azul lido */
.tique {
  color: var(--tique-cinza);
  font-weight: 800;
  letter-spacing: -0.35em;
  padding-right: 0.35em;
}

.tique.lido {
  color: var(--tique-azul);
}

/* Avisos no meio da conversa (bloqueio, chamadas...) */
.msg-sistema {
  align-self: center;
  max-width: 90%;
  padding: 0.35rem 0.8rem;
  text-align: center;
  background: #FFF5C4;
  color: #4E3B00;
  border-radius: 10px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Link falso dentro da mensagem de golpe */
.link-golpe {
  display: block;
  min-height: 48px;
  padding: 0.4rem 0;
  text-align: left;
  background: none;
  border: none;
  color: #0B57D0;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

/* Foto enviada */
.foto-msg {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Balão de áudio */
.audio {
  width: 230px;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.botao-play {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--verde-medio);
  color: #fff;
  border: none;
  border-radius: 50%;
}

.onda {
  flex: 1;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.onda span {
  flex: 1;
  background: #8696A0;
  border-radius: 2px;
  transform-origin: center;
}

.audio.tocando .onda span {
  background: var(--verde-medio);
  animation: onda 0.7s ease-in-out infinite alternate;
}

.audio.tocando .onda span:nth-child(3n) { animation-delay: 0.15s; }
.audio.tocando .onda span:nth-child(3n+1) { animation-delay: 0.3s; }
.audio.tocando .onda span:nth-child(4n) { animation-delay: 0.45s; }

@keyframes onda {
  from { transform: scaleY(0.35); }
  to { transform: scaleY(1); }
}

.duracao {
  min-width: 2.6rem;
  text-align: right;
}

/* ---------- 12. PAINEL DE EMOJIS E ANEXOS ---------- */
.painel-emojis {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.2rem;
  padding: 0.4rem;
  background: #fff;
  border-top: 1px solid #DDD;
}

.botao-emoji {
  min-height: 52px;
  background: none;
  border: none;
  border-radius: 10px;
  font-size: 1.6rem;
}

.botao-emoji:active {
  background: #EEE;
}

.menu-anexos {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
  background: #fff;
  border-top: 1px solid #DDD;
}

.opcao-anexo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  background: none;
  border: none;
  border-radius: 14px;
  font-weight: 700;
}

.bola-anexo {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.8rem;
}

/* ---------- 13. BARRA INFERIOR (DIGITAR / GRAVAR) ---------- */
.barra-inferior {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem;
  background: var(--fundo-conversa);
}

.campo-caixa {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 0.15rem;
  background: #fff;
  border-radius: 28px;
}

.campo-caixa:focus-within {
  box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.45);
}

#campo-mensagem {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 0.2rem;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
}

#campo-mensagem::placeholder {
  color: #66767C;
}

.botao-icone-cinza {
  width: 44px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: #54656F;
}

/* Botão redondo verde: microfone ou enviar */
.botao-principal {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--verde);
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  touch-action: none;           /* evita rolagem ao segurar o dedo */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.15s;
}

.botao-principal .ico {
  width: 1.6rem;
  height: 1.6rem;
}

.botao-principal.gravando {
  transform: scale(1.2);
  background: #1EBE5A;
}

/* Enquanto grava: esconde o campo e mostra o cronômetro */
.gravacao {
  display: none;
  flex: 1;
  min-height: 52px;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  padding: 0.3rem 0.9rem;
  background: #fff;
  border-radius: 28px;
}

.barra-inferior.gravando .campo-caixa {
  display: none;
}

.barra-inferior.gravando .gravacao {
  display: flex;
}

.ponto-gravando {
  width: 14px;
  height: 14px;
  background: var(--vermelho);
  border-radius: 50%;
  animation: piscar 1s infinite;
}

.gravacao-dica {
  color: var(--texto-secundario);
}

@keyframes piscar {
  50% { opacity: 0.2; }
}

.aviso-bloqueado {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  text-align: center;
  background: #fff;
  border-top: 1px solid #DDD;
}

/* ---------- 14. MENU "RESPONDER / BLOQUEAR / DENUNCIAR" ---------- */
.fundo-escuro {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.menu-mensagem {
  z-index: 15;
  display: flex;
  align-items: flex-end;
}

.folha {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: #fff;
  border-radius: 20px 20px 0 0;
}

.folha-titulo {
  font-weight: 700;
  text-align: center;
  padding-bottom: 0.25rem;
}

.opcao-folha {
  min-height: 56px;
  padding: 0 1rem;
  text-align: left;
  background: #F5F6F6;
  border: 2px solid #E0E3E4;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
}

.opcao-folha.cancelar {
  text-align: center;
  background: #fff;
  color: var(--texto-secundario);
}

/* ---------- 15. CHAMADA DE VOZ / VÍDEO ---------- */
.chamada {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem 1.25rem;
  overflow-y: auto;  /* em telas baixas, rola para o botão vermelho aparecer */
  text-align: center;
  background: linear-gradient(#0B3D36, #062824);
  color: #fff;
}

.chamada.video.atendida {
  background: linear-gradient(160deg, #3A6073, #16222A);
}

.chamada-tipo {
  opacity: 0.9;
}

.avatar.grande {
  width: 6.5rem;
  height: 6.5rem;
  flex-shrink: 0;
  margin: 1.25rem auto 0.75rem;
  font-size: 3.2rem;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.12);
}

.chamada-nome {
  font-size: 1.5rem;
}

.chamada-status {
  margin-top: 0.4rem;
  font-size: 1.25rem;
}

/* Quadradinho "Você" na chamada de vídeo */
.video-voce {
  position: absolute;
  top: 3rem;
  right: 0.75rem;
  width: 80px;
  height: 106px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #5B6B73;
  border: 2px solid #fff;
  border-radius: 12px;
}

.video-voce span {
  font-size: 2rem;
}

.chamada.video.atendida .video-voce {
  display: flex;
}

.chamada-botoes {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 2.5rem;
}

.grupo-botao-chamada {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.botao-desligar,
.botao-chamada-cinza {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
}

.botao-desligar {
  background: var(--vermelho);
  color: #fff;
}

.botao-chamada-cinza {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.botao-chamada-cinza[aria-pressed="true"] {
  background: #fff;
  color: #111;
}

.botao-desligar .ico,
.botao-chamada-cinza .ico {
  width: 2rem;
  height: 2rem;
}

/* ---------- 16. QUIZ ---------- */
.topo-simples {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.3rem;
  background: var(--verde-escuro);
  color: #fff;
}

.topo-simples h1 {
  flex: 1;
  font-size: 1.3rem;
}

.quiz-progresso {
  font-weight: 700;
}

.barra-progresso {
  height: 12px;
  background: #DCE3DF;
  border-radius: 6px;
  overflow: hidden;
}

#quiz-barra {
  width: 0;
  height: 100%;
  background: var(--verde);
  transition: width 0.3s;
}

.quiz-pergunta {
  font-size: 1.25rem;
  margin-bottom: 0.9rem;
}

.quiz-opcoes {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.opcao-quiz {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem;
  text-align: left;
  background: #fff;
  border: 3px solid #CFD6D2;
  border-radius: 14px;
  font-size: 1.05rem;
}

.opcao-quiz:disabled {
  cursor: default;
  opacity: 1;
  color: var(--texto);
}

.letra {
  width: 2.2rem;
  height: 2.2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E8EDEA;
  border-radius: 50%;
  font-weight: 800;
}

.opcao-texto {
  flex: 1;
}

.marca {
  font-weight: 800;
  white-space: nowrap;
}

.opcao-quiz.certa {
  background: #E8F5E9;
  border-color: #2E7D32;
}

.opcao-quiz.certa .letra {
  background: #2E7D32;
  color: #fff;
}

.opcao-quiz.errada {
  background: #FFEBEE;
  border-color: #C62828;
}

.opcao-quiz.errada .letra {
  background: #C62828;
  color: #fff;
}

.quiz-feedback {
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 3px solid;
}

.quiz-feedback.certo {
  background: #E8F5E9;
  border-color: #2E7D32;
  color: #1B5E20;
}

.quiz-feedback.errado {
  background: #FFEBEE;
  border-color: #C62828;
  color: #8E1B1B;
}

.quiz-feedback p {
  margin-top: 0.3rem;
  color: var(--texto);
}

.rotulo {
  font-weight: 700;
}

.campo-grande {
  width: 100%;
  min-height: 56px;
  padding: 0 1rem;
  background: #fff;
  border: 2px solid #9AA7A1;
  border-radius: 12px;
  font-size: 1.1rem;
}

.placar-emoji {
  font-size: 4rem;
}

.placar-texto {
  font-size: 1.7rem;
  color: var(--verde-escuro);
  margin: 0.3rem 0 0.6rem;
}

/* ---------- 17. RESULTADOS DA OFICINA ---------- */
.tabela-resultados {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.tabela-resultados th,
.tabela-resultados td {
  padding: 0.6rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #E3E6E8;
}

.tabela-resultados th {
  background: #E0EFEA;
  color: var(--verde-escuro);
}

.resumo-resultados {
  margin-top: 0.75rem;
  font-weight: 700;
}

/* ---------- 18. BALÃO DE DICA DAS MISSÕES ---------- */
.dica {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem 0.7rem;
  background: #FFF8D6;
  border-top: 4px solid #F9A825;
  color: #3B2F00;
}

.dica-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dica-missao {
  font-weight: 800;
  white-space: nowrap;
}

.botao-sair-missao {
  min-height: 48px;
  padding: 0 0.6rem;
  background: none;
  border: 2px solid #C9B458;
  border-radius: 10px;
  color: #4E3B00;
  font-size: 1rem;
  font-weight: 700;
}

.dica-corpo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dica-texto {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
}

/* Contorno amarelo pulsante no botão que a pessoa deve tocar */
.destaque {
  position: relative;
  z-index: 5;
  outline: 4px solid var(--amarelo-destaque) !important;
  outline-offset: 3px;
  animation: pulsar 1.4s ease-in-out infinite;
}

/* Itens de lista: contorno por dentro, para não ficar escondido */
.item-conversa.destaque,
.campo-caixa.destaque,
.menu-anexos.destaque,
.folha.destaque {
  outline-offset: -4px;
}

@keyframes pulsar {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 214, 0, 0.9); }
  50% { box-shadow: 0 0 0 12px rgba(255, 214, 0, 0); }
}

/* ---------- 19. AVISO RÁPIDO ---------- */
.aviso-rapido {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  padding: 0.8rem 1rem;
  background: #263238;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* ---------- 20. JANELA DE AVISO (MODAL) ---------- */
.modal-fundo {
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 1.25rem;
  background: #fff;
  border-radius: 18px;
}

.modal-icone {
  font-size: 3rem;
  text-align: center;
}

.modal-titulo {
  font-size: 1.3rem;
  text-align: center;
  color: var(--verde-escuro);
  margin-bottom: 0.75rem;
}

.modal-conteudo p {
  margin-bottom: 0.6rem;
}

.lista-sinais {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lista-sinais li {
  padding: 0.45rem 0.6rem;
  background: #F4F6F5;
  border-radius: 10px;
}

.caixa-dica {
  padding: 0.7rem 0.9rem;
  background: #E8F5E9;
  border-left: 5px solid #2E7D32;
  border-radius: 10px;
}

.modal-botoes {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* ---------- 21. PARABÉNS E CONFETE ---------- */
.parabens {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(7, 94, 84, 0.92);
}

.parabens-caixa {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  background: #fff;
  border-radius: 20px;
}

.parabens-caixa .botao-ouvir {
  align-self: center;
}

.parabens-emoji {
  font-size: 3.5rem;
}

.parabens-titulo {
  font-size: 1.7rem;
  color: var(--verde-escuro);
  margin-bottom: 0.4rem;
}

#parabens-texto {
  margin-bottom: 0.6rem;
}

#parabens-licao {
  text-align: left;
}

.confete-area {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.confete {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 14px;
  animation-name: cair;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes cair {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(1000px) rotate(720deg); }
}

/* ---------- 22. MENOS MOVIMENTO (para quem prefere) ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}
