/* GÉNÉRÉ par outils/cristal-public.js — ne pas modifier à la main.
   Feuille de la pièce « cristal » de la bibliothèque (skeep-studio,
   moteur/elements.js). Pour changer l'effet, changez la pièce, puis :
       node outils/cristal-public.js */
@property --sk-angle{syntax:"<angle>";inherits:true;initial-value:0deg}
.sk-cristal{
  position:relative;display:block;width:100%;height:var(--sk-haut,360px);
  container-type:size;overflow:hidden;isolation:isolate;
  background:var(--sk-encre,#07050f);
  --vif:color-mix(in srgb,var(--sk-couleur,#F25BD0) 28%,#ffffff);
  --profond:color-mix(in srgb,var(--sk-couleur,#F25BD0) 55%,#000000);
  --etincelle:color-mix(in srgb,var(--sk-couleur,#F25BD0) 55%,#ffffff);
  --ton0:color-mix(in srgb,var(--sk-couleur,#F25BD0) 94%,#000000);
  --ton1:color-mix(in srgb,var(--sk-couleur,#F25BD0) 80%,#ffffff);
  --ton2:color-mix(in srgb,var(--sk-couleur,#F25BD0) 70%,#000000);
  --ton3:color-mix(in srgb,var(--sk-couleur,#F25BD0) 60%,#ffffff);
  --ton4:color-mix(in srgb,var(--sk-couleur,#F25BD0) 30%,#ffffff);
  --sk-angle:0deg;
}
.sk-cristal[data-usage="fond"]{position:absolute;inset:0;height:auto;background:none;z-index:0;pointer-events:none}
/* LE CORPS : la boule (un cercle) ou la capsule (le rectangle de la scene). */
.sk-cristal__corps{
  position:absolute;inset:0;margin:auto;
  width:calc(var(--sk-taille,0.7) * 100cqmin);height:calc(var(--sk-taille,0.7) * 100cqmin);
  border-radius:50%;opacity:var(--sk-opacite,1);
  animation:sk-cristal-allume 1.6s cubic-bezier(.23,1,.32,1) both;
}
.sk-cristal[data-forme="capsule"] .sk-cristal__corps{
  inset:var(--sk-marge,8px);width:auto;height:auto;margin:0;border-radius:var(--sk-coin,24px);
}
@keyframes sk-cristal-allume{from{opacity:0;scale:.96}to{opacity:var(--sk-opacite,1);scale:1}}
/* LE VERRE : il garde la poussiere et la brume a l'interieur. */
.sk-cristal__verre{
  position:absolute;inset:0;overflow:hidden;border-radius:inherit;container-type:size;
  background:
    radial-gradient(ellipse 80% 52% at 50% 100%,color-mix(in srgb,var(--profond) calc(var(--sk-brume,0.7) * 70%),transparent),transparent 72%),
    radial-gradient(circle at 50% 30%,color-mix(in srgb,var(--profond) calc(var(--sk-brume,0.7) * 18%),transparent),transparent 70%);
  box-shadow:inset 0 0 calc(var(--sk-brume,0.7) * 40px) color-mix(in srgb,var(--profond) 60%,transparent);
}
/* LE BORD : un filet clair, et le halo qui le porte, hors du verre. */
@property --sk-tour{syntax:"<angle>";inherits:true;initial-value:0deg}
/* LE BORD : un filet d'un pixel, pas un trait. Il porte deux reflets qui le
   parcourent tres lentement, comme une lumiere sur une arete de verre ; le
   reste du tour n'est qu'un souffle de couleur. */
.sk-cristal__bord{
  position:absolute;inset:0;border-radius:inherit;pointer-events:none;padding:1px;
  background:conic-gradient(from var(--sk-tour),
    color-mix(in srgb,var(--vif) 16%,transparent) 0deg,var(--vif) 38deg,color-mix(in srgb,var(--vif) 12%,transparent) 110deg,
    color-mix(in srgb,var(--vif) 10%,transparent) 190deg,color-mix(in srgb,var(--vif) 75%,transparent) 262deg,color-mix(in srgb,var(--vif) 16%,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:sk-cristal-tourne 18s linear infinite;
}
@keyframes sk-cristal-tourne{to{--sk-tour:360deg}}
/* Le halo : tres bas, deux couches, pour que le verre semble eclaire de l'interieur. */
.sk-cristal__corps::after{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  box-shadow:0 0 calc(var(--sk-halo,0.9) * 30px) color-mix(in srgb,var(--sk-couleur,#F25BD0) 20%,transparent),
    0 0 calc(var(--sk-halo,0.9) * 8px) color-mix(in srgb,var(--sk-couleur,#F25BD0) 28%,transparent),
    inset 0 0 calc(var(--sk-halo,0.9) * 26px) color-mix(in srgb,var(--sk-couleur,#F25BD0) 16%,transparent);
}
/* LE VOLUME : un reflet de verre en haut, une lueur qui remonte du fond, un
   filet de lumiere sous l'arete. Sans eux, le verre est un a-plat. */
.sk-cristal__verre::after{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:
    radial-gradient(ellipse 72% 36% at 50% -6%,color-mix(in srgb,#ffffff 22%,transparent),transparent 72%),
    radial-gradient(circle at 22% 16%,color-mix(in srgb,#ffffff 14%,transparent),transparent 30%),
    linear-gradient(to top,color-mix(in srgb,var(--vif) 12%,transparent),transparent 30%);
  box-shadow:inset 0 1px 0 color-mix(in srgb,#ffffff 20%,transparent),inset 0 -14px 24px -18px color-mix(in srgb,var(--vif) 40%,transparent);
}
/* L'ECHAUFFEMENT : un secteur plus vif du contour, du cote de la souris. */
.sk-cristal__chaleur{
  position:absolute;inset:0;border-radius:inherit;pointer-events:none;padding:3px;opacity:0;
  background:conic-gradient(from calc(var(--sk-angle) - 50deg),transparent 0deg,var(--vif) 50deg,transparent 100deg);
  -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);
  filter:drop-shadow(0 0 6px var(--vif));
  transition:opacity 450ms ease,--sk-angle 260ms ease-out;
}
.sk-cristal[data-sur] .sk-cristal__chaleur{opacity:var(--sk-reaction,0.7)}
/* LES FILAMENTS ET LES ETINCELLES : des traces, dessinees par le script. */
.sk-cristal__anneau{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;
  filter:drop-shadow(0 0 3px color-mix(in srgb,var(--sk-couleur,#F25BD0) 80%,transparent))}
.sk-cristal__anneau path{fill:none;stroke-linejoin:round;stroke-linecap:round}
.sk-cristal__brin{stroke:var(--vif)}
.sk-cristal__arc{stroke:var(--etincelle);opacity:0}
/* LA POUSSIERE : un element par grain ; chacun porte sa place et son rythme. */
.sk-cristal__poussiere{position:absolute;inset:0;transition:translate 700ms ease-out}
.sk-cristal[data-sur] .sk-cristal__poussiere{translate:var(--sk-lx,0px) var(--sk-ly,0px)}
.sk-cristal__poussiere i{
  position:absolute;display:block;width:var(--taille,2px);height:var(--taille,2px);
  background:var(--ton0);opacity:0;
  transform:translate(var(--pousse-x,0px),var(--pousse-y,0px));
  transition:transform 700ms cubic-bezier(.23,1,.32,1);
  filter:brightness(calc(0.45 + var(--prof,0.5) * 0.9)) blur(calc((1 - var(--prof,0.5)) * 0.6px));
  box-shadow:0 0 calc(var(--prof,0.5) * 9px) var(--ton1);
  animation:sk-cristal-monte calc(var(--duree,6s) / var(--sk-vitesse,1)) linear infinite,
    sk-cristal-scintille calc(var(--duree,6s) * 0.2 / var(--sk-vitesse,1)) steps(2) infinite;
  animation-delay:var(--retard,0s),var(--retard,0s);
}
.sk-cristal__poussiere i:nth-child(5n+2){background:var(--ton1)}
.sk-cristal__poussiere i:nth-child(5n+3){background:var(--ton2)}
.sk-cristal__poussiere i:nth-child(5n+4){background:var(--ton3)}
.sk-cristal__poussiere i:nth-child(5n){background:var(--ton4)}
.sk-cristal[data-grain="rond"] .sk-cristal__poussiere i{border-radius:50%}
.sk-cristal[data-poussiere="descend"] .sk-cristal__poussiere i{animation-name:sk-cristal-tombe,sk-cristal-scintille}
.sk-cristal[data-poussiere="derive"] .sk-cristal__poussiere i{animation-name:sk-cristal-erre,sk-cristal-scintille}
.sk-cristal[data-poussiere="orbite"] .sk-cristal__poussiere i{animation-name:sk-cristal-orbite,sk-cristal-scintille}
@keyframes sk-cristal-monte{
  0%{opacity:0;translate:0 0}12%{opacity:1}82%{opacity:.85}
  100%{opacity:0;translate:var(--dx,0px) calc(var(--haut,40) * -1cqh)}
}
@keyframes sk-cristal-tombe{
  0%{opacity:0;translate:0 0}12%{opacity:1}82%{opacity:.85}
  100%{opacity:0;translate:var(--dx,0px) calc(var(--haut,40) * 1cqh)}
}
@keyframes sk-cristal-erre{
  0%,100%{opacity:.2;translate:0 0}25%{opacity:1;translate:var(--dx,6px) -6px}
  50%{opacity:.5;translate:0 -12px}75%{opacity:1;translate:calc(var(--dx,6px) * -1) -4px}
}
@keyframes sk-cristal-orbite{
  0%,100%{opacity:1;translate:0 0}25%{translate:var(--dx,8px) 0}
  50%{opacity:.6;translate:var(--dx,8px) var(--dx,8px)}75%{translate:0 var(--dx,8px)}
}
@keyframes sk-cristal-scintille{50%{scale:calc(1 - var(--sk-scintille,0.5))}}
/* SUR FOND CLAIR : de l'encre, sans lumiere. */
.sk-cristal[data-theme="clair"]{background:var(--sk-clair,#f6f4ef);
  --vif:color-mix(in srgb,var(--sk-couleur,#F25BD0) 70%,#000000);--etincelle:var(--vif)}
.sk-cristal[data-theme="clair"] .sk-cristal__bord{box-shadow:0 0 calc(var(--sk-halo,0.9) * 8px) color-mix(in srgb,var(--sk-couleur,#F25BD0) 25%,transparent)}
.sk-cristal[data-theme="clair"] .sk-cristal__anneau{filter:none}
@media (prefers-reduced-motion:reduce){
  .sk-cristal__corps,.sk-cristal__bord{animation:none}
  .sk-cristal__poussiere i{animation:none;opacity:.8}
  .sk-cristal__poussiere,.sk-cristal__chaleur{transition:none}
}
