/* ============================================================
   O Mundo da Heloísa — Edição Castelo Encantado (Tablet Kids UI)
   Design tátil 3D, acolhedor, colorido, legível e 100% responsivo
   ============================================================ */

@font-face {
  font-family: 'Fredoka';
  src: url('fontes/Fredoka.ttf') format('truetype');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ceu-topo: #FFE8F5;
  --ceu-meio: #F3E8FF;
  --ceu-base: #E0F2FE;
  --rosa-real: #EC4899;
  --rosa-escuro: #BE185D;
  --rosa-claro: #FCE7F3;
  --lilas-real: #8B5CF6;
  --lilas-escuro: #6D28D9;
  --ouro: #F59E0B;
  --ouro-claro: #FEF3C7;
  --ouro-borda: #D97706;
  --verde-magico: #10B981;
  --verde-escuro: #047857;
  --azul-ceu: #3B82F6;
  --azul-escuro: #1D4ED8;
  --texto-principal: #3B1D54;
  --texto-suave: #6B4C84;
  --cartao-bg: rgba(255, 255, 255, 0.92);
  --sombra-cartao: 0 12px 28px rgba(109, 40, 217, 0.12), 0 4px 0 rgba(236, 72, 153, 0.18);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Fredoka', 'Segoe UI', Verdana, sans-serif;
  background: linear-gradient(165deg, var(--ceu-topo) 0%, var(--ceu-meio) 52%, var(--ceu-base) 100%);
  background-attachment: fixed;
  color: var(--texto-principal);
  touch-action: manipulation;
  overflow: hidden;
  user-select: none;
  position: relative;
}

/* Nuvens e estrelinhas decorativas de fundo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 18%),
    radial-gradient(circle at 88% 15%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 20%),
    radial-gradient(circle at 82% 85%, rgba(254, 240, 138, 0.45) 0%, rgba(254, 240, 138, 0) 22%),
    radial-gradient(circle at 15% 82%, rgba(251, 207, 232, 0.5) 0%, rgba(251, 207, 232, 0) 22%);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  color: inherit;
  background: none;
}

/* ---------- Cabeçalho do Castelo ---------- */

#cabecalho {
  position: relative;
  z-index: 10;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 4px solid #F9A8D4;
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.12);
}

#titulo-tela {
  flex: 1;
  margin: 0;
  font-size: clamp(1.3rem, 3.2vw, 1.85rem);
  color: #9D174D;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cabecalho-acoes {
  display: flex;
  align-items: center;
  gap: 12px;
}

#pontuacao-estrelas {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  color: #92400E;
  background: linear-gradient(180deg, #FEF08A 0%, #FDE047 100%);
  border: 3px solid #F59E0B;
  border-radius: 999px;
  padding: 7px 18px;
  box-shadow: 0 4px 0 #D97706, 0 6px 14px rgba(245, 158, 11, 0.28);
  cursor: pointer;
  transition: transform 0.15s ease;
}
#pontuacao-estrelas:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #D97706;
}

.botao-redondo {
  width: 54px;
  height: 54px;
  font-size: 1.65rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #EC4899 0%, #DB2777 100%);
  color: #FFFFFF;
  border: 3px solid #FBCFE8;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0 #9D174D, 0 8px 16px rgba(219, 39, 119, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.botao-redondo:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #9D174D;
}

.botao-som-topo {
  width: 48px;
  height: 48px;
  font-size: 1.35rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #EDE9FE 0%, #DDD6FE 100%);
  border: 2px solid #C4B5FD;
  box-shadow: 0 4px 0 #8B5CF6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
}
.botao-som-topo:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #8B5CF6;
}

/* ---------- Área Principal ---------- */

main {
  position: relative;
  z-index: 1;
  height: calc(100dvh - 76px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 22px 32px;
}

.centro {
  max-width: 1120px;
  margin: 0 auto;
  animation: entrar-tela 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes entrar-tela {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Saudação da Princesa Heloísa ---------- */

.saudacao {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #FFFFFF 0%, #FDF2F8 60%, #F5F3FF 100%);
  border-radius: 30px;
  box-shadow: 0 10px 26px rgba(236, 72, 153, 0.16), 0 5px 0 #F9A8D4;
  border: 3px solid #F472B6;
  padding: 14px 26px;
  margin: 0 auto 16px;
  max-width: 820px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.saudacao:active {
  transform: scale(0.98);
}

.saudacao-foto {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 4px solid #F59E0B;
  background: #FCE7F3;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
  flex: none;
  animation: flutuar 3.8s ease-in-out infinite;
}

.saudacao-conteudo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.saudacao-texto {
  font-size: clamp(1.2rem, 2.8vw, 1.65rem);
  font-weight: 700;
  color: #9D174D;
  line-height: 1.2;
}

.saudacao-sub {
  font-size: clamp(0.92rem, 2vw, 1.08rem);
  color: #7E22CE;
  font-weight: 600;
}

/* ---------- Grade de Jogos (Portais Mágicos) ---------- */

.inicio {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  padding: 6px 4px;
}

@media (max-width: 1020px) {
  .inicio {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cartao-popup {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 164px;
  padding: 14px 10px 12px;
  border-radius: 28px;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--cor-clara, #FDF2F8) 100%);
  border: 4px solid var(--cor-cartao, #EC4899);
  box-shadow: 0 8px 0 var(--cor-sombra, #BE185D), 0 14px 26px rgba(59, 29, 84, 0.12);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease;
  position: relative;
  overflow: hidden;
}

.cartao-popup:hover {
  transform: translateY(-4px);
}

.cartao-popup:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--cor-sombra, #BE185D), 0 6px 12px rgba(59, 29, 84, 0.1);
}

.cartao-popup .badge-estrela {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #FEF3C7;
  border: 2px solid #F59E0B;
  color: #92400E;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.cartao-popup .icone-wrapper {
  width: 82px;
  height: 82px;
  border-radius: 24px;
  background: var(--cor-icone-bg, rgba(236, 72, 153, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: flutuar 3.5s ease-in-out infinite;
}

.cartao-popup img.emoji {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.12));
  pointer-events: none;
}

.cartao-popup span.emoji {
  font-size: 3.4rem;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.12));
  pointer-events: none;
}

.cartao-popup .titulo-cartao {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--texto-principal);
  text-align: center;
  line-height: 1.15;
}

.cartao-popup .sub-cartao {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--texto-suave);
  text-align: center;
  margin-top: -4px;
}

@keyframes flutuar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ---------- Botão pequeno (Painel dos Pais) ---------- */
.botao-pequeno {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 26px auto 8px;
  padding: 12px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 2px solid #D8B4FE;
  color: #6B21A8;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 0 #C084FC;
  transition: all 0.15s ease;
}
.botao-pequeno:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #C084FC;
}

/* ---------- Cartões e Componentes Gerais dos Jogos ---------- */

.cartao {
  background: var(--cartao-bg);
  border-radius: 30px;
  box-shadow: var(--sombra-cartao);
  border: 3px solid #F9A8D4;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.linha-botoes {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.tela-centralizada {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 56vh;
}

.instrucao {
  text-align: center;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 700;
  color: #831843;
  margin: 10px 0 16px;
}

h2.subtitulo {
  text-align: center;
  margin: 8px 0 20px;
  font-size: clamp(1.45rem, 3.6vw, 2.1rem);
  color: #9D174D;
  font-weight: 700;
}

/* Botões de Ação (Voltar, Ouvir, Menu) */
.botao-acao {
  background: linear-gradient(180deg, #EC4899 0%, #DB2777 100%);
  color: #FFFFFF;
  font-size: clamp(1.05rem, 2.4vw, 1.28rem);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.22), 0 8px 16px rgba(0, 0, 0, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.botao-acao:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
}

/* Botão grande de submenu (dentro de Letras, Sílabas, Números, Memória) */
.botao-jogo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 210px;
  min-height: 170px;
  padding: 22px 26px;
  border-radius: 28px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FDF2F8 100%);
  border: 4px solid var(--cor-do-jogo, #EC4899);
  box-shadow: 0 8px 0 var(--cor-do-jogo, #EC4899), 0 14px 24px rgba(0, 0, 0, 0.1);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--texto-principal);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.botao-jogo .emoji {
  font-size: 3.6rem;
  line-height: 1;
}
.botao-jogo:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--cor-do-jogo, #EC4899);
}

/* ---------- Opções de Resposta (Múltipla Escolha) ---------- */
.opcoes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.opcao {
  min-height: 126px;
  padding: 16px 24px;
  border-radius: 26px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F3FF 100%);
  border: 4px solid #C084FC;
  box-shadow: 0 7px 0 #9333EA, 0 10px 20px rgba(147, 51, 234, 0.14);
  font-size: clamp(2.2rem, 5.5vw, 3.2rem);
  font-weight: 700;
  color: var(--texto-principal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.opcao:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #9333EA;
}
.opcao.acertou {
  border-color: #10B981;
  background: linear-gradient(180deg, #D1FAE5 0%, #A7F3D0 100%);
  box-shadow: 0 7px 0 #059669;
  color: #065F46;
  animation: pular 0.5s ease;
}

.opcao-rotulo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--texto-suave);
}

.errado {
  animation: tremer 0.4s ease;
  border-color: #F43F5E !important;
}

@keyframes tremer {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
}

@keyframes pular {
  0% { transform: scale(1); }
  45% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.pulo {
  animation: pular 0.6s ease;
}

/* ---------- Jogo: LETRAS ---------- */
.grade-letras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
}

.celula-letra {
  aspect-ratio: 1;
  border-radius: 22px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FCE7F3 100%);
  border: 3px solid #F472B6;
  box-shadow: 0 6px 0 #DB2777, 0 8px 16px rgba(219, 39, 119, 0.14);
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  font-weight: 700;
  color: #9D174D;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.12s ease;
}
.celula-letra .mini-emoji {
  font-size: 1.25rem;
  line-height: 1;
}
.celula-letra:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #DB2777;
}

.letra-detalhe {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  max-width: 680px;
}

.letra-grande {
  font-size: clamp(4.8rem, 16vw, 8rem);
  font-weight: 700;
  color: #DB2777;
  line-height: 1;
  text-shadow: 0 4px 0 #FBCFE8;
}

.letra-emoji {
  font-size: clamp(4.2rem, 14vw, 6.8rem);
  line-height: 1.1;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.12));
  cursor: pointer;
  transition: transform 0.2s ease;
}
.letra-emoji:active {
  transform: scale(1.18) rotate(6deg);
}

.letra-palavra {
  font-size: clamp(1.6rem, 4.8vw, 2.4rem);
  font-weight: 700;
  color: var(--texto-principal);
}

/* ---------- Jogo: SÍLABAS ---------- */
.lacuna-silaba {
  min-width: 108px;
  min-height: 96px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  font-weight: 700;
  border-radius: 22px;
  border: 4px dashed #C084FC;
  background: #FAF5FF;
  color: #6B21A8;
  transition: all 0.2s ease;
}
.lacuna-silaba.destino {
  border-color: #F59E0B;
  border-style: solid;
  background: #FEF3C7;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
  animation: pulsar-leve 1.4s ease-in-out infinite;
}
.lacuna-silaba.cheia {
  border-style: solid;
  border-color: #10B981;
  background: #D1FAE5;
  color: #065F46;
  box-shadow: 0 5px 0 #059669;
  animation: pular 0.35s ease;
}

@keyframes pulsar-leve {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pecas-silabas {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
}

.peca-silaba {
  min-width: 112px;
  min-height: 96px;
  padding: 0 22px;
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  font-weight: 700;
  border-radius: 22px;
  background: linear-gradient(180deg, #A855F7 0%, #7E22CE 100%);
  color: #FFFFFF;
  border: 3px solid #E9D5FF;
  box-shadow: 0 7px 0 #581C87, 0 10px 20px rgba(126, 34, 206, 0.25);
  transition: transform 0.14s ease, opacity 0.2s ease;
}
.peca-silaba:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #581C87;
}
.peca-silaba.usada {
  opacity: 0.22;
  pointer-events: none;
  transform: scale(0.9);
}

/* ---------- Jogo: NÚMEROS ---------- */
.grupo-emojis {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: clamp(2.8rem, 7vw, 4.4rem);
  line-height: 1.2;
  padding: 12px 18px;
  background: #FDF4FF;
  border-radius: 24px;
  border: 3px dashed #E9D5FF;
  min-height: 100px;
}

.item-contavel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  font-size: 3.2rem;
  border-radius: 20px;
  background: #FFFFFF;
  border: 3px solid #FBCFE8;
  box-shadow: 0 4px 0 #F472B6;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
  position: relative;
}
.item-contavel.contado {
  background: #FEF3C7;
  border-color: #F59E0B;
  box-shadow: 0 4px 0 #D97706;
  transform: scale(1.08);
}
.item-contavel .numero-badge {
  position: absolute;
  bottom: -8px;
  right: -8px;
  background: #EC4899;
  color: #FFF;
  font-size: 0.95rem;
  font-weight: 700;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFF;
}

.conta {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #6D28D9;
  background: #EDE9FE;
  padding: 8px 28px;
  border-radius: 999px;
  border: 3px solid #C4B5FD;
}

/* ---------- Jogo: CORES & FORMAS ---------- */
.opcao-cor {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  border: 6px solid #FFFFFF;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22), 0 12px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}
.opcao-cor:active {
  transform: translateY(5px) scale(0.95);
}

/* ---------- Jogo: SOMBRA ---------- */
.sombra-e {
  font-size: clamp(5.5rem, 16vw, 8.5rem);
  line-height: 1.1;
  padding: 20px 36px;
  border-radius: 32px;
  background: radial-gradient(circle, #FEF3C7 0%, #FDE68A 100%);
  border: 4px solid #F59E0B;
  box-shadow: inset 0 4px 12px rgba(245, 158, 11, 0.25);
  transition: filter 0.4s ease, transform 0.4s ease;
}

.opcao-sombra {
  width: 124px;
  height: 124px;
  border-radius: 26px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F0FDF4 100%);
  border: 4px solid #6EE7B7;
  box-shadow: 0 6px 0 #10B981, 0 10px 18px rgba(16, 185, 129, 0.15);
  font-size: 3.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease;
}
.opcao-sombra:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #10B981;
}

/* ---------- Jogo: COLORIR & DESENHO ---------- */
.area-desenho {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.barra-ferramentas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  padding: 12px 16px;
  border-radius: 26px;
  border: 3px solid #F9A8D4;
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.12);
  width: 100%;
}

.ferramenta {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid #FFFFFF;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22), 0 4px 10px rgba(0, 0, 0, 0.14);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--texto-principal);
  background: #F1F5F9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.ferramenta.amplo {
  width: auto;
  height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 1rem;
  background: #FDF2F8;
  border: 2px solid #F472B6;
  color: #9D174D;
  box-shadow: 0 4px 0 #EC4899;
}
.ferramenta.selecionada {
  transform: translateY(-4px) scale(1.12);
  border-color: #F59E0B !important;
  box-shadow: 0 0 0 3px #FEF08A, 0 6px 12px rgba(0, 0, 0, 0.22);
}

.papel-colorir {
  width: 100%;
  max-width: 720px;
  background: #FFFFFF;
  border-radius: 30px;
  border: 5px solid #F472B6;
  box-shadow: 0 10px 28px rgba(236, 72, 153, 0.18);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.papel-colorir svg {
  width: 100%;
  max-height: 54vh;
  display: block;
}
.papel-colorir .regiao {
  fill: #FFFFFF;
  stroke: #3B1D54;
  stroke-width: 4.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  cursor: pointer;
  transition: fill 0.18s ease, filter 0.15s ease;
}
.papel-colorir .regiao:hover {
  filter: brightness(0.97);
}

#papel-do-desenho {
  width: 100%;
  max-width: 960px;
  height: clamp(320px, 58vh, 560px);
  background: #FFFFFF;
  border-radius: 28px;
  border: 5px solid #C084FC;
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.18);
  overflow: hidden;
  position: relative;
  touch-action: none;
}
#papel-do-desenho canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ---------- Jogo: MEMÓRIA (Cartas com Giro 3D) ---------- */
.grade-memoria {
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 135px));
  gap: 16px;
  justify-content: center;
  margin: 14px auto;
  max-width: 640px;
}

.carta-memoria {
  aspect-ratio: 1;
  border-radius: 24px;
  position: relative;
  background: linear-gradient(145deg, #EC4899 0%, #8B5CF6 100%);
  border: 4px solid #FBCFE8;
  box-shadow: 0 7px 0 #6D28D9, 0 10px 20px rgba(109, 40, 217, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.carta-memoria .frente {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  display: block;
}

.carta-memoria .verso {
  font-size: clamp(2.6rem, 6vw, 3.8rem);
  display: none;
}

.carta-memoria.virada {
  background: #FFFFFF;
  border-color: #F59E0B;
  box-shadow: 0 7px 0 #D97706, 0 10px 20px rgba(245, 158, 11, 0.2);
  transform: scale(1.03);
}
.carta-memoria.virada .frente {
  display: none;
}
.carta-memoria.virada .verso {
  display: block;
  animation: pular 0.3s ease;
}

.carta-memoria.acertada {
  background: linear-gradient(180deg, #FEF9C3 0%, #D1FAE5 100%);
  border-color: #10B981;
  box-shadow: 0 5px 0 #059669;
}

/* ---------- Jogo: MÚSICA (Xilofone Mágico) ---------- */
.xilofone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 32px;
  border: 4px solid #F9A8D4;
  box-shadow: var(--sombra-cartao);
  margin: 18px auto;
  max-width: 880px;
  overflow-x: auto;
}

.tecla {
  flex: 1;
  min-width: 64px;
  max-width: 86px;
  height: var(--altura-tecla, 210px);
  border-radius: 20px;
  color: #FFFFFF;
  font-size: 1.25rem;
  font-weight: 700;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.25), 0 10px 18px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 6px;
  position: relative;
  transition: transform 0.1s ease, filter 0.1s ease, box-shadow 0.1s ease;
}
.tecla::before,
.tecla::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #FEF08A 0%, #D97706 100%);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.8), 0 1px 2px rgba(0,0,0,0.3);
}
.tecla:active,
.tecla.acendida {
  transform: translateY(6px) scale(0.97);
  filter: brightness(1.22);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 0 24px var(--cor-tecla, #F59E0B);
}
.tecla.esperando-toque {
  animation: piscar-tecla 0.8s ease-in-out infinite;
  border-color: #FEF08A;
}

@keyframes piscar-tecla {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 0 rgba(0,0,0,0.25), 0 0 0 4px #FEF08A; }
  50% { transform: scale(1.06); box-shadow: 0 8px 0 rgba(0,0,0,0.25), 0 0 22px 8px #F59E0B; }
}

/* ---------- Jogo Novo: BALÕES MÁGICOS ---------- */
.palco-baloes {
  position: relative;
  width: 100%;
  max-width: 920px;
  height: clamp(340px, 60vh, 520px);
  margin: 0 auto;
  background: linear-gradient(180deg, #BAE6FD 0%, #E0F2FE 65%, #DCFCE7 100%);
  border-radius: 32px;
  border: 5px solid #38BDF8;
  box-shadow: var(--sombra-cartao);
  overflow: hidden;
}

.balao-item {
  position: absolute;
  width: 96px;
  height: 116px;
  border-radius: 50% 50% 48% 48%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  box-shadow: inset -10px -10px 20px rgba(0,0,0,0.18), inset 10px 10px 18px rgba(255,255,255,0.45), 0 8px 16px rgba(0,0,0,0.12);
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease;
}
.balao-item::after {
  content: "";
  position: absolute;
  bottom: -24px;
  left: 50%;
  width: 2px;
  height: 24px;
  background: rgba(59, 29, 84, 0.45);
}
.balao-item:active {
  transform: scale(1.2);
}

/* ---------- Jogo Novo: CASTELO DE ADESIVOS ---------- */
.cenario-castelo {
  position: relative;
  width: 100%;
  max-width: 920px;
  height: clamp(320px, 54vh, 480px);
  margin: 0 auto;
  background: linear-gradient(180deg, #FCE7F3 0%, #E0F2FE 62%, #86EFAC 62%, #4ADE80 100%);
  border-radius: 32px;
  border: 5px solid #F472B6;
  box-shadow: var(--sombra-cartao);
  overflow: hidden;
}

.adesivo-no-cenario {
  position: absolute;
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  cursor: grab;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.18));
  transition: transform 0.15s ease;
  touch-action: none;
}
.adesivo-no-cenario:active {
  transform: scale(1.22);
  cursor: grabbing;
}

.estante-adesivos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 26px;
  border: 3px solid #F9A8D4;
  margin-top: 14px;
}

.botao-adesivo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: #FDF2F8;
  border: 3px solid #F472B6;
  box-shadow: 0 4px 0 #DB2777;
  font-size: 2.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.botao-adesivo.bloqueado {
  opacity: 0.45;
  filter: grayscale(0.8);
  border-color: #CBD5E1;
  box-shadow: 0 4px 0 #94A3B8;
}
.botao-adesivo .custo-estrela {
  font-size: 0.72rem;
  font-weight: 700;
  background: #FEF3C7;
  color: #92400E;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid #F59E0B;
  margin-top: -2px;
}

/* ---------- Painel dos Pais ---------- */
.linha-painel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 2px dashed #FBCFE8;
  font-size: 1.15rem;
}
.linha-painel:last-child {
  border-bottom: none;
}

/* ---------- Confete ---------- */
#confete {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ---------- Responsividade Mobile / Tablet Retrato ---------- */
@media (max-width: 680px) {
  #cabecalho {
    height: 66px;
    padding: 0 14px;
  }
  main {
    height: calc(100dvh - 66px);
    padding: 14px 12px 26px;
  }
  .inicio {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .cartao-popup {
    min-height: 158px;
    padding: 14px 10px;
  }
  .saudacao {
    padding: 12px 16px;
    gap: 14px;
  }
  .saudacao-foto {
    width: 66px;
    height: 66px;
  }
  .grade-memoria {
    grid-template-columns: repeat(4, minmax(66px, 1fr));
    gap: 10px;
  }
}
