/* Trilha da Matemática — visual próprio (prefixo tm-). O comum fica em base.css (gerado). */
:root {
  --tema: #ffc58f;
  --tema-escuro: #e07b24;
  --tm-op: clamp(80px, 15vh, 128px);
  --tm-parada: clamp(80px, 15vh, 124px);
  --tm-trecho: clamp(80px, 11vh, 104px);
  --tm-terra: #e8cba6;
}

/* ---------- o caminho ---------- */
.palco.tm-caminho { flex-direction: column; gap: clamp(6px, 2vh, 18px); align-items: stretch; }
.tm-trechos { display: flex; justify-content: center; gap: clamp(4px, 1vw, 14px); flex: 0 0 auto; }
.tm-trecho {
  position: relative; width: var(--tm-trecho); height: var(--tm-trecho); padding: 6px; border: 0; border-radius: 22px;
  background: var(--branco); box-shadow: var(--sombra);
}
.tm-trecho svg { width: 100%; height: 100%; display: block; }
.tm-trecho.tm-escolhido { background: #fff1c9; outline: 5px solid var(--azul); outline-offset: -5px; }
.tm-trecho.fechado svg { opacity: 0.4; }
.tm-cadeado { position: absolute; right: 4px; bottom: 2px; font-size: 22px; }

.tm-trilha { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 28px); }
.tm-estrada { position: absolute; left: 0; right: 0; top: 50%; width: 100%; height: 60%; transform: translateY(-50%); pointer-events: none; }
.tm-placa {
  position: relative; display: flex; flex-direction: column; justify-content: center; padding: 8px 16px; min-width: 120px; max-width: 200px;
  background: #d9a066; border: 4px solid #7a4a21; border-radius: 12px; color: #3e2410; box-shadow: var(--sombra); text-align: center;
}
.tm-placa small { font-size: 15px; }
.tm-placa strong { font-size: clamp(17px, 2.2vw, 22px); line-height: 1.15; }
.tm-paradas { position: relative; display: flex; align-items: center; gap: clamp(10px, 2vw, 26px); height: 100%; }
.tm-parada-botao {
  position: relative; width: var(--tm-parada); height: var(--tm-parada); border-radius: 50%; border: 6px solid #fff;
  background: var(--amarelo); color: var(--azul); box-shadow: var(--sombra); font-weight: bold;
}
.tm-parada-botao.tm-alto { transform: translateY(calc(-1 * clamp(0px, 5vh, 46px))); }
.tm-parada-botao.tm-baixo { transform: translateY(clamp(0px, 5vh, 46px)); }
.tm-parada-numero { font-size: clamp(28px, 5vh, 44px); }
.tm-parada-botao.feita { background: #c8f0b4; }
.tm-parada-botao.fechada { background: #e9e4dc; color: #8a8a8a; }
.tm-parada-botao.tm-da-vez { border-color: var(--azul); }
.tm-selo { position: absolute; right: -8px; top: -8px; width: 40%; height: 40%; }
.tm-selo svg { width: 100%; height: 100%; }
.tm-parada-botao .tm-cadeado { right: 50%; transform: translateX(50%); bottom: 4px; font-size: 18px; }
.tm-gemalino-aqui { position: absolute; left: -26%; bottom: 52%; height: 70%; width: auto; pointer-events: none; }

/* ---------- a parada ---------- */
.palco.tm-parada { gap: clamp(8px, 1.6vw, 22px); align-items: stretch; }
.tm-cena {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: rgba(255, 253, 247, 0.82);
  border-radius: var(--raio); box-shadow: var(--sombra); padding: 6px 10px;
}
.tm-cabecalho { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; min-height: 26px; }
.tm-passinhos { display: flex; gap: 5px; flex: 0 0 auto; }
.tm-passinhos span { width: 13px; height: 18px; border-radius: 50% 50% 45% 45%; background: #e0d2c2; }
.tm-passinhos span.feito { background: #8d6e63; }
.tm-passinhos span.agora { background: var(--tema-escuro); }
.tm-curta { flex: 1 1 auto; text-align: center; font-weight: bold; color: var(--azul); font-size: clamp(16px, 2.6vh, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-desenho { flex: 1 1 auto; min-height: 0; display: flex; }
.tm-svg { width: 100%; height: 100%; display: block; }

.tm-opcoes {
  flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, var(--tm-op)); gap: 10px; align-content: center;
  overflow-y: auto; padding: 4px;
}
.tm-opcao {
  width: var(--tm-op); height: var(--tm-op); border: 0; border-radius: 22px; background: var(--branco); color: var(--azul);
  box-shadow: var(--sombra); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px; gap: 2px;
}
.tm-opcao .tm-nome { font-weight: bold; font-size: clamp(30px, 6vh, 52px); line-height: 1; }
.tm-opcao svg { width: 100%; flex: 1 1 auto; min-height: 0; }
.tm-opcao img { height: 70%; width: auto; }
.tm-formato-forma .tm-nome, .tm-formato-solido .tm-nome, .tm-formato-quem .tm-nome { font-size: clamp(12px, 1.8vh + 4px, 19px); line-height: 1.05; }
.tm-formato-forma svg, .tm-formato-solido svg { max-height: 64%; }
.tm-formato-relogio .tm-nome { font-size: clamp(18px, 3.4vh, 30px); }
.tm-largas { grid-template-columns: clamp(190px, 24vw, 320px); }
.tm-largas .tm-opcao { width: 100%; flex-direction: row; gap: 10px; }
.tm-largas .tm-nome { font-size: clamp(17px, 2.8vh, 26px); line-height: 1.1; }
.tm-formato-quem .tm-opcao img { height: 86%; }
.tm-montar .tm-opcao { font-weight: bold; font-size: clamp(17px, 3vh, 26px); }
.tm-pronto { background: var(--amarelo) !important; }
.tm-amarrar { background: var(--amarelo) !important; font-weight: bold; font-size: clamp(20px, 3.4vh, 30px); }
.tm-opcao.tm-certa { background: #c8f0b4; outline: 5px solid #43a047; outline-offset: -5px; }
.tm-opcao.tm-apagada, .tm-opcao.tm-tentou { opacity: 0.4; }
.tm-opcao.tm-mostrar { background: #fff1c9; outline: 5px solid var(--amarelo); outline-offset: -5px; box-shadow: 0 0 0 4px var(--azul); }

/* marcas da dica e o que entrou de novo */
.tm-novo { filter: drop-shadow(0 0 4px #ffb300); }
.tm-depois { display: none; }
.tm-marca { animation: tm-aparece 0.3s ease-out both; }
@keyframes tm-aparece { from { opacity: 0; } to { opacity: 1; } }

/* ---------- o fim da parada ---------- */
.tm-fim {
  margin: auto; display: flex; align-items: center; gap: clamp(10px, 3vw, 36px); padding: 12px clamp(12px, 3vw, 32px);
  background: var(--branco); border-radius: var(--raio); box-shadow: var(--sombra); max-width: 100%; max-height: 100%;
}
.tm-fim-figura { height: clamp(90px, 34vh, 260px); width: auto; flex: 0 0 auto; }
.tm-fim-texto { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-y: auto; max-height: 100%; }
.tm-fim-texto strong { font-size: clamp(22px, 4vh, 34px); color: var(--azul); }
.tm-fim-texto p { margin: 0; font-size: clamp(15px, 2.4vh, 20px); line-height: 1.3; }
.tm-fim-botoes { display: flex; flex-direction: column; gap: 10px; flex: 0 0 auto; }

/* ---------- telas baixas (celular deitado) ---------- */
@media (max-width: 760px) {
  .tm-placa { display: none; }
}
@media (max-height: 460px) {
  .tm-opcoes { gap: 6px; padding: 2px; }
  .tm-cena { padding: 2px 6px; }
  .tm-cabecalho { min-height: 22px; }
  .tm-fim { padding: 6px 12px; }
  .tm-fim-botoes { flex-direction: row; }
  .tm-fim { flex-wrap: nowrap; }
  .tm-fim-texto p { font-size: 14px; }
  .tm-fim-texto strong { font-size: 20px; }
}
@media (max-height: 340px) {
  .tm-fim-figura { display: none; }
  .tm-passinhos span { width: 10px; height: 14px; }
}

/* nome escrito embaixo do desenho de cada trecho (qualidade: toda escolha mostra o nome) */
.tm-trecho { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: auto; min-height: var(--tm-trecho); }
.tm-trecho svg { flex: 1 1 auto; min-height: 0; height: calc(var(--tm-trecho) - 26px); width: auto; max-width: 100%; }
.rotulo-botao { display: block; font-size: clamp(10px, 1.2vw, 13px); font-weight: 700; line-height: 1.1; color: #1f3b57; pointer-events: none; }
.tm-trecho .tm-cadeado { top: 2px; bottom: auto; right: 2px; } /* o cadeado no canto de cima, longe do nome */
