/*! Frutas para a Arca · © 2026 Pinturas Bíblicas · Por: Christiano Augusto | pinturasbiblicas.com.br
    Protegido pelas Leis 9.610/98 e 9.609/98. Proibida a reprodução em outro site ou aplicativo. */

.fr { margin: 0 0 8px; }
.fr__tela {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100svh - 96px); min-height: 260px;
  border: 3px solid var(--tinta, #333); border-radius: 22px; overflow: hidden; box-sizing: border-box;
  background: #BEE7FF; box-shadow: 0 8px 0 rgba(74, 48, 24, .18); outline: none;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  container-type: size;
}
.fr__tela canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fr__marca {
  position: absolute; right: 8px; bottom: 4px; z-index: 1; pointer-events: none;
  font: 600 max(7px, calc(var(--cel, 50px) * .14))/1 var(--fonte-texto, "Poppins", "Poppins reserva", sans-serif);
  color: rgba(80, 45, 15, .32); white-space: nowrap;
}
.fr__copia { padding: 40px 20px; text-align: center; font-size: 1.1rem; }

/* placar e botões de cima */
.fr__hud { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
/* placar: grande, com a fruta que acabou de pegar dentro de um círculo e um +1 que sobe */
.fr__placar {
  position: relative; margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 4px 18px 4px 4px;
  background: #FFF6D6; border: 3px solid var(--tinta, #333); border-radius: 999px;
  box-shadow: 0 4px 0 rgba(74, 48, 24, .25);
  font: 800 clamp(1.3rem, 6.5cqh, 1.9rem)/1 var(--fonte-titulo, "Poppins", "Poppins reserva", sans-serif); color: var(--tinta, #333);
}
.fr__placar-fruta {
  display: grid; place-items: center; width: clamp(40px, 11cqh, 58px); aspect-ratio: 1; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--tinta, #333);
}
.fr__placar-fruta img { width: 74%; height: 74%; object-fit: contain; }
.fr__placar-num b { font-weight: 800; }
.fr__placar-num small { font-size: .62em; font-weight: 700; color: #8C6A3E; margin-left: 1px; }
.fr__placar.is-pulo { animation: fr-pulo .4s ease-out; }
.fr__placar.is-pulo .fr__placar-fruta { animation: fr-gira .45s ease-out; }
@keyframes fr-pulo { 35% { transform: scale(1.15) rotate(-3deg); } 70% { transform: scale(.97); } }
@keyframes fr-gira { 40% { transform: rotate(-18deg) scale(1.15); } }
.fr__placar.is-todas { background: #FFE27A; }
.fr__placar.is-todas .fr__placar-num small { color: #6E4A12; }
.fr__mais {
  position: absolute; left: 100%; top: 50%; margin-left: 4px; opacity: 0; pointer-events: none;
  font: 800 1.1rem/1 var(--fonte-titulo, "Poppins", sans-serif); color: #E8457E;
  -webkit-text-stroke: 4px #fff; paint-order: stroke fill;
}
.fr__mais.is-sobe { animation: fr-mais .7s ease-out; }
@keyframes fr-mais { 0% { opacity: 0; transform: translateY(-20%) scale(.6); } 25% { opacity: 1; transform: translateY(-60%) scale(1.15); } 100% { opacity: 0; transform: translateY(-160%) scale(1); } }
.fr__oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fr__botoes { display: flex; gap: 8px; pointer-events: auto; }
.fr__bt, .fr__bt.jg-som {
  display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0;
  border: 2.5px solid var(--tinta, #333); border-radius: 50%; background: rgba(255, 255, 255, .9);
  color: var(--tinta, #333); cursor: pointer;
}
.fr__bt:hover { background: #fff; }
.fr__bt[hidden] { display: none; }
/* o botão de pausa só aparece enquanto se joga */
.fr:not(.fr--jogando) .fr__bt--pausa { visibility: hidden; }
.fr__pausa { z-index: 5; }
.fr__bt svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.fr__aviso {
  position: absolute; left: 50%; top: 84px; z-index: 2; margin: 0; transform: translateX(-50%);
  padding: 8px 16px; border-radius: 999px; background: #fff; border: 2.5px solid var(--tinta, #333);
  font: 700 1rem/1.2 var(--fonte-texto, "Poppins", "Poppins reserva", sans-serif); white-space: nowrap;
  animation: fr-aparece .25s ease-out; transition: opacity .4s;
}
.fr__aviso.is-some { opacity: 0; }
@keyframes fr-aparece { from { opacity: 0; transform: translate(-50%, -6px); } }

/* botões de toque (celular e tablet) */
.fr__controles { position: absolute; inset: auto 0 0 0; height: 0; z-index: 2; display: none; }
.fr--toque .fr__controles { display: block; }
@media (hover: none), (pointer: coarse) { .fr__controles { display: block; } .fr__dica--teclado { display: none; } }
.fr__ctl {
  --t: clamp(58px, 17cqh, 84px);
  position: absolute; bottom: 12px; width: var(--t); height: var(--t); box-sizing: border-box;
  display: grid; place-items: center; align-content: center; border-radius: 50%;
  background: rgba(255, 255, 255, .68); border: 3px solid rgba(51, 51, 51, .6); color: rgba(51, 51, 51, .85);
  touch-action: none; transition: transform .06s, background .06s;
}
.fr__ctl svg { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.fr__ctl small { font: 800 .7rem/1 var(--fonte-texto, "Poppins", "Poppins reserva", sans-serif); margin-top: -2px; }
.fr__ctl--esq { left: 12px; }
.fr__ctl--dir { left: calc(24px + var(--t)); }
.fr__ctl--pulo { --t: clamp(66px, 20cqh, 96px); right: 12px; background: rgba(255, 220, 120, .6); }
.fr__ctl.is-apertado { background: rgba(255, 255, 255, .92); transform: scale(.92); }
.fr__ctl--pulo.is-apertado { background: rgba(255, 210, 80, .95); }

.fr__capa.is-chega .fr__caixa { animation: fr-chega .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes fr-chega { from { opacity: 0; transform: scale(.85) translateY(10px); } }

/* abertura e vitória: cartão por cima do jogo */
.fr__capa {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 3cqh 4cqw;
  background: rgba(255, 249, 236, .82); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  animation: fr-surge .3s ease-out;
}
.fr__capa[hidden] { display: none; }
@keyframes fr-surge { from { opacity: 0; } }
.fr__caixa {
  width: min(100%, 440px); max-height: 100%; overflow: auto; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; gap: 1.6cqh; text-align: center;
  padding: 3.5cqh 22px; background: #fff; border: 3px solid var(--tinta, #333); border-radius: 22px;
  box-shadow: 0 8px 0 rgba(74, 48, 24, .18);
}
.fr__capa-bichos { display: flex; align-items: flex-end; gap: 6px; height: clamp(44px, 20cqh, 110px); }
.fr__capa-bichos img { height: 62%; width: auto; animation: fr-pulinho 1.4s ease-in-out infinite; }
.fr__capa-bichos .fr__capa-leao { height: 100%; animation-delay: .2s; }
.fr__capa-bichos img:last-child { animation-delay: .4s; }
.fr__vitoria .fr__capa-bichos img { height: 100%; }
@keyframes fr-pulinho { 0%, 60%, 100% { translate: 0 0; } 30% { translate: 0 -12%; } }
.fr__titulo { font: 800 clamp(1.15rem, 7cqh, 1.9rem)/1.1 var(--fonte-titulo, "Poppins", "Poppins reserva", sans-serif); color: var(--tinta, #333); }
.fr__texto { font-size: clamp(.85rem, 3.8cqh, 1.02rem); line-height: 1.4; color: var(--tinta-2, #5E5A6B); }
.fr__jogar { width: 100%; min-height: max(48px, 11cqh); font-size: 1.1rem; }
.fr__dica { font-size: .82rem; color: var(--tinta-3, #99939E); }
.fr__dica kbd { display: inline-block; min-width: 1.5em; padding: 1px 5px; border: 1.5px solid #CFC5B6; border-bottom-width: 3px; border-radius: 6px; background: #fff; font: 700 .78rem/1.3 var(--fonte-texto, "Poppins", sans-serif); color: var(--tinta, #333); }
.fr__dica--toque { display: none; }
.fr--toque .fr__dica--toque { display: block; }
.fr--toque .fr__dica--teclado { display: none; }
@media (hover: none), (pointer: coarse) { .fr__dica--toque { display: block; } }
.fr__recorde { font: 700 .9rem/1 var(--fonte-texto, "Poppins", sans-serif); color: #C98A12; }
.fr__recorde:empty { display: none; }
.fr__estrelas { font-size: clamp(1.5rem, 9cqh, 2.4rem); line-height: 1; color: #F5B50A; letter-spacing: 2px; }
.fr__versiculo { font-size: clamp(.75rem, 3.2cqh, .88rem); line-height: 1.4; font-style: italic; color: var(--tinta-3, #99939E); }

/* escolha de fase: um botão por bicho, todos numa linha (nada de deslizar para o lado) */
.fr__fases { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px 6px; width: 100%; padding-top: 4px; }
.fr__fase {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 1px;
  min-height: max(50px, 11.5cqh); margin: 0; padding: 5px 2px 4px; box-sizing: border-box;
  border: 2px solid #E3D8C6; border-radius: 14px; background: #FFFBF1; color: var(--tinta, #333);
  font: 800 .8rem/1 var(--fonte-titulo, "Poppins", "Poppins reserva", sans-serif); cursor: pointer;
  transition: transform .1s, border-color .1s;
}
.fr__fase img { height: clamp(24px, 6.5cqh, 38px); width: auto; max-width: 100%; object-fit: contain; }
.fr__fase-num {
  position: absolute; top: -7px; left: -5px; display: grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--tinta, #333); color: #fff; font-size: .72rem;
}
.fr__fase-est { font-size: .72rem; letter-spacing: .5px; color: #F5B50A; min-height: .8em; }
.fr__fase:hover:not(:disabled) { border-color: var(--tinta, #333); transform: translateY(-2px); }
.fr__fase.is-atual { border-color: var(--rosa-forte, #D62F73); background: #FFF0F6; box-shadow: 0 3px 0 rgba(214, 47, 115, .25); }
.fr__fase.is-atual .fr__fase-num { background: var(--rosa-forte, #D62F73); }
.fr__fase.is-trancada { cursor: not-allowed; background: #F4F1EC; border-style: dashed; }
.fr__fase.is-trancada img { filter: grayscale(1) brightness(1.15); opacity: .35; }
.fr__fase.is-trancada .fr__fase-num { background: #B9B2A8; }
/* fases difíceis (6 a 10): número laranja com raiozinho */
.fr__fase.is-dificil { background: #FFF6EC; border-color: #F2CFA4; }
.fr__fase.is-dificil .fr__fase-num { background: #E8742A; }
.fr__fase.is-dificil.is-trancada { background: #F4F1EC; border-color: #E3D8C6; }
.fr__fase.is-dificil.is-trancada .fr__fase-num { background: #D9A47E; }
.fr__fase.is-dificil.is-atual { border-color: #E8742A; background: #FFEEDD; box-shadow: 0 3px 0 rgba(232, 116, 42, .25); }
.fr__legenda { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font: 700 .76rem/1.2 var(--fonte-texto, "Poppins", sans-serif); color: var(--tinta-2, #5E5A6B); margin-top: -4px; }
.fr__legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; background: var(--rosa-forte, #D62F73); }
.fr__legenda span + span i { background: #E8742A; }
.fr__fase-cadeado {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; translate: -50% -60%;
  fill: #fff; stroke: #8C8378; stroke-width: 2; stroke-linecap: round;
}
/* vitória: próxima fase (com o próximo bicho) e, embaixo, jogar de novo e voltar às fases */
.fr__proxima img { height: 34px; width: auto; margin: -6px 0; }
.fr__proxima[hidden] { display: none; }
.fr__vit-botoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.fr__bt-texto { min-height: 46px; padding: 0 10px; gap: 6px; font-size: .92rem; }
.fr__bt-texto svg { width: 20px; height: 20px; }
/* capa com as 10 fases: sem o texto e com os bichos menores, para caber sem rolar */
@container (max-height: 600px) {
  .fr__capa:not(.fr__vitoria):not(.fr__pausa) .fr__texto { display: none; }
  .fr__capa:not(.fr__vitoria) .fr__capa-bichos { height: clamp(40px, 15cqh, 90px); }
}
@container (max-height: 380px) {
  .fr__versiculo, .fr__dica, .fr__capa:not(.fr__vitoria):not(.fr__pausa) .fr__texto { display: none !important; }
  .fr__caixa { gap: 1.2cqh; padding: 2.5cqh 18px; }
  .fr__fase { min-height: 46px; padding-top: 3px; }
  .fr__fase img { height: 24px; }
  .fr__capa:not(.fr__vitoria) .fr__capa-bichos { height: 13cqh; }
  .fr__legenda { display: none; }
}

/* tela cheia */
.fr.is-tela-cheia { max-width: none; margin: 0; background: #FFF9EC; display: grid; place-items: center; }
.fr.is-tela-cheia .fr__tela { width: 100vw; height: 100vh; max-height: none; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; }

/* celular em pé: tela mais alta, o jogo ocupa a tela */
@media (orientation: portrait) and (max-width: 760px) {
  .fr__tela { aspect-ratio: 9 / 16; max-height: calc(100svh - 24px); border-radius: 18px; }
  .fr__placar { font-size: 1.35rem; padding-right: 14px; }
  .fr__placar-fruta { width: 42px; }
  /* os botões ficam na faixa de terra de baixo (o frutas.js reserva 20% da altura) */
  .fr__ctl { --t: min(80px, 14cqh); bottom: max(8px, 3cqh); }
  .fr__ctl--pulo { --t: min(92px, 16cqh); bottom: max(6px, 2.4cqh); }
}
/* celular deitado: quase a tela toda */
@media (orientation: landscape) and (max-height: 520px) {
  .fr__tela { max-height: calc(100svh - 14px); min-height: 0; border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .fr__capa.is-chega .fr__caixa,
  .fr__capa-bichos img, .fr__placar.is-pulo, .fr__placar.is-pulo .fr__placar-fruta, .fr__mais.is-sobe, .fr__capa, .fr__aviso { animation: none; }
}
