/* =========================================================
   v9.20 — CURSEUR CONTEXTUEL FLUIDE
   - aucun texte, aucun carré
   - drag : geste horizontal minimaliste
   - étoile/lien : pointeur lumineux
   - aucun curseur système superposé
========================================================= */
@media (hover:hover) and (pointer:fine){
  html.lua-cursor-enabled,
  html.lua-cursor-enabled body,
  html.lua-cursor-enabled body *,
  html.lua-cursor-enabled body *::before,
  html.lua-cursor-enabled body *::after{
    cursor:none !important;
  }

  .lua-cursor-dot{display:none !important}

  .lua-cursor-ring{
    position:fixed;
    left:0;
    top:0;
    z-index:2147483647;
    width:28px;
    height:28px;
    margin:-14px 0 0 -14px;
    pointer-events:none !important;
    opacity:0;
    transform:translate3d(-100px,-100px,0);
    transform-origin:center;
    will-change:transform,opacity;
    filter:drop-shadow(0 0 8px var(--lua-scrollbar-glow,rgba(168,121,234,.42)));
    transition:opacity .16s ease,filter .28s ease,width .34s cubic-bezier(.16,1,.3,1),height .34s cubic-bezier(.16,1,.3,1),margin .34s cubic-bezier(.16,1,.3,1);
    contain:layout style paint;
  }

  html.lua-cursor-visible .lua-cursor-ring{opacity:1}

  .lua-cursor-core,
  .lua-cursor-ring::before,
  .lua-cursor-ring::after{
    content:"";
    position:absolute;
    left:50%;
    top:50%;
    display:block;
    box-sizing:border-box;
    pointer-events:none !important;
  }

  /* Neutre : éclat très discret */
  .lua-cursor-core{
    width:6px;
    height:6px;
    margin:-3px 0 0 -3px;
    border-radius:50%;
    border:1px solid color-mix(in srgb,var(--lua-scrollbar-soft,#eadcff) 88%,transparent);
    background:color-mix(in srgb,var(--lua-scrollbar-accent,#a879ea) 36%,transparent);
    box-shadow:0 0 9px var(--lua-scrollbar-glow,rgba(168,121,234,.42));
    transition:all .3s cubic-bezier(.16,1,.3,1);
  }

  .lua-cursor-ring::before,
  .lua-cursor-ring::after{
    opacity:0;
    transition:opacity .2s ease,transform .32s cubic-bezier(.16,1,.3,1),width .32s cubic-bezier(.16,1,.3,1);
  }

  /* DRAG : trait central + deux éclats qui glissent latéralement */
  html.lua-cursor-drag .lua-cursor-ring{
    width:46px;
    height:22px;
    margin:-11px 0 0 -23px;
  }

  html.lua-cursor-drag .lua-cursor-core{
    width:17px;
    height:2px;
    margin:-1px 0 0 -8.5px;
    border:0;
    border-radius:999px;
    background:linear-gradient(90deg,transparent,rgba(244,240,255,.94),transparent);
    box-shadow:0 0 7px rgba(244,240,255,.34);
    opacity:.82;
  }

  html.lua-cursor-drag .lua-cursor-ring::before,
  html.lua-cursor-drag .lua-cursor-ring::after{
    width:5px;
    height:5px;
    margin:-2.5px 0 0 -2.5px;
    opacity:.95;
    border:1px solid var(--lua-scrollbar-soft,#eadcff);
    background:color-mix(in srgb,var(--lua-scrollbar-accent,#a879ea) 34%,transparent);
    transform:rotate(45deg);
    box-shadow:0 0 8px var(--lua-scrollbar-glow,rgba(168,121,234,.42));
  }

  html.lua-cursor-drag .lua-cursor-ring::before{
    animation:luaDragGlideLeft 1.7s cubic-bezier(.45,0,.2,1) infinite;
  }
  html.lua-cursor-drag .lua-cursor-ring::after{
    animation:luaDragGlideRight 1.7s cubic-bezier(.45,0,.2,1) infinite;
  }

  html.lua-cursor-drag.lua-cursor-down .lua-cursor-ring::before{
    animation:none;
    transform:translateX(-9px) rotate(45deg) scale(.72);
  }
  html.lua-cursor-drag.lua-cursor-down .lua-cursor-ring::after{
    animation:none;
    transform:translateX(9px) rotate(45deg) scale(.72);
  }
  html.lua-cursor-drag.lua-cursor-down .lua-cursor-core{
    width:23px;
    margin-left:-11.5px;
    background:linear-gradient(90deg,transparent,rgba(244,240,255,.94),transparent);
  }

  /* CLICK / ÉTOILE : pointeur fin, net et lumineux */
  html.lua-cursor-click .lua-cursor-ring,
  html.lua-cursor-star .lua-cursor-ring{
    width:26px;
    height:26px;
    margin:-5px 0 0 -5px;
    filter:drop-shadow(0 0 10px var(--lua-scrollbar-glow,rgba(168,121,234,.58)));
  }

  html.lua-cursor-click .lua-cursor-core,
  html.lua-cursor-star .lua-cursor-core{
    width:15px;
    height:20px;
    margin:-2px 0 0 -2px;
    transform:rotate(-11deg);
    border:0;
    border-radius:0;
    background:linear-gradient(145deg,var(--lua-scrollbar-soft,#f2e9ff),var(--lua-scrollbar-accent,#a879ea));
    clip-path:polygon(0 0,100% 70%,59% 72%,43% 100%);
    box-shadow:none;
    opacity:1;
  }

  html.lua-cursor-click .lua-cursor-ring::before,
  html.lua-cursor-star .lua-cursor-ring::before,
  html.lua-cursor-click .lua-cursor-ring::after,
  html.lua-cursor-star .lua-cursor-ring::after{display:none !important}

  html.lua-cursor-star .lua-cursor-core{
    animation:luaStarPointerPulse 1.6s ease-in-out infinite;
  }

  html.lua-cursor-click.lua-cursor-down .lua-cursor-core,
  html.lua-cursor-star.lua-cursor-down .lua-cursor-core{
    animation:none;
    transform:rotate(-11deg) scale(.8);
  }

  /* Champs de saisie */
  html.lua-cursor-text .lua-cursor-ring{
    width:3px;
    height:28px;
    margin:-14px 0 0 -1.5px;
  }
  html.lua-cursor-text .lua-cursor-core{
    width:2px;
    height:26px;
    margin:-13px 0 0 -1px;
    transform:none;
    border:0;
    border-radius:2px;
    background:var(--lua-scrollbar-soft,#eadcff);
  }
  html.lua-cursor-text .lua-cursor-ring::before,
  html.lua-cursor-text .lua-cursor-ring::after{display:none}

  @keyframes luaDragGlideLeft{
    0%,100%{transform:translateX(-8px) rotate(45deg);opacity:.4}
    50%{transform:translateX(-18px) rotate(45deg);opacity:1}
  }
  @keyframes luaDragGlideRight{
    0%,100%{transform:translateX(8px) rotate(45deg);opacity:.4}
    50%{transform:translateX(18px) rotate(45deg);opacity:1}
  }
  @keyframes luaStarPointerPulse{
    0%,100%{filter:brightness(1);transform:rotate(-11deg) scale(1)}
    50%{filter:brightness(1.18);transform:rotate(-11deg) scale(1.06)}
  }
}

@media (prefers-reduced-motion:reduce){
  .lua-cursor-ring,
  .lua-cursor-core,
  .lua-cursor-ring::before,
  .lua-cursor-ring::after{
    transition:none !important;
    animation:none !important;
  }
}

/* =========================================================
   v9.21 — neutralisation des anciens cursor:pointer !important
   Le bouton modal « Voir le roman » avait une règle historique
   plus spécifique qui réactivait le curseur système.
========================================================= */
@media (hover:hover) and (pointer:fine){
  html.lua-cursor-enabled body.is-portal-open:not(.is-book-page) .content-panel.is-visible .book-open,
  html.lua-cursor-enabled body .book-open,
  html.lua-cursor-enabled body .book-link-page,
  html.lua-cursor-enabled body a,
  html.lua-cursor-enabled body button,
  html.lua-cursor-enabled body [role="button"],
  html.lua-cursor-enabled body [data-book-id],
  html.lua-cursor-enabled body [data-book]{
    cursor:none !important;
  }

  /* Un seul composant de curseur peut être visible. */
  body > .lua-cursor-ring:not([data-lua-cursor="v921"]),
  body > .lua-cursor-dot{
    display:none !important;
  }
}


/* v9.24 — le mode drag ne doit jamais rester actif sur une page roman */
@media (hover:hover) and (pointer:fine){
  html.lua-cursor-enabled body.is-book-page ~ .lua-cursor-ring,
  html.lua-cursor-enabled body.is-page-transition ~ .lua-cursor-ring{
    animation:none !important;
  }
}
