.term-title {
  position: relative;
  cursor: var(--cursor-pointer);
  user-select: none;
  -webkit-user-select: none;
}

.term-title--pulse {
  animation: term-title-pulse 0.14s ease-out;
}

@keyframes term-title-pulse {
  0% {
    transform: scale(1);
    filter:
      drop-shadow(0 1px 0 rgba(0, 0, 0, 0.95))
      drop-shadow(0 0 12px rgba(255, 120, 40, 0.22));
  }

  35% {
    transform: scale(1.04);
    filter:
      drop-shadow(0 1px 0 rgba(0, 0, 0, 0.95))
      drop-shadow(0 0 18px rgba(255, 200, 120, 0.95))
      drop-shadow(0 0 36px rgba(255, 128, 0, 0.85))
      drop-shadow(0 0 64px rgba(255, 80, 0, 0.55));
  }

  100% {
    transform: scale(1);
    filter:
      drop-shadow(0 1px 0 rgba(0, 0, 0, 0.95))
      drop-shadow(0 0 12px rgba(255, 120, 40, 0.22));
  }
}

.title-fx-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 6;
}

.title-fx-layer--viewport {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.term-header {
  position: relative;
}

.title-fx-particle {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  animation: title-fx-fly var(--fx-duration, 520ms) cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.title-fx-particle--spark {
  width: var(--fx-size, 4px);
  height: var(--fx-size, 4px);
  background: radial-gradient(circle at 35% 35%, #fffef0 0%, #ffdd88 40%, #ff7700 100%);
  box-shadow:
    0 0 4px #fff8d0,
    0 0 10px #ffae55,
    0 0 20px rgba(255, 128, 0, 0.95),
    0 0 32px rgba(255, 80, 0, 0.65);
}

.title-fx-particle--fire {
  width: var(--fx-size, 10px);
  height: var(--fx-size, 14px);
  border-radius: 45% 55% 50% 50%;
  background: linear-gradient(180deg, #fff8d8 0%, #ffae55 35%, #ff6600 70%, #e83820 100%);
  box-shadow:
    0 0 8px rgba(255, 240, 180, 0.95),
    0 0 16px rgba(255, 120, 0, 0.95),
    0 0 28px rgba(255, 80, 0, 0.75),
    0 0 44px rgba(232, 56, 32, 0.45);
  filter: blur(0.35px);
}

.title-fx-particle--smoke {
  width: var(--fx-size, 16px);
  height: var(--fx-size, 16px);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 170, 90, 0.35) 0%, rgba(120, 130, 140, 0.4) 45%, transparent 72%);
  box-shadow:
    0 0 14px rgba(255, 140, 60, 0.35),
    0 0 28px rgba(80, 90, 100, 0.25);
  filter: blur(4px);
  animation-timing-function: cubic-bezier(0.15, 0.4, 0.25, 1);
}

.title-fx-glow-burst {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 230, 170, 0.95) 0%, rgba(255, 140, 40, 0.55) 32%, transparent 68%);
  box-shadow:
    0 0 24px rgba(255, 200, 120, 0.95),
    0 0 48px rgba(255, 128, 0, 0.75),
    0 0 80px rgba(255, 60, 0, 0.45);
  animation: title-fx-glow-burst var(--fx-glow-duration, 480ms) ease-out forwards;
}

@keyframes title-fx-fly {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    opacity: 1;
    filter: brightness(1.2);
  }

  100% {
    transform: translate3d(var(--fx-tx), var(--fx-ty), 0) rotate(var(--fx-rot)) scale(var(--fx-scale-end, 0.2));
    opacity: 0;
    filter: brightness(0.85);
  }
}

@keyframes title-fx-glow-burst {
  0% {
    transform: scale(0.25);
    opacity: 1;
  }

  100% {
    transform: scale(var(--fx-glow-scale, 4.5));
    opacity: 0;
  }
}
