:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --border: #e3e7ee;
  --text: #16203a;
  --muted: #667085;
  --primary: #2a5da8;
  --primary-dark: #1e4780;
  --most: #27865e;
  --least: #b06a5c;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.55; font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
#app { max-width: 720px; margin: 0 auto; padding: 32px 20px 72px; }
.loading { text-align: center; color: var(--muted); padding: 72px 0; }

h1 { font-size: 27px; font-weight: 750; letter-spacing: -.02em; margin: 0 0 8px; }
h2 { font-size: 19px; font-weight: 650; margin: 0 0 8px; }
p { margin: 0 0 14px; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(16,24,40,.05);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: #fff; border: none; border-radius: 10px;
  padding: 14px 24px; font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn:hover:not(:disabled) { background: var(--primary-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: none; color: var(--muted); border: 1px solid var(--border); }
.btn.ghost:hover:not(:disabled) { background: #f1f3f7; color: var(--text); }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; font-size: 16px; background: #fff; color: var(--text);
}
input:focus { outline: 2px solid rgba(42,93,168,.25); border-color: var(--primary); }
.field { margin-bottom: 18px; }
.check { display: flex; gap: 11px; align-items: flex-start; font-weight: 400; font-size: 15px; cursor: pointer; }
.check input { width: auto; margin-top: 4px; flex-shrink: 0; }
.error { color: #c0392b; font-size: 14px; margin-top: 12px; }

/* ─────────────────────────────────────────────────────────── progresso */
.progress-wrap { position: sticky; top: 0; background: var(--bg); padding: 14px 0 12px; z-index: 10; }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.progress { height: 7px; background: #e5e9f0; border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width .25s ease; }

/* ──────────────────────────────────────────────────────── grade do bloco */
.grid-head {
  display: grid; grid-template-columns: 1fr 78px 78px; gap: 10px; align-items: end;
  padding: 0 4px 9px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
.grid-head .h-most { text-align: center; color: var(--most); }
.grid-head .h-least { text-align: center; color: var(--least); }

.opt {
  display: grid; grid-template-columns: 1fr 78px 78px; gap: 10px; align-items: center;
  padding: 6px 4px; border-radius: 10px;
}
.opt + .opt { border-top: 1px solid #eef1f5; }
.opt .word { font-size: 17px; font-weight: 500; }

.pick {
  height: 46px; border: 2px solid var(--border); border-radius: 10px; background: #fff;
  cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all .12s;
}
.pick:hover:not(:disabled) { border-color: #c6cedb; }
.pick:disabled { opacity: .3; cursor: not-allowed; }
.pick.most.on { background: var(--most); border-color: var(--most); color: #fff; }
.pick.least.on { background: var(--least); border-color: var(--least); color: #fff; }

.nav-row { display: flex; gap: 12px; margin-top: 22px; }
.nav-row .btn { flex: 1; }

.hint-box {
  background: #eef4fd; border: 1px solid #cddffa; border-radius: 10px;
  padding: 14px 16px; font-size: 14px; margin-bottom: 20px;
}

.done { text-align: center; padding: 48px 22px; }
.done .icon {
  width: 62px; height: 62px; border-radius: 50%; background: var(--most); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 18px;
}

.steps { display: flex; gap: 8px; margin-bottom: 22px; }
.steps div { flex: 1; height: 4px; border-radius: 2px; background: #e5e9f0; }
.steps div.on { background: var(--primary); }

@media (max-width: 640px) {
  #app { padding: 16px 13px 24px; }
  h1 { font-size: 22px; }
  h2 { font-size: 17px; }
  .card { padding: 17px 15px; }

  /* Palavra ganha espaço; os botões viram alvos de toque generosos */
  .grid-head, .opt { grid-template-columns: 1fr 68px 68px; gap: 8px; }
  .grid-head { font-size: 11px; }
  .opt { padding: 4px 2px; }
  .opt .word { font-size: 17px; font-weight: 550; }
  .pick { height: 54px; font-size: 12.5px; border-radius: 11px; }

  /* Navegação fixa no rodapé: "Próximo" sempre a um toque, sem rolar */
  .nav-row {
    position: sticky; bottom: 0; margin: 18px -15px -17px; padding: 12px 15px;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
    border-top: 1px solid var(--border); gap: 10px;
  }
  .nav-row .btn { padding: 15px 18px; }

  .progress-wrap { padding: 10px 0 10px; }
  .hint-box { padding: 13px 14px; font-size: 13.5px; }
  .steps { margin-bottom: 18px; }
  .done { padding: 38px 16px; }
}

/* Telas muito estreitas (iPhone SE e similares) */
@media (max-width: 370px) {
  .grid-head, .opt { grid-template-columns: 1fr 58px 58px; gap: 6px; }
  .opt .word { font-size: 16px; }
  .pick { height: 50px; font-size: 11.5px; }
}

/* Tablet: conteúdo mais largo, sem esticar demais a linha de leitura */
@media (min-width: 641px) and (max-width: 1024px) {
  #app { max-width: 620px; padding: 34px 24px 72px; }
  .pick { height: 50px; }
}
