/* O portal infantil (/turma). Visual próprio, separado do painel do responsável:
   fundo azul-marinho da marca, destaque âmbar, verde SalzNeuro; Fredoka nos títulos. */

:root {
  --fundo: #021f3d;
  --fundo-2: #04305a;
  --painel: #0a3d6e;
  --linha: rgba(255, 255, 255, .14);
  --texto: #f3f8fc;
  --texto-2: #b9cfe2;
  --ambar: #f5b83d;
  --verde: #1cb555;
  --perigo: #ff8a80;
  --cor: var(--ambar);
  --raio: 18px;
  --margem: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--fundo); color: var(--texto);
  font-family: Nunito, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 17px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
h1, h2, h3, .titulo { font-family: Fredoka, Nunito, system-ui, sans-serif; font-weight: 600; margin: 0; text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--ambar); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }

/* ---------- botões ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: 0 1.4em; border: 0; border-radius: 999px;
  background: var(--cor); color: #1b1300; font-family: Fredoka, sans-serif; font-weight: 600; font-size: 1.1rem;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .28); transition: transform .12s, box-shadow .12s, filter .12s;
}
.botao:hover { filter: brightness(1.08); transform: translateY(-1px); }
.botao:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .28); }
.botao[disabled] { opacity: .45; cursor: default; transform: none; filter: none; }
.botao.verde { --cor: var(--verde); color: #fff; }
.botao.fantasma { background: rgba(255, 255, 255, .1); color: var(--texto); box-shadow: none; border: 1px solid var(--linha); }
.botao.fantasma:hover { background: rgba(255, 255, 255, .18); }
.botao.pequeno { min-height: 40px; font-size: .95rem; padding: 0 1em; }
.link { background: none; border: 0; padding: .4em .2em; color: var(--texto-2); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--texto); }

/* ---------- barra do alto ---------- */
.topo {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 10px var(--margem); padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: linear-gradient(to bottom, rgba(2, 31, 61, .96), rgba(2, 31, 61, .72)); backdrop-filter: blur(8px);
}
.topo .marca { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.topo .marca img { height: 34px; width: auto; background: #fff; border-radius: 10px; padding: 4px 8px; }
.topo .marca span { font-family: Fredoka, sans-serif; font-weight: 600; font-size: 1.25rem; color: var(--ambar); white-space: nowrap; }
.perfil { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px; border-radius: 999px; }
.perfil img { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--ambar); object-fit: cover; background: var(--painel); }
.perfil span { font-family: Fredoka, sans-serif; font-weight: 600; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .topo .marca span, .perfil span { display: none; } }

/* ---------- visitante sem login (24/11/2026) ---------- */
.faixa-visitante {
  display: flex; align-items: center; gap: 10px; margin: 4px var(--margem) 14px; padding: 10px 16px;
  border-radius: var(--raio); background: rgba(245, 184, 61, .14); border: 1px solid rgba(245, 184, 61, .42);
  color: var(--texto); font-size: .95rem; line-height: 1.35;
}
.faixa-visitante span { font-size: 1.3rem; flex: none; }
.entrada .visitante { margin-top: 18px; text-align: center; }
.entrada .visitante p { margin: 6px 0 0; color: var(--texto-2); font-size: .9rem; }

/* ---------- herói ---------- */
.heroi { position: relative; display: grid; margin: 0 0 8px; }
.slide {
  grid-area: 1 / 1; position: relative; min-height: clamp(360px, 46vw, 620px); display: flex; align-items: flex-end;
  opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility .7s; overflow: hidden;
}
.slide.ativo { opacity: 1; visibility: visible; }
.slide > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.slide.capa > img { object-position: 50% 40%; }
.slide::before { /* a faixa escura da esquerda, para o texto */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(2, 31, 61, .96) 0%, rgba(2, 31, 61, .78) 32%, rgba(2, 31, 61, .12) 64%, transparent 100%),
    linear-gradient(0deg, var(--fundo) 0%, rgba(2, 31, 61, .55) 22%, transparent 48%);
}
.slide .texto { position: relative; z-index: 2; padding: 0 var(--margem) clamp(40px, 6vw, 84px); max-width: min(640px, 92vw); }
.slide .rotulo {
  display: inline-block; padding: .25em .9em; border-radius: 999px; background: var(--cor); color: #1b1300;
  font-family: Fredoka, sans-serif; font-weight: 600; font-size: .85rem; letter-spacing: .02em;
}
.slide h1 { font-size: clamp(2rem, 5.2vw, 4rem); line-height: 1.05; margin: .25em 0 .2em; text-shadow: 0 3px 18px rgba(0, 0, 0, .45); }
.slide p {
  margin: 0 0 1.1em; color: #e4eef7; font-size: clamp(1rem, 1.5vw, 1.2rem);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}
.slide .dados { display: flex; gap: .9em; flex-wrap: wrap; align-items: center; color: var(--texto-2); font-weight: 700; font-size: .95rem; margin-bottom: 1em; }
.slide .botao { min-height: 60px; font-size: 1.3rem; padding: 0 1.7em; }
.bolinhas { position: absolute; z-index: 3; right: var(--margem); bottom: 26px; display: flex; gap: 8px; }
.bolinhas button { width: 34px; height: 12px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .32); padding: 0; }
.bolinhas button[aria-current="true"] { background: var(--ambar); }
@media (max-width: 700px) {
  .slide { min-height: max(118vw, 440px); }
  .slide p { -webkit-line-clamp: 2; }
  .slide::before { background: linear-gradient(0deg, var(--fundo) 0%, rgba(2, 31, 61, .9) 34%, rgba(2, 31, 61, .2) 70%, transparent 100%); }
  .slide > img { object-position: 60% 30%; }
  .slide .texto { padding-bottom: 48px; }
  .bolinhas { right: auto; left: var(--margem); bottom: 18px; }
}

/* ---------- fileiras ---------- */
.fileira { position: relative; margin: 26px 0 0; }
.fileira h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); padding: 0 var(--margem); margin-bottom: 10px; }
.trilho {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-left: var(--margem);
  padding: 8px var(--margem) 18px; scrollbar-width: none;
}
.trilho::-webkit-scrollbar { display: none; }
.cartao {
  --largura: clamp(200px, 23vw, 300px);
  position: relative; flex: 0 0 var(--largura); scroll-snap-align: start; display: block;
  border-radius: var(--raio); background: var(--painel); overflow: hidden;
  box-shadow: 0 0 0 2px transparent, 0 8px 18px rgba(0, 0, 0, .3); transition: transform .16s, box-shadow .16s;
}
.cartao:hover, .cartao:focus-visible { transform: translateY(-6px) scale(1.03); box-shadow: 0 0 0 3px var(--cor), 0 16px 28px rgba(0, 0, 0, .45); z-index: 2; }
.cartao .capa { aspect-ratio: 3 / 2; background: linear-gradient(135deg, var(--painel), var(--fundo-2)); display: grid; place-items: center; font-size: 3.4rem; }
.cartao .capa img { width: 100%; height: 100%; object-fit: cover; }
/* margem, e não padding: com line-clamp o padding de baixo deixaria aparecer a terceira linha */
.cartao h3 { font-size: 1.05rem; line-height: 1.2; margin: 10px 12px 12px; min-height: 2.4em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cartao .selo {
  position: absolute; top: 8px; left: 8px; padding: .15em .7em; border-radius: 999px; font-size: .78rem; font-weight: 800;
  background: rgba(2, 31, 61, .82); color: #fff; backdrop-filter: blur(4px);
}
.cartao .selo.feito { background: var(--verde); }
.cartao .selo.missao { background: #f5b83d; color: #021f3d; }
/* a figurinha por missão cumprida (Gerenciador de Atividades, etapa 10) */
.figurinha-nova { margin: 14px var(--margem, 16px) 0; padding: 16px 18px; border-radius: 18px; background: linear-gradient(135deg, #f5b83d, #ffd77a); color: #021f3d; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.figurinha-nova .figs { display: flex; }
.figurinha-nova .figs img { width: 104px; height: 104px; filter: drop-shadow(0 4px 6px rgba(2, 31, 61, .35)); animation: figurinha-chega .6s ease-out both; }
.figurinha-nova .figs img + img { margin-left: -28px; animation-delay: .15s; }
.figurinha-nova .texto { flex: 1; min-width: 14rem; }
.figurinha-nova h2 { font-size: 1.5rem; margin: 0 0 4px; }
.figurinha-nova p { margin: 0 0 10px; font-weight: 700; }
@keyframes figurinha-chega { from { transform: scale(.3) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .figurinha-nova .figs img { animation: none; } }
.faixa-album { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 12px var(--margem, 16px) 0; padding: 12px 16px; border-radius: 14px; background: var(--fundo-2); border: 2px solid #f5b83d; color: var(--texto); font-weight: 800; text-decoration: none; }
.faixa-album small { font-weight: 600; color: var(--texto-2); }
.faixa-album:hover, .faixa-album:focus-visible { background: #0a4e8a; }
.album { padding: 18px var(--margem, 16px) 0; }
.album h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0; }
.album .conta { color: var(--texto-2); margin: 6px 0 0; font-weight: 700; }
.album h2 { font-size: 1.15rem; margin: 22px 0 10px; }
.album .casas { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.album .casa { position: relative; aspect-ratio: 1; border-radius: 16px; background: var(--fundo-2); border: 2px dashed rgba(255, 255, 255, .18); display: grid; place-items: center; }
.album .casa img { width: 88%; height: 88%; object-fit: contain; }
.album .casa.falta { color: var(--texto-2); font-size: 1.8rem; font-weight: 800; }
.album .casa.tem { border: 2px solid #f5b83d; background: #0a4e8a; }
.album .casa .vezes { position: absolute; right: 6px; bottom: 6px; padding: 1px 7px; border-radius: 999px; background: #f5b83d; color: #021f3d; font-size: .75rem; font-weight: 800; }
.aviso-adulto { margin: 8px var(--margem, 16px) 0; padding: 10px 14px; border-radius: 12px; background: #f5b83d; color: #021f3d; font-weight: 800; text-align: center; }
.cartao .selo.tipo { left: auto; right: 8px; }

/* ---------- atividade que não é jogo: vídeo, texto, material ---------- */
.conteudo { max-width: 920px; margin: 0 auto; padding: 22px var(--margem) 60px; }
.conteudo .tela { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--raio); background: #000; display: block; }
.conteudo img.capa-grande, .conteudo img.material { width: 100%; border-radius: var(--raio); }
.conteudo .resumo { font-size: 1.2rem; margin: 18px 0 0; }
.conteudo .texto-longo { margin: 18px 0 0; padding: 20px; border-radius: var(--raio); background: var(--fundo-2); white-space: pre-line; line-height: 1.6; }
.conteudo audio { width: 100%; margin-top: 18px; }
.conteudo .linha-botoes .botao { flex: 0 1 auto; }
.cartao.fechada .capa img { filter: grayscale(.7) brightness(.6); }
.seta {
  position: absolute; top: 50%; z-index: 5; width: 46px; height: 76px; border: 0; border-radius: 14px;
  background: rgba(2, 31, 61, .82); color: #fff; font-size: 1.8rem; display: none; place-items: center; transform: translateY(-20%);
}
.seta.antes { left: 6px; } .seta.depois { right: 6px; }
@media (hover: hover) and (min-width: 800px) { .fileira:hover .seta:not([hidden]) { display: grid; } }
.grade { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(150px, 44vw), 1fr)); padding: 8px var(--margem) 18px; }
.grade .cartao { flex: none; width: auto; }
.rodape { padding: 40px var(--margem) calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--texto-2); font-size: .9rem; text-align: center; }
.vazio { padding: 60px var(--margem); text-align: center; color: var(--texto-2); }

/* ---------- caixa de diálogo (senha do adulto) ---------- */
dialog.caixa {
  border: 1px solid var(--linha); border-radius: 24px; background: var(--fundo-2); color: var(--texto);
  padding: 26px; width: min(420px, calc(100vw - 32px));
}
dialog.caixa::backdrop { background: rgba(0, 10, 25, .72); backdrop-filter: blur(3px); }
dialog.caixa h2 { font-size: 1.4rem; margin-bottom: .3em; }
dialog.caixa p { margin: 0 0 1em; color: var(--texto-2); }
.campo { display: block; width: 100%; min-height: 54px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--linha);
  background: rgba(255, 255, 255, .08); color: var(--texto); font: inherit; font-size: 1.1rem; }
.campo:focus { border-color: var(--ambar); outline: none; }
.rotulo-campo { display: block; font-weight: 800; font-size: .85rem; color: var(--texto-2); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.erro { color: var(--perigo); font-weight: 700; margin: .7em 0 0; }
.aviso-topo { margin: 0 auto 18px; max-width: 560px; padding: 12px 16px; border-radius: 14px; background: rgba(245, 184, 61, .16); border: 1px solid rgba(245, 184, 61, .5); text-align: center; }
.linha-botoes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.linha-botoes .botao { flex: 1 1 auto; }

/* ---------- a entrada ---------- */
.entrada {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 16px calc(40px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(1200px 600px at 50% -10%, #0a4e8a 0%, var(--fundo-2) 45%, var(--fundo) 100%);
}
.entrada .marca { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.entrada .marca img { height: 44px; width: auto; background: #fff; border-radius: 12px; padding: 6px 10px; }
.entrada .marca span { font-family: Fredoka, sans-serif; font-weight: 700; font-size: 1.7rem; color: var(--ambar); }
.passo { width: 100%; max-width: 760px; text-align: center; }
.passo > h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin-bottom: .6em; }
.passo > p { color: var(--texto-2); margin: -.4em 0 1.2em; }
.perfis { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin-bottom: 26px; }
.perfis form { margin: 0; }
.perfil-grande { background: none; border: 0; padding: 6px; width: 132px; display: grid; gap: 8px; justify-items: center; border-radius: 22px; transition: transform .14s; }
.perfil-grande:hover { transform: scale(1.06); }
.perfil-grande img, .perfil-grande .mais {
  width: 116px; height: 116px; border-radius: 28px; object-fit: cover; background: var(--painel); border: 4px solid transparent; transition: border-color .14s;
}
.perfil-grande:hover img, .perfil-grande:hover .mais { border-color: var(--ambar); }
.perfil-grande .mais { display: grid; place-items: center; font-size: 3rem; color: var(--texto-2); border: 4px dashed var(--linha); }
.perfil-grande b { font-family: Fredoka, sans-serif; font-weight: 600; font-size: 1.15rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perfil-grande small { color: var(--texto-2); font-size: .8rem; }
.perfil-grande.apagado { opacity: .5; }
.estreito { max-width: 400px; margin: 0 auto; text-align: left; }
.quem { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.quem img { width: 62px; height: 62px; border-radius: 18px; border: 3px solid var(--ambar); object-fit: cover; }
.quem b { font-family: Fredoka, sans-serif; font-size: 1.5rem; font-weight: 600; }
.casas { display: flex; justify-content: center; gap: 12px; margin: 6px 0 18px; }
.casas span { width: 66px; height: 66px; border-radius: 18px; border: 3px dashed var(--linha); background: rgba(255, 255, 255, .05); display: grid; place-items: center; overflow: hidden; }
.casas span.cheia { border-style: solid; border-color: var(--ambar); }
.casas span.opcional { opacity: .55; }
.casas img { width: 100%; height: 100%; object-fit: cover; }
.figuras { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; max-width: 640px; margin: 0 auto 20px; }
@media (max-width: 620px) { .figuras { grid-template-columns: repeat(4, 1fr); } .casas span { width: 56px; height: 56px; } }
@media (max-width: 380px) { .figuras { grid-template-columns: repeat(3, 1fr); } }
.figura { background: var(--painel); border: 3px solid transparent; border-radius: 20px; padding: 6px 6px 4px; display: grid; gap: 2px; justify-items: center; transition: transform .1s, border-color .1s; }
.figura:hover { border-color: var(--linha); }
.figura:active { transform: scale(.92); border-color: var(--ambar); }
.figura img { width: 100%; aspect-ratio: 1; border-radius: 14px; object-fit: cover; }
.figura span { font-size: .74rem; font-weight: 800; color: var(--texto-2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figura { min-width: 0; }
.acoes { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; align-items: center; }
.rodape-entrada { margin-top: 28px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.criar-conta { max-width: 400px; margin: 30px auto 0; padding-top: 22px; border-top: 1px solid var(--linha); display: grid; gap: 10px; justify-items: center; }
.criar-conta p { margin: 0; color: var(--texto-2); }
.criar-conta .botao { width: 100%; }
.criar-conta small { color: var(--texto-2); font-size: .85rem; }

/* ---------- jogar ---------- */
body.jogando { background: #011426; }
.barra-jogo {
  display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 clamp(10px, 2vw, 24px);
  padding-top: env(safe-area-inset-top, 0px); background: var(--fundo); border-bottom: 3px solid var(--cor);
}
.barra-jogo h1 { font-size: clamp(1rem, 2.4vw, 1.3rem); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-jogo img.eu { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--cor); object-fit: cover; }
.palco { max-width: 1320px; margin: 0 auto; }
.palco iframe { display: block; width: 100%; border: 0; background: #fff; }
.recado {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 30px); z-index: 50;
  max-width: calc(100vw - 32px); padding: 14px 22px; border-radius: 999px; background: var(--verde); color: #fff;
  font-family: Fredoka, sans-serif; font-weight: 600; font-size: 1.1rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
.recado.aparece { opacity: 1; transform: translate(-50%, 0); }
.recado.alerta { background: var(--ambar); color: #1b1300; }

/* ---------- aviso (peça a um adulto) ---------- */
.aviso-pagina { min-height: 100dvh; display: grid; place-items: center; padding: 24px; text-align: center; }
.aviso-pagina .caixa-aviso { max-width: 460px; }
.aviso-pagina .emoji { font-size: 5rem; line-height: 1; margin-bottom: 12px; }
.aviso-pagina h1 { font-size: 2rem; margin-bottom: .4em; }
.aviso-pagina p { color: var(--texto-2); font-size: 1.15rem; margin: 0 0 1.4em; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .cartao:hover, .cartao:focus-visible, .perfil-grande:hover { transform: none; }
}
