/*
   Curseur personnalisé (ordinateurs avec souris)
*/

html.curseur-actif,
html.curseur-actif * {
    cursor: none !important;
}

html.curseur-actif input,
html.curseur-actif textarea,
html.curseur-actif select {
    cursor: text !important;
}

.curseur-etoile,
.curseur-point {
    position: fixed;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s;
}

.curseur-visible .curseur-etoile,
.curseur-visible .curseur-point {
    opacity: 1;
}

.curseur-etoile {
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
}

.curseur-etoile svg {
    width: 100%;
    height: 100%;
    fill: var(--accent);
    stroke: var(--encre);
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.curseur-etoile.survol svg {
    transform: scale(1.6) rotate(45deg);
}

.curseur-etoile.appui svg {
    transform: scale(0.75);
}

.curseur-etoile.texte {
    opacity: 0 !important;
}

.curseur-point {
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: var(--encre);
}

.curseur-etoile .curseur-zzz {
    position: absolute;
    left: 20px;
    top: -20px;
    font: 800 13px system-ui;
    color: var(--encre);
    opacity: 0;
    white-space: nowrap;
}

.curseur-endormi .curseur-etoile .curseur-zzz {
    opacity: 1;
    animation: zzz 2.2s ease-in-out infinite;
}

.curseur-endormi .curseur-etoile svg {
    transform: scale(0.75);
    opacity: 0.65;
}

@keyframes zzz {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    50% {
        transform: translateY(-7px);
        opacity: 1;
    }
}

html.surprise .curseur-etoile svg {
    animation: rotation-surprise 1.1s linear infinite;
}

@keyframes rotation-surprise {
    to {
        transform: rotate(360deg);
    }
}

.curseur-pilule {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9998;
    pointer-events: none;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 99px;
    background: var(--encre);
    color: var(--papier);
    display: flex;
    align-items: center;
    overflow: hidden;
    opacity: 0;
    transition:
        width 0.42s cubic-bezier(0.2, 1.1, 0.3, 1),
        height 0.3s,
        margin 0.3s,
        opacity 0.15s;
}

.curseur-pilule span {
    flex: none;
    font:
        800 13px/1 system-ui,
        sans-serif;
    white-space: nowrap;
    padding: 0 16px 0 40px;
    opacity: 0;
    transition: opacity 0.2s;
}

.curseur-pilule.actif {
    opacity: 1;
    width: var(--largeur-pilule, 130px);
    height: 32px;
    margin-top: -16px;
}

.curseur-pilule.actif span {
    opacity: 1;
    transition-delay: 0.18s;
}

.curseur-avec-pilule .curseur-point {
    opacity: 0 !important;
}

.curseur-etoile.tourne svg {
    animation: curseur-rotation 0.75s cubic-bezier(0.3, 1.2, 0.4, 1);
}

@keyframes curseur-rotation {
    from {
        transform: scale(1.6) rotate(45deg);
    }
    to {
        transform: scale(1.6) rotate(405deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .curseur-pilule {
        display: none;
    }

    .curseur-etoile.tourne svg {
        animation: none;
    }
}
