/* UI 017.3P.1 — Character battery / thermal pass.
   Goal: while the isolated Character layer is open, the page should behave like a static page.
   Battle/Home visuals are unchanged as soon as Character closes. */

/* Core 0.5.3 has full-screen infinite fog/shimmer/embers on the document itself.
   They are completely invisible below Character, so do not spend GPU time on them. */
html:has(#i173a-character-layer) body::before,
html:has(#i173a-character-layer) body::after{
  animation:none!important;
  filter:none!important;
  opacity:0!important;
  content:none!important;
}

html:has(#i173a-character-layer) .arena-ambience{
  display:none!important;
  visibility:hidden!important;
}

html:has(#i173a-character-layer) .arena-ambience *,
html:has(#i173a-character-layer) .arena-ambience *::before,
html:has(#i173a-character-layer) .arena-ambience *::after{
  animation:none!important;
  filter:none!important;
}

/* Home sits underneath Character. Keep its box geometry available for the cloned dock,
   but skip its paint and pause CSS animation work while Character is visible. */
html:has(#i173a-character-layer) #i13-home-layer{
  visibility:hidden!important;
  pointer-events:none!important;
}

html:has(#i173a-character-layer) #i13-home-layer,
html:has(#i173a-character-layer) #i13-home-layer *,
html:has(#i173a-character-layer) #i13-home-layer *::before,
html:has(#i173a-character-layer) #i13-home-layer *::after{
  animation-play-state:paused!important;
}

/* A transparent PNG drop-shadow forces an expensive full-image filter pass in WebKit.
   The Character portrait is static, so use the source art without the live filter. */
#i173a-character-layer .i173a-hero-art{
  filter:none!important;
  -webkit-filter:none!important;
}

/* The large decorative circular glow is not worth a full raster shadow on mobile. */
#i173a-character-layer .i173a-art-zone::before{
  box-shadow:0 0 0 1px rgba(132,54,147,.035)!important;
}

/* Isolate the two largest Character paint regions. */
#i173a-character-layer .i173a-stage,
#i173a-character-layer .i173b3-stats{
  contain:layout paint style;
}

/* B.3 can be far below the viewport. Let Safari skip its paint until it is approached. */
#i173a-character-layer .i173b3-stats{
  content-visibility:auto;
  contain-intrinsic-size:auto 760px;
}

/* No decorative perpetual animation is allowed in the static Character stage itself.
   Short state-change animations (B.3 value flashes) remain explicitly enabled below. */
#i173a-character-layer .i173a-stage *,
#i173a-character-layer .i173a-stage *::before,
#i173a-character-layer .i173a-stage *::after{
  animation-play-state:paused!important;
}

#i173a-character-layer .i173b3-value-flash-up,
#i173a-character-layer .i173b3-value-flash-down{
  animation-play-state:running!important;
}

/* Extra low-power treatment for the already selected Economical mode. */
html.arena-cool-mode:has(#i173a-character-layer) #i173a-character-layer,
html[data-performance="cool"]:has(#i173a-character-layer) #i173a-character-layer{
  background:#07050b!important;
}

html.arena-cool-mode:has(#i173a-character-layer) #i173a-character-layer .i173b3-stats,
html[data-performance="cool"]:has(#i173a-character-layer) #i173a-character-layer .i173b3-stats{
  box-shadow:none!important;
}
