/* Visual da ferramenta Quadrinhos Bíblicos (classes começam com qb-, ql-, qz-, vs-, cl-) */

:root { --qb-fonte: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Arial Rounded MT Bold", var(--fonte); --qb-tinta: #3a2a22; }

/* ---------- Cores das capas ---------- */
.qb-cor-ceu    { --g1: #8fd3ff; --g2: #3d8fd0; --g3: #1f4f8a; }
.qb-cor-mar    { --g1: #7fd6e0; --g2: #2f86c4; --g3: #173f6e; }
.qb-cor-ouro   { --g1: #ffd77a; --g2: #e09a2e; --g3: #8a4f12; }
.qb-cor-mata   { --g1: #a6e08a; --g2: #4fa65a; --g3: #1f5b3a; }
.qb-cor-noite  { --g1: #9aa6ff; --g2: #4a4fb0; --g3: #1b1d4f; }
.qb-cor-aurora { --g1: #ffc08a; --g2: #e0697a; --g3: #6b2a5a; }
.qb-cor-vinho  { --g1: #f2a0b0; --g2: #a3476b; --g3: #4a1530; }

/* ---------- Topo ---------- */
.qb-selo, .qb-cat-topo { display: inline-flex; align-items: center; gap: .35rem; margin: .6rem 0 0; padding: .28rem .8rem; border-radius: 999px; background: var(--dourado-suave); color: var(--dourado); font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.qb-h1-sub { display: block; font-family: var(--qb-fonte); font-size: .5em; font-weight: 700; color: var(--texto-2); letter-spacing: 0; margin-top: .2rem; }
.qb-ref-topo { display: inline-block; font-weight: 650; margin-left: .2rem; }
.qb-sec-cab { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; margin: 2.2rem 0 .9rem; }
.qb-sec-cab h2 { margin: 0; }
.qb-sec-sub { font-size: .85rem; color: var(--texto-2); }
.qb-rot { margin: 0 0 .4rem; font-family: var(--fonte); font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dourado); }
.qb-rot-claro { color: rgba(255,255,255,.85); margin-top: .9rem; }

/* ---------- Quadrinho (desenho + balões) ---------- */
.qb-quadro {
  position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 14px;
  background: #f4efe4; container-type: inline-size; box-shadow: 0 0 0 3px var(--qb-tinta);
}
.qb-quadro > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.qb-luz { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.1s ease;
  background: radial-gradient(circle at 50% 45%, rgba(255, 252, 230, .97), rgba(255, 236, 170, .75) 38%, rgba(160, 215, 255, .5) 75%, rgba(140, 200, 255, .35)); mix-blend-mode: screen; }
.qb-aceso .qb-luz { opacity: 1; }
.qb-aceso .qb-chuva, .qb-aceso .qb-raio { opacity: 0; transition: opacity .8s; }
.qb-aceso .qb-onda-forte { transform: translateY(16px); transition: transform 1.2s ease; }
.qb-aceso .qb-balanca { animation: none; }

.qb-balao {
  position: absolute; z-index: 2; margin: 0; max-width: 50%; padding: .3em .62em .36em; border-radius: 1.1em;
  background: #fff; color: #2a1f1a; border: max(2px, .55cqw) solid var(--qb-tinta);
  font: 800 clamp(9px, 3.4cqw, 20px)/1.16 var(--qb-fonte); text-align: center; letter-spacing: -.005em;
  box-shadow: 0 .5cqw 0 rgba(0,0,0,.12); animation: qb-pop .45s cubic-bezier(.3,1.6,.5,1) both;
}
.qb-balao::before, .qb-balao::after { content: ""; position: absolute; left: var(--cauda, 50%); width: 0; height: 0; transform: translateX(-50%); }
.qb-balao::before { bottom: -1.05em; border: .55em solid transparent; border-top: .62em solid var(--qb-tinta); border-bottom: 0; }
.qb-balao::after { bottom: -.72em; border: .42em solid transparent; border-top: .5em solid #fff; border-bottom: 0; }
.qb-balao.qb-cauda-cima::before { bottom: auto; top: -1.05em; border-top: 0; border-bottom: .62em solid var(--qb-tinta); }
.qb-balao.qb-cauda-cima::after { bottom: auto; top: -.72em; border-top: 0; border-bottom: .5em solid #fff; }
.qb-b-grito { background: #fff6c4; border-radius: .5em; transform: rotate(-1.5deg); text-transform: none; }
.qb-b-grito::after { border-top-color: #fff6c4; } .qb-b-grito.qb-cauda-cima::after { border-bottom-color: #fff6c4; }
.qb-b-voz { background: #fffbea; border-color: #d9a441; color: #6b4a12; font-style: italic; box-shadow: 0 0 2cqw rgba(255, 220, 120, .9); }
.qb-b-voz::before { border-top-color: #d9a441; } .qb-b-voz.qb-cauda-cima::before { border-bottom-color: #d9a441; }
.qb-b-voz.qb-cauda-cima::after { border-bottom-color: #fffbea; } .qb-b-voz::after { border-top-color: #fffbea; }
.qb-b-pensa { border-style: dashed; border-radius: 2em; }
@keyframes qb-pop { from { opacity: 0; transform: scale(.4) translateY(10px); } }

/* Animações dos desenhos */
.qb-nuvem { animation: qb-nuvem 9s ease-in-out infinite alternate; }
@keyframes qb-nuvem { to { transform: translateX(14px); } }
.qb-onda { animation: qb-onda 3.2s ease-in-out infinite alternate; }
@keyframes qb-onda { to { transform: translate(-10px, 3px); } }
.qb-onda-forte { animation: qb-onda 1.4s ease-in-out infinite alternate; }
.qb-balanca { transform-box: fill-box; transform-origin: 50% 100%; animation: qb-balanca 1.8s ease-in-out infinite alternate; }
@keyframes qb-balanca { from { transform: rotate(-4deg); } to { transform: rotate(4deg) translateY(3px); } }
.qb-pulsa { animation: qb-pulsa 3s ease-in-out infinite; }
@keyframes qb-pulsa { 50% { opacity: .35; } }
.qb-pisca { animation: qb-pulsa 2.6s ease-in-out infinite; }
.qb-pisca-g { transform-box: fill-box; transform-origin: center; animation: qb-gira 6s linear infinite; }
@keyframes qb-gira { to { transform: rotate(360deg); } }
.qb-chuva { animation: qb-chuva .6s linear infinite; }
@keyframes qb-chuva { to { transform: translate(-6px, 16px); } }
.qb-raio { animation: qb-raio 3.4s steps(1) infinite; }
@keyframes qb-raio { 0%, 60%, 70%, 100% { opacity: 0; } 62%, 68% { opacity: 1; } }
.qb-asa { transform-box: fill-box; transform-origin: 50% 100%; animation: qb-asa .5s ease-in-out infinite alternate; }
@keyframes qb-asa { to { transform: scaleY(.6); } }
.qb-zzz text { animation: qb-pulsa 2s ease-in-out infinite; } .qb-zzz text:nth-child(2) { animation-delay: .4s; } .qb-zzz text:nth-child(3) { animation-delay: .8s; }
.qb-bolhas { animation: qb-bolha 4s ease-in infinite; }
@keyframes qb-bolha { to { transform: translateY(-40px); opacity: 0; } }

/* Toques */
.qb-it.qb-alvo { cursor: pointer; animation: qb-alvo 1.4s ease-in-out infinite; outline: none; }
@keyframes qb-alvo { 50% { filter: drop-shadow(0 0 6px #ffd84a) drop-shadow(0 0 2px #fff); } }
.qb-it.qb-alvo:focus-visible { filter: drop-shadow(0 0 4px #e2b866) drop-shadow(0 0 4px #e2b866); }
.qb-it.qb-oculto { opacity: .18; }
.qb-it { transition: opacity .8s; }
.qb-ef-pula { transform-box: fill-box; transform-origin: 50% 100%; animation: qb-pula .8s cubic-bezier(.3,1.5,.5,1) 2; }
@keyframes qb-pula { 30% { transform: translateY(-14%) scale(1.04, .97); } 60% { transform: translateY(0) scale(1.05, .92); } }
.qb-ef-brilha, .qb-ef-aparece { animation: qb-brilho 1.2s ease-in-out 3; }
@keyframes qb-brilho { 50% { filter: drop-shadow(0 0 10px #fff3a8) drop-shadow(0 0 4px #ffd84a) brightness(1.15); } }

/* Modo colorir */
.qb-linha .pt:not([stroke]) { stroke: var(--qb-tinta); stroke-width: 1.5; }
.qb-linha .pt, .qb-linha .pt-grupo { cursor: pointer; transition: fill .15s; }

/* ---------- Capas ---------- */
.qb-capa { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; container-type: inline-size; background: linear-gradient(150deg, var(--g1, #cde), var(--g2, #89a)); }
.qb-capa > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.qb-capa .qb-luz { display: none; }
.qb-capa-emoji { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 2.6rem; }
.qb-capa > svg ~ .qb-capa-emoji { left: auto; top: auto; right: 8px; bottom: 8px; transform: none; font-size: 1.15rem; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.qb-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.94); color: #e0602f; font-size: 1.6rem; padding-left: 5px; box-shadow: 0 6px 22px rgba(0,0,0,.28); transition: transform .2s; }

/* ---------- Seletor de idade ---------- */
.qb-idades { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; max-width: 420px; }
.qb-idades button { display: grid; justify-items: center; gap: 0; padding: .5rem .3rem .45rem; border-radius: 16px; border: 2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; cursor: pointer; font-family: var(--qb-fonte); line-height: 1.1; transition: transform .12s, background .2s; }
.qb-idades button span { font-size: 1.4rem; }
.qb-idades button strong { font-size: 1rem; }
.qb-idades button small { font-size: .7rem; opacity: .85; }
.qb-idades button:active { transform: scale(.95); }
.qb-idades button[aria-pressed="true"] { background: #fff; border-color: #fff; color: var(--g3, #234); box-shadow: 0 4px 14px rgba(0,0,0,.18); }

/* ---------- História da semana / Capa da página ---------- */
.qb-semana, .qb-abrir {
  position: relative; overflow: hidden; display: grid; gap: 1.1rem; align-items: center; margin: .6rem 0 1.4rem; padding: 1.15rem; border-radius: 28px; color: #fff;
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--g1) 60%, transparent), transparent 55%), linear-gradient(155deg, var(--g2), var(--g3));
  box-shadow: 0 16px 40px color-mix(in srgb, var(--g3) 40%, transparent);
}
.qb-semana-rot { margin: 0; font-weight: 800; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: #fff3c4; }
.qb-semana h2, .qb-abrir h2 { margin: .2rem 0 .5rem; color: #fff; font-family: var(--qb-fonte); font-size: clamp(1.5rem, 5.4vw, 2.1rem); }
.qb-semana p, .qb-abrir p { color: rgba(255,255,255,.9); }
.qb-semana-capa, .qb-abrir-capa { position: relative; display: block; padding: 0; border: 0; border-radius: 20px; overflow: hidden; cursor: pointer; box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 14px 30px rgba(0,0,0,.25); transform: rotate(-1.2deg); transition: transform .2s; background: none; }
.qb-semana-capa:hover, .qb-abrir-capa:hover { transform: rotate(0) scale(1.01); }
.qb-semana-capa:hover .qb-play, .qb-abrir-capa:hover .qb-play { transform: scale(1.08); }
.qb-semana-bts, .qb-abrir-bts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.qb-ler-bt { min-height: 54px; padding: .7rem 1.5rem; font-size: 1.08rem; font-family: var(--qb-fonte); font-weight: 800; background: linear-gradient(135deg, #fff3b0, #ffd24a); color: #4a2f0a; box-shadow: 0 8px 22px rgba(255, 200, 60, .4); }
.qb-abrir .btn-sec { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.qb-abrir .btn-sec[aria-pressed="true"] { background: #fff; color: var(--g3); }
#qb-continuar strong { margin-left: .25rem; }
.qb-estrelas-pag { margin: .8rem 0 0; font-size: .9rem; }
@media (min-width: 760px) {
  .qb-semana, .qb-abrir { grid-template-columns: 1fr 1.05fr; padding: 1.6rem; }
  .qb-semana-capa, .qb-abrir-capa { order: 2; }
  .qb-abrir .qb-abrir-capa { order: 0; }
}

/* ---------- Estante ---------- */
.qb-estante { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(46%, 230px), 1fr)); }
.qb-estante-p { grid-template-columns: repeat(auto-fill, minmax(min(46%, 190px), 1fr)); }
.qb-cartao { position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--texto); background: var(--superficie); border: 1px solid var(--borda); border-radius: 20px; overflow: hidden; box-shadow: var(--sombra); transition: transform .15s, box-shadow .2s; }
.qb-cartao[hidden] { display: none; }
.qb-cartao:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 14px 30px rgba(0,0,0,.14); }
.qb-cartao:active { transform: scale(.98); }
.qb-cartao-txt { display: flex; flex-direction: column; gap: .1rem; padding: .65rem .8rem .75rem; }
.qb-cartao-txt small { font-size: .7rem; font-weight: 700; color: var(--texto-2); letter-spacing: .02em; }
.qb-cartao-txt strong { font-family: var(--qb-fonte); font-size: 1.02rem; line-height: 1.2; }
.qb-estrelas { font-size: .82rem; letter-spacing: .05em; min-height: 1.1em; }
.qb-estrelas .apagada, .ql-fim-est .apagada { filter: grayscale(1); opacity: .3; }
.qb-cartao.qb-lida::after { content: "✓"; position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #2f9a5a; color: #fff; font-weight: 900; font-size: .85rem; box-shadow: 0 2px 6px rgba(0,0,0,.25); }

/* ---------- Tira (história completa na página) ---------- */
.qb-tira { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); counter-reset: q; }
.qb-tira-q { margin: 0; }
.qb-tira-bt { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 14px; }
.qb-tira-bt .qb-quadro { box-shadow: 0 0 0 3px var(--qb-tinta), 4px 5px 0 3px rgba(0,0,0,.12); }
.qb-tira-n { position: absolute; left: -6px; top: -8px; z-index: 3; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #ffd24a; color: #3a2a22; border: 2.5px solid var(--qb-tinta); font: 900 .9rem var(--qb-fonte); }
.qb-tira-txt { margin: .7rem .2rem 0; font-size: .97rem; line-height: 1.5; }
.qb-tira-ref { display: block; font-size: .8rem; color: var(--texto-2); margin-top: .2rem; }
.qb-tira-ref::before { content: "📖 "; }

/* ---------- Atividades na página ---------- */
.qb-ativ-grade { display: grid; gap: 1rem; margin-bottom: 1rem; }
@media (min-width: 860px) { .qb-ativ-grade { grid-template-columns: 1fr 1fr; } }
.qb-ativ-caixa { padding: 1.1rem; }

/* ---------- Quiz ---------- */
.qz-topo { display: flex; justify-content: space-between; margin: 0 0 .45rem; font-size: .82rem; font-weight: 800; color: var(--texto-2); }
.qz-barra { height: 8px; border-radius: 99px; background: var(--superficie-2); overflow: hidden; }
.qz-barra i { display: block; height: 100%; background: linear-gradient(90deg, #ffd24a, #f28c38); border-radius: 99px; transition: width .4s; }
.qz-perg { font-family: var(--qb-fonte); font-size: clamp(1.15rem, 4vw, 1.35rem); margin: 1rem 0 .8rem; }
.qz-ops { display: grid; gap: .5rem; }
.qz-op { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .75rem .9rem; min-height: 56px; border-radius: 16px; border: 2.5px solid var(--borda); background: var(--superficie); color: var(--texto); font: 700 1.02rem/1.25 var(--qb-fonte); text-align: left; cursor: pointer; transition: transform .12s, border-color .2s, background .2s; }
.qz-op:hover:not(:disabled) { border-color: #f2b33d; }
.qz-op:active:not(:disabled) { transform: scale(.98); }
.qz-op:disabled { cursor: default; }
.qz-letra { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--superficie-2); font-size: .9rem; }
.qz-op.certa { border-color: #2f9a5a; background: color-mix(in srgb, #2f9a5a 14%, var(--superficie)); }
.qz-op.certa .qz-letra { background: #2f9a5a; color: #fff; }
.qz-op.errada { border-color: #e0893a; background: color-mix(in srgb, #e0893a 12%, var(--superficie)); }
.qz-resp, .ql-resp { margin: .8rem 0 0; padding: .7rem .9rem; border-radius: 14px; font-size: .97rem; line-height: 1.45; }
.qz-resp.ok, .ql-resp.ok { background: color-mix(in srgb, #2f9a5a 14%, var(--superficie)); }
.qz-resp.quase, .ql-resp.quase { background: color-mix(in srgb, #f2b33d 18%, var(--superficie)); }
.qz-seg { margin-top: .8rem; width: 100%; }
.qz-final { text-align: center; position: relative; }
.qz-grande { font-size: 3.4rem; margin: .2rem 0 0; line-height: 1.2; }
.qz-final h3 { font-family: var(--qb-fonte); font-size: 1.4rem; margin: .3rem 0; }
.qz-bts, .vs-bts { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .8rem; }

/* ---------- Versículo ---------- */
.vs { position: relative; text-align: center; }
.vs-topo, .cl-topo { margin: 0; font-weight: 800; font-family: var(--qb-fonte); font-size: 1.1rem; }
.vs-dica { margin: .2rem 0 .8rem; color: var(--texto-2); font-size: .92rem; }
.vs-linha { min-height: 4.2rem; padding: .8rem; border-radius: 16px; border: 2.5px dashed var(--borda); background: var(--superficie-2); font: 800 clamp(1.1rem, 4.2vw, 1.4rem)/1.35 var(--qb-fonte); }
.vs-linha span { animation: qb-pop .35s ease both; display: inline-block; }
.vs-ref { margin: .45rem 0 .8rem; font-weight: 800; color: var(--dourado); }
.vs-pecas { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.vs-pecas[hidden] { display: none; }
.vs-peca { padding: .6rem .95rem; min-height: 48px; border-radius: 14px; border: 0; background: linear-gradient(160deg, #ffe58a, #ffc94a); color: #4a2f0a; font: 800 1.02rem var(--qb-fonte); cursor: pointer; box-shadow: 0 4px 0 #d79a1e; transition: transform .1s; }
.vs-peca:active { transform: translateY(3px); box-shadow: 0 1px 0 #d79a1e; }
.vs-peca.usada { opacity: 0; pointer-events: none; transform: scale(.5); transition: all .3s; }
.vs-peca.treme { animation: qb-treme .4s; }
@keyframes qb-treme { 25% { transform: translateX(-6px) rotate(-3deg); } 75% { transform: translateX(6px) rotate(3deg); } }
.vs-expl { margin: .9rem 0 0; padding: .7rem .9rem; border-radius: 14px; background: var(--dourado-suave); text-align: left; }

/* ---------- Colorir ---------- */
.cl { text-align: center; }
.cl-quadro { max-width: 640px; margin: .7rem auto; background: #fff; touch-action: manipulation; }
.cl-paleta { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin: .8rem auto; max-width: 560px; }
.cl-cor { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--superficie); background: var(--c); box-shadow: 0 0 0 1.5px var(--borda); cursor: pointer; transition: transform .12s; }
.cl-cor[data-cor="#ffffff"] { background: repeating-linear-gradient(45deg, #fff 0 5px, #e8e4dc 5px 10px); }
.cl-cor[aria-checked="true"] { transform: scale(1.18); box-shadow: 0 0 0 3px var(--texto); }
.cl-bts { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }

/* ---------- Para pais e professores ---------- */
.qb-pais { margin-top: 2.6rem; }
.qb-pais-grade { display: grid; gap: 1rem; margin: 1rem 0; }
@media (min-width: 820px) { .qb-pais-grade { grid-template-columns: 1fr 1fr; } }
.qb-ideia { font-family: var(--qb-fonte); font-size: 1.2rem; font-weight: 800; line-height: 1.35; }
.qb-vers { margin: 0; padding: .8rem 1rem; border-radius: 14px; background: var(--dourado-suave); font-family: var(--fonte-titulo); font-size: 1.08rem; }
.qb-vers cite { display: block; margin-top: .3rem; font-family: var(--fonte); font-size: .85rem; font-style: normal; font-weight: 700; }
.qb-cuidado { margin: .8rem 0 0; padding: .7rem .9rem; border-radius: 12px; background: var(--superficie-2); font-size: .95rem; }
.qb-conversa { display: grid; gap: .8rem; }
@media (min-width: 820px) { .qb-conversa { grid-template-columns: repeat(3, 1fr); } }
.qb-conv { transition: box-shadow .2s, border-color .2s; }
.qb-conv ul { margin: 0; padding-left: 1.1rem; } .qb-conv li { margin-bottom: .4rem; }
.qb-conv.qb-idade-ativa { border-color: var(--dourado); box-shadow: 0 0 0 2px var(--dourado), var(--sombra); }
.qb-conv.qb-idade-ativa .qb-rot::after { content: " · selecionada"; color: var(--texto-2); text-transform: none; letter-spacing: 0; font-weight: 600; }
.qb-atividade h3 { margin-top: 0; font-family: var(--qb-fonte); }
.qb-pais-bts, .qb-mais { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.qb-vizinhas { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 2.2rem 0 1rem; }
.qb-viz { display: flex; flex-direction: column; padding: .8rem 1rem; border-radius: 16px; background: var(--superficie); border: 1px solid var(--borda); text-decoration: none; color: var(--texto); box-shadow: var(--sombra); }
.qb-viz small { color: var(--texto-2); font-weight: 700; }
.qb-viz strong { font-family: var(--qb-fonte); line-height: 1.25; }
.qb-viz-prox { text-align: right; grid-column: 2; }

/* Referências por quadrinho só aparecem para 9 a 12 anos no leitor */
.ql-ref { display: none; }
:root[data-qb-idade="9-12"] .ql-ref { display: block; }

/* ---------- Álbum ---------- */
.qb-album-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .8rem; }
.qb-album-stats div { display: flex; flex-direction: column; align-items: center; padding: .7rem .3rem; border-radius: 16px; background: var(--superficie); border: 1px solid var(--borda); text-align: center; }
.qb-album-stats strong { font: 900 1.6rem/1.1 var(--qb-fonte); color: var(--primaria); }
.qb-album-stats span { font-size: .76rem; color: var(--texto-2); font-weight: 650; }
.qb-album-progresso { height: 12px; border-radius: 99px; background: var(--superficie-2); overflow: hidden; margin-bottom: 1rem; }
.qb-album-progresso i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5cb85c, #ffd24a); border-radius: 99px; transition: width .6s; }
.qb-album-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .8rem; }
.qb-fig { display: flex; flex-direction: column; align-items: center; gap: .25rem; text-decoration: none; color: var(--texto-2); font-size: .75rem; }
.qb-fig .qb-capa, .qb-fig-vazia { width: 78px; height: 78px; aspect-ratio: auto; border-radius: 50%; box-shadow: 0 0 0 3px var(--superficie), 0 0 0 5px var(--borda); }
.qb-fig .qb-capa-emoji { right: -2px !important; bottom: -2px !important; }
.qb-fig-vazia { display: grid; place-items: center; background: var(--superficie-2); color: var(--texto-2); font: 900 1.4rem var(--qb-fonte); border: 2.5px dashed var(--borda); box-shadow: none; }
.qb-fig.ouro .qb-capa { box-shadow: 0 0 0 3px #fff3b0, 0 0 0 6px #e2b866, 0 0 18px rgba(226, 184, 102, .7); }
.qb-album-dica { font-size: .88rem; color: var(--texto-2); margin: 1rem 0; }
.qb-cert p { margin: 0 0 .6rem; }
.qb-cert-form { display: flex; flex-wrap: wrap; gap: .5rem; }
.qb-cert-form .entrada { flex: 1 1 200px; }
.qb-certificado { display: none; }

/* ---------- Guia (página principal) ---------- */
.qb-guia { margin-top: 2.4rem; }
.qb-guia-grade { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); margin-bottom: .9rem; }
.qb-guia-grade h3 { margin-top: .2rem; font-family: var(--qb-fonte); }
.qb-guia-em { font-size: 2rem; margin: 0; }

/* =====================================================================
   LEITOR EM TELA CHEIA
   ===================================================================== */
.ql {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  color: #fff; overflow: hidden; overscroll-behavior: contain;
  background: radial-gradient(130% 90% at 50% 0%, var(--g1, #8fd3ff), transparent 60%), linear-gradient(170deg, var(--g2, #3d8fd0), var(--g3, #1f4f8a));
}
.ql[open] { display: flex; flex-direction: column; animation: ql-entra .3s ease-out; }
.ql::backdrop { background: #000; }
@keyframes ql-entra { from { opacity: 0; transform: scale(.97); } }
.ql[data-cor="ceu"] { --g1: #8fd3ff; --g2: #3d8fd0; --g3: #1f4f8a; }
.ql[data-cor="mar"] { --g1: #7fd6e0; --g2: #2f86c4; --g3: #173f6e; }
.ql[data-cor="ouro"] { --g1: #ffd77a; --g2: #d98a24; --g3: #6b3a0c; }
.ql[data-cor="mata"] { --g1: #a6e08a; --g2: #3f9650; --g3: #17462c; }
.ql[data-cor="noite"] { --g1: #7f8aef; --g2: #3a3f98; --g3: #14163f; }
.ql[data-cor="aurora"] { --g1: #ffc08a; --g2: #d85c70; --g3: #5a2250; }
.ql[data-cor="vinho"] { --g1: #f2a0b0; --g2: #a3476b; --g3: #4a1530; }
body.ql-aberto { overflow: hidden; }
.ql-topo { display: flex; align-items: center; gap: .6rem; padding: calc(10px + env(safe-area-inset-top)) 12px 8px; }
.ql-ico { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 1.25rem; cursor: pointer; }
.ql-ico[aria-pressed="false"] { opacity: .55; }
.ql-ico[aria-pressed="true"] { background: #fff; }
.ql-pontos { flex: 1; display: flex; justify-content: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.ql-pontos li { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.3); transition: all .3s; }
.ql-pontos li.feito { background: #ffd24a; }
.ql-pontos li.agora { width: 28px; border-radius: 99px; background: #fff; }
.ql-corpo { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 4px 14px; overflow-y: auto; }
.ql-corpo[hidden] { display: none; }
.ql-cena { position: relative; width: 100%; max-width: min(760px, calc((100dvh - 330px) * 4 / 3)); min-width: min(100%, 300px); }
.ql-quadro { border-radius: 18px; box-shadow: 0 0 0 4px var(--qb-tinta), 0 18px 40px rgba(0,0,0,.35); }
.ql-quadro.qb-entra { animation: ql-vira .45s ease-out; }
@keyframes ql-vira { from { opacity: 0; transform: translateX(30px) rotate(1.5deg); } }
.ql-dica { position: absolute; z-index: 4; left: 50%; bottom: 10px; transform: translateX(-50%); margin: 0; padding: .45rem 1rem; border-radius: 99px; background: #fff; color: #3a2a22; font: 800 clamp(.85rem, 3.4vw, 1rem) var(--qb-fonte); white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.3); animation: ql-dica 1.4s ease-in-out infinite; }
.ql-dica[hidden] { display: none; }
@keyframes ql-dica { 50% { transform: translateX(-50%) translateY(-4px); } }
.ql-texto { width: 100%; max-width: 760px; padding: .9rem 1.1rem; border-radius: 20px; background: rgba(255,255,255,.96); color: #2a1f1a; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.ql-narra { margin: 0; font: 700 clamp(1.05rem, 3.9vw, 1.3rem)/1.45 var(--qb-fonte); }
:root[data-qb-idade="3-5"] .ql-narra { font-size: clamp(1.15rem, 4.4vw, 1.45rem); }
.ql-ref { margin: .35rem 0 0; font-size: .85rem; font-weight: 800; color: #9a6a12; }
.ql-inter:empty { display: none; }
.ql-inter { margin-top: .7rem; }
.ql-revela { margin: 0; padding: .6rem .8rem; border-radius: 14px; background: #fff6c4; font: 700 1.02rem/1.4 var(--qb-fonte); animation: qb-pop .4s ease both; }
.ql-perg { margin: 0 0 .5rem; font: 800 1.06rem/1.35 var(--qb-fonte); }
.ql-ops { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ql-op { min-height: 54px; padding: .5rem .7rem; border-radius: 16px; border: 2.5px solid #e6dccb; background: #fff; color: #2a1f1a; font: 800 1rem/1.2 var(--qb-fonte); cursor: pointer; box-shadow: 0 4px 0 #e6dccb; transition: transform .1s; }
.ql-op:active { transform: translateY(3px); box-shadow: 0 1px 0 #e6dccb; }
.ql-op.certa { border-color: #2f9a5a; background: #e3f6ea; box-shadow: 0 4px 0 #2f9a5a; }
.ql-op.quase { border-color: #f2b33d; background: #fff6dc; }
.ql-resp { color: #2a1f1a; }
.ql-resp.ok { background: #e3f6ea; } .ql-resp.quase { background: #fff6dc; }
.ql-baixo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); }
.ql-baixo[hidden] { display: none; }
.ql-nav { width: 64px; height: 64px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 1.5rem; cursor: pointer; transition: transform .12s; }
.ql-nav:disabled { opacity: .25; cursor: default; }
.ql-nav:active:not(:disabled) { transform: scale(.92); }
.ql-prox { width: 78px; height: 78px; background: linear-gradient(135deg, #fff3b0, #ffd24a); color: #4a2f0a; font-size: 1.8rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.ql-pulsa { animation: ql-pulsa 1.3s ease-in-out infinite; }
@keyframes ql-pulsa { 50% { transform: scale(1.09); box-shadow: 0 0 0 10px rgba(255,210,74,.25), 0 8px 24px rgba(0,0,0,.25); } }
.ql-conta { font: 800 .95rem var(--qb-fonte); opacity: .85; }
@media (orientation: landscape) and (min-width: 820px) {
  .ql-corpo { flex-direction: row; justify-content: center; align-items: center; gap: 1.4rem; padding: 4px 24px; }
  .ql-cena { max-width: min(62vw, calc((100dvh - 190px) * 4 / 3)); }
  .ql-texto { max-width: 380px; }
}

/* Fim e atividades no leitor */
.ql-fim, .ql-ativ { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
.ql-fim[hidden], .ql-ativ[hidden] { display: none; }
.ql-fig { display: inline-block; margin-top: .5rem; }
.ql-fig .qb-capa { width: min(56vw, 240px); border-radius: 50%; aspect-ratio: 1; box-shadow: 0 0 0 6px #fff, 0 0 0 10px #ffd24a, 0 16px 40px rgba(0,0,0,.3); }
.ql-fig.qb-nova { animation: ql-figura 1s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes ql-figura { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }
.ql-fim-tit { margin: 1rem 0 .2rem; font: 900 clamp(1.5rem, 6vw, 2rem)/1.15 var(--qb-fonte); }
.ql-fim-est { margin: 0; font-size: 2rem; letter-spacing: .1em; }
.ql-fim-ideia { max-width: 520px; margin: .6rem auto; padding: .7rem 1rem; border-radius: 16px; background: rgba(255,255,255,.16); font: 700 1.05rem/1.4 var(--qb-fonte); }
.ql-fim-sub { margin: 1rem 0 .5rem; font-weight: 800; opacity: .85; }
.ql-fim-bts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; max-width: 460px; margin: 0 auto; }
.ql-ativ-bt { position: relative; display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .8rem .3rem; border-radius: 20px; border: 0; background: #fff; color: #2a1f1a; font: 800 1rem var(--qb-fonte); cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.ql-ativ-bt span { font-size: 2rem; }
.ql-ativ-bt.feito::after { content: "⭐"; position: absolute; top: -8px; right: -6px; font-size: 1.3rem; }
.ql-fim-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1.4rem; }
.ql-fim-nav .btn-sec { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.ql-fim-nav .btn:not(.btn-sec) { background: #fff; color: #2a1f1a; white-space: normal; }
.ql-voltar { display: block; margin: 0 0 .6rem; padding: .5rem 1rem; border: 0; border-radius: 99px; background: rgba(255,255,255,.18); color: #fff; font: 800 .95rem var(--qb-fonte); cursor: pointer; }
.ql-ativ-in { max-width: 680px; margin: 0 auto; padding: 1.1rem; border-radius: 22px; background: var(--superficie); color: var(--texto); text-align: left; box-shadow: 0 14px 40px rgba(0,0,0,.25); }
.ql-ativ-in .vs, .ql-ativ-in .cl { text-align: center; }

/* Confete */
.qb-confete { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.qb-confete i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: qb-cai 2.2s ease-in forwards; }
@keyframes qb-cai { to { transform: translateY(110vh) rotate(var(--gira)); opacity: .6; } }

@media (prefers-reduced-motion: reduce) {
  .qb-nuvem, .qb-onda, .qb-onda-forte, .qb-balanca, .qb-chuva, .qb-raio, .qb-asa, .qb-pulsa, .qb-pisca, .qb-pisca-g, .qb-bolhas, .qb-it.qb-alvo, .ql-dica, .ql-pulsa { animation: none !important; }
}

/* ---------- Impressão ---------- */
@media print {
  .qb-abrir, .qb-semana, .qb-ativ-sec, .qb-vizinhas, .qb-album, .qb-estante-sec, .qb-guia, .faq, .outras, .qb-tira-n { display: none !important; }
  .qb-tira { grid-template-columns: 1fr 1fr; gap: 10pt; }
  .qb-tira-q { break-inside: avoid; }
  .qb-tira-txt { font-size: 10.5pt; margin-top: 4pt; }
  .qb-quadro { box-shadow: 0 0 0 2px #000 !important; }
  .qb-balao { animation: none !important; }
  .qb-pais { break-before: page; }
  .qb-conv { break-inside: avoid; }
  .qb-nuvem, .qb-onda, .qb-balanca, .qb-chuva { animation: none !important; }
  /* só o desenho para colorir */
  body.qb-imp-colorir .principal > .container > *:not(.qb-ativ-sec) { display: none !important; }
  body.qb-imp-colorir .qb-ativ-sec { display: block !important; }
  body.qb-imp-colorir .qb-ativ-sec > *:not(#qb-colorir), body.qb-imp-colorir #qb-colorir .cl > *:not(.cl-quadro) { display: none !important; }
  body.qb-imp-colorir #qb-colorir { border: 0; box-shadow: none; }
  body.qb-imp-colorir .cl-quadro { max-width: none; width: 100%; }
  body.qb-imp-colorir .ql { display: none !important; }
  /* certificado */
  body.qb-imp-cert .principal > .container > *:not(.qb-album) { display: none !important; }
  body.qb-imp-cert .qb-album { display: block !important; }
  body.qb-imp-cert .qb-album > *:not(.qb-certificado) { display: none !important; }
  body.qb-imp-cert .qb-certificado { display: block !important; }
}
.qb-certificado { text-align: center; padding: 40pt 30pt; border: 10pt double #c99a2e; border-radius: 16pt; font-family: var(--qb-fonte); color: #2a1f1a; }
.qb-cert-topo { font-size: 16pt; letter-spacing: .2em; text-transform: uppercase; color: #9a6a12; font-weight: 800; }
.qb-cert-titulo { font: 900 34pt/1.1 var(--fonte-titulo); margin: 6pt 0 18pt; }
.qb-cert-nome { font-size: 26pt; font-weight: 900; border-bottom: 2pt solid #c99a2e; display: inline-block; min-width: 60%; padding: 0 10pt 4pt; margin: 4pt 0 14pt; }
.qb-cert-vers { font-family: var(--fonte-titulo); font-style: italic; margin-top: 18pt; }
.qb-cert-site { font-size: 9pt; color: #8a7a6a; margin-top: 24pt; }
.ql-corpo > .ql-cena { margin-top: auto; } .ql-corpo > .ql-texto { margin-bottom: auto; }
#qb-pagina [hidden], .ql [hidden], #qb-continuar[hidden], #qb-cert-bt[hidden], #qb-cert-falta[hidden] { display: none !important; }
.qb-balao.qb-sem-cauda::before, .qb-balao.qb-sem-cauda::after { display: none; }
@media (orientation: landscape) and (min-width: 820px) { .ql-corpo > .ql-cena, .ql-corpo > .ql-texto { margin: auto 0; } }
