/* ==========================================================
   O visual do aplicativo.
   Antonio: você não precisa mexer aqui agora.
   Um dia você vai querer mudar as cores — aí a gente mexe junto.
   ========================================================== */

* {
  box-sizing: border-box;
}

:root {
  --fundo: #1e1e2e;
  --fundo-claro: #2a2a3e;
  --texto: #eeeeee;
  --roxo: #a06cf0;
  --rosa: #f06cc0;
  --verde: #4ade80;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  display: flex;
  flex-direction: column;
  /* respeita o "notch" e a barrinha de baixo do celular */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---------- topo ---------- */

#topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #ffffff1a;
}

#topo h1 {
  font-size: 18px;
  margin: 0;
  flex: 1;
  background: linear-gradient(90deg, var(--roxo), var(--rosa));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#voltar {
  background: none;
  border: 1px solid #ffffff33;
  color: var(--texto);
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

/* ---------- menu de programas ---------- */

#menu {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.cartao {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 17px;
  color: var(--texto);
  background: var(--fundo-claro);
  border: 1px solid #ffffff1a;
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
}

.cartao:active {
  transform: scale(0.98);
}

.cartao[disabled] {
  opacity: 0.4;
  cursor: default;
}

.cartao .emoji {
  font-size: 26px;
}

.cartao .numero {
  display: block;
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 2px;
}

/* ---------- conversa ---------- */

#conversa {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.balao {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 17px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  animation: aparecer 0.15s ease-out;
}

@keyframes aparecer {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.balao.computador {
  align-self: flex-start;
  background: var(--fundo-claro);
  border-bottom-left-radius: 6px;
}

.balao.antonio {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--roxo), var(--rosa));
  border-bottom-right-radius: 6px;
}

.balao.erro {
  align-self: stretch;
  max-width: 100%;
  background: #4a1f2a;
  border: 1px solid #f06c6c66;
  font-size: 15px;
  font-family: ui-monospace, monospace;
}

.balao.fim {
  align-self: center;
  background: none;
  opacity: 0.5;
  font-size: 14px;
}

/* ---------- barra de digitar ---------- */

#barra {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid #ffffff1a;
  background: var(--fundo);
}

#campo {
  flex: 1;
  font: inherit;
  /* 16px ou mais: impede o iPhone de dar zoom sozinho ao focar */
  font-size: 17px;
  padding: 14px 16px;
  border-radius: 999px;
  border: 1px solid #ffffff33;
  background: var(--fundo-claro);
  color: var(--texto);
}

#campo:focus {
  outline: 2px solid var(--roxo);
}

#barra button {
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  padding: 14px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--roxo), var(--rosa));
  color: white;
  cursor: pointer;
}
