:root {
  --red: #E5432F;
  --red-dark: #B92E1D;
  --yellow: #F2C21F;
  --yellow-soft: #FFF1C2;
  --ink: #1C1A18;
  --muted: #6E655C;
  --bg: #FFF8EC;
  --card: #FFFFFF;
  --line: #EFE4D2;
  --ok: #1F9D55;
  --ok-soft: #DDF5E6;
  --bad: #D93025;
  --bad-soft: #FDE2DF;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(120, 60, 20, .10);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(circle at 100% 0, rgba(242,194,31,.25), transparent 40%),
                    radial-gradient(circle at 0 100%, rgba(229,67,47,.12), transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.loading { margin: auto; color: var(--muted); font-weight: 700; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.6rem; font-weight: 900; }
h2 { font-size: 1.3rem; font-weight: 900; }
p { line-height: 1.45; }
.muted { color: var(--muted); }
.center { text-align: center; }

.logo-wrap { display: flex; justify-content: center; padding: 8px 0 4px; }
.logo { width: 100%; max-width: 300px; height: auto; }
.logo.small { max-width: 170px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 16px;
}

/* topo */
.topbar { display: flex; align-items: center; gap: 10px; }
.topbar img { width: 40px; height: 40px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.topbar .who { flex: 1; min-width: 0; }
.topbar .who b { display: block; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who span { font-size: .85rem; color: var(--muted); }
.icon-btn {
  min-width: 48px; height: 48px; border-radius: 14px; border: 0; background: #fff;
  box-shadow: var(--shadow); font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; padding: 0 12px;
}

/* botões */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 14px 18px;
  border: 0; border-radius: 16px; cursor: pointer;
  font: inherit; font-size: 1.1rem; font-weight: 800;
  transition: transform .08s ease, filter .15s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 0 var(--red-dark); margin-bottom: 6px; }
.btn-primary:active { box-shadow: 0 2px 0 var(--red-dark); transform: translateY(4px); }
.btn-yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 6px 0 #C99A05; margin-bottom: 6px; }
.btn-yellow:active { box-shadow: 0 2px 0 #C99A05; transform: translateY(4px); }
.btn-ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn-small { min-height: 44px; font-size: .95rem; padding: 8px 12px; width: auto; border-radius: 12px; }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.stack > * + * { margin-top: 12px; }

/* formulários */
.tabs { display: flex; background: var(--yellow-soft); border-radius: 14px; padding: 4px; gap: 4px; }
.tab {
  flex: 1; min-height: 48px; border: 0; border-radius: 11px; background: transparent;
  font: inherit; font-weight: 800; font-size: 1rem; color: var(--muted); cursor: pointer;
}
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
label { display: block; font-weight: 800; font-size: .95rem; margin-bottom: 6px; }
.field + .field { margin-top: 14px; }
input[type=text], input[type=password] {
  width: 100%; min-height: 54px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 14px; background: #FFFDF8;
  font: inherit; font-size: 1.05rem; color: var(--ink);
}
input:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(242,194,31,.3); }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.error { color: var(--bad); font-weight: 700; min-height: 1.2em; margin: 10px 0 0; font-size: .95rem; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 18px 0 14px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.google-box { display: flex; justify-content: center; min-height: 44px; }

/* home */
.hero { text-align: center; padding: 22px 18px; background: linear-gradient(135deg, var(--red), #F06A3A); color: #fff; }
.hero h2 { font-size: 1.45rem; }
.hero p { margin: 6px 0 16px; opacity: .95; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--bg); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; font-weight: 900; }
.stat span { font-size: .82rem; color: var(--muted); font-weight: 700; }
.stat.ok b { color: var(--ok); }
.stat.bad b { color: var(--bad); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* quiz */
.quiz-head { display: flex; align-items: center; gap: 10px; }
.quiz-head .count { font-weight: 900; min-width: 52px; text-align: right; }
.progress { flex: 1; height: 14px; background: #fff; border-radius: 99px; overflow: hidden; box-shadow: inset 0 0 0 2px var(--line); }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--yellow), var(--red)); border-radius: 99px; transition: width .35s ease; }
.score-pill { display: inline-block; background: var(--yellow-soft); border-radius: 99px; padding: 4px 12px; font-weight: 800; font-size: .9rem; }
.question { font-size: 1.3rem; font-weight: 900; line-height: 1.3; margin: 4px 0 0; }
.options { display: grid; gap: 12px; margin-top: 18px; }
.option {
  display: flex; align-items: center; gap: 12px; text-align: left;
  width: 100%; min-height: 60px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 16px; background: #fff;
  font: inherit; font-size: 1.08rem; font-weight: 700; color: var(--ink); cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.option:active { transform: scale(.98); }
.option .letter {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--yellow-soft); font-weight: 900;
}
.option.correct { background: var(--ok-soft); border-color: var(--ok); }
.option.correct .letter { background: var(--ok); color: #fff; }
.option.wrong { background: var(--bad-soft); border-color: var(--bad); animation: shake .35s; }
.option.wrong .letter { background: var(--bad); color: #fff; }
.option:disabled { cursor: default; }
.option.dim { opacity: .55; }
.feedback { margin-top: 16px; border-radius: 16px; padding: 14px 16px; animation: pop .25s ease; }
.feedback.ok { background: var(--ok-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback b { font-size: 1.15rem; display: block; }
.feedback .ref { display: inline-block; margin-top: 6px; font-weight: 800; background: #fff; border-radius: 8px; padding: 2px 8px; font-size: .9rem; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* resultado */
.big-score { font-size: 3.4rem; font-weight: 900; color: var(--red); line-height: 1; }
.medal { font-size: 3rem; }

/* ranking */
.rank-list { list-style: none; padding: 0; margin: 14px 0 0; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li.me { background: var(--yellow-soft); border-radius: 12px; padding-left: 10px; padding-right: 10px; }
.pos { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--bg); }
.pos.p1 { background: var(--yellow); }
.pos.p2 { background: #DADDE2; }
.pos.p3 { background: #E9B48A; }
.rank-name { flex: 1; min-width: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-val { font-weight: 900; }
.my-pos { margin-top: 12px; padding: 12px; background: var(--bg); border-radius: 12px; font-weight: 700; text-align: center; }

/* admin */
.user-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row .top { display: flex; justify-content: space-between; gap: 8px; }
.user-row .meta { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.user-row .actions { display: flex; gap: 8px; margin-top: 10px; }
.tag { font-size: .72rem; font-weight: 800; background: var(--yellow-soft); border-radius: 6px; padding: 2px 6px; margin-left: 6px; vertical-align: middle; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(120px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700;
  max-width: calc(100% - 32px); transition: transform .25s ease; z-index: 10;
}
.toast.show { transform: translateX(-50%) translateY(0); }
footer { margin-top: auto; padding-top: 20px; text-align: center; font-size: .8rem; color: var(--muted); }

/* regras de cadastro */
.aviso { background: #FFF6D6; border: 1px solid #F2C21F; border-radius: 12px; padding: 10px 12px; font-size: .88rem; line-height: 1.35; margin-bottom: 14px; color: #3a2f00; }
input.invalido { border-color: var(--bad) !important; background: #FFF1EF; }
input.valido { border-color: #2EAD5B !important; }
.hint.hint-erro { color: var(--bad); font-weight: 700; }

/* nível da pergunta */
.q-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.nivel { display: inline-block; border-radius: 99px; padding: 4px 12px; font-weight: 900; font-size: .82rem; letter-spacing: .02em; }
.nivel-facil { background: var(--ok-soft); color: #157A41; }
.nivel-media { background: #FFF1C2; color: #8A6400; }
.nivel-dificil { background: var(--bad-soft); color: #B3261E; }

/* instalar no celular */
.modal { position: fixed; inset: 0; background: rgba(28,26,24,.55); display: flex; align-items: flex-end; justify-content: center; padding: 16px; z-index: 20; }
.modal-card { width: 100%; max-width: 448px; margin: 0 0 env(safe-area-inset-bottom); }
.modal-card ol { margin: 0; padding-left: 22px; line-height: 1.5; }
.modal-card p { margin: 0; }

/* Bíblia: atalho na tela inicial */
.biblia-card { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; padding: 16px 18px; }
.biblia-card:active { transform: scale(.99); }
.biblia-ico { font-size: 2rem; flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--yellow-soft); }
.biblia-txt { flex: 1; min-width: 0; }
.biblia-txt b { display: block; font-size: 1.2rem; font-weight: 900; }
.biblia-txt span { font-size: .88rem; color: var(--muted); font-weight: 700; }
.biblia-seta { font-size: 2rem; color: var(--muted); font-weight: 900; }
.stats-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats-3 .stat { padding: 10px 6px; }
.stats-3 .stat b { font-size: 1.15rem; }
.stats-3 .stat span { font-size: .74rem; }

/* lista de livros e capítulos */
.livros { list-style: none; padding: 0; margin: 10px 0 0; }
.livro {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 10px 6px;
  border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left;
}
.livros li:last-child .livro { border-bottom: 0; }
.livro-nome { flex: 1; font-weight: 800; font-size: 1.05rem; }
.livro-prog { font-size: .85rem; color: var(--muted); font-weight: 800; }
.livro-prog.completo { color: var(--ok); }
.livro.breve { cursor: default; color: var(--muted); }
.livro.breve .livro-nome { font-weight: 700; }
.grade-caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.cap-btn {
  position: relative; height: 54px; border-radius: 14px; border: 2px solid var(--line); background: #fff;
  font: inherit; font-weight: 900; font-size: 1.05rem; color: var(--ink); cursor: pointer;
}
.cap-btn.comecou { border-color: var(--yellow); background: #FFFBEA; }
.cap-btn.lido { border-color: var(--ok); background: var(--ok-soft); color: #157A41; }
.cap-btn .check { position: absolute; top: 2px; right: 6px; font-size: .75rem; }

/* leitor */
.leitor-topo { position: sticky; top: 0; z-index: 5; margin: -16px -16px 0; padding: 10px 16px 0; background: rgba(255, 248, 236, .96); backdrop-filter: blur(6px); }
.leitor-topo .topbar { gap: 8px; }
.leitor-topo .icon-btn { min-width: 44px; height: 44px; }
.fonte-btn { padding: 0 8px; font-size: .95rem; }
.leitura-status { display: block; font-size: .8rem; color: var(--muted); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leitura-status.ok { color: var(--ok); }
.leitura-status.pausa, .leitura-status.aviso-st { color: #8A6400; }
.leitura-barra { height: 4px; margin: 10px -16px 0; background: var(--line); }
.leitura-barra > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--yellow), var(--red)); transition: width .6s ease; }
.leitura-barra.ok > div { background: var(--ok); }
.leitor-card { padding: 22px 20px; }
.cap-titulo { font-size: 1.5rem; margin-bottom: 10px; }
.texto-biblia { font-family: Georgia, 'Noto Serif', 'Times New Roman', serif; font-size: var(--fonte, 19px); line-height: 1.75; color: #24201C; overflow-wrap: break-word; }
.texto-biblia p { margin: 0 0 .9em; line-height: inherit; }
.texto-biblia .vn { font-family: 'Nunito', system-ui, sans-serif; font-size: .62em; font-weight: 900; color: var(--red); vertical-align: super; line-height: 0; margin-right: .2em; }
.texto-biblia .v-ausente { color: var(--muted); font-style: italic; font-size: .85em; }
.fim-capitulo { text-align: center; color: var(--muted); font-weight: 800; font-size: .85rem; padding: 10px 0 2px; }
.row .btn { font-size: .95rem; min-height: 52px; padding: 10px; }
footer.traducao { font-size: .74rem; line-height: 1.45; }
footer.traducao a { color: inherit; }

/* admin: leitura */
.alerta { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #FFF6D6; border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.alerta.resolvido { background: var(--bg); opacity: .8; }
.alertas-user summary { cursor: pointer; font-size: .85rem; font-weight: 800; color: var(--muted); margin-top: 6px; }
.rank-val .rank-sub { display: block; font-size: .75rem; font-weight: 800; color: var(--muted); text-align: right; }
.rank-list .rank-val { text-align: right; }

/* quadro de avisos */
.avisos-card { display: block; width: 100%; border: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; padding: 16px 18px; }
.avisos-topo { display: flex; align-items: center; gap: 8px; }
.avisos-topo b { font-size: 1.15rem; font-weight: 900; }
.avisos-ver { margin-left: auto; font-size: .85rem; font-weight: 800; color: var(--muted); }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: .78rem; font-weight: 900; display: inline-grid; place-items: center; }
.avisos-linha { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.avisos-tit { flex: 1; min-width: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avisos-dt { font-size: .8rem; color: var(--muted); font-weight: 700; flex: none; }
.ponto-novo { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--red); display: inline-block; }
.aviso-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.aviso-item:first-child { padding-top: 0; }
.aviso-item:last-child { border-bottom: 0; padding-bottom: 0; }
.aviso-cab { display: flex; align-items: center; gap: 8px; }
.aviso-cab h3 { flex: 1; font-size: 1.1rem; }
.aviso-data { font-size: .85rem; color: var(--muted); font-weight: 800; margin-top: 4px; }
.aviso-texto { white-space: pre-line; overflow-wrap: anywhere; margin: 8px 0 0; }
.aviso-texto a { color: var(--red-dark); font-weight: 700; }
.tag-cinza { background: var(--line); }
textarea, input[type=date] { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: #FFFDF8; font: inherit; font-size: 1.05rem; color: var(--ink); }
input[type=date] { min-height: 54px; }
textarea { resize: vertical; line-height: 1.45; }
textarea:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(242,194,31,.3); }
.check-linha { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 800; }
.check-linha input { width: 22px; height: 22px; }

/* traduções */
.cap-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cap-cab .cap-titulo { margin-bottom: 0; }
.trad-switch { display: inline-flex; background: var(--yellow-soft); border-radius: 12px; padding: 3px; gap: 3px; }
.trad-op { border: 0; background: transparent; border-radius: 9px; min-height: 36px; padding: 0 10px; font: inherit; font-size: .85rem; font-weight: 800; color: var(--muted); cursor: pointer; }
.trad-op.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.trad-sigla { font-size: .78rem; font-weight: 900; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 4px 8px; }
.texto-biblia p.verso { margin: 0 0 .35em; }
.texto-biblia .titulo-salmo { font-style: italic; color: var(--muted); font-size: .9em; }
footer.traducao .credito { display: inline; }

/* Desafio de Estudos */
.estudos-card { display: block; width: 100%; border: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; padding: 16px 18px; background: linear-gradient(135deg, #FFFDF5, #FFF4CF); }
.est-hoje { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.est-hoje b { font-size: 1.1rem; font-weight: 900; }
.est-rot { display: block; font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--red-dark); margin-bottom: 4px; }
.est-ref { font-size: .88rem; color: var(--muted); font-weight: 700; }
.est-semana { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .85rem; font-weight: 800; color: var(--muted); }
.est-pontos { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.est-ponto { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.est-ponto.aberto { background: #fff; box-shadow: inset 0 0 0 2px var(--yellow); }
.est-ponto.feito { background: var(--ok); }
.semana summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.semana summary::-webkit-details-marker { display: none; }
.semana summary .meta { font-size: .85rem; color: var(--muted); font-weight: 700; }
.est-data { flex: none; width: 74px; font-size: .82rem; font-weight: 900; color: var(--muted); }
.est-ref-l { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); }
.quiz-box { background: var(--bg); border-radius: 12px; padding: 12px; font-weight: 700; font-size: .92rem; line-height: 1.4; }
.quiz-box.ok { background: var(--ok-soft); color: #157A41; }
.quiz-box.aviso-quiz { background: #FFF6D6; }
.estudo p { margin: 0 0 .8em; line-height: 1.6; }
.estudo p:last-child { margin-bottom: 0; }
.reflexao { margin: 0; padding-left: 22px; line-height: 1.5; }
.reflexao li + li { margin-top: 8px; }
.versiculo-chave { background: linear-gradient(135deg, var(--red), #F06A3A); color: #fff; }
.versiculo-chave .est-rot { color: #FFE9A8; }
.versiculo-chave blockquote { margin: 4px 0 10px; font-family: Georgia, 'Noto Serif', serif; font-size: 1.2rem; line-height: 1.5; }
.versiculo-chave .trecho-credito, .versiculo-chave .trecho-credito a { color: rgba(255,255,255,.85); }
.trecho { margin-top: 6px; }
.trecho-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.trecho-barra { margin: 8px 0 12px; border-radius: 99px; overflow: hidden; }
.trecho-credito { font-size: .72rem; color: var(--muted); line-height: 1.4; margin-top: 8px; }
.trecho-credito a { color: inherit; }
.trecho-abas { margin: 6px 0 10px; flex-wrap: wrap; }
/* cinco abas no ranking cabem em 360 px */
.tab { min-width: 0; padding: 0 4px; font-size: clamp(.82rem, 3.7vw, 1rem); white-space: nowrap; }
