/*
 * Le fantôme qui surgit au clic sur une création de la collection
 * automne-Halloween (scripts/fantome-halloween.js) : il sort de la création
 * cliquée (--depart-x, --depart-y : son centre, mesuré depuis le centre de
 * l'écran), puis fonce vers le centre en grossissant jusqu'à remplir
 * l'écran, sur un voile qui s'assombrit. La fiche s'ouvre à la fin.
 */
.fantome-surgit {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    animation: fantome-voile 1500ms ease-in both;
}

.fantome-surgit__fantome {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14rem;
    height: auto;
    margin: -7rem 0 0 -7rem;
    filter: drop-shadow(0 0 24px rgba(255, 170, 60, 0.45));
    animation: fantome-surgit 1500ms cubic-bezier(0.55, 0, 0.8, 0.4) both;
}

@keyframes fantome-voile {
    from { background: rgba(20, 8, 6, 0); }
    to { background: rgba(20, 8, 6, 0.6); }
}

/* Il sort de la création en s'élevant, se tortille, puis la ruée. */
@keyframes fantome-surgit {
    0% { opacity: 0; transform: translate(var(--depart-x, 0px), var(--depart-y, 0px)) scale(0.2); }
    25% { opacity: 1; transform: translate(var(--depart-x, 0px), calc(var(--depart-y, 0px) - 3rem)) scale(0.7) rotate(-8deg); }
    40% { transform: translate(var(--depart-x, 0px), calc(var(--depart-y, 0px) - 3.5rem)) scale(0.75) rotate(4deg); }
    85% { opacity: 1; }
    100% { opacity: 0; transform: translate(0, 0) scale(7); }
}
