/* ==========================================================================
   KIBO DOCES & SABORES - MOTOR DE ANIMACOES (CSS3)
   Pinos, Marcador Kibo Aqui, Dicas de Jogo e Elogios
   ========================================================================== */

/* Pulso do Pino do Nivel Actual */
@keyframes pinPulse {
    0% { transform: scale(1); box-shadow: 0 6px 0 #1B5E20, 0 8px 16px rgba(76, 175, 80, 0.4); }
    50% { transform: scale(1.08); box-shadow: 0 8px 0 #1B5E20, 0 14px 26px rgba(76, 175, 80, 0.6); }
    100% { transform: scale(1); box-shadow: 0 6px 0 #1B5E20, 0 8px 16px rgba(76, 175, 80, 0.4); }
}

/* Animacao do Marcador Kibo Aqui */
@keyframes markerBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Pulso da Dica (Hint) apos inactividade */
@keyframes hintPulse {
    0% { transform: scale(1); box-shadow: 0 0 4px #29B6F6; }
    50% { transform: scale(1.12); box-shadow: 0 0 16px #0288D1, 0 0 24px #29B6F6; }
    100% { transform: scale(1); box-shadow: 0 0 4px #29B6F6; }
}

/* Eliminacao de Peca */
@keyframes tileClear {
    0% { transform: scale(1); opacity: 1; filter: brightness(1); }
    50% { transform: scale(1.28); opacity: 0.8; filter: brightness(1.6); }
    100% { transform: scale(0); opacity: 0; filter: brightness(2); }
}

.tile-clearing {
    animation: tileClear 0.2s ease-out forwards;
    z-index: 6;
}

/* Queda por Gravidade / Spawn */
@keyframes tileSpawn {
    0% { transform: translateY(-24px) scale(0.6); opacity: 0; }
    70% { transform: translateY(3px) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.tile-spawning {
    animation: tileSpawn 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Brilho de Doce Listrado */
@keyframes stripeGlowH {
    0% { opacity: 0.4; transform: scaleX(0.9); }
    50% { opacity: 0.95; transform: scaleX(1.1); }
    100% { opacity: 0.4; transform: scaleX(0.9); }
}

.stripe-h {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: #FFF;
    box-shadow: 0 0 10px #FFF, 0 0 16px var(--candy-gold);
    transform: translateY(-50%);
    animation: stripeGlowH 1s infinite ease-in-out;
}

.stripe-v {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: #FFF;
    box-shadow: 0 0 10px #FFF, 0 0 16px var(--candy-gold);
    transform: translateX(-50%);
    animation: stripeGlowH 1s infinite ease-in-out;
}

/* Brilho Pulsante do Pacote de Chips Explosivo */
@keyframes chipsBlastPulse {
    0% { transform: scale(0.95); box-shadow: inset 0 0 6px #F1C40F, 0 0 8px #FF7043; }
    50% { transform: scale(1.08); box-shadow: inset 0 0 14px #FFF, 0 0 16px #FF5252; }
    100% { transform: scale(0.95); box-shadow: inset 0 0 6px #F1C40F, 0 0 8px #FF7043; }
}

.chips-blast-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    border: 2px dashed #F1C40F;
    animation: chipsBlastPulse 1.2s infinite ease-in-out;
    pointer-events: none;
}

/* Brilho do Chupa-Chupa Arco-Iris */
@keyframes rainbowAura {
    0% { filter: hue-rotate(0deg) drop-shadow(0 0 6px #FF5252); }
    50% { filter: hue-rotate(180deg) drop-shadow(0 0 10px #4CAF50); }
    100% { filter: hue-rotate(360deg) drop-shadow(0 0 6px #FF5252); }
}

.rainbow-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    animation: rainbowAura 3s linear infinite;
    pointer-events: none;
}

/* Brilho do Super Booster */
@keyframes sponsorBoosterPulse {
    0% { transform: scale(1); box-shadow: 0 0 8px rgba(255, 179, 0, 0.6); }
    50% { transform: scale(1.06); box-shadow: 0 0 18px rgba(255, 82, 82, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 8px rgba(255, 179, 0, 0.6); }
}

.sponsor-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    border: 2px solid var(--candy-gold);
    animation: sponsorBoosterPulse 1.4s infinite ease-in-out;
    pointer-events: none;
}

/* Toast de Elogio */
@keyframes toastPop {
    0% { transform: translate(-50%, 20px) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
    35% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -90px) scale(0.8); opacity: 0; }
}

/* Animacao do Banner de Missao de Soletracao */
@keyframes bannerDropIn {
    0% { transform: translate(-50%, -40px) scale(0.8); opacity: 0; }
    70% { transform: translate(-50%, 5px) scale(1.04); opacity: 1; }
    100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* Pulso dos Emblemas de Letras no Tabuleiro */
@keyframes letterBadgePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); }
    50% { transform: scale(1.18); box-shadow: 0 0 12px #26C6DA, 0 3px 8px rgba(0, 0, 0, 0.4); }
}

/* Animacao de preenchimento da letra na barra superior */
@keyframes letterFillPop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1.15); }
}

/* Squash & Stretch ao seleccionar e mover peças */
@keyframes squashStretch {
    0% { transform: scale(1, 1); }
    30% { transform: scale(1.25, 0.78); }
    60% { transform: scale(0.85, 1.22); }
    80% { transform: scale(1.08, 0.94); }
    100% { transform: scale(1, 1); }
}

.tile-squash {
    animation: squashStretch 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Brilho da trilha no mapa */
@keyframes trailGlowPulse {
    0%, 100% { filter: drop-shadow(0 0 4px #ffd700); stroke-width: 6; }
    50% { filter: drop-shadow(0 0 14px #ff9800); stroke-width: 8; }
}

.trail-glowing {
    animation: trailGlowPulse 2s ease-in-out infinite;
}

/* Explosao de confeitos e estrelas */
@keyframes confettiBurst {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--tx, 40px), var(--ty, -60px)) scale(0) rotate(360deg); opacity: 0; }
}

.candy-particle {
    position: absolute;
    pointer-events: none;
    z-index: 100;
    animation: confettiBurst 0.65s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
