/* OUT V13.6 — restore the PR #299 known-good MV topology without rolling back V13 gameplay. */

/* V13.5 hid the original #ytBackground surface. PR #299 explicitly kept it as
   the bundled Qol BaMidbar player; restore that surface after all older CSS. */
#ytBackground,
#ytBackground.yt-background{display:block!important;visibility:visible}
body.aaa-loaded .cinema-layer.mv-ready #ytBackground,
body.aaa-loaded .cinema-layer.mv-ready #ytBackground.yt-background{
  opacity:clamp(.36,calc(var(--mv-opacity)*2.2),.84)!important;
  filter:blur(calc(var(--mv-blur)*.26)) brightness(calc(var(--mv-bright) + .42)) saturate(var(--mv-sat)) contrast(1.05)!important;
}
body.aaa-loaded .cinema-layer:not(.mv-ready) #ytBackground{opacity:0!important}
body.out-mv-disabled #ytBackground{opacity:0!important}

/* Non-Qol official tracks keep the PR #299 custom-player route. */
.out-mv-pr299-v13{position:absolute!important;inset:0!important;overflow:hidden;pointer-events:none;z-index:0!important}
.out-mv-pr299-v13>div,
.out-mv-pr299-v13 iframe{
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  width:177.77777778vh!important;
  min-width:100vw!important;
  height:100vh!important;
  min-height:56.25vw!important;
  transform:translate(-50%,-50%) scale(1.035)!important;
  border:0!important;
  pointer-events:none!important;
}
.out-mv-pr299-v13 iframe{
  opacity:clamp(.36,calc(var(--mv-opacity)*2.2),.84)!important;
  filter:blur(calc(var(--mv-blur)*.26)) brightness(calc(var(--mv-bright) + .42)) saturate(var(--mv-sat)) contrast(1.05)!important;
  transition:opacity .22s ease,filter .24s ease;
  will-change:opacity,filter,transform;
}
body.out-mv-live .out-mv-pr299-v13 iframe{opacity:clamp(.42,calc(var(--mv-opacity)*2.3),.86)!important}
body.out-mv-disabled .out-mv-pr299-v13 iframe{opacity:0!important}

/* Keep the repaired V13 foreground readability and pre-start setup surface. */
body.out-run-active .cinema-scrim{background:linear-gradient(180deg,rgba(1,3,7,.22),rgba(2,6,13,.06) 35%,rgba(2,5,12,.11) 70%,rgba(0,2,7,.34))!important}
body.out-run-active .cinema-vignette{box-shadow:inset 0 0 13vw rgba(0,0,0,.48),inset 0 -10vh 15vh rgba(0,0,0,.30)!important}

@media(max-width:760px),(pointer:coarse){
  body.aaa-loaded .cinema-layer.mv-ready #ytBackground,
  body.aaa-loaded .cinema-layer.mv-ready #ytBackground.yt-background,
  .out-mv-pr299-v13 iframe{
    opacity:clamp(.40,calc(var(--mv-opacity)*2.25),.84)!important;
    filter:blur(calc(var(--mv-blur)*.20)) brightness(calc(var(--mv-bright) + .46)) saturate(var(--mv-sat)) contrast(1.04)!important;
  }
}
