/* ---- マウスストーカー（通常カーソル併用・PC向け） ---- */
#yab_stalker {
  --yab-stalker-blue: #0093db;
  --yab-stalker-blue: var(--color2, #0093db);
  --yab-stalker-green: #6ead1a;
  --yab-stalker-green: var(--theme-color, #6ead1a);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
  transition: opacity 0.25s ease;
}

#yab_stalker.is_visible {
  opacity: 0.5;
}

#yab_stalker.is_text {
  opacity: 0;
}

#yab_stalker .yab_stalker_core {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0093db;
  background: var(--yab-stalker-blue);
  box-shadow: 0 0 14px rgba(0, 147, 219, 0.3);
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  animation: yab_stalker_morph 6s ease-in-out infinite;
}

/* border 波は ::before / ::after */
#yab_stalker .yab_stalker_core::before,
#yab_stalker .yab_stalker_core::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 147, 219, 0.7);
  background: transparent;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

/* ホバー: 緑の芯 + 緑の波円（after / before） */
#yab_stalker.is_hover .yab_stalker_core {
  width: 36px;
  height: 36px;
  background: #6ead1a;
  background: var(--yab-stalker-green);
  box-shadow: 0 0 22px rgba(110, 173, 26, 0.35);
}

#yab_stalker.is_hover .yab_stalker_core::before {
  border-color: rgba(110, 173, 26, 0.55);
  animation: yab_stalker_ring 1.5s ease-out infinite;
}

#yab_stalker.is_hover .yab_stalker_core::after {
  border-color: rgba(110, 173, 26, 0.55);
  animation: yab_stalker_ring 1.5s ease-out 0.55s infinite;
}

/* クリック: 緑の芯 + 大きな緑ボーダーが広がって薄くなる */
#yab_stalker.is_click .yab_stalker_core {
  width: 16px;
  height: 16px;
  background: #6ead1a;
  background: var(--yab-stalker-green);
  box-shadow: 0 0 18px rgba(110, 173, 26, 0.4);
  animation: none;
  border-radius: 50%;
}

#yab_stalker.is_click .yab_stalker_core::before {
  border-color: rgba(110, 173, 26, 0.7);
  animation: yab_stalker_burst_ring 1s ease-out forwards;
}

#yab_stalker.is_click .yab_stalker_core::after {
  border-color: rgba(110, 173, 26, 0.7);
  animation: yab_stalker_burst_ring 1s ease-out 0.18s forwards;
}

@keyframes yab_stalker_morph {
  0%,
  100% {
    border-radius: 48% 52% 55% 45% / 48% 45% 55% 52%;
  }
  25% {
    border-radius: 55% 45% 48% 52% / 52% 55% 45% 48%;
  }
  50% {
    border-radius: 45% 55% 52% 48% / 55% 48% 52% 45%;
  }
  75% {
    border-radius: 52% 48% 45% 55% / 45% 52% 48% 55%;
  }
}

@keyframes yab_stalker_ring {
  0% {
    width: 28px;
    height: 28px;
    opacity: 0.55;
    border-width: 2px;
    border-color: rgba(110, 173, 26, 0.55);
  }
  100% {
    width: 110px;
    height: 110px;
    opacity: 0;
    border-width: 1px;
    border-color: rgba(110, 173, 26, 0);
  }
}

@keyframes yab_stalker_burst_ring {
  0% {
    width: 20px;
    height: 20px;
    opacity: 0.65;
    border-width: 4px;
    border-color: rgba(110, 173, 26, 0.65);
  }
  70% {
    opacity: 0.2;
    border-color: rgba(110, 173, 26, 0.25);
  }
  100% {
    width: 260px;
    height: 260px;
    opacity: 0;
    border-width: 1px;
    border-color: rgba(110, 173, 26, 0);
  }
}

#yab_stalker.is_reduced .yab_stalker_core,
#yab_stalker.is_reduced.is_hover .yab_stalker_core::before,
#yab_stalker.is_reduced.is_hover .yab_stalker_core::after,
#yab_stalker.is_reduced.is_click .yab_stalker_core::before,
#yab_stalker.is_reduced.is_click .yab_stalker_core::after {
  animation: none;
}

#yab_stalker.is_reduced .yab_stalker_core {
  border-radius: 50%;
}

@media (prefers-reduced-motion: reduce) {
  #yab_stalker .yab_stalker_core,
  #yab_stalker.is_hover .yab_stalker_core::before,
  #yab_stalker.is_hover .yab_stalker_core::after,
  #yab_stalker.is_click .yab_stalker_core::before,
  #yab_stalker.is_click .yab_stalker_core::after {
    animation: none;
  }

  #yab_stalker .yab_stalker_core {
    border-radius: 50%;
  }
}

@media (hover: none) and (pointer: coarse) {
  #yab_stalker {
    display: none !important;
  }

  .yab_stalker_toggle {
    display: none !important;
  }
}
