/* ============================================================
 * EMOJI UNIVERSE - VISUAL EFFECTS
 * Glow, glass, gradient, glitch, sparkles & friends.
 * ============================================================ */

/* -------------------- GLOW / NEON -------------------- */
.glow {
  text-shadow:
    0 0 8px var(--color-accent),
    0 0 16px var(--color-accent-soft),
    0 0 28px var(--color-accent-soft);
}

.glow-accent {
  filter:
    drop-shadow(0 0 6px var(--color-accent))
    drop-shadow(0 0 14px var(--color-accent-soft));
}

.glow-soft {
  box-shadow:
    inset 0 0 0 1px var(--color-border-strong),
    0 0 24px var(--color-accent-soft);
}

.glow-pulse {
  animation: pulseGlow 1.8s ease-in-out infinite;
}

/* -------------------- GLASS / GLASSMORPHISM -------------------- */
.glass {
  background: color-mix(in oklab, var(--color-bg-2) 60%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
}

.glass--frosted {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.glass--dark {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* -------------------- GRADIENT TEXT -------------------- */
.grad-text {
  background: var(--grad-accent);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.grad-text-2 {
  background: var(--grad-accent-2);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.grad-text-shift {
  background: linear-gradient(135deg,
    var(--color-accent),
    var(--color-accent-2),
    var(--color-accent-3),
    var(--color-accent));
  background-size: 400% 400%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* -------------------- GLITCH TEXT -------------------- */
.glitch {
  position: relative;
  display: inline-block;
  color: var(--color-fg);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.glitch::before {
  color: var(--color-accent);
  z-index: -1;
  animation: glitchA 1.2s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch::after {
  color: var(--color-accent-2);
  z-index: -2;
  animation: glitchB 0.9s infinite linear alternate-reverse;
  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
}

/* -------------------- SHIMMER PLACEHOLDER -------------------- */
.shimmer {
  background: linear-gradient(90deg,
    var(--color-surface) 0%,
    var(--color-surface-2) 50%,
    var(--color-surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

.shimmer-block {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg,
    var(--color-surface) 0%,
    var(--color-surface-2) 50%,
    var(--color-surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

/* -------------------- RIPPLE -------------------- */
.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, var(--color-accent-soft) 0%, transparent 60%);
  width: 24px;
  height: 24px;
  transform: scale(0);
  animation: ripple 700ms ease-out forwards;
}

/* -------------------- CONFETTI -------------------- */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: var(--layer-toast);
}

.confetti__piece {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  animation: confettiFall 2.6s cubic-bezier(0.45, 0.1, 0.65, 1) forwards;
}

.confetti__piece--circle { border-radius: 50%; }
.confetti__piece--square { border-radius: 2px; }
.confetti__piece--triangle {
  width: 0; height: 0;
  background: transparent !important;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid currentColor;
}

.confetti__piece--emoji {
  width: auto;
  height: auto;
  font-size: 24px;
  background: none !important;
}

/* -------------------- EMOJI RAIN -------------------- */
.emoji-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--layer-toast);
  overflow: hidden;
}

.emoji-rain__drop {
  position: absolute;
  font-size: 28px;
  animation: emojiRain 4s linear forwards;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* -------------------- SCANLINES -------------------- */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.05) 3px,
    rgba(0, 0, 0, 0.05) 4px
  );
  opacity: 0;
  transition: opacity var(--t-slow) ease;
}

.scanlines.is-on {
  opacity: 0.8;
}

.scanlines::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04) 0%,
    transparent 8%,
    transparent 92%,
    rgba(0, 0, 0, 0.25) 100%);
  pointer-events: none;
  animation: scanline 8s linear infinite;
}

/* -------------------- STARS / SPARKLES -------------------- */
.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px #fff;
  animation: sparkle 1.4s ease-in-out infinite;
  pointer-events: none;
}

.sparkle::before,
.sparkle::after {
  content: "";
  position: absolute;
  background: inherit;
}

.sparkle::before {
  inset: -8px 50%;
  width: 1px;
  margin-left: -0.5px;
}

.sparkle::after {
  inset: 50% -8px;
  height: 1px;
  margin-top: -0.5px;
}

/* -------------------- TILTED CARD (3D) -------------------- */
.tilt {
  transform-style: preserve-3d;
  transition: transform var(--t-base) var(--ease-out-quart);
}

.tilt:hover {
  transform: perspective(600px) rotateX(8deg) rotateY(-8deg) scale(1.04);
}

.tilt > * {
  transform: translateZ(20px);
}

/* -------------------- GLOWING BORDER -------------------- */
.glow-border {
  position: relative;
  isolation: isolate;
  border-radius: var(--radius-md);
}

.glow-border::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--grad-accent-2);
  z-index: -1;
  opacity: 0;
  filter: blur(12px);
  transition: opacity var(--t-base) ease;
}

.glow-border:hover::before {
  opacity: 0.8;
}

/* -------------------- HOLOGRAPHIC CARD -------------------- */
.holo {
  position: relative;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.02) 50%,
      rgba(255, 255, 255, 0.08) 100%),
    var(--grad-card);
  isolation: isolate;
  overflow: hidden;
}

.holo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 65%
  );
  background-size: 200% 100%;
  background-position: -100% 0;
  mix-blend-mode: overlay;
  pointer-events: none;
  transition: background-position 1.6s ease;
}

.holo:hover::after {
  background-position: 100% 0;
}

/* -------------------- METAL SHEEN -------------------- */
.sheen {
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--color-fg) 28%, transparent),
    color-mix(in oklab, var(--color-fg) 8%, transparent) 30%,
    color-mix(in oklab, var(--color-fg) 28%, transparent));
  border-radius: var(--radius-sm);
}

/* -------------------- TYPEWRITER -------------------- */
.typewriter {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--color-accent);
  animation:
    typewriter 2.4s steps(38, end) forwards,
    typewriterCaret 0.8s step-end infinite;
}

/* -------------------- ORBITER -------------------- */
.orbiter {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.orbiter__core {
  font-size: 56px;
  filter: drop-shadow(0 0 20px var(--color-accent-soft));
}

.orbiter__satellite {
  position: absolute;
  font-size: 24px;
  animation: orbit 6s linear infinite;
}

.orbiter__satellite--2 {
  animation-duration: 8s;
  animation-direction: reverse;
}

.orbiter__satellite--3 {
  animation-duration: 10s;
}

/* -------------------- CURSOR TRAIL DOT -------------------- */
.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  pointer-events: none;
  z-index: var(--layer-toast);
  mix-blend-mode: screen;
  transform: translate(-50%, -50%);
  transition: opacity var(--t-base) ease;
  box-shadow: 0 0 12px var(--color-accent);
}

.cursor-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--layer-toast);
  transform: translate(-50%, -50%);
  opacity: 0.6;
  animation: trailFade 600ms ease forwards;
}

@keyframes trailFade {
  to { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
}

/* -------------------- TILT ON HOVER (subtle) -------------------- */
.hover-lift {
  transition: transform var(--t-base) var(--ease-out-back);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-pop {
  transition: transform var(--t-base) var(--ease-out-back);
}

.hover-pop:hover {
  transform: scale(1.08);
}

.hover-shake:hover {
  animation: wiggle 0.4s ease;
}

/* -------------------- DOTS LOADER -------------------- */
.dots {
  display: inline-flex;
  gap: 4px;
}

.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: typingDots 1.4s infinite ease-in-out;
}

.dots span:nth-child(1) { animation-delay: -0.32s; }
.dots span:nth-child(2) { animation-delay: -0.16s; }
.dots span:nth-child(3) { animation-delay: 0s; }

/* -------------------- PULSE RING -------------------- */
.pulse-ring {
  position: relative;
}

.pulse-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--color-accent);
  animation: pulseRing 1.6s ease-out infinite;
}

/* -------------------- SOFT BORDER GLOW (animated) -------------------- */
.aglow {
  position: relative;
  isolation: isolate;
}

.aglow::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    var(--color-accent),
    var(--color-accent-2),
    var(--color-accent-3),
    var(--color-accent));
  z-index: -1;
  animation: spin 4s linear infinite;
  filter: blur(6px);
  opacity: 0.6;
}

/* -------------------- COSMIC DUST -------------------- */
.dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 80% 20%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 30% 80%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 90% 60%, rgba(255, 255, 255, 0.5), transparent);
  background-size: 200px 200px;
  background-repeat: repeat;
  animation: float1 30s linear infinite;
  opacity: 0.6;
}

/* -------------------- KONAMI EFFECT -------------------- */
.konami-active {
  animation: rainbowShift 2s linear infinite;
}

.konami-active .card,
.konami-active .sticker,
.konami-active .reaction-pack {
  animation: jello 1s ease;
}
