/* O que comer? — mobile-first, uso com uma mão. Tema claro/escuro automático. */

:root {
  --fundo: #fbf7f2;
  --superficie: #ffffff;
  --superficie-2: #f3ece3;
  --texto: #2b2520;
  --texto-suave: #6f655c;
  --borda: #e6ddd2;
  --destaque: #d9480f;
  --destaque-texto: #ffffff;
  --destaque-suave: #fde8dc;
  --aviso: #fff4d6;
  --aviso-borda: #f0d58a;
  --alerta-texto: #a23c07;
  --sombra: 0 1px 2px rgb(60 40 20 / 0.06), 0 4px 16px rgb(60 40 20 / 0.06);
  --raio: 16px;
  --largura: 480px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #1a1714;
    --superficie: #25211d;
    --superficie-2: #2f2a25;
    --texto: #f3ede6;
    --texto-suave: #b3a89c;
    --borda: #3b352f;
    --destaque: #ff7a3d;
    --destaque-texto: #1a1714;
    --destaque-suave: #3d2518;
    --aviso: #3a3120;
    --aviso-borda: #6b5a2c;
    --alerta-texto: #ffab7a;
    --sombra: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.4;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible { outline: 3px solid var(--destaque); outline-offset: 2px; }

/* ---- Estrutura de tela ---------------------------------------------- */

.tela {
  display: flex;
  flex-direction: column;
  max-width: var(--largura);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
}

.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
}

.botao-texto {
  border: 0;
  background: none;
  padding: 10px 8px;
  margin: 0 -8px;
  color: var(--texto-suave);
  font-size: 15px;
  border-radius: 10px;
}
.botao-texto:hover { color: var(--texto); }

.progresso {
  height: 4px;
  background: var(--superficie-2);
  border-radius: 2px;
  overflow: hidden;
  margin: 4px 0 0;
}
.progresso > span {
  display: block;
  height: 100%;
  background: var(--destaque);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.carregando, .erro { margin: auto; color: var(--texto-suave); text-align: center; }
.erro { color: var(--texto); }

/* ---- Início ---------------------------------------------------------- */

.inicio {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding-bottom: 8px;
}
.inicio .emoji-grande { font-size: 72px; line-height: 1; margin: 0; }
.inicio h1 { font-size: 36px; line-height: 1.1; margin: 8px 0 0; }
.inicio p { margin: 0 0 24px; color: var(--texto-suave); font-size: 18px; }

/* ---- Pergunta -------------------------------------------------------- */

.pergunta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 20px;
  padding-top: 24px;
}
.pergunta h1 {
  font-size: 28px;
  line-height: 1.15;
  margin: 0;
}
.restantes { margin: -12px 0 0; color: var(--texto-suave); font-size: 15px; }

.opcoes { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.opcoes--duas { grid-template-columns: 1fr 1fr; }
.opcoes--muitas { gap: 8px; }
.opcoes--muitas .opcao { min-height: 50px; padding: 8px 16px; }

.opcao {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  border: 1.5px solid var(--borda);
  border-radius: var(--raio);
  background: var(--superficie);
  box-shadow: var(--sombra);
  text-align: left;
  font-size: 18px;
  font-weight: 500;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.opcao:hover { border-color: var(--destaque); }
.opcao:active { transform: scale(0.98); background: var(--destaque-suave); }
.opcao .emoji { font-size: 26px; line-height: 1; flex: none; }

.opcoes--duas .opcao {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  text-align: center;
}
.opcoes--duas .opcao .emoji { font-size: 40px; }

.acoes-secundarias {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}
.botao-secundario {
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px dashed var(--borda);
  border-radius: var(--raio);
  background: transparent;
  color: var(--texto-suave);
  font-size: 17px;
}
.botao-secundario:hover { color: var(--texto); border-color: var(--texto-suave); }

.ver-agora {
  align-self: center;
  border: 0;
  background: none;
  padding: 12px;
  color: var(--destaque);
  font-size: 16px;
  font-weight: 600;
}

/* ---- Botão principal ------------------------------------------------- */

.botao-principal {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: 0;
  border-radius: var(--raio);
  background: var(--destaque);
  color: var(--destaque-texto);
  font-size: 19px;
  font-weight: 600;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.botao-principal:hover { filter: brightness(1.05); }
.botao-principal:active { transform: scale(0.98); }

/* ---- Resultado ------------------------------------------------------- */

.resultado { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; flex: 1; }
.resultado h1 { font-size: 26px; margin: 4px 0 0; }
.resultado h2 { font-size: 16px; margin: 10px 0 0; color: var(--texto-suave); font-weight: 600; }

.aviso {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--aviso-borda);
  border-radius: 12px;
  background: var(--aviso);
  font-size: 15px;
}

.cards { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: var(--superficie);
  box-shadow: var(--sombra);
}
.card .emoji { font-size: 32px; line-height: 1; flex: none; }
.card .nome { font-size: 18px; font-weight: 600; margin: 0; }
.card--destaque {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px;
  border: 2px solid var(--destaque);
}
.card--destaque .emoji { font-size: 56px; }
.card--destaque .nome { font-size: 26px; line-height: 1.15; }
.card--aproximado { box-shadow: none; background: transparent; border-style: dashed; }

.card-corpo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.detalhe { margin: 0; color: var(--texto-suave); font-size: 14px; }
.nao-atende { margin: 2px 0 0; color: var(--alerta-texto); font-size: 14px; font-weight: 500; }
.nao-atende::before { content: "⚠ "; }

/* ---- Suas escolhas --------------------------------------------------- */

.escolhas {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--superficie-2);
}
.escolhas-titulo {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--texto-suave);
}
.resultado .escolhas-titulo { margin: 0 0 8px; color: var(--texto-suave); font-size: 13px; }
.escolhas ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.escolhas li { display: flex; flex-direction: column; line-height: 1.25; }
.escolha-rotulo { font-size: 12px; color: var(--texto-suave); }
.escolha-valor { font-size: 15px; font-weight: 600; }
.escolhas li.tanto-faz { flex-basis: 100%; }
.escolhas li.tanto-faz .escolha-valor { font-weight: 400; font-style: italic; color: var(--texto-suave); }
.escolhas li.nova .escolha-valor { color: var(--destaque); animation: entrar 0.35s ease both; }

.rodape-acoes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}
.rodape-acoes .botao-principal { grid-column: 1 / -1; }
.rodape-acoes .botao-secundario { border-style: solid; padding: 10px; font-size: 16px; }
.rodape-acoes .botao-secundario:only-of-type { grid-column: 1 / -1; }

/* ---- Movimento ------------------------------------------------------- */

@keyframes entrar {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.animar { animation: entrar 0.25s ease both; }

@media (prefers-reduced-motion: reduce) {
  .animar { animation: none; }
  * { transition: none !important; }
}

/* ---- Telas maiores: só centraliza ------------------------------------ */

@media (min-width: 700px) {
  .tela { padding-top: 40px; min-height: auto; }
  .pergunta, .inicio { justify-content: flex-start; }
}
