/* Jogos Bíblicos v2 — usa as cores do tema do site (claro/escuro) */
#jg-root {
  --jg-ouro: var(--gold, #C9A14A);
  --jg-txt: var(--text-main, var(--ink, #2A1E10));
  --jg-sub: var(--text-muted, #7a6a55);
  --jg-card: var(--card-bg, rgba(255,253,248,.85));
  --jg-borda: var(--card-border, rgba(160,120,40,.28));
  --jg-ok: #2f8f5b; --jg-no: #c0453a;
  color: var(--jg-txt);
  max-width: 860px; margin: 0 auto; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  position: relative;
}
#jg-root button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
#jg-root button:disabled { cursor: default; }
#jg-root .jg-svg { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }

/* topo */
.jg-top { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; }
.jg-top-t { flex: 1; min-width: 0; }
.jg-top h3 { margin: 0; font-family: 'Cinzel', Georgia, serif; font-size: 1.15rem; letter-spacing: .03em; color: var(--jg-ouro); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jg-top small { color: var(--jg-sub); font-size: .78rem; }
.jg-ico-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--jg-borda); background: var(--jg-card); display: grid; place-items: center; transition: transform .15s, background-color .2s; }
.jg-ico-btn:active { transform: scale(.92); }
.jg-som:not(.on) { opacity: .55; }
.jg-pts { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--jg-card); border: 1px solid var(--jg-borda); font-weight: 700; color: var(--jg-ouro); }
.jg-pts.pop { animation: jgPop .45s ease; }

/* nível */
.jg-nivel { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 18px; background: var(--jg-card); border: 1px solid var(--jg-borda); margin-bottom: 18px; animation: jgEntra .4s ease both; }
.jg-nivel-n { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font: 700 1.35rem 'Cinzel', serif; color: #2a1a05; background: linear-gradient(145deg, #f3d98d, #c9963a); box-shadow: 0 4px 14px rgba(201,150,58,.35); flex: none; }
.jg-nivel-i { flex: 1; min-width: 0; }
.jg-nivel-i b { font-family: 'Cinzel', serif; font-size: 1.02rem; }
.jg-nivel-i small { color: var(--jg-sub); font-size: .78rem; }
.jg-barra { height: 8px; border-radius: 8px; background: rgba(128,100,50,.18); margin: 7px 0 5px; overflow: hidden; }
.jg-barra i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #e9c46a, #c9963a); transition: width .6s ease; }

/* cartões do hub */
.jg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.jg-card { position: relative; text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 20px; border-radius: 18px; border: 1px solid var(--jg-borda); background: var(--jg-card); transition: transform .18s, box-shadow .2s, border-color .2s; animation: jgEntra .45s ease both; animation-delay: calc(var(--i) * 60ms); min-height: 140px; }
.jg-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(120,80,20,.16); border-color: var(--jg-ouro); }
.jg-card:active { transform: scale(.97); }
.jg-card-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: var(--jg-ouro); background: rgba(201,150,58,.13); margin-bottom: 4px; }
.jg-card-ic .jg-svg { width: 26px; height: 26px; }
.jg-card-t { font-family: 'Cinzel', serif; font-weight: 700; font-size: 1rem; }
.jg-card-d { color: var(--jg-sub); font-size: .84rem; line-height: 1.35; }
.jg-novo { position: absolute; top: 14px; right: 14px; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--jg-ok); color: #fff; }

/* menu de nível */
.jg-menu { text-align: center; padding: 10px 0; animation: jgEntra .35s ease both; }
.jg-menu-ic { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 22px; display: grid; place-items: center; color: var(--jg-ouro); background: rgba(201,150,58,.13); }
.jg-menu-ic .jg-svg { width: 38px; height: 38px; }
.jg-menu p { max-width: 460px; margin: 0 auto 20px; color: var(--jg-sub); line-height: 1.5; }
.jg-niveis { display: grid; gap: 12px; max-width: 460px; margin: 0 auto; }
.jg-nivel-btn { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 12px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--jg-borda); background: var(--jg-card); transition: transform .15s, border-color .2s; animation: jgEntra .4s ease both; animation-delay: calc(var(--i) * 70ms); }
.jg-nivel-btn:hover { border-color: var(--jg-ouro); }
.jg-nivel-btn:active { transform: scale(.97); }
.jg-nivel-btn b { font-family: 'Cinzel', serif; font-size: 1.02rem; }
.jg-nivel-btn span { grid-column: 1; color: var(--jg-sub); font-size: .84rem; }
.jg-nivel-btn em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-size: .78rem; font-weight: 700; color: var(--jg-ouro); }

/* placar e cartão de jogo */
.jg-hud { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; color: var(--jg-sub); margin-bottom: 10px; }
.jg-hud b { color: var(--jg-txt); }
.jg-tag { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: rgba(201,150,58,.15); color: var(--jg-ouro); }
.jg-cartao { padding: 22px 20px; border-radius: 20px; background: var(--jg-card); border: 1px solid var(--jg-borda); box-shadow: 0 8px 28px rgba(80,50,10,.08); }
.jg-entra { animation: jgEntra .35s ease both; }
.jg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 0; font-weight: 700; color: #2a1a05 !important; background: linear-gradient(145deg, #f3d98d, #c9963a); box-shadow: 0 4px 14px rgba(201,150,58,.3); transition: transform .15s, opacity .2s; margin-top: 14px; width: 100%; }
.jg-btn:active { transform: scale(.97); }
.jg-btn.sec { background: var(--jg-card); color: var(--jg-txt) !important; border: 1px solid var(--jg-borda); box-shadow: none; width: auto; flex: 1; min-height: 44px; font-size: .88rem; }
.jg-btn:disabled { opacity: .4; }
.jg-ajudas { display: flex; gap: 10px; margin-top: 4px; }

/* quiz */
.jg-tempo { height: 6px; border-radius: 6px; background: rgba(128,100,50,.16); overflow: hidden; margin-bottom: 14px; }
.jg-tempo i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #e9c46a, #c9963a); transition: width .1s linear; }
.jg-tempo i.alerta { background: var(--jg-no); }
.jg-seq { opacity: .35; transition: opacity .2s, color .2s; }
.jg-seq.on { opacity: 1; color: #d9772b; font-weight: 700; }
.jg-perg { font-family: 'Cinzel', Georgia, serif; font-size: 1.18rem; line-height: 1.45; margin: 12px 0 18px; }
.jg-opcoes { display: grid; gap: 10px; }
.jg-op { display: flex; align-items: center; gap: 12px; text-align: left; padding: 13px 14px; min-height: 54px; border-radius: 14px; border: 1px solid var(--jg-borda); background: rgba(255,255,255,.04); font-size: .98rem; transition: transform .15s, background-color .2s, border-color .2s, opacity .3s; animation: jgEntra .35s ease both; animation-delay: calc(var(--i) * 60ms); }
.jg-op:not(:disabled):hover { border-color: var(--jg-ouro); }
.jg-op:not(:disabled):active { transform: scale(.98); }
.jg-op-l { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: rgba(201,150,58,.15); color: var(--jg-ouro); flex: none; }
.jg-op.certa { background: rgba(47,143,91,.16); border-color: var(--jg-ok); animation: jgPop .4s ease; }
.jg-op.certa .jg-op-l { background: var(--jg-ok); color: #fff; }
.jg-op.errada { background: rgba(192,69,58,.14); border-color: var(--jg-no); animation: jgTreme .4s ease; }
.jg-op.errada .jg-op-l { background: var(--jg-no); color: #fff; }
.jg-op.some { opacity: .2; }
.jg-fb { margin-top: 16px; padding: 14px 16px; border-radius: 14px; border-left: 4px solid var(--jg-ok); background: rgba(47,143,91,.1); animation: jgEntra .3s ease both; }
.jg-fb.no { border-left-color: var(--jg-no); background: rgba(192,69,58,.09); }
.jg-fb b { display: block; margin-bottom: 4px; }
.jg-fb p { margin: 0; line-height: 1.45; font-size: .92rem; }
.jg-fb cite { display: block; margin-top: 6px; font-size: .8rem; color: var(--jg-ouro); font-style: normal; font-weight: 700; }

/* forca */
.jg-dica { margin: 0 0 14px; color: var(--jg-sub); font-style: italic; line-height: 1.4; }
.jg-velas { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.jg-vela { color: #e0892b; transition: opacity .3s, transform .3s, color .3s; }
.jg-vela .jg-svg { width: 26px; height: 26px; fill: rgba(240,170,60,.35); }
.jg-vela.off { color: var(--jg-sub); opacity: .3; transform: scale(.8); }
.jg-vela.off .jg-svg { fill: none; }
.jg-palavra { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 48px; }
.jg-letra { width: 34px; height: 44px; border-bottom: 3px solid var(--jg-ouro); display: grid; place-items: center; font: 700 1.4rem 'Cinzel', serif; }
.jg-letra.on { animation: jgPop .35s ease; }
.jg-letra.perdida { color: var(--jg-no); }
.jg-esp { width: 16px; }
.jg-teclado { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin-top: 14px; }
.jg-tecla { min-height: 46px; border-radius: 10px; border: 1px solid var(--jg-borda); background: var(--jg-card); font-weight: 700; transition: transform .1s, background-color .2s, opacity .2s; }
.jg-tecla:not(:disabled):active { transform: scale(.9); }
.jg-tecla.certa { background: var(--jg-ok); color: #fff !important; border-color: transparent; }
.jg-tecla.errada { opacity: .3; }

/* caça-palavras */
.jg-grade { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; touch-action: none; max-width: 520px; margin: 0 auto; }
.jg-cel { aspect-ratio: 1; display: grid; place-items: center; border-radius: 7px; font-weight: 700; font-size: clamp(.72rem, 3.4vw, 1.05rem); background: rgba(201,150,58,.08); transition: background-color .15s, transform .15s, color .15s; }
.jg-cel.sel { background: var(--jg-ouro); color: #2a1a05; transform: scale(1.06); }
.jg-cel.achada { background: hsla(var(--h), 62%, 52%, .32); }
.jg-lista { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.jg-lista span { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--jg-borda); font-size: .8rem; font-weight: 700; letter-spacing: .04em; transition: opacity .3s; }
.jg-lista span.ok { text-decoration: line-through; opacity: .6; background: hsla(var(--h), 62%, 52%, .25); }

/* memória */
.jg-mem { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); max-width: 560px; margin: 0 auto; perspective: 900px; }
.jg-mem.c6 { grid-template-columns: repeat(6, 1fr); max-width: 760px; }
.jg-mc { aspect-ratio: 3 / 4; padding: 0; border: 0; background: none; animation: jgEntra .35s ease both; animation-delay: calc(var(--i) * 25ms); }
.jg-mc-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.3,.7,.3,1.2); }
.jg-mc.virada .jg-mc-in, .jg-mc.par .jg-mc-in { transform: rotateY(180deg); }
.jg-mc-f { position: absolute; inset: 0; border-radius: 14px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 1px solid var(--jg-borda); }
.jg-mc-verso { background: linear-gradient(145deg, #3b2a5a, #1d1430); color: #e9c46a; }
.jg-mc-verso .jg-svg { width: 34%; height: 34%; }
.jg-mc-frente { transform: rotateY(180deg); background: var(--jg-card); align-content: center; gap: 4px; }
.jg-mc-frente em { font-style: normal; font-size: clamp(1.4rem, 6vw, 2.2rem); line-height: 1; }
.jg-mc-frente small { font-size: clamp(.58rem, 2.4vw, .78rem); font-weight: 700; color: var(--jg-sub); }
.jg-mc.par .jg-mc-frente { border-color: var(--jg-ok); box-shadow: 0 0 0 2px rgba(47,143,91,.3) inset; }
.jg-fato { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--jg-card); border: 1px solid var(--jg-borda); font-size: .9rem; line-height: 1.45; color: var(--jg-sub); min-height: 52px; }
.jg-fato b { color: var(--jg-txt); }

/* versículo */
.jg-verso { font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif; font-size: 1.32rem; line-height: 2.1; margin: 4px 0 6px; }
.jg-lac { display: inline-block; min-width: 92px; min-height: 36px; padding: 0 10px; margin: 0 2px; border: 0; border-bottom: 2px dashed var(--jg-ouro); border-radius: 8px 8px 0 0; background: rgba(201,150,58,.1); font-weight: 700; vertical-align: baseline; transition: background-color .2s; }
.jg-lac.cheia { border-bottom-style: solid; animation: jgPop .3s ease; }
.jg-lac.certa { background: rgba(47,143,91,.2); border-color: var(--jg-ok); }
.jg-lac.errada { background: rgba(192,69,58,.18); border-color: var(--jg-no); text-decoration: line-through; }
.jg-corr { color: var(--jg-ok); font-weight: 700; font-size: .85rem; margin-left: 4px; font-family: system-ui, sans-serif; }
.jg-ref { display: block; text-align: right; color: var(--jg-ouro); font-style: normal; font-weight: 700; font-size: .85rem; }
.jg-fichas { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.jg-ficha { min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--jg-borda); background: var(--jg-card); font-weight: 700; box-shadow: 0 3px 0 rgba(120,80,20,.15); transition: transform .12s, opacity .2s; }
.jg-ficha:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
.jg-ficha.usada { opacity: .25; }

/* livros */
.jg-ordem { list-style: none; counter-reset: o; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.jg-ordem li { counter-increment: o; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--jg-borda); color: var(--jg-sub); }
.jg-ordem li::before { content: counter(o); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; background: rgba(201,150,58,.14); color: var(--jg-ouro); flex: none; }
.jg-ordem li.on { border-style: solid; border-color: var(--jg-ok); background: rgba(47,143,91,.1); color: var(--jg-txt); animation: jgPop .3s ease; }
.jg-ordem li b { flex: 1; }
.jg-ordem li span { font-size: .72rem; font-weight: 700; color: var(--jg-sub); }
.jg-livros { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.jg-livro { min-height: 50px; padding: 10px; border-radius: 12px; border: 1px solid var(--jg-borda); background: rgba(255,255,255,.04); font-weight: 700; font-size: .92rem; transition: transform .12s, opacity .25s, border-color .2s; }
.jg-livro:not(:disabled):hover { border-color: var(--jg-ouro); }
.jg-livro.ok { opacity: .25; }
.jg-vidas { display: inline-flex; gap: 3px; color: var(--jg-no); }
.jg-vidas .jg-svg { fill: currentColor; }
.jg-vidas .off { opacity: .2; }
.treme { animation: jgTreme .4s ease; }

/* resultado */
.jg-fim { text-align: center; padding: 18px 8px; animation: jgEntra .4s ease both; }
.jg-ests { display: flex; gap: 10px; justify-content: center; margin-bottom: 8px; }
.jg-est { color: rgba(128,100,50,.25); animation: jgEstrela .5s ease both; animation-delay: calc(.2s + var(--i) * .18s); }
.jg-est .jg-svg { width: 54px; height: 54px; }
.jg-est.on { color: #e9b949; }
.jg-est.on .jg-svg { fill: #f3cf6b; }
.jg-fim h4 { font-family: 'Cinzel', serif; font-size: 1.4rem; margin: 6px 0 10px; color: var(--jg-ouro); }
.jg-rec-novo { display: inline-flex; gap: 6px; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--jg-ok); color: #fff; font-weight: 700; font-size: .84rem; margin-bottom: 12px; animation: jgPop .5s ease .6s both; }
.jg-fim-l { list-style: none; padding: 0; margin: 6px auto 14px; max-width: 340px; }
.jg-fim-l li { display: flex; justify-content: space-between; padding: 10px 4px; border-bottom: 1px solid var(--jg-borda); }
.jg-fim-l span { color: var(--jg-sub); }
.jg-vs { font-style: italic; color: var(--jg-sub); font-size: .86rem; max-width: 380px; margin: 0 auto; }
.jg-acoes { display: flex; gap: 10px; max-width: 380px; margin: 0 auto; }
.jg-acoes .jg-btn { flex: 1; }
.jg-acoes .jg-btn.sec { margin-top: 14px; }

/* confete */
.jg-confete { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.jg-confete i { position: absolute; top: -12px; left: var(--x); width: 8px; height: 14px; border-radius: 2px; background: hsl(var(--h), 80%, 60%); animation: jgCai 2.2s ease-in var(--d) forwards; }

@keyframes jgEntra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes jgPop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes jgTreme { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
@keyframes jgEstrela { from { opacity: 0; transform: scale(.3) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes jgCai { to { transform: translateY(105vh) rotate(var(--r)); opacity: .9; } }

@media (max-width: 600px) {
  .jg-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .jg-card { padding: 14px; min-height: 150px; }
  .jg-card-d { font-size: .76rem; }
  .jg-novo { top: 10px; right: 10px; }
  .jg-cartao { padding: 18px 14px; }
  .jg-perg { font-size: 1.06rem; }
  .jg-teclado { grid-template-columns: repeat(7, 1fr); }
  .jg-mem.c6 { grid-template-columns: repeat(4, 1fr); }
  .jg-verso { font-size: 1.18rem; }
  .jg-livros { grid-template-columns: 1fr 1fr; }
  .jg-top h3 { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  #jg-root *, .jg-confete i { animation: none !important; transition: none !important; }
}

/* neutraliza estilos genéricos do painel do computador (.extra-panel p / .extra-detail) */
.extra-detail:has(> #jg-root) { background: none; border: 0; padding: 0; font-style: normal; line-height: 1.5; }
#jg-root { font-style: normal; line-height: 1.5; font-size: 16px; }
#jg-root p { font-size: inherit; line-height: 1.5; color: inherit; font-style: normal; padding: 0; border: 0; cursor: default; }
#jg-root p::after, #jg-root p::before { content: none; }
#jg-root .jg-perg { font-size: 1.18rem; line-height: 1.45; }
#jg-root .jg-dica, #jg-root .jg-menu p, #jg-root .jg-vs { color: var(--jg-sub); }
#jg-root .jg-dica, #jg-root .jg-vs { font-style: italic; }
#jg-root .jg-verso { font-size: 1.32rem; line-height: 2.1; }
@media (max-width: 600px) { #jg-root .jg-perg { font-size: 1.06rem; } #jg-root .jg-verso { font-size: 1.18rem; } }
#jg-root .jg-palavra { flex-wrap: nowrap; gap: 4px; }
#jg-root .jg-letra { width: min(34px, calc((100vw - 80px) / var(--len, 8) - 4px)); font-size: min(1.4rem, calc((100vw - 80px) / var(--len, 8) * .62)); }
#jg-root .jg-esp { width: min(16px, calc((100vw - 80px) / var(--len, 8) / 2)); }
@media (max-width: 600px) { .jg-mc { aspect-ratio: 5 / 6; } .jg-mem { gap: 8px; } }
