:root {
  --branco: #ffffff;
  --grafite: #23272b;
  --cinza: #5c636a;
  --claro: #f3f4f5;
  --linha: #d5d8db;
  --vermelho: #c8102e;
  --verde: #157a3a;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--branco);
  color: var(--grafite);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { overscroll-behavior-y: none; }
button { font-family: inherit; cursor: pointer; }

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Topo fixo ---------- */
.cabeca {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--branco);
  padding-top: env(safe-area-inset-top);
}
.faixa-treino {
  background: var(--grafite);
  color: #fff;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 16px;
}
.topo {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--linha);
}
.b192 {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  background: var(--vermelho);
  color: #fff;
  font-weight: 800;
  font-size: 23px;
  border-radius: 14px;
  text-decoration: none;
}
.b192 svg { width: 26px; height: 26px; }
.som {
  flex: 0 0 58px;
  height: 58px;
  border: 2px solid var(--linha);
  border-radius: 14px;
  background: #fff;
  color: var(--grafite);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.som svg { width: 28px; height: 28px; }
.som.desligado { color: var(--cinza); border-style: dashed; }

.aviso-sozinha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--grafite);
  color: #fff;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}
.aviso-sozinha[hidden] { display: none; }
.aviso-sozinha-tempo {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.aviso-sozinha.zerado .aviso-sozinha-tempo { color: #ffd2d8; }

/* ---------- Tela ---------- */
.tela {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 6px;
}
.etapa {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cinza);
  min-height: 18px;
}
.etapa-info { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tom-perigo .etapa-txt { color: var(--vermelho); }
.tom-ok .etapa-txt { color: var(--verde); }

.instr {
  margin: 0;
  font-size: 30px;
  line-height: 1.17;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--grafite);
  cursor: pointer;
  outline-offset: 4px;
}
.tom-ok .instr { color: var(--verde); }

.det {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
  color: var(--grafite);
}

/* ---------- Animação ---------- */
.midia {
  position: relative;
  flex: 1 1 auto;
  min-height: 150px;
  border-radius: 16px;
  background: #f4f7fb; /* mesmo fundo dos cartões dos mapas */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.midia video, .midia img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.midia.tocavel { cursor: pointer; user-select: none; -webkit-user-select: none; }
.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--cinza);
  text-align: center;
  padding: 10px 14px;
  border: 2px dashed var(--linha);
  border-radius: 12px;
  margin: 12px 12px 56px;
}
.com-ritmo .placeholder { margin: 12px 140px 12px 12px; }
.placeholder strong { font-size: 18px; color: var(--grafite); }

.midia.com-contador { min-height: 170px; }
.midia.com-contador video, .midia.com-contador img { height: calc(100% - 50px); }
.com-ritmo .midia video, .com-ritmo .midia img { right: 128px; width: auto; }
.dica {
  font-size: 12px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--cinza);
  width: 64px;
}
.contador {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ponto {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--grafite);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 19px;
  transition: background .12s, color .12s;
}
.ponto.on { background: var(--grafite); color: #fff; }

.pulso {
  position: absolute;
  right: 10px;
  top: 50%;
  margin-top: -54px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--grafite);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px rgba(35, 39, 43, .12);
}
.pulso-num {
  font-size: 58px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pulso.bate { animation: bate .26s ease-out; }
@keyframes bate {
  0% { transform: scale(1.14); box-shadow: 0 0 0 14px rgba(35, 39, 43, .22); }
  100% { transform: scale(1); box-shadow: 0 0 0 6px rgba(35, 39, 43, .12); }
}

/* ---------- Botões ---------- */
.link {
  align-self: center;
  background: none;
  border: 0;
  color: var(--grafite);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 17px;
  padding: 10px 12px;
  min-height: 44px;
}
.botoes { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.bt {
  width: 100%;
  min-height: 64px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 2px solid var(--grafite);
  background: #fff;
  color: var(--grafite);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  touch-action: manipulation;
}
.bt:active { transform: scale(.985); }
.bt.principal { background: var(--grafite); color: #fff; }
.bt.perigo { border-color: var(--vermelho); color: var(--vermelho); }
.bt.ok { background: var(--verde); border-color: var(--verde); color: #fff; }
.bt.b192 {
  background: var(--vermelho);
  border-color: var(--vermelho);
  color: #fff;
  min-height: 84px;
  font-size: 28px;
}

/* ---------- Rodapé ---------- */
.rodape { padding: 4px 16px calc(10px + env(safe-area-inset-bottom)); }
.rod-linha { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rod-bt {
  background: none;
  border: 0;
  color: var(--cinza);
  font-size: 16px;
  padding: 10px 4px;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rod-bt[disabled] { visibility: hidden; }
.rod-bt[hidden] { display: none; }
.rod-nunca, .rod-ligar { color: var(--vermelho); font-weight: 700; }
.rod-ligar, .rod-nunca { margin-left: auto; }
.aviso-legal { margin: 2px 0 0; font-size: 12px; line-height: 1.35; color: var(--cinza); text-align: center; }

/* ---------- Camadas ---------- */
.camada {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 22, 24, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.camada-caixa {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
}
.camada-titulo { margin: 0 0 12px; font-size: 26px; line-height: 1.2; font-weight: 800; }
.nunca-lista { list-style: none; margin: 0 0 16px; padding: 0; }
.nunca-lista li {
  position: relative;
  padding: 12px 0 12px 40px;
  font-size: 21px;
  font-weight: 700;
  border-bottom: 1px solid var(--linha);
}
.nunca-lista li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  border-radius: 50%;
  border: 3px solid var(--vermelho);
  background:
    linear-gradient(45deg, transparent 44%, var(--vermelho) 44%, var(--vermelho) 56%, transparent 56%);
}

/* ---------- Aviso rápido (modo treino) ---------- */
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  top: 96px;
  z-index: 60;
  max-width: 528px;
  margin: 0 auto;
  background: var(--grafite);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  padding: 16px;
  border-radius: 14px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.toast.on { opacity: 1; transform: none; }

/* ---------- /verificar ---------- */
.verificar { padding: 24px 16px; display: flex; flex-direction: column; gap: 16px; }
.verificar-status { font-size: 30px; font-weight: 800; line-height: 1.2; margin: 0; }
.verificar-status.ok { color: var(--verde); }
.verificar-det { font-size: 17px; line-height: 1.4; margin: 0; color: var(--cinza); }

@media (max-height: 640px) {
  .instr { font-size: 28px; }
  .det { font-size: 17px; }
  .midia { min-height: 128px; }
  .tela { gap: 8px; padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .pulso.bate { animation-duration: .01s; }
}

/* ---------- Guias 3 a 8 ---------- */
.aviso-calma {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--grafite);
  background: var(--claro);
  border-radius: 12px;
  padding: 10px 12px;
}
.relogio {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--grafite);
  color: #fff;
  border-radius: 14px;
  padding: 6px 16px 6px 12px;
}
.relogio::before {
  content: "";
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 3px solid currentColor;
  background: linear-gradient(currentColor, currentColor) 50% 3px / 3px 8px no-repeat;
  box-sizing: border-box;
}
.relogio-num { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.relogio.acabou { background: var(--verde); animation: piscar 1s steps(2, start) 3; }
@keyframes piscar { to { opacity: .55; } }
.lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lista li {
  position: relative;
  padding: 9px 0 9px 28px;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
  border-bottom: 1px solid var(--linha);
}
.lista li::before {
  content: "";
  position: absolute; left: 4px; top: 16px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--vermelho);
}
.lista-ok li::before {
  top: 13px; width: 14px; height: 8px; border-radius: 0;
  background: none;
  border-left: 3px solid var(--verde);
  border-bottom: 3px solid var(--verde);
  transform: rotate(-45deg);
}
.bt.tel { background: var(--grafite); border-color: var(--grafite); color: #fff; min-height: 72px; font-size: 24px; }
.rod-linha { flex-wrap: wrap; }
.rod-linha .rod-bt { font-size: 15px; }
.lista-192 li::before { border-color: var(--vermelho); }
.det-apos { font-weight: 700; }
