/* Trilha da Leitura — visual próprio (prefixo tl-). Tamanhos em vh/vw com limites, para caber
   do computador (1280x800) ao celular deitado dentro do navegador (640x300). Nada pisca. */
:root {
  --tema: #9fd98b;
  --tema-escuro: #4f9a3c;
  --tl-letra: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --tl-texto-grande: clamp(26px, 8vh, 58px);
  --tl-texto-frase: clamp(23px, 6.6vh, 42px);
  --tl-fig-op: clamp(80px, 25vh, 210px);
  --tl-fig-grande: clamp(70px, 24vh, 240px);
  --tl-sil: clamp(46px, 13vh, 96px);
  --tl-vao: clamp(6px, 1.8vh, 18px);
  --tl-certo: #43a047;
  --tl-brilho: #ffd54f;
}

/* ---------- trilha (menu) ---------- */
.palco.tl-menu { align-items: stretch; gap: 10px; }
.tl-setas { display: flex; flex-direction: column; justify-content: center; gap: var(--tl-vao); }
.tl-trecho {
  flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 4px 12px 8px;
  background: rgba(255, 253, 247, 0.88); border-radius: var(--raio);
}
.tl-trecho-topo { display: flex; align-items: center; gap: 10px; color: var(--azul); font-size: clamp(16px, 4.4vh, 28px); }
.tl-trecho-amigo img { height: clamp(28px, 9vh, 84px); width: auto; }
.tl-trecho-topo strong { flex: 1; }
.tl-trecho-pontos { display: flex; gap: 6px; }
.tl-trecho-pontos i { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--azul); }
.tl-trecho-pontos i.ativo { background: var(--azul); }
.tl-paradas {
  flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, var(--tl-parada));
  justify-content: center; align-content: center; gap: var(--tl-vao) clamp(10px, 3vw, 44px);
  --tl-parada: clamp(80px, 16vh, 140px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M4 12 Q50 2 96 12 Q100 22 80 28 Q50 36 14 28' fill='none' stroke='%23c49a6c' stroke-width='3' stroke-dasharray='5 4' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 92% 80% no-repeat;
}
.tl-parada-botao {
  position: relative; width: var(--tl-parada); height: var(--tl-parada); border-radius: 50%; border: 4px solid var(--branco);
  background: var(--amarelo); color: var(--azul); font-size: clamp(26px, 6vh, 44px); font-weight: bold; box-shadow: var(--sombra);
}
.tl-parada-botao:nth-child(n + 5) { transform: translateX(calc(50% + clamp(5px, 1.5vw, 22px))); }
.tl-parada-botao.feita { background: var(--tema); }
.tl-parada-botao.fechada { background: #e3e3e3; color: #8a8a8a; }
.tl-estrela { position: absolute; top: -8px; right: -8px; font-size: clamp(22px, 5vh, 34px); color: #f9a825; text-shadow: 0 0 3px #fff; }
.tl-cadeado { position: absolute; bottom: -6px; right: -6px; font-size: clamp(16px, 4vh, 24px); }

/* ---------- parada ---------- */
.palco.tl-palco-parada { flex-direction: column; }
.tl-progresso { display: flex; gap: 4px; height: 8px; margin-bottom: 6px; flex: 0 0 auto; }
.tl-progresso i { flex: 1; border-radius: 4px; background: rgba(255, 255, 255, 0.75); }
.tl-progresso i.feito { background: var(--tema-escuro); }
.tl-progresso i.atual { background: var(--tl-brilho); }
.tl-lugar { flex: 1; min-height: 0; display: flex; }
.tl-item {
  flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--tl-vao); background: rgba(255, 253, 247, 0.88); border-radius: var(--raio); padding: 6px 10px;
}
.tl-pergunta { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 24px); max-width: 100%; }
.tl-opcoes { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--tl-vao); }
.tl-figura { width: var(--tl-fig-grande); height: var(--tl-fig-grande); flex: 0 0 auto; }
.tl-figura-cena { width: auto; }
.tl-svg, .tl-recorte { width: 100%; height: 100%; object-fit: contain; display: block; }

/* opções */
.tl-op {
  min-width: var(--alvo); min-height: var(--alvo); border: 4px solid var(--branco); border-radius: 20px;
  background: var(--branco); box-shadow: var(--sombra); color: var(--azul);
}
.tl-op-texto { padding: 0 clamp(10px, 2vw, 22px); font-size: var(--tl-texto-frase); font-weight: bold; font-family: var(--tl-letra); }
.tl-op-fig { width: var(--tl-fig-op); height: var(--tl-fig-op); padding: 4px; }
.tl-op-fig:has(.tl-cena-2) { width: calc(var(--tl-fig-op) * 1.7); }
.tl-op.tl-certa { border-color: var(--tl-certo); background: #dff5d4; }
.tl-op.tl-errada { opacity: 0.35; }
.tl-op.tl-escolhida { border-color: var(--azul); background: #e3f0ff; }
.tl-op.tl-usada { opacity: 0.3; }
.tl-brilho { box-shadow: 0 0 0 5px var(--tl-brilho), 0 0 16px 6px rgba(255, 213, 79, 0.8) !important; }
.tl-cena { display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; height: 100%; }
.tl-fig { height: 100%; aspect-ratio: 1; display: block; }
.tl-cena-2 .tl-fig, .tl-cena-3 .tl-fig { height: 92%; }

/* sílabas e palavras */
.tl-silabas { display: flex; gap: 6px; }
.tl-sil {
  min-width: var(--tl-sil); height: var(--tl-sil); padding: 0 8px; display: grid; place-items: center;
  background: #fff; border: 4px solid #c49a6c; border-radius: 14px; font-size: var(--tl-texto-grande); font-weight: bold; color: var(--azul);
}
.tl-sil.tl-vazia { background: #fffbe6; border-style: dashed; }
.tl-juntar { gap: 18px; }
.tl-juntar .tl-sil { position: relative; }
.tl-juntar .tl-sil:not(:first-child)::before { content: "+"; position: absolute; left: -19px; color: #8a6a45; font-size: 0.75em; }
.tl-palavra { font-size: calc(var(--tl-texto-grande) * 1.25); font-weight: bold; color: var(--azul); letter-spacing: 2px; font-family: var(--tl-letra); }
.tl-palavra .tl-pedaco { border-radius: 10px; }
.tl-separada .tl-pedaco + .tl-pedaco::before { content: "·"; color: #9e8a70; margin: 0 4px; }
.tl-ouvir { flex: 0 0 auto; font-size: 34px; }

/* cartões de apresentação */
.tl-cartoes { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--tl-vao); }
.tl-cartao {
  min-width: var(--alvo); height: clamp(80px, 22vh, 150px); padding: 0 10px; border: 4px solid #c49a6c; border-radius: 18px;
  background: #fff; box-shadow: var(--sombra); display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--azul); font-family: var(--tl-letra);
}
.tl-cartao-texto { font-size: var(--tl-texto-grande); font-weight: bold; line-height: 1; }
.tl-cartao-fig { min-width: clamp(80px, 22vh, 150px); }
.tl-cartao-exemplo { font-size: calc(var(--tl-texto-frase) * 0.8); color: var(--texto); }
.tl-cartao-exemplo b { color: #d84315; }
.tl-cartao.tl-ouvido { border-color: var(--tema-escuro); }
.tl-cartao.tl-lendo, .tl-pal.tl-lendo { background: #fff59d; }
.tl-seguir { font-size: 40px; }

/* ligar */
.tl-ligar .tl-ligar-linha { gap: clamp(10px, 3vw, 40px); }
.tl-op.tl-par-1 { border-color: #43a047; }
.tl-op.tl-par-2 { border-color: #1e88e5; }
.tl-op.tl-par-3 { border-color: #8e24aa; }

/* frases */
.tl-frase { margin: 0; font-size: var(--tl-texto-frase); font-weight: bold; color: var(--texto); text-align: center; line-height: 1.35; font-family: var(--tl-letra); }
.tl-pal { border-radius: 6px; padding: 0 2px; }
.tl-apoio { text-decoration: underline dotted #8a6a45; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.tl-lacuna { display: inline-block; min-width: 3.2em; border-bottom: 4px dashed #c49a6c; color: var(--tema-escuro); }
.tl-lacuna.tl-brilho { border-radius: 6px; }
.tl-montada { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 1.4em; }
.tl-vaga-palavra { display: inline-block; min-width: 2.2em; border-bottom: 4px dashed #c49a6c; }
.tl-texto { display: flex; flex-direction: column; gap: 2px; }
.tl-pergunta-texto { color: var(--azul); }
.tl-texto .tl-frase { font-size: calc(var(--tl-texto-frase) * 0.85); }
.tl-sim, .tl-nao { min-width: calc(var(--alvo) * 1.5); }

/* história */
.tl-item.tl-historia { flex-direction: row; }
.tl-historia .tl-figura-cena { height: min(100%, 60vh); max-width: 45%; }
.tl-historia .tl-figura-cena .tl-cena { height: 100%; }
.tl-historia .tl-fig:has(.tl-svg) { height: 62%; }
.tl-lado-historia { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--tl-vao); }
.tl-frase-historia { font-size: calc(var(--tl-texto-frase) * 1.1); }
.tl-botoes-historia { display: flex; gap: 16px; }

/* festa curta */
.tl-festa .tl-certa { animation: tl-pulo 0.5s ease-out; }
@keyframes tl-pulo { 50% { transform: scale(1.08); } }

/* fim da parada */
.tl-fim {
  flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--tl-vao) 20px;
  background: rgba(255, 253, 247, 0.85); border-radius: var(--raio); padding: 8px;
}
.tl-fim-estrela { font-size: clamp(44px, 16vh, 120px); color: #f9a825; text-shadow: 0 3px 0 #fff; line-height: 1; }
.tl-fim-texto { display: flex; flex-direction: column; gap: 4px; max-width: 520px; font-size: clamp(16px, 4.6vh, 24px); }
.tl-fim-texto strong { color: var(--azul); font-size: 1.25em; }
.tl-fim-botoes { flex-basis: 100%; display: flex; justify-content: center; gap: 16px; }

/* ---------- telas baixas: celular deitado dentro do navegador ---------- */
@media (max-height: 340px) {
  .tl-item { padding: 2px 6px; }
  .tl-progresso { height: 6px; margin-bottom: 3px; }
  .tl-trecho { padding: 2px 8px 4px; }
  .tl-fim-texto span { display: none; }
}
