/* ============================================================
   ISLAND TOUR (tour.js)

   A guia apresenta a ilha: holofote em cima do prédio (ou de um elemento da página de
   verdade, que troca por trás) e uma caixa de diálogo presa a uma borda, com o retrato
   dela e a fala sendo digitada. A cortina não é um <div> por cima: é o box-shadow
   gigante do próprio recorte, que assim acompanha o holofote numa transição só, sem
   quatro painéis brigando para fechar as frestas.
   ============================================================ */
.tour {
  position: fixed; inset: 0; z-index: 300;
  opacity: 0; transition: opacity 260ms var(--ease-smooth);
}
.tour.is-in { opacity: 1; }
.tour[hidden] { display: none; }

/* Cortina das paradas SEM alvo (abertura, despedida, alvo que não apareceu). */
.tour-veil { position: absolute; inset: 0; background: rgba(6,6,9,0.66); opacity: 0; transition: opacity 300ms var(--ease-smooth); }
.tour.is-center .tour-veil { opacity: 1; }

.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(6,6,9,0.70), 0 0 0 2px var(--accent), 0 0 24px 2px var(--accent-glow);
  transition: top 460ms var(--ease-smooth), left 460ms var(--ease-smooth),
              width 460ms var(--ease-smooth), height 460ms var(--ease-smooth), opacity 200ms;
  animation: tourPulse 2.4s ease-in-out infinite;
}
.tour.is-center .tour-spot { opacity: 0; }
@keyframes tourPulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(6,6,9,0.70), 0 0 0 2px var(--accent), 0 0 18px 1px var(--accent-glow); }
  50%      { box-shadow: 0 0 0 9999px rgba(6,6,9,0.70), 0 0 0 2px var(--accent), 0 0 34px 5px var(--accent-glow); }
}

/* ---- a caixa de diálogo ----
   Presa ao rodapé por padrão; `.is-top` (posto pelo JS quando o alvo está na metade de
   baixo) a leva para o topo. Só essas duas posições: uma caixa que persegue o alvo pela
   tela faria o retrato da guia pular de um canto para o outro a cada fala. */
.tour-dlg {
  position: fixed; left: 50%; bottom: 26px;
  width: min(820px, calc(100vw - 40px));
  margin-left: calc(min(820px, 100vw - 40px) / -2);
  display: flex; align-items: stretch;
  filter: drop-shadow(0 26px 44px rgba(0,0,0,0.65));
}
.tour.is-top .tour-dlg { bottom: auto; top: 26px; }
/* A entrada é REPLICADA a cada fala (a classe sai e volta): é ela que dá a sensação de
   "nova fala" mesmo quando a caixa não muda de lugar. */
.tour-dlg-in { animation: tourDlgIn 380ms var(--ease-smooth) both; }
@keyframes tourDlgIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* retrato: quadro inclinado, a arte desinclinada por dentro para a guia ficar de pé */
.tour-face {
  position: relative; z-index: 2; flex: 0 0 auto;
  width: 190px; height: 200px; align-self: flex-end;
  margin: -48px -18px 0 6px;
  overflow: hidden;
  transform: skewX(-8deg);
  border: 3px solid var(--accent);
  background: #e8315b;
  box-shadow: 0 0 26px var(--accent-glow);
}
.tour-face img {
  width: 116%; height: 100%; margin-left: -8%;
  object-fit: cover; object-position: 50% 12%;
  transform: skewX(8deg); transform-origin: center;
  display: block;
}
/* Enquanto a fala é digitada o retrato "respira" — é o que faz ela parecer falando. */
.tour.is-talking .tour-face img { animation: tourTalk 420ms ease-in-out infinite; }
@keyframes tourTalk {
  0%, 100% { transform: skewX(8deg) translateY(0) scale(1); }
  50%      { transform: skewX(8deg) translateY(-2px) scale(1.018); }
}
.tour.is-top .tour-face { align-self: flex-start; margin: 0 -18px -48px 6px; }

.tour-body {
  position: relative; flex: 1 1 auto; min-width: 0;
  padding: 16px 22px 14px 38px;
  background: rgba(10, 10, 13, 0.96);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
}
.tour-who { display: flex; align-items: baseline; gap: 12px; }
.tour-name {
  display: inline-block; padding: 3px 12px 3px 10px;
  transform: skewX(-12deg); transform-origin: left bottom;
  font-family: var(--font-display); font-weight: 800; font-style: italic;
  font-size: 13px; letter-spacing: 1.6px;
  color: #0b0b0e; background: var(--accent);
}
.tour-kicker { font-size: 10px; letter-spacing: 2px; color: var(--text-dim); }
.tour-title {
  margin: 10px 0 6px;
  font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 17px; letter-spacing: 1.2px;
  color: var(--text); text-transform: uppercase;
}
/* Fantasma + fala ao vivo na mesma célula: o fantasma (a fala inteira, invisível)
   reserva a altura final, então a caixa não cresce linha a linha durante a digitação. */
.tour-text {
  display: grid; margin: 0; cursor: pointer;
  font-size: 14.5px; line-height: 1.55; color: var(--text);
}
.tour-text > span { grid-area: 1 / 1; }
.tt-ghost { visibility: hidden; }
.tour.is-talking .tt-live::after {
  content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 3px;
  vertical-align: -2px; background: var(--accent);
  animation: tourCaret 700ms steps(2) infinite;
}
@keyframes tourCaret { 50% { opacity: 0; } }

.tour-foot { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.tour-dont { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-dim); cursor: pointer; white-space: nowrap; }
.tour-dont input { accent-color: var(--accent); width: 13px; height: 13px; cursor: pointer; }
.tour-dots { display: flex; gap: 4px; flex: 1 1 auto; justify-content: center; min-width: 0; }
.tour-dots i {
  width: 5px; height: 5px; border-radius: 99px; background: rgba(255,255,255,0.18); flex: 0 0 auto;
  transition: width 300ms var(--ease-smooth), background 300ms;
}
.tour-dots i.on { width: 16px; background: var(--accent); }
.tour-dots i.done { background: rgba(233,161,59,0.45); }
.tour-btns { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tour-back {
  padding: 9px 14px; border-radius: 9px; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  font-family: var(--font-ui); font-weight: 700; font-size: 11.5px; letter-spacing: 0.5px;
  transition: color 180ms, border-color 180ms;
}
.tour-back:hover { color: var(--text); border-color: var(--border-strong); }
.tour-back[hidden] { display: none; }
.tour-next { padding: 10px 20px; font-size: 12px; white-space: nowrap; }
.tour-x {
  position: absolute; top: 14px; right: 16px; padding: 4px 8px; cursor: pointer;
  background: transparent; border: none; border-radius: 7px;
  font-family: var(--font-ui); font-weight: 700; font-size: 10px; letter-spacing: 1.4px;
  color: var(--text-dim);
}
.tour-x:hover { color: var(--text); background: rgba(255,255,255,0.06); }

/* Confete do fim: reaproveita o molde do selo de confirmação (.cfx-burst). */
.tour-burst { position: absolute; left: 50%; top: 30px; pointer-events: none; }

/* Botão de rever, no cabeçalho do FAQ. */
.page-head .btn-ghost { margin-top: 0; }
.faq-tour-btn { display: inline-flex; align-items: center; gap: 8px; }
.faq-tour-btn svg { width: 15px; height: 15px; }

/* TELA ESTREITA: a caixa ocupa a largura toda, o retrato encolhe e os pontinhos saem
   (são muitas paradas para caber numa linha de telefone; o "3 / 19" já diz onde se está). */
@media (max-width: 720px) {
  .tour-dlg {
    left: 12px; right: 12px; width: auto; margin-left: 0; bottom: 14px;
  }
  .tour.is-top .tour-dlg { top: 14px; }
  /* Quase quadrado de propósito: as poses falam com as MÃOS (a carta, o V, o dedo
     apontando), que ficam nas laterais da arte — um quadro alto e estreito as cortaria. */
  .tour-face { width: 118px; height: 126px; margin: -38px -12px 0 2px; border-width: 2px; }
  .tour.is-top .tour-face { margin: 0 -12px -38px 2px; }
  .tour-body { padding: 12px 14px 12px 24px; }
  .tour-title { font-size: 14px; margin: 8px 0 4px; }
  .tour-text { font-size: 13px; line-height: 1.5; }
  .tour-dots { display: none; }
  .tour-foot { gap: 10px; flex-wrap: wrap; }
  .tour-x { top: auto; bottom: 14px; right: auto; left: 20px; padding: 4px 0; }
  /* SKIP desce para o rodapé da caixa: em cima ele encostava no contador "2 / 16". */
  .tour-dont { margin-left: 86px; }
  .tour-spot { border-radius: 12px; }
}

/* Enquanto o passeio anda, a faixa de avisos sai de cena: ela dividiria o rodapé com a
   caixa de diálogo. */
body.tour-on #ticker-bar { opacity: 0; visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .tour-spot { animation: none; transition: none; }
  .tour-dlg-in, .tour.is-talking .tour-face img, .tour.is-talking .tt-live::after { animation: none; }
}

/* No passeio o prédio em destaque usa o mesmo visual do hover, mas o "ENTER ›" não vale
   ali: a cortina está por cima e o clique não chegaria. */
body.tour-on .lobby-spot.is-chosen .ls-sub::after { content: ""; }
