/* Shared scroll performance overrides.
   Root issue: large shells used backdrop-filter blur together with overflow:clip
   and position:sticky descendants. That combo forces expensive re-blur work on
   every scroll frame, even on the News hub (few images). Sticky gallery tabs
   and the mobile top bar had the same cost on image-heavy pages.
   Look is preserved with slightly more opaque fills instead of live blur.

   Second pass: freeze placeholder shimmer (hundreds of .shot tiles), soften
   remaining large shadows, tighten snow containment, skip off-screen squads,
   and keep sticky chrome blur-free (already ~opaque). */

main {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  /* Was rgba(..., 0.72) + blur(10px); opaque fill reads similarly without GPU blur. */
  background: rgba(8, 20, 32, 0.88) !important;
  /* Soften the huge shadow paint area that rode along with the filtered layer. */
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32) !important;
}

/* Standalone frosted cards that still declared blur (nested .content .bf6 already opted out). */
.bf6 {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(8, 20, 32, 0.88) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32) !important;
}
/* Nested cards already use a light translucent fill; do not reintroduce a big shadow. */
.content .bf6,
.content .box {
  box-shadow: none !important;
  background: rgba(8, 20, 32, 0.35) !important;
}

/* Sticky chrome: backgrounds were already ~0.88–0.92 opaque; blur was redundant. */
.topbar,
.gal-tabs,
.to-top {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.topbar {
  background: rgba(7, 19, 31, 0.97) !important;
}
.gal-tabs {
  background: rgba(7, 19, 31, 0.96) !important;
}
.to-top {
  background: rgba(8, 20, 32, 0.96) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28) !important;
}

/* Lightbox only when open; solid dim is enough and cheaper. */
dialog.lb::backdrop {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(2, 8, 14, 0.92) !important;
}

/* Avatar ring shadow: smaller blur radius = less paint while sticky side moves. */
.face {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32) !important;
}

/* Lightbox frame shadow only matters when open; smaller blur = cheaper paint. */
.lb-frame img {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
}

/* Fixed snow flecks: static tile (no keyframes), but still a full-viewport layer.
   Contain paint so scroll of main does not dirty the fleck layer as much.
   Do not raise main above .snow — flecks are meant to overlay the card. */
.snow {
  contain: strict;
  transform: translateZ(0);
}

/* Placeholder shimmer: infinite background-position animation on every unloaded
   .shot (hundreds on skins/official art) costs main-thread + compositor time
   during scroll. Keep the soft gradient; drop the motion. */
.shot:not(.ld):not(.shot-none) {
  animation: none !important;
}

/* Skip layout/paint for off-screen gallery cards and news stories. */
.gal-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 360px;
}
.story {
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}
/* Collapsed/off-screen squad sections on skins.html. */
details.gal-squad {
  content-visibility: auto;
  contain-intrinsic-size: auto 88px;
}

/* Sticky side panel: limit how much of its subtree invalidates with page scroll.
   Avoid contain:paint here — it can interfere with position:sticky. */
.side {
  contain: layout;
}

@media (prefers-reduced-motion: reduce) {
  .snow { display: none !important; }
  .shot:not(.ld):not(.shot-none) { animation: none !important; }
}
