/* background.css — the original page's .rb-root layer (spaces restored), fixed behind every screen.
   The neon glow animates opacity only (a static drop-shadow on the element) — it looks the same
   as the original's animated filter but doesn't repaint every frame on phones. */

.rb-root {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg);
  transition: background-color 1.2s ease;
  contain: strict;
}
.rb-grad {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1100px 720px at 72% 16%, rgba(255, 255, 255, .32), transparent 60%),
    radial-gradient(900px 700px at 20% 90%, rgba(255, 255, 255, .14), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(0, 0, 0, .10) 55%, rgba(0, 0, 0, .34));
}
.rb-overlay { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.rb-warm { background: radial-gradient(800px 600px at 50% 30%, rgba(255, 200, 150, .22), transparent 65%); }
.rb-gold { background: radial-gradient(700px 500px at 50% 40%, rgba(255, 211, 110, .35), transparent 60%); }
.rb-vig  { background: radial-gradient(ellipse at center, transparent 40%, rgba(40, 0, 15, .55)); }

.rb-neon {
  position: absolute;
  fill: none;
  stroke: rgba(255, 255, 255, .92);
  stroke-width: .9;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .85)) drop-shadow(0 0 18px rgba(255, 150, 185, .9));
  will-change: opacity;
}
.rb-n1 { width: min(34vw, 220px); right: 7%; top: 11%; animation: rbPulse 5s ease-in-out infinite; }
.rb-n2 { width: min(26vw, 164px); right: 25%; top: 26%; animation: rbPulse 5s ease-in-out .9s infinite; }
.rb-n3 { width: min(16vw, 110px); left: 8%; bottom: 16%; opacity: .4; animation: rbPulse3 6.5s ease-in-out .4s infinite; }
@keyframes rbPulse { 0%, 100% { opacity: .45; } 50% { opacity: .95; } }
@keyframes rbPulse3 { 0%, 100% { opacity: .2; } 50% { opacity: .45; } }

.rb-layer { position: absolute; inset: 0; transition: opacity 1.2s ease; }
.rb-fh {
  position: absolute;
  bottom: -6%;
  color: rgba(255, 255, 255, .6);
  animation: rbRise linear infinite;
  will-change: transform, opacity;
}
@keyframes rbRise {
  0% { transform: translateY(0) scale(.5) rotate(-8deg); opacity: 0; }
  12% { opacity: .75; }
  100% { transform: translateY(-92vh) scale(1) rotate(8deg); opacity: 0; }
}
.rb-sp {
  position: absolute;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, .9);
  animation: rbTw ease-in-out infinite;
}
@keyframes rbTw { 0%, 100% { opacity: .1; transform: scale(.4); } 50% { opacity: .95; transform: scale(1); } }
.rb-star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  animation: rbTw 3s ease-in-out infinite;
}

/* extra layers are off unless a mood turns them on */
.rb-joy, .rb-extra-sparks, .rb-stars { opacity: 0; }

/* ---------- moods ---------- */
html[data-mood="hush"] .rb-hearts { opacity: .6; }
html[data-mood="hush"] .rb-neons { opacity: .5; }
html[data-mood="golden"] .rb-warm { opacity: .7; }
html[data-mood="sparkle"] .rb-extra-sparks { opacity: 1; }
html[data-mood="play"] .rb-hearts, html[data-mood="play"] .rb-sparks { opacity: 0; }
html[data-mood="play"] .rb-neons { opacity: .2; }
html[data-mood="play"] .rb-neon { animation-play-state: paused; }
html[data-mood="velvet"] .rb-hearts .rb-fh:nth-child(n+6) { opacity: 0 !important; }
html[data-mood="velvet"] .rb-hearts { opacity: .5; }
html[data-mood="velvet"] .rb-vig { opacity: .7; }
html[data-mood="velvet"] .rb-stars { opacity: 1; }
html[data-mood="candle"] .rb-warm { opacity: .8; }
html[data-mood="candle"] .rb-vig { opacity: .35; }
html[data-mood="candle"] .rb-hearts { opacity: .5; }
html[data-mood="candle"] .rb-neons { opacity: .45; }
html[data-mood="joy"] .rb-joy { opacity: 1; }
html[data-mood="joy"] .rb-gold { opacity: .5; }
html[data-mood="joy"] .rb-extra-sparks { opacity: 1; }

/* paused while the game runs / heavy confetti */
html.bg-paused .rb-fh, html.bg-paused .rb-sp, html.bg-paused .rb-neon, html.bg-paused .rb-star { animation-play-state: paused; }

html.lite .rb-neon { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .8)); }

@media (prefers-reduced-motion: reduce) {
  .rb-neon, .rb-fh, .rb-sp, .rb-star { animation: none !important; }
  .rb-fh { display: none; }
}
