/* Prevent browser edge bounce without disabling normal document scrolling. */
html, body { overscroll-behavior-y: none; }

/* One viewport-sized background for every page, independent of page height/scroll. */
body:has(> .augment-site-background) {
  isolation: isolate;
  background: #06040e !important;
}
body > .augment-site-background {
  position: fixed;
  inset: 112px 0 0;
  height: calc(100vh - 112px);
  height: calc(100lvh - 112px);
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(6,4,14,.48) 0%, rgba(6,4,14,.58) 45%, rgba(4,3,9,.82) 100%),
    url('../img/intro-detailed.webp');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
/* Page wrappers expose the same layer. Panels retain their own backgrounds. */
body .intro-hero,
body .hiscore-page,
body #vote,
body #vote.augment-vote-page,
body #vote.mt-auto,
body #vote.py-12,
body #vote.bg-gray-800,
body .redirect-page {
  background: transparent !important;
}
body .intro-hero::before,
body .hiscore-page::before,
body .hiscore-page::after,
body #vote::before,
body #vote::after,
body #vote.augment-vote-page::before,
body #vote.augment-vote-page::after {
  content: none !important;
}

/* Match Vote's fixed navigation so the scene starts below the same 112px header. */
body:has(> .topbar) { padding-top:112px !important; }
body > .topbar { position:fixed !important; top:0; left:0; right:0; z-index:9999; }
body > .navglass { position:fixed !important; top:38px; left:0; right:0; z-index:9998; }
body > .sheet { position:fixed !important; top:112px; }
body:not(:has(> .topbar)) > .augment-site-background { inset:0; height:100vh; height:100lvh; }

/* Tiny local glows: only opacity changes, with no full-screen animated surface. */
body > .augment-site-background { overflow: hidden; }
.scene-lantern {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(255,235,169,.74) 0%, rgba(255,186,75,.34) 16%,
    rgba(239,125,31,.14) 38%, rgba(225,105,22,0) 72%);
  opacity: .46;
  animation: augment-lantern-flicker var(--light-duration) ease-in-out var(--light-delay) infinite;
}
.scene-lantern--violet {
  background: radial-gradient(ellipse at center,
    rgba(249,219,255,.8) 0%, rgba(218,130,255,.42) 16%,
    rgba(175,60,244,.2) 38%, rgba(139,36,218,0) 72%);
}
.scene-lantern[hidden] { display: none; }
.scene-lights-paused .scene-lantern { animation-play-state: paused; }
@keyframes augment-lantern-flicker {
  0%, 100% { opacity: .38; }
  17% { opacity: .63; }
  29% { opacity: .44; }
  43% { opacity: .72; }
  58% { opacity: .50; }
  74% { opacity: .65; }
  88% { opacity: .42; }
}
@media (max-width: 768px), (pointer: coarse) {
  .scene-lantern { animation-duration: 6s; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-lantern { display: none; animation: none; }
}
