/* ==========================================================================
   HAUNT.GG EFFECTS & ASSETS TOOLKIT FOR WEBSITES
   ========================================================================== */

:root {
  --haunt-primary: #f27db3;
  --haunt-primary-rgb: 242, 125, 179;
  --haunt-bg: #0c0c10;
  --haunt-card-bg: rgba(22, 22, 30, 0.75);
  --haunt-card-border: rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------------------------
   1. AVATAR & DECORACIONES ANIMADAS
   -------------------------------------------------------------------------- */
.haunt-avatar-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  user-select: none;
}

.haunt-avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #1e1e28;
  position: relative;
  z-index: 1;
}

.haunt-decoration-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 120px;
  height: 120px;
  pointer-events: none;
  z-index: 2;
}

.avatar-wrap .haunt-decoration-img,
.gunslol-avatar-wrap .haunt-decoration-img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 124%;
  height: 124%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}

/* --------------------------------------------------------------------------
   2. EFECTOS DE NOMBRE (USERNAME EFFECTS)
   -------------------------------------------------------------------------- */
.haunt-username {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

/* Glow */
.haunt-glow {
  text-shadow: 0 0 calc(var(--haunt-glow-strength, 5) * 2px) var(--haunt-glow-color, var(--haunt-primary));
}

/* Rainbow text */
.haunt-rainbow-text {
  background: linear-gradient(
    var(--haunt-name-angle, 90deg),
    #ff3b5c, #ff9f0a, #ffd60a, #30d158, #40c8e0, #0a84ff, #bf5af2, #ff3b5c
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hauntRainbowFlow 4s linear infinite;
}

@keyframes hauntRainbowFlow {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Gradient text */
.haunt-gradient-text {
  background: linear-gradient(
    var(--haunt-name-angle, 90deg),
    var(--haunt-c1, #f27db3),
    var(--haunt-c2, #9e6bff),
    var(--haunt-c3, #0a84ff)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Sparkles / Particles superpuestas */
.haunt-sparkles-overlay {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  pointer-events: none;
  object-fit: cover;
  mix-blend-mode: screen;
  z-index: 3;
}

/* Typewriter cursor */
.haunt-typewriter-cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--haunt-primary);
  animation: hauntCaret 1s steps(2, start) infinite;
}

@keyframes hauntCaret {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Focus Frame & Orbit */
.haunt-focus-wrapper {
  position: relative;
  display: inline-block;
  padding: 6px 12px;
}

.haunt-focus-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.haunt-focus-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border-style: solid;
  border-color: var(--haunt-focus-color, var(--haunt-primary));
  filter: drop-shadow(0 0 4px var(--haunt-focus-color, var(--haunt-primary)));
}

.haunt-focus-tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.haunt-focus-tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.haunt-focus-bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.haunt-focus-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.haunt-focus-orbiting {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--haunt-focus-color, var(--haunt-primary));
  animation: hauntFocusOrbit 3s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes hauntFocusOrbit {
  0%   { top: -4px; left: -4px; }
  25%  { top: -4px; left: calc(100% - 6px); }
  50%  { top: calc(100% - 6px); left: calc(100% - 6px); }
  75%  { top: calc(100% - 6px); left: -4px; }
  100% { top: -4px; left: -4px; }
}

/* --------------------------------------------------------------------------
   3. EFECTOS DE FONDO (BACKGROUND EFFECTS)
   -------------------------------------------------------------------------- */

/* Linterna interactiva (Flashlight) */
.haunt-flashlight-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  background: radial-gradient(
    circle 240px at var(--p-flashlight-x, 50vw) var(--p-flashlight-y, 50vh),
    rgba(255, 255, 255, 0.12) 0%,
    rgba(0, 0, 0, 0.45) 80%,
    rgba(0, 0, 0, 0.75) 100%
  );
  mix-blend-mode: overlay;
}

/* Old TV (Scanlines + Static) */
.haunt-tv-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 98;
  background: linear-gradient(rgba(0, 0, 0, 0.35) 50%, rgba(0, 0, 0, 0) 50%);
  background-size: 100% 3px;
  opacity: 0.7;
}

.haunt-tv-static {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 97;
  opacity: 0.08;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='tvNoise'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23tvNoise)'/></svg>");
  animation: hauntTvStatic 0.2s steps(4) infinite;
}

@keyframes hauntTvStatic {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 3%); }
  50% { transform: translate(3%, -3%); }
  75% { transform: translate(-2%, -2%); }
  100% { transform: translate(0, 0); }
}

/* Dither Grain */
.haunt-dither-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 96;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='dn'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23dn)' opacity='0.9'/></svg>");
  background-size: 140px 140px;
}

.haunt-dither-dots {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  background-image: radial-gradient(rgba(240, 230, 210, 0.4) 1px, transparent 1.4px);
  background-size: 4px 4px;
}

/* --------------------------------------------------------------------------
   4. TARJETAS Y WIDGETS
   -------------------------------------------------------------------------- */
.haunt-card {
  background: var(--haunt-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--haunt-card-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
}

.haunt-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
  transition: transform 0.2s;
}

.haunt-badge-icon:hover {
  transform: scale(1.15);
}

.haunt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(242, 125, 179, 0.3);
  background: rgba(242, 125, 179, 0.12);
  color: var(--haunt-primary);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.haunt-btn:hover {
  background: rgba(242, 125, 179, 0.22);
  transform: translateY(-1px);
}
