:root {
  --brand: #14131F;
  --brand-panel: #1E1D2E;
  --brand-card: #322F52;
  --accent: #3B4CE0;
  --accent-soft: #ECEEFC;
  --ink: #F4F5FB;
  --ink-muted: #A7ADC2;
  --ok: #33C481;
  --live: #E0473B;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* CSS de autor sempre vence a folha padrao do navegador - sem isso, o
   [hidden] do HTML perde pra qualquer ".tela { display:flex }" e as
   telas ficam todas visiveis ao mesmo tempo. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--brand);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) 20px max(16px, env(safe-area-inset-bottom));
}

.topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
}
.topo__logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.topo h1 { margin: 0; font-size: 1.15rem; letter-spacing: -0.01em; }
.topo__sub { margin: 2px 0 0; font-size: 0.8rem; color: var(--ink-muted); }

.tela {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}

.mensagem {
  color: var(--ink-muted);
  font-size: 1rem;
  max-width: 32ch;
  line-height: 1.5;
}

.mensagem--erro { color: var(--live); }

.manual-instalar__passos {
  text-align: left;
  max-width: 34ch;
  margin: 0 auto 20px;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.6;
}
.manual-instalar__passos li { margin-bottom: 10px; }

.hero-gabi {
  width: min(58vw, 220px);
  height: min(58vw, 220px);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--brand-card), 0 12px 40px rgba(0, 0, 0, 0.45);
}

.botao {
  appearance: none;
  border: 1px solid var(--brand-card);
  background: var(--brand-panel);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 22px;
  border-radius: 999px;
  cursor: pointer;
  min-width: 220px;
  text-decoration: none;
  display: inline-block;
}
.botao--principal { background: var(--accent); border-color: var(--accent); color: white; }
.botao:active { transform: scale(0.98); }

.palco {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.mic {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, var(--accent), #2733A8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 rgba(59, 76, 224, 0.55);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.mic:active { transform: scale(0.97); }
.mic[data-estado="escutando"] {
  animation: pulso 1.4s ease-out infinite;
  background: radial-gradient(circle at 35% 30%, var(--live), #9c2c24);
}
.mic[data-estado="pensando"] { animation: girar 1.1s linear infinite; }
.mic[data-estado="falando"] { background: radial-gradient(circle at 35% 30%, var(--ok), #1d7a52); }

@keyframes pulso {
  0% { box-shadow: 0 0 0 0 rgba(224, 71, 59, 0.55); }
  100% { box-shadow: 0 0 0 34px rgba(224, 71, 59, 0); }
}
@keyframes girar {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.status { color: var(--ink-muted); font-size: 0.95rem; min-height: 1.3em; }

.transcricao {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 12px;
}
.transcricao__linha { margin: 6px 0; font-size: 0.92rem; line-height: 1.45; }
.transcricao__linha--voce { color: var(--ink-muted); }
.transcricao__linha--gabi { color: var(--ink); font-weight: 500; }

.rodape { text-align: center; padding-top: 4px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.link {
  appearance: none;
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}
.link--live { color: var(--accent-soft); text-decoration: none; font-weight: 600; }

.live-indicador {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brand-card), var(--brand-panel));
  border: 2px solid var(--accent);
}
.live-indicador[data-estado="ouvindo"] {
  background: radial-gradient(circle at 35% 30%, var(--accent), #2733A8);
  animation: pulso 1.4s ease-out infinite;
}
.live-indicador[data-estado="falando"] {
  background: radial-gradient(circle at 35% 30%, var(--ok), #1d7a52);
  animation: pulso-suave 1.6s ease-in-out infinite;
}
.live-indicador[data-estado="conectando"] { animation: girar 1.1s linear infinite; }
.live-indicador[data-estado="erro"] { background: radial-gradient(circle at 35% 30%, var(--live), #7a2c24); }

@keyframes pulso-suave {
  0%, 100% { box-shadow: 0 0 0 0 rgba(51, 196, 129, 0.4); }
  50% { box-shadow: 0 0 0 18px rgba(51, 196, 129, 0); }
}
