:root {
  --pulsar-cursor-accent-rgb: 77, 163, 255;
  --pulsar-cursor-action-rgb: 77, 163, 255;
}

body.stocksThemeActive {
  --pulsar-cursor-accent-rgb: 155, 122, 235;
  --pulsar-cursor-action-rgb: 155, 122, 235;
}

body.fxThemeActive {
  --pulsar-cursor-accent-rgb: 226, 179, 74;
  --pulsar-cursor-action-rgb: 226, 179, 74;
}

html[data-pulsar-cursor-tone="web3"] {
  --pulsar-cursor-accent-rgb: 77, 163, 255;
  --pulsar-cursor-action-rgb: 77, 163, 255;
}

html[data-pulsar-cursor-tone="hypeflow"] {
  --pulsar-cursor-accent-rgb: 61, 213, 168;
  --pulsar-cursor-action-rgb: 61, 213, 168;
}

html[data-pulsar-cursor-tone="stocks"] {
  --pulsar-cursor-accent-rgb: 155, 122, 235;
  --pulsar-cursor-action-rgb: 155, 122, 235;
}

html[data-pulsar-cursor-tone="fx"] {
  --pulsar-cursor-accent-rgb: 226, 179, 74;
  --pulsar-cursor-action-rgb: 226, 179, 74;
}

html[data-pulsar-cursor-tone="polyflow"] {
  --pulsar-cursor-accent-rgb: 77, 163, 255;
  --pulsar-cursor-action-rgb: 77, 163, 255;
}

.pulsarCursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483646;
  width: 34px;
  height: 34px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-80px, -80px, 0);
  transition: opacity 120ms ease;
  contain: layout style;
  will-change: transform;
}

.pulsarCursor[popover] {
  inset: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.pulsarCursor--visible {
  opacity: 1;
}

.pulsarCursor__halo {
  position: absolute;
  top: -7px;
  left: -7px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(var(--pulsar-cursor-accent-rgb), 0.52);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(var(--pulsar-cursor-accent-rgb), 0.17) 0 9%, transparent 32%),
    conic-gradient(from 210deg, transparent 0 55%, rgba(var(--pulsar-cursor-accent-rgb), 0.18) 70%, transparent 86%);
  box-shadow:
    0 0 7px rgba(var(--pulsar-cursor-accent-rgb), 0.58),
    inset 0 0 6px rgba(var(--pulsar-cursor-accent-rgb), 0.16);
  opacity: 0.76;
  transform: scale(0.82);
  transition:
    opacity 160ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pulsarCursor__pointer {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 23px;
  overflow: visible;
  color: rgb(237, 249, 255);
  filter:
    drop-shadow(0 0 2px rgba(var(--pulsar-cursor-accent-rgb), 0.96))
    drop-shadow(0 0 6px rgba(var(--pulsar-cursor-accent-rgb), 0.72));
  transition:
    transform 120ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pulsarCursor__beacon {
  position: absolute;
  top: 7px;
  left: 6px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgb(var(--pulsar-cursor-accent-rgb));
  box-shadow: 0 0 7px 2px rgba(var(--pulsar-cursor-accent-rgb), 0.88);
  opacity: 0.9;
  transition: transform 160ms ease;
}

.pulsarCursor__modeGlyph {
  position: absolute;
  top: 10px;
  left: 13px;
  width: 13px;
  height: 13px;
  box-sizing: border-box;
  border: 1px solid rgba(var(--pulsar-cursor-accent-rgb), 0.92);
  border-radius: 50%;
  background: rgba(7, 13, 24, 0.94);
  box-shadow:
    0 0 5px rgba(var(--pulsar-cursor-accent-rgb), 0.9),
    inset 0 0 4px rgba(var(--pulsar-cursor-accent-rgb), 0.22);
  color: rgb(var(--pulsar-cursor-accent-rgb));
  opacity: 0;
  transform: scale(0.64);
  transition: opacity 140ms ease, transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pulsarCursor--help .pulsarCursor__modeGlyph,
.pulsarCursor--forbidden .pulsarCursor__modeGlyph {
  opacity: 1;
  transform: scale(1);
}

.pulsarCursor--help .pulsarCursor__modeGlyph::before {
  content: "?";
  position: absolute;
  inset: -1px 0 0;
  display: grid;
  place-items: center;
  font: 800 10px/1 ui-sans-serif, system-ui, sans-serif;
  text-shadow: 0 0 5px rgba(var(--pulsar-cursor-accent-rgb), 0.92);
}

.pulsarCursor--forbidden .pulsarCursor__modeGlyph::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 1px;
  width: 9px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 4px rgba(var(--pulsar-cursor-accent-rgb), 0.95);
  transform: rotate(-45deg);
  transform-origin: center;
}

.pulsarCursor--help .pulsarCursor__halo,
.pulsarCursor--forbidden .pulsarCursor__halo {
  opacity: 0.94;
  transform: scale(1);
}

.pulsarCursor--forbidden .pulsarCursor__pointer,
.pulsarCursor--forbidden .pulsarCursor__beacon {
  opacity: 0.72;
}

.pulsarCursor--interactive .pulsarCursor__halo {
  opacity: 1;
  transform: scale(1.08);
}

.pulsarCursor--interactive .pulsarCursor__pointer {
  transform: translate3d(1px, 1px, 0) scale(0.92);
}

.pulsarCursor--interactive .pulsarCursor__beacon {
  transform: scale(1.25);
}

.pulsarCursor--pressed .pulsarCursor__halo {
  opacity: 0.9;
  transform: scale(0.72);
}

.pulsarCursor--pressed .pulsarCursor__pointer {
  transform: translate3d(1px, 1px, 0) scale(0.84);
}

.pulsarCursorTrail {
  position: fixed;
  inset: 0;
  z-index: 2147483645;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  contain: strict;
}

.pulsarCursorTrail[popover] {
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.pulsarCursorTrail.is-visible {
  opacity: 1;
}

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

  html.pulsarCursorEnabled :is(
    input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
    textarea,
    [contenteditable="true"]
  ) {
    cursor: text !important;
  }

  html.pulsarCursorEnabled :is(:disabled, [aria-disabled="true"]) {
    cursor: none !important;
  }
}

@media (any-pointer: coarse), (hover: none) {
  .pulsarCursor,
  .pulsarCursorTrail {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulsarCursor,
  .pulsarCursor__halo,
  .pulsarCursor__pointer,
  .pulsarCursor__beacon,
  .pulsarCursor__modeGlyph,
  .pulsarCursorTrail {
    transition: none;
  }

  .pulsarCursorTrail {
    display: none !important;
  }
}
