/* Motion backdrop (templates/champions/base.html, champions/motion.js): a muted Riot client loop fills the fixed page
   backdrop of every page on the Pages shell, the Pages and the Arena Wiki, under the backdrop's veil, made darker here:
   darker on the Pages, whose heroes and numbers sit on it, and darkest on wiki articles, where people read. The poster
   (the loop's first frame, set on <html> with the loop by base.html) shows first, 720p below 1100px wide and 1080p
   above, as motion.js picks the video. The veil is a plain gradient layer, rasterised once. No CSS filter, mask or blend mode on the video
   (each would be re-run for every video frame) and nothing over it uses backdrop-filter or loops: the bars' blur and
   the logo's bounce are off below. No color-mix(), nesting or :has() (League client, Chromium 108). */

.cp-motion__poster,
.cp-motion__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}

.cp-motion__poster {
  background: center 40% / cover no-repeat var(--cp-poster);
}

@media (min-width: 1100px) {
  .cp-motion__poster {
    background-image: var(--cp-poster-wide);
  }
}

/* The video fades in over its own first frame (the poster) once it is really playing. */
.cp-motion__video {
  opacity: 0;
  transition: opacity 0.8s var(--j-ease-std);
}

.cp-backdrop.is-playing .cp-motion__video {
  opacity: 1;
}

/* Pages: an even dim, darker at the edges and the bottom, and a little darker on the left behind the hero text. */
.cp-backdrop .j-backdrop__veil {
  background-color: rgba(var(--j-ink-rgb), 0.62);
  background-image:
    radial-gradient(120% 95% at 55% 30%, rgba(var(--j-ink-rgb), 0) 35%, rgba(var(--j-ink-rgb), 0.6) 100%),
    linear-gradient(180deg, rgba(var(--j-ink-rgb), 0.3) 0%, rgba(var(--j-ink-rgb), 0) 22%, rgba(var(--j-ink-rgb), 0.45) 100%),
    linear-gradient(90deg, rgba(var(--j-ink-rgb), 0.35) 0%, rgba(var(--j-ink-rgb), 0) 55%);
}

/* Wiki home and list pages: a lighter dim, as approved for the wiki on 23 Nov 2026. */
.cp-backdrop.wk-backdrop .j-backdrop__veil {
  background-color: rgba(var(--j-ink-rgb), 0.5);
}

/* Wiki articles: reading pages. The statements sit on solid sheets, but the title, the facts line and the margins sit
   on the clip, so the dim is much stronger. */
.cp-backdrop.wk-backdrop--wiki-article .j-backdrop__veil,
.cp-backdrop.wk-backdrop--wiki-votes .j-backdrop__veil {
  background-color: rgba(var(--j-ink-rgb), 0.72);
}

/* Over a playing video, the live blur of the top bar and of the champion pages' sticky section tabs would be re-run
   for every video frame (both bars are nearly opaque anyway), and the logo's endless bounce would make the page draw
   every screen refresh instead of every video frame. Without a GPU this matters most: with the earlier drifting
   backdrop, the bar's blur and the bounce, Firefox 159 with software rendering drew a wiki page at 9 fps doing nothing
   (6 Nov 2026). */
.cp-body .j-topbar,
.cp-body .cp-tabs {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.cp-body .j-topbar .j-brand__sweats {
  animation: none;
}

/* "Pause the background" (fixed, bottom right), styled as the Arena Profile scene's button (journey/arena-scene.css). */
.cp-motion-toggle {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--j-line-control);
  background: rgba(var(--j-ink-rgb), 0.72);
  color: var(--j-muted);
  cursor: pointer;
  transition: border-color var(--j-dur-fast) var(--j-ease-std), color var(--j-dur-fast) var(--j-ease-std);
}

.cp-motion-toggle[hidden] {
  display: none;
}

.cp-motion-toggle:hover {
  border-color: var(--j-gold-300);
  color: var(--j-gold-100);
}

.cp-motion-toggle .j-i {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
}
