/**
 * Nex+ username text effects (distinct from badge chip effects).
 * Color via --uname-color (defaults to gold).
 */

.nex-username-fx {
  display: inline-block;
  position: relative;
  --uname-color: #fbbf24;
}

/* Soft aura */
.nex-username-fx-glow {
  color: var(--uname-color) !important;
  text-shadow:
    0 0 10px color-mix(in srgb, var(--uname-color) 55%, transparent),
    0 0 22px color-mix(in srgb, var(--uname-color) 32%, transparent);
  animation: nex-uname-aura 3.2s ease-in-out infinite;
}

@keyframes nex-uname-aura {
  0%, 100% {
    text-shadow:
      0 0 8px color-mix(in srgb, var(--uname-color) 40%, transparent),
      0 0 16px color-mix(in srgb, var(--uname-color) 22%, transparent);
  }
  50% {
    text-shadow:
      0 0 14px color-mix(in srgb, var(--uname-color) 75%, white 15%),
      0 0 28px color-mix(in srgb, var(--uname-color) 45%, transparent);
  }
}

/*
 * Transparent shimmer — faded name with a bright bar that reveals it.
 * Uses --uname-color directly (not currentColor) so fill-clip stays reliable.
 */
.nex-username-fx-shimmer {
  color: transparent !important;
  background-image: linear-gradient(
    110deg,
    transparent 0%,
    transparent 16%,
    color-mix(in srgb, var(--uname-color, #fbbf24) 42%, transparent) 30%,
    #fff 50%,
    color-mix(in srgb, var(--uname-color, #fbbf24) 42%, transparent) 70%,
    transparent 84%,
    transparent 100%
  );
  background-size: 200% 100%;
  background-repeat: repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: nex-uname-shimmer 2.8s linear infinite;
}

@keyframes nex-uname-shimmer {
  from { background-position: 0% 50%; }
  to   { background-position: -200% 50%; }
}

/* Neon sign tinted by --uname-color */
.nex-username-fx-neon {
  color: color-mix(in srgb, var(--uname-color) 70%, white 30%) !important;
  text-shadow:
    0 0 4px var(--uname-color),
    0 0 10px color-mix(in srgb, var(--uname-color) 80%, transparent),
    0 0 20px color-mix(in srgb, var(--uname-color) 55%, transparent),
    0 0 2px #fff;
  animation: nex-uname-neon 2.8s ease-in-out infinite;
}

@keyframes nex-uname-neon {
  0%, 100% {
    text-shadow:
      0 0 4px var(--uname-color),
      0 0 10px color-mix(in srgb, var(--uname-color) 75%, transparent),
      0 0 18px color-mix(in srgb, var(--uname-color) 45%, transparent);
  }
  50% {
    text-shadow:
      0 0 6px #fff,
      0 0 16px var(--uname-color),
      0 0 30px color-mix(in srgb, var(--uname-color) 70%, transparent);
  }
}

/* Spectrum — multi-hue (color picker does not recolor this one) */
.nex-username-fx-rainbow {
  background-image: linear-gradient(
    90deg,
    #f472b6 0%,
    #fb923c 16.66%,
    #fbbf24 33.33%,
    #34d399 50%,
    #38bdf8 66.66%,
    #a78bfa 83.33%,
    #f472b6 100%
  );
  background-size: 200% 100%;
  background-repeat: repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  animation: nex-uname-spectrum 5s linear infinite;
}

@keyframes nex-uname-spectrum {
  from { background-position: 0% 50%; }
  to   { background-position: -200% 50%; }
}

/* Twinkle */
.nex-username-fx-sparkle {
  color: var(--uname-color) !important;
  text-shadow:
    0 0 2px rgba(255, 255, 255, 0.85),
    0 0 8px color-mix(in srgb, var(--uname-color) 55%, transparent),
    1px -1px 0 rgba(255, 255, 255, 0.35);
  animation: nex-uname-twinkle 2.6s ease-in-out infinite;
}

@keyframes nex-uname-twinkle {
  0%, 100% {
    text-shadow:
      0 0 2px rgba(255, 255, 255, 0.7),
      0 0 8px color-mix(in srgb, var(--uname-color) 40%, transparent),
      1px -1px 0 rgba(255, 255, 255, 0.25);
    filter: brightness(1);
  }
  35% {
    text-shadow:
      0 0 3px #fff,
      0 0 12px color-mix(in srgb, var(--uname-color) 70%, white 20%),
      -1px 1px 0 rgba(255, 255, 255, 0.45),
      2px -2px 6px color-mix(in srgb, var(--uname-color) 40%, transparent);
    filter: brightness(1.15);
  }
  55% {
    text-shadow:
      0 0 2px rgba(255, 255, 255, 0.9),
      0 0 10px color-mix(in srgb, var(--uname-color) 60%, transparent);
    filter: brightness(1.05);
  }
}

/* Aurora — multi-hue */
.nex-username-fx-holographic {
  background-image: linear-gradient(
    115deg,
    #67e8f9 0%,
    #a5b4fc 25%,
    #f0abfc 50%,
    #67e8f9 75%,
    #a5b4fc 100%
  );
  background-size: 200% 200%;
  background-repeat: repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  animation: nex-uname-aurora 6s linear infinite;
}

@keyframes nex-uname-aurora {
  from { background-position: 0% 40%; }
  to   { background-position: 200% 60%; }
}

/* Molten fill from dark to --uname-color */
.nex-username-fx-gradient {
  background-image: linear-gradient(
    105deg,
    color-mix(in srgb, var(--uname-color) 35%, #000) 0%,
    color-mix(in srgb, var(--uname-color) 75%, #000) 35%,
    var(--uname-color) 55%,
    color-mix(in srgb, var(--uname-color) 85%, white 15%) 75%,
    color-mix(in srgb, var(--uname-color) 55%, #000) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .nex-username-fx-glow,
  .nex-username-fx-shimmer,
  .nex-username-fx-neon,
  .nex-username-fx-rainbow,
  .nex-username-fx-sparkle,
  .nex-username-fx-holographic {
    animation: none !important;
  }
}
