/**
 * QUIZTREFF COSMETICS - Full Slot System
 * =======================================
 * Lesbarkeit bleibt König: Overlays/Particles immer mit Subtle-Mode (Opacity capped)
 * Neon nur als Akzent, nicht als Flutlicht
 * CSS-only Animationen, prefers-reduced-motion respektieren
 */

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== PROFILE BACKGROUNDS ========== */

/* Noir Violet Fog */
body.cos-bg-noir-violet-fog {
  background: linear-gradient(180deg, #0a0010 0%, #050508 100%) !important;
}
body.cos-bg-noir-violet-fog::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(140,0,255,0.12), transparent 60%),
    radial-gradient(ellipse 60% 40% at 30% 20%, rgba(255,0,200,0.08), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Starfield Soft */
body.cos-bg-starfield-soft::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 80% 60%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 90% 40%, rgba(255,255,255,0.35), transparent);
  background-size: 200px 200px;
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

/* Neon Grid Floor */
body.cos-bg-neon-grid-floor::before {
  content: "";
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.8) 100%),
    repeating-linear-gradient(90deg, rgba(255,0,200,0.06) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(0deg, rgba(0,200,255,0.04) 0 1px, transparent 1px 60px);
  transform: perspective(500px) rotateX(60deg);
  transform-origin: bottom;
  pointer-events: none;
  z-index: -1;
  opacity: 0.7;
}

/* Arcade Smoke */
body.cos-bg-arcade-smoke::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 60% at 50% 100%, rgba(80,0,120,0.15), transparent 70%),
    radial-gradient(ellipse 80% 40% at 20% 80%, rgba(0,100,180,0.10), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* Galaxy Band */
body.cos-bg-galaxy-band::before {
  content: "";
  position: fixed;
  top: 30%;
  left: -10%;
  right: -10%;
  height: 40%;
  background:
    radial-gradient(ellipse 100% 100% at 50% 50%, rgba(140,0,255,0.12), transparent 60%),
    radial-gradient(ellipse 80% 60% at 30% 40%, rgba(255,0,200,0.08), transparent 50%),
    radial-gradient(ellipse 60% 80% at 70% 60%, rgba(0,150,255,0.06), transparent 50%);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.8;
}

/* Black Ice */
body.cos-bg-black-ice::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(200,220,255,0.03) 0%, transparent 50%),
    linear-gradient(225deg, rgba(180,200,255,0.02) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
}
body.cos-bg-black-ice::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    120deg,
    transparent 0px,
    transparent 100px,
    rgba(200,220,255,0.015) 100px,
    rgba(200,220,255,0.015) 101px
  );
  pointer-events: none;
  z-index: -1;
}

/* ========== HEADER GLOW STYLES ========== */

.profile-header-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  pointer-events: none;
  z-index: 0;
}

/* Violet Crown */
.cos-hdr-violet-crown {
  background: radial-gradient(ellipse 50% 100% at 50% 0%, rgba(160,0,255,0.25), transparent 70%);
}

/* Dual Tone */
.cos-hdr-dual-tone {
  background:
    radial-gradient(ellipse 40% 100% at 20% 0%, rgba(160,0,255,0.20), transparent 60%),
    radial-gradient(ellipse 40% 100% at 80% 0%, rgba(0,180,255,0.18), transparent 60%);
}

/* Rainbow Neon Soft */
.cos-hdr-rainbow-neon-soft {
  background: linear-gradient(90deg,
    rgba(255,0,0,0.08) 0%,
    rgba(255,150,0,0.08) 20%,
    rgba(255,255,0,0.06) 40%,
    rgba(0,255,100,0.06) 60%,
    rgba(0,150,255,0.08) 80%,
    rgba(150,0,255,0.08) 100%
  );
  filter: blur(30px);
  opacity: 0.7;
}

/* Blackhole */
.cos-hdr-blackhole {
  background: radial-gradient(ellipse 60% 120% at 50% -20%, rgba(0,0,0,0.9), transparent 50%),
              radial-gradient(ellipse 80% 100% at 50% 0%, rgba(80,0,120,0.15), transparent 60%);
}

/* ========== PROFILE OVERLAYS ========== */

.profile-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

/* Vignette Soft */
.cos-ov-vignette-soft {
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 50%, rgba(0,0,0,0.4) 100%);
}

/* Filmgrain Ultra */
.cos-ov-filmgrain-ultra {
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Scanlines Arcade */
.cos-ov-scanlines-arcade {
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  opacity: 0.5;
}

/* Raindrops Window */
.cos-ov-raindrops-window {
  background:
    radial-gradient(ellipse 3px 4px at 10% 20%, rgba(255,255,255,0.08), transparent),
    radial-gradient(ellipse 2px 3px at 25% 45%, rgba(255,255,255,0.06), transparent),
    radial-gradient(ellipse 4px 5px at 40% 15%, rgba(255,255,255,0.07), transparent),
    radial-gradient(ellipse 2px 4px at 55% 70%, rgba(255,255,255,0.05), transparent),
    radial-gradient(ellipse 3px 3px at 70% 35%, rgba(255,255,255,0.06), transparent),
    radial-gradient(ellipse 2px 5px at 85% 60%, rgba(255,255,255,0.07), transparent),
    radial-gradient(ellipse 4px 4px at 95% 25%, rgba(255,255,255,0.05), transparent);
  background-size: 100px 150px;
  opacity: 0.6;
}

/* ========== AVATAR FRAMES ========== */

/* Simple Glow Violet */
.cos-af-simple-glow-violet {
  box-shadow: 0 0 0 3px rgba(160,0,255,0.5), 0 0 20px rgba(160,0,255,0.3);
  border-radius: 16px;
}

/* Arcade Tube */
.cos-af-arcade-tube {
  box-shadow:
    0 0 0 2px rgba(255,0,200,0.7),
    0 0 10px rgba(255,0,200,0.5),
    0 0 20px rgba(255,0,200,0.3),
    inset 0 0 10px rgba(255,0,200,0.2);
  border-radius: 16px;
}

/* Hologram Hex */
.cos-af-hologram-hex {
  box-shadow: 0 0 0 3px rgba(0,255,200,0.4), 0 0 25px rgba(0,255,200,0.2);
  border-radius: 16px;
  animation: hologram-shimmer 3s ease-in-out infinite;
}
@keyframes hologram-shimmer {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0,255,200,0.4), 0 0 25px rgba(0,255,200,0.2); }
  50% { box-shadow: 0 0 0 3px rgba(255,0,200,0.4), 0 0 25px rgba(255,0,200,0.2); }
}

/* Crown Quizlord */
.cos-af-crown-quizlord {
  position: relative;
  box-shadow: 0 0 0 3px rgba(255,215,0,0.5), 0 0 20px rgba(255,215,0,0.25);
  border-radius: 16px;
}
.cos-af-crown-quizlord::before {
  content: "👑";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  filter: drop-shadow(0 0 4px rgba(255,215,0,0.6));
}

/* Black Onyx */
.cos-af-black-onyx {
  box-shadow:
    0 0 0 2px rgba(40,40,50,0.9),
    0 0 0 4px rgba(100,100,120,0.3),
    0 0 15px rgba(0,0,0,0.5);
  border-radius: 16px;
}

/* ========== AVATAR AURAS ========== */

.avatar-aura {
  position: absolute;
  inset: -20px;
  pointer-events: none;
  z-index: -1;
}

/* Stars Orbit */
.cos-aa-stars-orbit {
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 80% 20%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 60% 80%, rgba(255,255,255,0.7), transparent),
    radial-gradient(2px 2px at 10% 70%, rgba(255,255,255,0.5), transparent);
  animation: orbit-rotate 12s linear infinite;
  border-radius: 50%;
}
@keyframes orbit-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Violet Mist */
.cos-aa-violet-mist {
  background: radial-gradient(circle at 50% 50%, rgba(160,0,255,0.25), transparent 70%);
  filter: blur(15px);
  border-radius: 50%;
}

/* Lightning Soft */
.cos-aa-lightning-soft {
  background:
    linear-gradient(45deg, transparent 40%, rgba(200,220,255,0.15) 45%, transparent 50%),
    linear-gradient(-45deg, transparent 40%, rgba(200,220,255,0.12) 45%, transparent 50%);
  animation: lightning-pulse 4s ease-in-out infinite;
  border-radius: 50%;
}
@keyframes lightning-pulse {
  0%, 90%, 100% { opacity: 0.3; }
  92%, 94% { opacity: 0.8; }
}

/* Confetti Micro */
.cos-aa-confetti-micro {
  opacity: 0;
  transition: opacity 0.3s;
}
.avatar-wrap:hover .cos-aa-confetti-micro {
  opacity: 1;
  background:
    radial-gradient(3px 3px at 15% 25%, rgba(255,0,200,0.7), transparent),
    radial-gradient(2px 2px at 30% 60%, rgba(0,200,255,0.6), transparent),
    radial-gradient(3px 3px at 70% 30%, rgba(255,200,0,0.7), transparent),
    radial-gradient(2px 2px at 85% 70%, rgba(0,255,150,0.6), transparent);
  animation: confetti-fall 1s ease-out forwards;
}
@keyframes confetti-fall {
  from { transform: translateY(-10px); }
  to { transform: translateY(10px); opacity: 0; }
}

/* ========== NAMEPLATES ========== */

.nameplate {
  position: relative;
  display: inline-block;
}

/* Glass Bar */
.cos-np-glass-bar {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Neon Underline */
.cos-np-neon-underline {
  border-bottom: 2px solid rgba(255,0,200,0.6);
  box-shadow: 0 2px 10px rgba(255,0,200,0.3);
  padding-bottom: 4px;
}

/* Galaxy Sheen */
.cos-np-galaxy-sheen {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(160,0,255,0.15) 30%,
    rgba(0,150,255,0.15) 70%,
    transparent 100%
  );
  padding: 4px 16px;
  border-radius: 8px;
}

/* ========== BADGES ========== */

.profile-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 14px;
  margin-left: 8px;
}

.cos-bd-first-steps { filter: drop-shadow(0 0 3px rgba(255,100,0,0.5)); }
.cos-bd-arcade-chip { filter: drop-shadow(0 0 3px rgba(0,255,200,0.5)); }
.cos-bd-star-violet { filter: drop-shadow(0 0 4px rgba(160,0,255,0.6)); }
.cos-bd-crown-micro { filter: drop-shadow(0 0 5px rgba(255,215,0,0.6)); }
.cos-bd-boardgame-die { filter: drop-shadow(0 0 3px rgba(255,0,200,0.5)); }

/* ========== TITLE PREFIXES ========== */

.title-prefix {
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
}

.cos-tp-neo {
  background: rgba(0,255,200,0.15);
  color: rgba(0,255,200,0.9);
  border: 1px solid rgba(0,255,200,0.3);
}

.cos-tp-arcade {
  background: rgba(255,0,200,0.15);
  color: rgba(255,0,200,0.9);
  border: 1px solid rgba(255,0,200,0.3);
}

.cos-tp-quizpilot {
  background: rgba(0,150,255,0.15);
  color: rgba(100,200,255,0.9);
  border: 1px solid rgba(0,150,255,0.3);
}

.cos-tp-shadowhost {
  background: rgba(80,0,120,0.3);
  color: rgba(200,150,255,0.9);
  border: 1px solid rgba(140,0,200,0.4);
  text-shadow: 0 0 8px rgba(140,0,200,0.5);
}

.cos-tp-galaxy-vip {
  background: linear-gradient(90deg, rgba(160,0,255,0.2), rgba(0,150,255,0.2));
  color: rgba(255,220,255,0.95);
  border: 1px solid rgba(200,100,255,0.4);
  text-shadow: 0 0 10px rgba(200,100,255,0.5);
}

/* ========== STATCARD SKINS ========== */

/* Ember Gold (Singleplayer) */
.cos-sc-ember-gold {
  background: linear-gradient(135deg, rgba(255,150,0,0.15), rgba(255,100,0,0.1)) !important;
  border-color: rgba(255,150,0,0.3) !important;
  box-shadow: 0 0 20px rgba(255,120,0,0.15);
}

/* Ocean Neon (Multiplayer) */
.cos-sc-ocean-neon {
  background: linear-gradient(135deg, rgba(0,150,255,0.15), rgba(0,100,200,0.1)) !important;
  border-color: rgba(0,150,255,0.3) !important;
  box-shadow: 0 0 20px rgba(0,150,255,0.15);
  animation: ocean-pulse 3s ease-in-out infinite;
}
@keyframes ocean-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,150,255,0.15); }
  50% { box-shadow: 0 0 30px rgba(0,150,255,0.25); }
}

/* Violet Royal (Boardgame) */
.cos-sc-violet-royal {
  background: linear-gradient(135deg, rgba(140,0,200,0.15), rgba(100,0,160,0.1)) !important;
  border-color: rgba(160,0,255,0.3) !important;
  box-shadow: 0 0 20px rgba(140,0,200,0.15);
}

/* Triple Prism */
.cos-sc-triple-prism {
  background: linear-gradient(135deg,
    rgba(255,0,100,0.1),
    rgba(100,0,255,0.1),
    rgba(0,200,255,0.1)
  ) !important;
  border-color: rgba(200,100,255,0.3) !important;
}

/* Obsidian Minimal */
.cos-sc-obsidian-minimal {
  background: rgba(15,15,20,0.9) !important;
  border: 1px solid rgba(80,80,100,0.3) !important;
}

/* ========== TROPHYCARD SKINS ========== */

/* Goldfoil */
.cos-tc-goldfoil {
  background: linear-gradient(135deg,
    rgba(255,215,0,0.08) 0%,
    rgba(255,180,0,0.15) 50%,
    rgba(255,215,0,0.08) 100%
  ) !important;
  border-color: rgba(255,200,0,0.4) !important;
}

/* Holo Card */
.cos-tc-holo-card {
  background: linear-gradient(135deg,
    rgba(255,0,200,0.08),
    rgba(0,255,200,0.08),
    rgba(255,200,0,0.08),
    rgba(0,150,255,0.08)
  ) !important;
  background-size: 400% 400%;
  animation: holo-shift 5s ease infinite;
  border-color: rgba(255,255,255,0.2) !important;
}
@keyframes holo-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Noir Stamp */
.cos-tc-noir-stamp {
  background: rgba(20,10,30,0.9) !important;
  border: 2px solid rgba(140,0,200,0.4) !important;
  box-shadow: inset 0 0 20px rgba(140,0,200,0.1);
}

/* ========== VICTORY ANIMATIONS ========== */

.victory-anim {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
}

.victory-anim.active {
  animation: victory-show 1.5s ease-out forwards;
}

@keyframes victory-show {
  0% { opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* Starburst Soft */
.cos-va-starburst-soft.active {
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.4), transparent 40%);
}

/* Confetti Violet */
.cos-va-confetti-violet.active {
  background:
    radial-gradient(4px 4px at 10% 20%, rgba(160,0,255,0.8), transparent),
    radial-gradient(3px 3px at 20% 40%, rgba(200,0,255,0.7), transparent),
    radial-gradient(4px 4px at 30% 10%, rgba(180,0,255,0.8), transparent),
    radial-gradient(3px 3px at 40% 50%, rgba(140,0,255,0.7), transparent),
    radial-gradient(4px 4px at 50% 25%, rgba(160,0,255,0.8), transparent),
    radial-gradient(3px 3px at 60% 45%, rgba(200,0,255,0.7), transparent),
    radial-gradient(4px 4px at 70% 15%, rgba(180,0,255,0.8), transparent),
    radial-gradient(3px 3px at 80% 35%, rgba(140,0,255,0.7), transparent),
    radial-gradient(4px 4px at 90% 20%, rgba(160,0,255,0.8), transparent);
  animation: victory-show 1s ease-out forwards, confetti-drop 1s ease-out forwards;
}
@keyframes confetti-drop {
  from { background-position-y: -20px; }
  to { background-position-y: 100px; }
}

/* Holo Wave */
.cos-va-holo-wave.active {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,0,200,0.3) 45%,
    rgba(0,255,200,0.4) 50%,
    rgba(255,0,200,0.3) 55%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: victory-show 1.5s ease-out forwards, holo-wave-move 1s ease-out forwards;
}
@keyframes holo-wave-move {
  from { background-position-x: -100%; }
  to { background-position-x: 200%; }
}

/* ========== LOW PERF MODE ========== */
body.low-perf-mode *,
body.low-perf-mode *::before,
body.low-perf-mode *::after {
  animation: none !important;
  transition: none !important;
}

body.low-perf-mode .avatar-aura,
body.low-perf-mode .victory-anim,
body.low-perf-mode .profile-overlay.cos-ov-filmgrain-ultra,
body.low-perf-mode .profile-overlay.cos-ov-raindrops-window {
  display: none !important;
}
