:root {
  --ink: #1f3328;
  --ink-suave: #4f6356;
  --verde: #2f6b4f;
  --verde-esc: #1e4d38;
  --areia: #efe3c6;
  --papel: #ffffff;
  --linha: #dbe3d3;
  --neg: #d6453d;
  --pos: #2a9b66;
  --neutro: #8a9690;
  --cor: #2f6b4f;
  --titulo: Fredoka, "Trebuchet MS", system-ui, sans-serif;
  --corpo: Nunito, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--corpo);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: linear-gradient(180deg, #e3efdc 0%, #f1ecd6 55%, #f6eacb 100%) fixed;
}

button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding-bottom: 8px;
}
.logo-link { display: block; max-width: 62%; border-radius: 8px; }
.logo-link:focus-visible { outline: 3px solid #f2b705; outline-offset: 3px; }
.logo { height: 46px; width: auto; max-width: 100%; display: block; }
.selo {
  font-family: var(--titulo);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--verde);
  margin-left: auto;
}

main { flex: 1; }

.tela { animation: entra .35s ease both; }
@keyframes entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Botões ---------- */

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  font-weight: 800;
  font-size: 17px;
  text-align: center;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:focus-visible, .bola:focus-visible, .lado:focus-visible, .voltar:focus-visible {
  outline: 3px solid #f2b705;
  outline-offset: 3px;
}
.btn.primario {
  background: var(--verde);
  color: #fff;
  box-shadow: 0 6px 0 var(--verde-esc);
}
.btn.primario:hover { transform: translateY(-1px); }
.btn.primario:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--verde-esc); }
.btn.secundario {
  background: transparent;
  color: var(--verde-esc);
  border: 2px solid var(--verde);
}
.btn.secundario:hover { background: rgba(47, 107, 79, .08); }
.btn.perigo { background: #fbe4e1; border-color: var(--neg); color: #8f1f19; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn[hidden] { display: none; }

/* ---------- Início ---------- */

.inicio { text-align: center; padding-top: 8px; }
.avatares {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 400px;
  margin: 0 auto 22px;
}
.avatares img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(30, 77, 56, .2);
}
.avatares img:nth-child(3n+2) { transform: translateY(6px); }
.titulo {
  font-family: var(--titulo);
  font-weight: 700;
  font-size: clamp(32px, 8vw, 46px);
  line-height: 1.1;
  margin: 0 0 14px;
  color: var(--verde-esc);
}
.sub { margin: 0 auto 24px; max-width: 460px; color: var(--ink-suave); font-size: 18px; }
.acoes-inicio { display: grid; gap: 12px; max-width: 420px; margin: 0 auto; }
.nota { margin: 18px 0 0; font-size: 14px; color: var(--ink-suave); }

/* ---------- Perguntas ---------- */

.progresso { height: 12px; background: rgba(47, 107, 79, .15); border-radius: 99px; overflow: hidden; }
.barra { height: 100%; background: linear-gradient(90deg, #4cae7d, var(--verde)); border-radius: 99px; transition: width .4s ease; }
.info-prog {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-suave);
}
.voltar { background: none; border: 0; padding: 6px 4px; font-weight: 700; color: var(--verde-esc); border-radius: 8px; }
.voltar:disabled { visibility: hidden; }

.cartao {
  background: var(--papel);
  border-radius: 24px;
  padding: 26px 20px 22px;
  box-shadow: 0 10px 30px rgba(30, 77, 56, .12);
}
.tipo-q {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--verde);
}
.enunciado {
  font-family: var(--titulo);
  font-weight: 600;
  font-size: clamp(22px, 5.4vw, 28px);
  line-height: 1.25;
  margin: 0 0 26px;
  outline: none;
}

.pontas {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 10px;
}
.ponta.neg { color: var(--neg); }
.ponta.pos { color: var(--pos); }

.escala { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bola {
  flex: none;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--c);
  padding: 0;
  display: grid;
  place-items: center;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.bola.v-2 { --c: var(--neg); width: 62px; height: 62px; }
.bola.v-1 { --c: #e58a85; width: 48px; height: 48px; }
.bola.v0 { --c: var(--neutro); width: 38px; height: 38px; }
.bola.v1 { --c: #62bd90; width: 48px; height: 48px; }
.bola.v2 { --c: var(--pos); width: 62px; height: 62px; }
.bola:hover { background: color-mix(in srgb, var(--c) 18%, white); transform: scale(1.06); }
.bola.sel { background: var(--c); transform: scale(1.1); box-shadow: 0 4px 10px color-mix(in srgb, var(--c) 45%, transparent); }
.bola.sel::after { content: "✓"; color: #fff; font-weight: 900; font-size: 22px; line-height: 1; }
.bola.v0.sel::after, .bola.v-1.sel::after, .bola.v1.sel::after { font-size: 18px; }

.rotulo { height: 26px; margin: 14px 0 0; text-align: center; font-weight: 800; color: var(--verde-esc); }
.dica { margin: 4px 0 0; text-align: center; font-size: 13px; color: var(--ink-suave); display: none; }
@media (hover: hover) and (pointer: fine) { .dica { display: block; } }

.lados { display: grid; gap: 12px; }
.lado {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  width: 100%;
  min-height: 84px;
  padding: 16px 18px;
  background: #f5f9f1;
  border: 3px solid var(--linha);
  border-radius: 20px;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.lado .letra {
  flex: none;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--verde);
  color: #fff;
  font-family: var(--titulo);
  font-weight: 700;
}
.lado:hover { border-color: var(--verde); background: #eaf4e5; transform: translateY(-2px); }
.lado.sel { border-color: var(--verde); background: #d9eed0; }

/* ---------- Calculando ---------- */

.calculando { text-align: center; padding: 90px 0; font-family: var(--titulo); font-size: 24px; color: var(--verde-esc); }
.patas { display: flex; justify-content: center; gap: 14px; margin-bottom: 16px; }
.patas i { width: 18px; height: 18px; border-radius: 50%; background: var(--verde); animation: pulsa 1s infinite ease-in-out; }
.patas i:nth-child(2) { animation-delay: .2s; }
.patas i:nth-child(3) { animation-delay: .4s; }
@keyframes pulsa { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1.2); opacity: 1; } }

/* ---------- Resultado ---------- */

.heroi {
  border-radius: 28px;
  overflow: hidden;
  background: var(--cor);
  color: #fff;
  box-shadow: 0 14px 34px rgba(30, 50, 40, .25);
}
.heroi .foto { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.heroi-texto { padding: 20px 22px 26px; text-align: center; }
.vc-e { margin: 0; font-weight: 800; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; opacity: .92; }
.nome {
  font-family: var(--titulo);
  font-weight: 700;
  font-size: clamp(36px, 10vw, 54px);
  line-height: 1.05;
  margin: 4px 0 6px;
  outline: none;
  overflow-wrap: anywhere;
}
.cient { margin: 0 0 10px; font-style: italic; font-weight: 600; opacity: .92; }
.tagline { margin: 0; font-family: var(--titulo); font-size: 20px; font-weight: 500; }

.bloco {
  background: var(--papel);
  border-radius: 22px;
  padding: 22px 20px;
  margin-top: 16px;
  box-shadow: 0 6px 20px rgba(30, 77, 56, .1);
}
.bloco h2 {
  font-family: var(--titulo);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--cor);
}
.intro { margin: 0 0 12px; color: var(--ink-suave); }

.motivos { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.motivos li { padding-left: 14px; border-left: 5px solid var(--cor); }
.motivos strong { display: block; font-weight: 800; }
.motivos p { margin: 2px 0 0; }


.curiosidade { background: #fff8e1; }
.curiosidade h2 { color: #8a5a00; }
.curiosidade p { margin: 0; }
.fatos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fatos li { position: relative; padding-left: 22px; }
.fatos li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: #d89b00; }

.poder {
  background: var(--cor);
  color: #fff;
  text-align: center;
  padding: 22px 22px 24px;
}
.rotulo-poder { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.frase-poder { margin: 0; font-family: var(--titulo); font-weight: 600; font-size: 24px; line-height: 1.25; }

.bloco p { margin: 0 0 10px; }
.bloco p:last-child { margin-bottom: 0; }
.atencao {
  margin-top: 12px !important;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff3e0;
  color: #6b3d00;
  font-size: 15px;
}

.bando { display: grid; gap: 14px; }
.amigo { display: flex; align-items: center; gap: 14px; width: 100%; padding: 6px; margin: -6px; border: 0; border-radius: 16px; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: background .12s ease; }
.amigo:hover { background: color-mix(in srgb, var(--cor) 8%, white); }
.amigo:focus-visible, .rk:focus-visible, .voltar:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.amigo img { flex: none; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .2); }
.amigo-nome { display: block; font-family: var(--titulo); font-weight: 600; font-size: 20px; line-height: 1.2; margin: 0 0 2px; }
.amigo-tag { display: block; font-size: 15px; color: var(--ink-suave); }

.tracos { display: grid; gap: 12px; }
.traco { display: grid; grid-template-columns: 112px 1fr 44px; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.trilho { height: 14px; border-radius: 99px; background: #e7ede2; overflow: hidden; }
.preench { height: 100%; width: 0; background: var(--cor); border-radius: 99px; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.traco-val { text-align: right; color: var(--ink-suave); }

.segundo { display: flex; gap: 16px; align-items: center; }
.segundo img { flex: none; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .2); }
.rotulo-seg { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-suave); }
.segundo h3 { font-family: var(--titulo); font-size: 24px; margin: 0 0 4px; }
.segundo p:last-child { margin: 0; font-size: 15px; }

.acoes { display: grid; gap: 12px; margin-top: 22px; }
.aviso { min-height: 24px; text-align: center; font-weight: 700; font-size: 15px; color: var(--verde-esc); margin: 12px 0 0; }

.resultado.anima .heroi { animation: revela .7s cubic-bezier(.2, .9, .3, 1.2) both; }
.resultado.anima .bloco { animation: sobe .5s ease both; animation-delay: calc(.2s + var(--i, 0) * .09s); }
@keyframes revela { from { opacity: 0; transform: scale(.9) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes sobe { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- O que há de bom ---------- */

.boas { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.boas li {
  display: grid;
  gap: 2px;
  padding: 12px 14px 12px 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--cor) 9%, white);
  border-left: 5px solid var(--cor);
}
.boas strong { font-family: var(--titulo); font-weight: 600; font-size: 18px; color: color-mix(in srgb, var(--cor) 80%, black); }
.boas span { font-size: 16px; }

/* ---------- Confiança, retrato, desempate ---------- */

.conf {
  display: inline-block;
  margin: 12px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  font-weight: 800;
  font-size: 15px;
}
.conf-forte { background: rgba(255, 255, 255, .95); color: var(--cor); }

.retrato p { font-size: 18px; line-height: 1.55; }
.retrato p + p { margin-top: 10px; }
.nao {
  margin: 12px 0 0 !important;
  padding: 10px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--cor) 10%, white);
  font-size: 15px;
}

.duelo {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: #fff8e1;
  text-align: center;
}
.duelo-tit { margin: 0; font-family: var(--titulo); font-weight: 700; font-size: 22px; color: #8a5a00; }
.duelo-par { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 12px 0 8px; }
.rosto { display: grid; justify-items: center; gap: 6px; max-width: 130px; font-size: 14px; line-height: 1.2; }
.rosto img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .2); }
.vs { font-weight: 800; color: var(--ink-suave); }
.duelo-txt { margin: 0; font-size: 15px; }
.coleta { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--ink-suave); }

/* ---------- Ranking e fichas ---------- */

.rk-lista { display: grid; gap: 8px; }
.rk {
  display: grid;
  grid-template-columns: 34px 52px 1fr 76px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--linha);
  border-radius: 16px;
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.rk:hover { transform: translateY(-1px); border-color: var(--cor); }
.rk.topo { border-color: var(--cor); background: color-mix(in srgb, var(--cor) 8%, white); }
.rk .pos { font-family: var(--titulo); font-weight: 700; font-size: 18px; color: var(--ink-suave); text-align: center; }
.rk img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.rk-info { display: grid; min-width: 0; line-height: 1.2; }
.rk-info strong { font-family: var(--titulo); font-weight: 600; font-size: 17px; }
.rk-tag { font-size: 13px; line-height: 1.25; color: var(--ink-suave); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rk-aff { display: grid; gap: 4px; justify-items: end; font-size: 13px; }
.rk-bar { display: block; width: 100%; height: 8px; border-radius: 99px; background: #e7ede2; overflow: hidden; }
.rk-bar i { display: block; height: 100%; border-radius: 99px; }
.voltar-ficha { margin: 0 0 10px; }
.trilho { position: relative; }
.marca { position: absolute; top: -4px; width: 4px; height: 22px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.dica-share { margin: 6px 0 0; text-align: center; font-size: 13px; color: var(--ink-suave); }
.dica-share[hidden] { display: none; }

@media (max-width: 380px) {
  .rk { grid-template-columns: 28px 44px 1fr 64px; gap: 8px; }
  .rk img { width: 44px; height: 44px; }
}

/* ---------- Rodapé ---------- */

.rodape { margin-top: 32px; font-size: 13px; color: var(--ink-suave); }
.rodape summary { cursor: pointer; font-weight: 700; }
.rodape ul { padding-left: 18px; margin: 8px 0; }
.rodape a { color: var(--verde-esc); }

@media (max-width: 380px) {
  .bola.v-2, .bola.v2 { width: 54px; height: 54px; }
  .bola.v-1, .bola.v1 { width: 42px; height: 42px; }
  .traco { grid-template-columns: 96px 1fr 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
