/* Общий декоративный фон (главная, баланс). Разметка: <div class="bg-decor">…</div> + body.has-bg-decor */
/* ——— Декоративный фон ——— */
html { background: #050505; }
body.has-bg-decor { background: transparent !important; }
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #06060a;
}
.bg-grid {
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 25%, transparent 80%);
}
.bg-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.9;
  will-change: transform;
}
.bg-orb-1 {
  width: 520px; height: 520px;
  left: -140px; top: -120px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.55), transparent 65%);
  animation: orbDrift1 26s ease-in-out infinite alternate;
}
.bg-orb-2 {
  width: 460px; height: 460px;
  right: -120px; top: 18%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.4), transparent 65%);
  animation: orbDrift2 32s ease-in-out infinite alternate;
}
.bg-orb-3 {
  width: 600px; height: 600px;
  left: 30%; bottom: -320px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35), transparent 65%);
  animation: orbDrift3 38s ease-in-out infinite alternate;
}
@keyframes orbDrift1 { to { transform: translate(140px, 90px) scale(1.1); } }
@keyframes orbDrift2 { to { transform: translate(-160px, 120px) scale(0.9); } }
@keyframes orbDrift3 { to { transform: translate(-120px, -80px) scale(1.15); } }

.bg-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 28% 72%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 46% 34%, rgba(196, 181, 253, 0.6), transparent),
    radial-gradient(1px 1px at 63% 12%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 78% 58%, rgba(103, 232, 249, 0.55), transparent),
    radial-gradient(1px 1px at 88% 26%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 8% 88%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 55% 86%, rgba(196, 181, 253, 0.45), transparent),
    radial-gradient(1px 1px at 94% 82%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 36% 8%, rgba(103, 232, 249, 0.45), transparent);
  animation: starsTwinkle 6s ease-in-out infinite alternate;
}
@keyframes starsTwinkle { from { opacity: 0.5; } to { opacity: 1; } }

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

@media (max-width: 640px) {
  .bg-orb { filter: blur(70px); }
  .bg-orb-1 { width: 340px; height: 340px; }
  .bg-orb-2 { width: 300px; height: 300px; top: 35%; }
  .bg-orb-3 { width: 380px; height: 380px; }
  .bg-grid { background-size: 40px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-orb, .bg-stars { animation: none; }
}

