/* These layers follow controls without affecting layout or intercepting input. */
.crystal-button-light {
  position: fixed;
  z-index: 10000;
  inset: 0 auto auto 0;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint;
  opacity: 0;
}
.crystal-button-light[hidden] { display: none; }

.crystal-button-hover {
  background:
    radial-gradient(ellipse 58px 32px at var(--light-x) var(--light-y), #ffffff44, #d4f3ff19 60%, transparent),
    linear-gradient(165deg, #f6fdff1c, transparent 62%);
  box-shadow: inset 0 1px 1px #fff9, inset 0 -1px #a9e6fb78;
  transition: opacity 160ms ease-out;
}
.crystal-button-hover.is-lit { opacity: 1; }
.crystal-button-hover::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0;
  background: linear-gradient(109deg, transparent 27%, #b6e9fc3d 42%, #ffffffbf 48%, #fff0d24d 53%, transparent 65%);
}
.crystal-button-hover.is-lit::after { animation: crystal-button-glint 620ms ease-out both; }

.crystal-button-press {
  box-shadow: inset 0 0 0 1px #e1faff, inset 0 0 10px #d8f6ffc2;
  animation: crystal-button-flash 360ms ease-out both;
}
.crystal-button-press::after {
  position: absolute;
  inset: 0;
  content: "";
  background: radial-gradient(circle at var(--light-x) var(--light-y),
    #fff1 0%, #cdefff1f 44%, #ffffffc9 51%, #a9e5ff59 55%, transparent 63%);
  transform-origin: var(--light-x) var(--light-y);
  animation: crystal-button-ripple 360ms ease-out both;
}
@keyframes crystal-button-glint {
  0% { transform: translateX(-85%); opacity: 0; }
  24% { opacity: .6; }
  100% { transform: translateX(90%); opacity: 0; }
}
@keyframes crystal-button-flash {
  from { opacity: .9; }
  to { opacity: 0; }
}
@keyframes crystal-button-ripple {
  from { transform: scale(.12); }
  to { transform: scale(2.8); }
}

@media (prefers-reduced-motion: reduce) {
  .crystal-button-light { display: none; }
}
@media (forced-colors: active) {
  .crystal-button-light { display: none; }
}
