/* Festa da Turma do Gemalino — o visual próprio (prefixo fs-). O comum vem de base.css. */

/* ---------- menu ---------- */
.palco.fs-menu { display: grid; grid-template-columns: repeat(2, auto); gap: clamp(12px, 3vmin, 28px); align-content: center; justify-content: center; }
.fs-modo {
  width: clamp(170px, 30vw, 320px); height: clamp(var(--alvo), 26vh, 210px); min-height: var(--alvo);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 28px; background: var(--branco); box-shadow: var(--sombra), inset 0 -8px 0 #f8c6dc; color: var(--azul);
}
.fs-modo-icone { font-size: clamp(40px, 9vmin, 84px); line-height: 1; }
.fs-modo-nome { font-size: clamp(16px, 2.4vmin, 24px); font-weight: bold; }

/* ---------- o amigo com enfeites ---------- */
.fs-boneco-caixa { container-type: size; width: 100%; height: 100%; display: grid; place-items: center; }
.fs-boneco { position: relative; }
.fs-boneco > img { position: relative; z-index: 1; width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; }
.fs-camada { position: absolute; inset: 0; pointer-events: none; }
.fs-atras { z-index: 0; }
.fs-frente { z-index: 2; }
.fs-peca { position: absolute; transform-origin: 50% 50%; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.2)); }
.fs-peca svg { width: 100%; height: auto; display: block; }
.fs-peca.fs-chegou svg { animation: fs-chegar 0.45s ease-out; }
@keyframes fs-chegar { 0% { transform: scale(0.3); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } }
.fs-pula { animation: fs-pula 0.55s ease-out; }
@keyframes fs-pula { 40% { transform: translateY(-8%); } 70% { transform: translateY(0) scale(1.04, 0.96); } }
.fs-cocega { animation: fs-cocega 0.5s ease-in-out; }
@keyframes fs-cocega { 20% { transform: rotate(-4deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }
.fs-balanca { animation: fs-balanca 0.6s ease-in-out; }
@keyframes fs-balanca { 25% { transform: translateX(-4%); } 75% { transform: translateX(4%); } }
.fs-desfile { animation: fs-desfile 1.4s ease-in-out; }
@keyframes fs-desfile { 25% { transform: translateY(-6%) rotate(-4deg); } 50% { transform: translateY(0) rotate(0); } 75% { transform: translateY(-6%) rotate(4deg); } }
.fs-boneco-caixa.alvo { outline: 6px dashed var(--amarelo); outline-offset: 6px; border-radius: 24px; }

/* ---------- escolher o amigo ---------- */
.palco.fs-escolher { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 2vmin, 20px); align-items: center; padding: 8px; }
.fs-amigo-escolha {
  height: min(62vh, 360px); min-height: var(--alvo); min-width: var(--alvo); padding: 12px; border: 0; border-radius: 26px;
  background: var(--branco); box-shadow: var(--sombra), inset 0 -8px 0 #f8c6dc; display: grid; place-items: center; overflow: hidden;
}
.fs-amigo-escolha .fs-boneco-caixa { height: 100%; }

/* ---------- arrumar: o amigo e a cesta ---------- */
.palco.fs-arrumar, .palco.fs-tempo { align-items: stretch; gap: 10px; }
.fs-lado-boneco { flex: 1 1 55%; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 6% 4% 4%; }
.fs-lado-boneco .fs-boneco-caixa { cursor: pointer; }
.fs-cesta {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 10px; overflow-y: auto;
  background: rgba(255, 255, 255, 0.7); border-radius: 26px; box-shadow: var(--sombra);
}
.fs-pecas { display: grid; grid-template-columns: repeat(3, var(--alvo)); gap: 10px; }
.fs-item {
  width: var(--alvo); height: var(--alvo); padding: 8px; border: 0; border-radius: 20px; background: #fff;
  box-shadow: 0 3px 0 #f3b5cf; display: grid; place-items: center; position: relative;
}
.fs-item svg { width: 100%; height: 100%; }
.fs-item.arrastando { z-index: 20; box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25); }
.fs-item.fs-usando { background: #fff6c8; box-shadow: 0 0 0 4px var(--amarelo); }
.fs-item.fs-usando::after { content: "✓"; position: absolute; right: 4px; top: 0; font-size: 20px; font-weight: bold; color: #2e7d32; }
.fs-cesta-botoes { display: flex; gap: 10px; justify-content: center; margin-top: auto; }

/* ---------- roupa para o tempo ---------- */
.fs-janela { position: relative; border-radius: 26px; overflow: hidden; }
.fs-janela .fs-boneco-caixa { position: relative; z-index: 1; pointer-events: none; transition: transform 1.2s ease-in, opacity 1.2s ease-in; }
.fs-janela .fs-boneco-caixa.fs-sai { transform: translateX(110%); opacity: 0; }
.fs-ceu { position: absolute; inset: 0; overflow: hidden; border-radius: 26px; cursor: pointer; }
.fs-ceu[data-tempo="frio"] { background: linear-gradient(#b8c9dc, #eef4fb 70%, #fff 70%); }
.fs-ceu[data-tempo="chuva"] { background: linear-gradient(#7d8fa6, #b5c3d3 70%, #8fae7c 70%); }
.fs-ceu[data-tempo="sol"] { background: linear-gradient(#58b9f5, #bfe7ff 70%, #9fd98b 70%); }
.fs-floco { position: absolute; top: -6%; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; animation: fs-cair 4s linear infinite; }
.fs-gota { position: absolute; top: -10%; width: 4px; height: 22px; border-radius: 4px; background: rgba(230, 244, 255, 0.85); animation: fs-cair 1s linear infinite; }
@keyframes fs-cair { to { transform: translateY(110cqh); } }
.fs-ceu { container-type: size; }
.fs-sol {
  position: absolute; right: 8%; top: 8%; width: 22cqmin; height: 22cqmin; border-radius: 50%; background: #ffd54f;
  box-shadow: 0 0 0 12px rgba(255, 213, 79, 0.45), 0 0 0 26px rgba(255, 213, 79, 0.2); animation: fs-brilho 3s ease-in-out infinite;
}
@keyframes fs-brilho { 50% { box-shadow: 0 0 0 18px rgba(255, 213, 79, 0.5), 0 0 0 36px rgba(255, 213, 79, 0.18); } }
.fs-ceu.fs-forte .fs-floco, .fs-ceu.fs-forte .fs-gota { animation-duration: 0.6s; }
.fs-ceu.fs-forte .fs-sol { animation: fs-pula 0.6s ease-out; }
.fs-cesta-tempo .fs-pecas { grid-template-columns: repeat(2, var(--alvo)); }
.palco.fs-fim { flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.fs-turma-fim { display: flex; gap: 12px; height: min(50vh, 300px); width: 100%; justify-content: center; }
.fs-turma-fim .fs-boneco-caixa { width: 22%; }

/* ---------- casinha ---------- */
.palco.fs-casinha { align-items: stretch; gap: 10px; }
.fs-sala { position: relative; flex: 1 1 auto; min-width: 0; border-radius: 26px; overflow: hidden; container-type: size; box-shadow: var(--sombra); }
.fs-sala.alvo { outline: 6px dashed var(--amarelo); outline-offset: -6px; }
.fs-parede { position: absolute; left: 0; top: 0; width: 100%; height: 64%; border: 0; border-radius: 0; padding: 0; background: #f8bbd0; transition: background 0.4s; }
.fs-parede[data-parede="rosa"] { background: #f8bbd0; }
.fs-parede[data-parede="azul"] { background: #b3dcf7; }
.fs-parede[data-parede="amarelo"] { background: #fff1a8; }
.fs-parede[data-parede="verde"] { background: #c8ebc0; }
.fs-parede[data-parede="lilas"] { background: #dccdf5; }
.fs-parede::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8%; background: rgba(255, 255, 255, 0.55); }
.fs-janela-casa {
  position: absolute; right: 8%; top: 12%; width: 22%; height: 46%; border: 8px solid #fff; border-radius: 12px;
  background: linear-gradient(#7cc8f5, #c7ecff 70%, #9fd98b 70%);
}
.fs-janela-casa::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: #fff; }
.fs-chao { position: absolute; left: 0; bottom: 0; width: 100%; height: 36%; background: repeating-linear-gradient(90deg, #d7a86e 0 12cqw, #cc9b60 12cqw 24cqw); }
.fs-tapete {
  position: absolute; left: 4%; top: 18%; width: 42%; height: 70%; min-height: var(--alvo); border: 6px solid #fff; border-radius: 50%; padding: 0;
  background: #ff8a65; transition: background 0.3s;
}
.fs-tapete[data-tapete="listras"] { background: repeating-linear-gradient(90deg, #ff8a65 0 22px, #ffcc80 22px 44px); }
.fs-tapete[data-tapete="bolinhas"] { background: radial-gradient(circle, #fff 0 6px, transparent 7px) 0 0 / 30px 30px, #4fc3f7; }
.fs-tapete[data-tapete="estrelas"] { background: radial-gradient(circle, #ffd54f 0 5px, transparent 6px) 0 0 / 26px 26px, radial-gradient(circle, #fff 0 3px, transparent 4px) 13px 13px / 26px 26px, #7e57c2; }
.fs-mesinha {
  position: absolute; left: 50%; bottom: 6%; width: max(26cqw, calc(var(--alvo) * 2.2)); aspect-ratio: 220 / 150;
  border: 0; padding: 0; background: transparent; z-index: 1;
}
.fs-mesinha svg { width: 100%; height: 100%; display: block; }
.fs-movel {
  position: absolute; width: max(var(--alvo), 12cqw); aspect-ratio: 1; padding: 0; border: 0; background: transparent; z-index: 3;
  border-radius: 14px;
}
.fs-movel svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.18)); }
.fs-movel.arrastando { z-index: 20; }
.fs-movel .fs-luz { transition: opacity 0.3s; }
.fs-movel.fs-ligado .fs-luz { opacity: 0.9; }
.fs-movel .fs-flor { opacity: 0; transition: opacity 0.4s; }
.fs-movel.fs-florida .fs-flor { opacity: 1; }
.fs-movel .fs-desenho { display: none; }
.fs-movel[data-desenho="0"] .fs-desenho-0, .fs-movel[data-desenho="1"] .fs-desenho-1, .fs-movel[data-desenho="2"] .fs-desenho-2 { display: inline; }
.fs-item .fs-desenho-1, .fs-item .fs-desenho-2 { display: none; }
.fs-item .fs-flor { opacity: 0; }
.fs-nadando .fs-peixe { animation: fs-peixe 1.4s ease-in-out; }
@keyframes fs-peixe { 30% { transform: translateX(-46px); } 60% { transform: translateX(-46px) translateY(10px); } }
.fs-nadando .fs-bolha { animation: fs-bolha 1.4s ease-out; }
@keyframes fs-bolha { to { transform: translateY(-30px); opacity: 0; } }
.fs-tocando .fs-notas { animation: fs-notas 1.6s ease-out; }
@keyframes fs-notas { 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
.fs-pousa { animation: fs-pousa 0.4s ease-out; }
@keyframes fs-pousa { 50% { transform: scale(1.08, 0.92); } }
.fs-pedido { box-shadow: 0 0 0 5px var(--amarelo); animation: fs-chamar 1.2s ease-in-out infinite; }
@keyframes fs-chamar { 50% { box-shadow: 0 0 0 10px rgba(255, 213, 79, 0.55); } }
.fs-cesta-casa .fs-pecas { grid-template-columns: repeat(2, var(--alvo)); }

/* ---------- festa: bandeirinhas ---------- */
.palco.fs-bandeiras { flex-direction: column; align-items: center; justify-content: space-around; gap: 10px; }
.fs-varal {
  display: flex; justify-content: center; gap: clamp(2px, 1vw, 10px); padding-top: 10px; width: 100%;
  background: linear-gradient(#6d4c41, #6d4c41) top 4px left 0 / 100% 4px no-repeat;
}
.fs-bandeira { width: clamp(38px, 8vw, 80px); }
.fs-bandeira svg { width: 100%; height: auto; display: block; }
.fs-bandeira.fs-proxima { animation: fs-quica 1s ease-in-out infinite; }
@keyframes fs-quica { 50% { transform: translateY(8px); } }
.fs-escolhas { display: flex; gap: clamp(14px, 4vw, 40px); }
.fs-escolha { width: calc(var(--alvo) * 1.15); height: calc(var(--alvo) * 1.15); }

/* ---------- festa: balões ---------- */
.palco.fs-baloes { flex-direction: column; align-items: stretch; gap: 6px; }
.fs-teto { flex: 1 1 auto; display: flex; justify-content: center; align-items: flex-start; gap: 10px; min-height: calc(var(--alvo) * 1.4); position: relative; }
.fs-balao { width: calc(var(--alvo) * 1.1); height: calc(var(--alvo) * 1.7); padding: 0; border: 0; background: transparent; animation: fs-sobe 0.9s ease-out; }
.fs-balao svg { width: 100%; height: 100%; display: block; }
@keyframes fs-sobe { from { transform: translateY(60vh) scale(0.3); } }
.fs-balao.fs-voa { position: absolute; right: 10%; top: 0; animation: fs-voa 2s ease-in forwards; pointer-events: none; }
@keyframes fs-voa { from { transform: translateY(40vh) scale(0.4); } to { transform: translate(40vw, -30vh); opacity: 0; } }
.fs-chao-festa { display: flex; align-items: flex-end; justify-content: center; gap: clamp(12px, 4vw, 40px); }
.fs-tobias-bomba { height: min(30vh, 200px); }
.fs-tobias-bomba img { height: 100%; width: auto; display: block; }
.fs-pontos { display: flex; gap: 8px; align-self: center; }
.fs-ponto { width: 26px; height: 26px; border-radius: 50%; border: 4px solid var(--azul); background: #fff; }
.fs-ponto.fs-cheio { background: var(--amarelo); }
.fs-bomba { width: calc(var(--alvo) * 1.2); height: calc(var(--alvo) * 1.5); padding: 4px; border: 0; border-radius: 20px; background: rgba(255, 255, 255, 0.7); box-shadow: var(--sombra); }
.fs-bomba svg { width: 100%; height: 100%; display: block; }
.fs-bombeia { animation: fs-bombeia 0.35s ease-in-out; }
@keyframes fs-bombeia { 50% { transform: scaleY(0.88); } }

/* ---------- festa: o salão ---------- */
.palco.fs-salao { align-items: stretch; }
.fs-salao-fundo { position: relative; flex: 1; border-radius: 26px; overflow: hidden; background: #f8bbd0; box-shadow: var(--sombra); }
.fs-salao-fundo[data-parede="azul"] { background: #b3dcf7; }
.fs-salao-fundo[data-parede="amarelo"] { background: #fff1a8; }
.fs-salao-fundo[data-parede="verde"] { background: #c8ebc0; }
.fs-salao-fundo[data-parede="lilas"] { background: #dccdf5; }
.fs-salao-fundo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; background: #d7a86e; z-index: 0; }
.fs-teto-festa { position: absolute; inset: 0 0 auto 0; height: 40%; pointer-events: none; }
.fs-varal-pequeno .fs-bandeira { width: clamp(22px, 4vw, 48px); }
.fs-balao-enfeite { position: absolute; top: calc(12% + var(--n) * 6%); width: clamp(34px, 6vw, 70px); }
.fs-balao-enfeite.fs-esquerda { left: calc(3% + var(--n) * 6%); }
.fs-balao-enfeite.fs-direita { right: calc(3% + var(--n) * 6%); }
.fs-balao-enfeite svg { width: 100%; height: auto; display: block; animation: fs-quica 2.4s ease-in-out infinite; }
.fs-turma-festa { position: absolute; left: 2%; right: 2%; bottom: 4%; height: 62%; display: flex; justify-content: space-around; align-items: flex-end; z-index: 1; }
.fs-amigo-festa { width: 23%; height: 100%; min-width: var(--alvo); padding: 0; border: 0; background: transparent; }
.fs-danca { animation: fs-danca 1.6s ease-in-out; }
@keyframes fs-danca { 20% { transform: translateY(-8%) rotate(-6deg); } 40% { transform: translateY(0) rotate(0); } 60% { transform: translateY(-8%) rotate(6deg); } 80% { transform: translateY(0); } }
.fs-musica { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 2; }
.fs-salao-fundo .fs-fim-botoes { position: absolute; left: 0; right: 0; top: 30%; z-index: 5; }
.fs-salao-fundo .fs-fim-botoes[hidden] { display: none; }

/* ---------- confete ---------- */
.fs-confete {
  position: absolute; width: 10px; height: 14px; border-radius: 2px; pointer-events: none; z-index: 30;
  animation: fs-confete 1.4s ease-out forwards;
}
@keyframes fs-confete { to { transform: translate(var(--dx), calc(var(--dy) + 180px)) rotate(var(--giro)); opacity: 0; } }
.fs-fim-botoes { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* ---------- telas baixas (celular deitado) ---------- */
@media (max-height: 500px) {
  .fs-amigo-escolha { height: 72vh; }
  .fs-pecas { grid-template-columns: repeat(4, var(--alvo)); gap: 8px; }
  .fs-cesta { padding: 8px; gap: 8px; }
  .fs-cesta-tempo .fs-pecas, .fs-cesta-casa .fs-pecas { grid-template-columns: repeat(3, var(--alvo)); }
  .fs-turma-fim { height: 46vh; }
  .fs-tobias-bomba { height: 34vh; }
  .fs-teto { min-height: calc(var(--alvo) * 1.4); }
}

@media (prefers-reduced-motion: reduce) {
  .fs-floco, .fs-gota, .fs-sol, .fs-pedido, .fs-bandeira.fs-proxima, .fs-balao-enfeite svg { animation: none; }
  .fs-danca, .fs-balao, .fs-bombeia { animation: none; }
  .fs-nadando .fs-peixe, .fs-nadando .fs-bolha, .fs-pousa { animation: none; }
  .fs-pula, .fs-cocega, .fs-balanca, .fs-desfile, .fs-peca.fs-chegou svg { animation: none; }
}

/* celular deitado: festa mais baixinha */
@media (max-height: 500px) {
  .fs-balao { width: var(--alvo); height: calc(var(--alvo) * 1.1); }
  .fs-teto { min-height: calc(var(--alvo) * 1.1); }
  .fs-bomba { width: var(--alvo); height: calc(var(--alvo) * 1.15); }
  .fs-bandeira { width: clamp(30px, 6.5vw, 60px); }
  .fs-escolha { width: var(--alvo); height: var(--alvo); }
}
