#magicToggle {
    position: fixed;
    bottom: 0;
    left: 80px;
    padding: 5px 8px;
    font-size: 10px;
    background: rgba(255,255,255,0.35);
    color: #000;
    border: 1px solid rgba(0,0,0,0.3);
    border-radius: 6px;
    cursor: pointer;
    z-index: 10000;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#magicContainer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 999;
}

.firefly {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: float 5s infinite ease-in-out;
    filter: drop-shadow(0 0 4px currentColor);
}

.firefly.hint {
    animation: hintFloat 2s ease-out forwards;
}

@keyframes float {
    0%   { opacity: 0; transform: translate(0,0); }
    10%  { opacity: 1; }
    50%  { opacity: 0.7; transform: translate(-15px,10px); }
    70%  { opacity: 0.4; transform: translate(-30px,-10px); }
    100% { opacity: 0; transform: translate(0,0); }
}

@keyframes hintFloat {
    0%   { opacity: 0; transform: translateY(8px) scale(0.8); }
    30%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-16px) scale(1); }
}

/* Animazioni pulsante */

@keyframes attentionPulse {
    0%   { box-shadow: 0 0 0 rgba(255,255,255,0); }
    50%  { box-shadow: 0 0 10px rgba(255,255,255,0.8); }
    100% { box-shadow: 0 0 0 rgba(255,255,255,0); }
}

#magicToggle.attention {
    animation: attentionPulse 0.5s ease-in-out;
}

@keyframes idleGlow {
    from { box-shadow: 0 0 0 rgba(255,255,255,0.4); }
    to   { box-shadow: 0 0 8px rgba(255,255,255,0.6); }
}

@keyframes idleGlowFade {
    from { box-shadow: 0 0 8px rgba(255,255,255,0.6); }
    to   { box-shadow: 0 0 0 rgba(255,255,255,0); }
}

#magicToggle.idle {
    animation: idleGlow 0.5s ease-out forwards;
}

#magicToggle.idle.fadeout {
    animation: idleGlowFade 0.5s ease-in forwards;
}
