/* ============================================================
   NOIR BITS — effets inspirés de React Bits, recréés en CSS/JS natif (aucune dépendance)
   Spotlight Card · Glare Hover · Star Border · Shiny Text · Blur Text · Decrypted Text
   Count Up · Click Spark · Magnet · Tilted Card · Light Rays
   ============================================================ */
@property --bits-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* Spotlight Card : lumière qui suit le pointeur (calque injecté au premier survol) */
.bits-spot { position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .45s cubic-bezier(.22,1,.36,1);
  background: radial-gradient(260px circle at var(--bx, 50%) var(--by, 50%), rgba(255,255,255,.075), transparent 70%); }
.bits-spot::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: radial-gradient(180px circle at var(--bx, 50%) var(--by, 50%), rgba(255,255,255,.55), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.bits-on > .bits-spot { opacity: 1; }

/* Glare Hover : reflet qui traverse la carte dans le sens du pointeur */
.bits-glare { position: absolute; inset: 0; z-index: 4; border-radius: inherit; pointer-events: none; overflow: hidden; }
.bits-glare::before { content: ''; position: absolute; top: -50%; bottom: -50%; width: 45%; left: -60%; transform: skewX(-18deg); opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent); }
.bits-glare.go::before { animation: bitsGlare .85s cubic-bezier(.22,1,.36,1) forwards; }
.bits-glare.go.rev::before { animation-name: bitsGlareRev; }
@keyframes bitsGlare { 0% { left: -60%; opacity: 1; } 100% { left: 120%; opacity: 1; } }
@keyframes bitsGlareRev { 0% { left: 120%; opacity: 1; } 100% { left: -60%; opacity: 1; } }

/* Star Border : une étoile de lumière fait le tour du contour */
.bits-star { position: absolute; inset: -1px; z-index: 5; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--bits-a), transparent 0 330deg, rgba(255,255,255,.0) 330deg, rgba(255,255,255,.95) 356deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: bitsStar 6s linear infinite; filter: drop-shadow(0 0 4px rgba(255,255,255,.7)); }
@keyframes bitsStar { to { --bits-a: 360deg; } }

/* Shiny Text : reflet qui passe sur le texte */
.bits-shine { background: linear-gradient(110deg, #9DA0A9 0%, #9DA0A9 42%, #FFFFFF 50%, #9DA0A9 58%, #9DA0A9 100%) 0 0 / 260% 100% !important;
  -webkit-background-clip: text !important; background-clip: text !important; -webkit-text-fill-color: transparent !important; animation: bitsShine 5.5s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes bitsShine { 0%, 30% { background-position: 100% 0; } 70%, 100% { background-position: 0% 0; } }

/* Blur Text : le titre sort du flou */
.bits-blur-in { animation: bitsBlur .9s cubic-bezier(.22,1,.36,1) both; }
@keyframes bitsBlur { from { opacity: 0; filter: blur(10px); transform: translateY(8px); } to { opacity: 1; filter: none; transform: none; } }

/* Click Spark */
.bits-sparks { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 2147483000; pointer-events: none; }
.bits-sparks i { position: absolute; left: 0; top: 0; width: 2px; height: 11px; margin: -5.5px 0 0 -1px; border-radius: 2px; background: linear-gradient(#fff, rgba(255,255,255,0)); }

/* Light Rays : rayons de lumière discrets venant du haut (pages de l'app) */
.bits-rays { position: fixed; left: 50%; top: -30vh; width: 160vmax; height: 120vh; z-index: -1; pointer-events: none; transform: translateX(-50%); transform-origin: 50% 0;
  background: repeating-conic-gradient(from 180deg at 50% 0%, rgba(255,255,255,.0) 0deg, rgba(255,255,255,.045) 2.2deg, rgba(255,255,255,0) 5deg, rgba(255,255,255,0) 9deg);
  -webkit-mask-image: radial-gradient(70% 80% at 50% 0%, #000 0%, rgba(0,0,0,.4) 45%, transparent 75%); mask-image: radial-gradient(70% 80% at 50% 0%, #000 0%, rgba(0,0,0,.4) 45%, transparent 75%);
  animation: bitsRays 22s ease-in-out infinite alternate; }
@keyframes bitsRays { from { transform: translateX(-50%) rotate(-3deg); } to { transform: translateX(-50%) rotate(3deg); } }

@media (prefers-reduced-motion: reduce) {
  .bits-star, .bits-shine, .bits-rays, .bits-blur-in { animation: none !important; }
  .bits-shine { background-position: 50% 0 !important; }
  .bits-glare { display: none; }
}

/* ============================================================
   NOIR GLOW — lueurs légères (uniquement transform / opacity animés : pas de repaint, pas de lag)
   html.fx-lite (appareil modeste) ou moins d'animations demandé : tout reste fixe
   ============================================================ */
/* Halo d'ambiance : deux grandes lueurs argentées qui dérivent lentement derrière la page */
.fx-aura { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; contain: strict; }
.fx-aura i { position: absolute; width: 90vmax; height: 90vmax; border-radius: 50%; will-change: transform; }
.fx-aura i:nth-child(1) { left: -35vmax; top: -45vmax; background: radial-gradient(closest-side, rgba(210,216,228,.13), rgba(210,216,228,.045) 45%, transparent);
  animation: fxDriftA 38s ease-in-out infinite alternate; }
.fx-aura i:nth-child(2) { right: -40vmax; bottom: -50vmax; background: radial-gradient(closest-side, rgba(255,255,255,.09), rgba(255,255,255,.03) 45%, transparent);
  animation: fxDriftB 46s ease-in-out infinite alternate; }
@keyframes fxDriftA { to { transform: translate3d(22vmax, 14vmax, 0) scale(1.12); } }
@keyframes fxDriftB { to { transform: translate3d(-18vmax, -16vmax, 0) scale(.92); } }

/* Lumière du curseur sur le fond (souris uniquement) */
.fx-cursor { position: fixed; left: 0; top: 0; width: 640px; height: 640px; margin: -320px 0 0 -320px; z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.075), rgba(255,255,255,.025) 55%, transparent); opacity: 0; transition: opacity .6s ease; will-change: transform; }
.fx-cursor.on { opacity: 1; }

/* Trait de lumière qui parcourt le bas de la barre de navigation */
.fx-navline { position: absolute; left: 24px; right: 24px; bottom: -1px; height: 1px; overflow: hidden; pointer-events: none; border-radius: 1px; }
.fx-navline::before { content: ''; position: absolute; top: 0; left: 0; width: 34%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); transform: translateX(-110%); animation: fxNavSweep 7s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes fxNavSweep { 0%, 35% { transform: translateX(-110%); } 85%, 100% { transform: translateX(310%); } }

/* Lueur au survol des boutons principaux (transition courte, seulement au survol) */
.btn-primary:hover, .nb-p:hover, .pass-btn:hover, .mp-btn-primary:hover, html body #monkyNav .mn-upgrade:hover { filter: drop-shadow(0 0 16px rgba(255,255,255,.28)) drop-shadow(0 0 2px rgba(255,255,255,.35)); }

/* Halo lumineux fixe derrière les icônes 3D */
.mk-empty img, .empty.e3 .e-3d, .mpx-3d, .ep-ic { background: radial-gradient(closest-side, rgba(255,255,255,.13), rgba(255,255,255,.035) 60%, transparent) !important; border-radius: 50%; }
.ios-ic, .mpx-title i.i3, .co-method .mi, .co-ai { box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 22px -6px rgba(255,255,255,.22); }

/* Titres : lueur douce, calculée une seule fois */
h1.bits-blur-in, .ios-title.bits-blur-in { animation-name: bitsBlurGlow; }
@keyframes bitsBlurGlow { from { opacity: 0; filter: blur(10px) drop-shadow(0 0 22px rgba(255,255,255,0)); transform: translateY(8px); } to { opacity: 1; filter: blur(0) drop-shadow(0 0 22px rgba(255,255,255,.13)); transform: none; } }
.nm-head h1, .px-head h1, .st-head h1, .wt-head h1, .lk-head h1, .ph-head h1, .lb-hero h1, .pm-hero h1, .ios-title, .ck-title h1 { filter: drop-shadow(0 0 22px rgba(255,255,255,.13)); }

html.fx-lite .fx-aura i, html.fx-lite .fx-navline::before { animation: none; }
html.fx-lite .fx-navline { display: none; }
@media (prefers-reduced-motion: reduce) { .fx-aura i, .fx-navline::before { animation: none !important; } .fx-navline, .fx-cursor { display: none; } }
