@media (any-pointer: fine) {
  html,
  body,
  body * {
    cursor: url("cursor-default.svg") 48 32, crosshair;
  }

  a,
  a *,
  button,
  button *,
  [role="button"],
  [role="button"] *,
  summary,
  input[type="range"],
  input[type="checkbox"],
  input[type="radio"],
  .finale-stage:active {
    cursor: url("cursor-active.svg") 56 46, pointer;
  }

  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
  textarea,
  [contenteditable="true"] {
    cursor: text;
  }
}

.motion-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 2147483647;
  pointer-events: none;
}

.motion-cursor[hidden] { display: none; }
.motion-cursor * { pointer-events: none; }

.cursor-body {
  --cursor-scale: 1;
  position: absolute;
  left: -56px;
  top: -46px;
  display: block;
  width: 112px;
  height: 92px;
  transform: scale(var(--cursor-scale));
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}

.cursor-body img {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  max-width: none;
  transform: translate(-50%, -50%);
  transition: opacity .18s ease, transform .32s cubic-bezier(.2, .8, .2, 1);
}

.cursor-body .cursor-default {
  width: 96px;
  height: 64px;
}

.cursor-body .cursor-active {
  width: 112px;
  height: 92px;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-25deg) scale(1.15);
}

.cursor-lock,
.cursor-pulse {
  position: absolute;
  display: block;
  width: 72px;
  height: 72px;
  color: #40ff4d;
  opacity: 0;
}

.cursor-lock {
  left: 20px;
  top: 10px;
  background:
    linear-gradient(currentColor, currentColor) left top / 9px 1px,
    linear-gradient(currentColor, currentColor) left top / 1px 9px,
    linear-gradient(currentColor, currentColor) right top / 9px 1px,
    linear-gradient(currentColor, currentColor) right top / 1px 9px,
    linear-gradient(currentColor, currentColor) left bottom / 9px 1px,
    linear-gradient(currentColor, currentColor) left bottom / 1px 9px,
    linear-gradient(currentColor, currentColor) right bottom / 9px 1px,
    linear-gradient(currentColor, currentColor) right bottom / 1px 9px;
  background-repeat: no-repeat;
  transform: scale(1.2) rotate(10deg);
  transition: opacity .18s ease, transform .28s cubic-bezier(.2, .8, .2, 1), color .12s;
}

.cursor-pulse {
  left: -36px;
  top: -36px;
  border: 1px solid #40ff4d;
  border-radius: 50%;
}

.is-hovering .cursor-body { --cursor-scale: .92; }
.is-hovering .cursor-default { opacity: 0; }
.is-hovering .cursor-active {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0) scale(1);
}

.is-hovering .cursor-lock {
  opacity: .85;
  transform: scale(1) rotate(0);
}

.is-pressed .cursor-body { transform: scale(.66); }
.is-pressed .cursor-default { opacity: 0; }
.is-pressed .cursor-active {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0) scale(1);
}

.is-pressed .cursor-lock {
  opacity: 1;
  color: #fff;
  transform: scale(.85) rotate(0);
}

.is-releasing .cursor-body {
  animation: cursor-release .38s cubic-bezier(.16, 1, .3, 1) both;
}

.is-releasing .cursor-pulse {
  animation: cursor-click-wave .38s ease-out both;
}

@keyframes cursor-release {
  0% { transform: scale(.66); }
  55% { transform: scale(1.12); }
  100% { transform: scale(var(--cursor-scale)); }
}

@keyframes cursor-click-wave {
  from { transform: scale(.55); opacity: .85; }
  to { transform: scale(1.45); opacity: 0; }
}

@media (any-pointer: fine) {
  html.motion-cursor-enabled,
  html.motion-cursor-enabled body,
  html.motion-cursor-enabled body * {
    cursor: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-body,
  .cursor-body img,
  .cursor-lock { transition: none; }
  .is-releasing .cursor-body,
  .is-releasing .cursor-pulse { animation: none; }
}
