/* Skyy V1 — display name effects */
.dn-effect[data-dn-effect="rainbow"] {
  background: linear-gradient(
    90deg,
    #ff2d55,
    #ff9500,
    #ffea00,
    #34c759,
    #00c7ff,
    #5856d6,
    #bf5af2,
    #ff2d55,
    #ff9500,
    #ffea00,
    #34c759,
    #00c7ff,
    #5856d6,
    #bf5af2,
    #ff2d55
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  -webkit-text-stroke: 0 transparent;
  paint-order: normal;
  text-shadow: none;
  filter: none;
  animation: dn-rainbow 5s linear infinite;
}

#profile-username.dn-effect[data-dn-effect="rainbow"],
body[data-profile-layout="v1"] #profile-username.dn-effect[data-dn-effect="rainbow"] {
  -webkit-text-stroke: 0 transparent;
  text-shadow: none;
  paint-order: normal;
  filter: none;
}

.dn-effect[data-dn-effect="neon_pulse"] {
  animation: dn-neon-pulse 2.2s ease-in-out infinite;
}

.dn-effect[data-dn-effect="typewriter"],
.dn-effect[data-dn-effect="scramble"] {
  position: relative;
  display: inline-block;
  vertical-align: bottom;
  text-align: center;
}

.dn-effect-ghost {
  visibility: hidden;
  white-space: pre;
  pointer-events: none;
  user-select: none;
}

.dn-effect-layer {
  position: absolute;
  inset: 0 auto auto 0;
  right: 0;
  white-space: pre;
  text-align: inherit;
}

.dn-effect[data-dn-effect="glitch"] {
  position: relative;
  display: inline-block;
  vertical-align: bottom;
  isolation: isolate;
}

.dn-effect[data-dn-effect="glitch"]::before,
.dn-effect[data-dn-effect="glitch"]::after {
  content: attr(data-dn-original-text);
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  font: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-transform: inherit;
  white-space: nowrap;
  text-shadow: none;
  -webkit-text-stroke: 0 transparent;
}

.dn-effect[data-dn-effect="glitch"].is-glitching::before {
  opacity: 0.72;
  color: rgba(72, 196, 255, 0.92);
  clip-path: inset(18% 0 52% 0);
  transform: translateX(-2px);
  z-index: 1;
  animation: dn-glitch-cyan 110ms steps(2, end);
}

.dn-effect[data-dn-effect="glitch"].is-glitching::after {
  opacity: 0.72;
  color: rgba(255, 72, 128, 0.92);
  clip-path: inset(54% 0 14% 0);
  transform: translateX(2px);
  z-index: 3;
  animation: dn-glitch-magenta 110ms steps(2, end);
}

#profile-username.dn-effect[data-dn-effect="glitch"],
body[data-profile-layout="v1"] #profile-username.dn-effect[data-dn-effect="glitch"],
.dash-experience-preview-name.dn-effect[data-dn-effect="glitch"],
.dash-text-colour-preview__name.dn-effect[data-dn-effect="glitch"] {
  position: relative;
  z-index: 2;
}

.dn-effect[data-dn-effect="wave"] .dn-effect-inner {
  display: inline-block;
}

.dn-effect[data-dn-effect="wave"] .dn-effect-char {
  display: inline-block;
  animation: dn-wave 1.8s ease-in-out infinite;
  animation-delay: calc(var(--dn-i) * 0.09s);
}

.dn-effect-sparkle-layer {
  position: absolute;
  inset: -6px -8px;
  pointer-events: none;
  overflow: visible;
}

.dn-effect[data-dn-effect="white_sparkles"] {
  position: relative;
  display: inline-block;
}

.dn-effect-sparkle-star {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0;
  transform: scale(0.2) rotate(0deg);
  animation: dn-sparkle-star 1.4s ease-in-out infinite;
}

.dn-effect-sparkle-star::before,
.dn-effect-sparkle-star::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 255, 255, 0.95);
  transform: translate(-50%, -50%);
  border-radius: 1px;
}

.dn-effect-sparkle-star::before {
  width: 100%;
  height: 2px;
}

.dn-effect-sparkle-star::after {
  width: 2px;
  height: 100%;
}

.v1-name-row {
  position: relative;
}

.v1-name-row .username {
  align-items: center;
}

/* Allow glow/wave/sparkle overflow without shifting layout */
#profile-username.dn-effect,
body[data-profile-layout="v1"] #profile-username.dn-effect {
  overflow: visible;
  text-overflow: clip;
}

body[data-profile-layout="v1"] .v1-name-row .username {
  overflow: visible;
}

.dn-effect[data-dn-effect="wave"],
.dn-effect[data-dn-effect="white_sparkles"],
.dn-effect[data-dn-effect="neon_pulse"],
.dn-effect[data-dn-effect="glitch"] {
  overflow: visible;
}

.dash-experience-modal__preview-stage .dash-experience-preview-name.dn-effect {
  overflow: visible;
}

.dash-experience-modal__preview-stage[data-preview-effect="glitch"] {
  overflow: visible;
}

body[data-profile-layout="v1"] .v1-name-row .username:has(#profile-username[data-dn-effect="glitch"]) {
  overflow: visible;
}

@keyframes dn-rainbow {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@keyframes dn-neon-pulse {
  0%, 100% {
    text-shadow:
      0 0 6px rgba(255, 143, 177, 0.45),
      0 0 14px rgba(255, 143, 177, 0.28),
      0 0 24px rgba(255, 143, 177, 0.12);
  }
  50% {
    text-shadow:
      0 0 10px rgba(255, 143, 177, 0.75),
      0 0 22px rgba(255, 143, 177, 0.5),
      0 0 36px rgba(255, 143, 177, 0.28);
  }
}

@keyframes dn-wave {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-6px); }
  70% { transform: translateY(0); }
}

@keyframes dn-sparkle-star {
  0%, 100% { opacity: 0; transform: scale(0.15) rotate(0deg); }
  18% { opacity: 0.95; transform: scale(1) rotate(18deg); }
  42% { opacity: 0.15; transform: scale(0.35) rotate(36deg); }
}

@keyframes dn-glitch-cyan {
  0%, 100% { transform: translateX(-2px); }
  50% { transform: translateX(-3px); }
}

@keyframes dn-glitch-magenta {
  0%, 100% { transform: translateX(2px); }
  50% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .dn-effect[data-dn-effect="rainbow"],
  .dn-effect[data-dn-effect="neon_pulse"],
  .dn-effect[data-dn-effect="wave"] .dn-effect-char,
  .dn-effect-sparkle-star,
  .dn-effect[data-dn-effect="glitch"].is-glitching::before,
  .dn-effect[data-dn-effect="glitch"].is-glitching::after {
    animation: none !important;
  }

  .dn-effect[data-dn-effect="glitch"].is-glitching::before,
  .dn-effect[data-dn-effect="glitch"].is-glitching::after {
    opacity: 0 !important;
  }
}

.dash-experience-preview-name.dn-effect[data-dn-effect="rainbow"],
.dash-experience-preview-name.dn-effect[data-dn-effect="neon_pulse"] {
  display: inline-block;
}

.dash-experience-preview-name.dn-effect[data-dn-effect="rainbow"] {
  -webkit-text-stroke: 0 transparent;
  text-shadow: none;
}
