@media (pointer: fine) {
  html.pixel-cursor-enabled,
  html.pixel-cursor-enabled * {
    cursor: none !important;
  }
  html.pixel-cursor-enabled.text-cursor,
  html.pixel-cursor-enabled.text-cursor input,
  html.pixel-cursor-enabled.text-cursor textarea,
  html.pixel-cursor-enabled.text-cursor select {
    cursor: text !important;
  }
}

.pixel-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  image-rendering: pixelated;
  will-change: transform;
}

.pixel-cursor.on { opacity: 1; }
.pixel-cursor.hidden { opacity: 0; }
.pixel-cursor canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.pixel-cursor.click canvas {
  transform: translate(1px, 1px);
}

.particle-layer {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  overflow: hidden;
}

.pixel-particle {
  position: fixed;
  display: block;
  image-rendering: pixelated;
  box-shadow: 1px 0 0 #000;
  animation: pixelBurst 0.62s steps(8, end) forwards;
}

@keyframes pixelBurst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pixel-particle { animation-duration: 0.2s; }
}
