/* Frame lock — mobile uses fixed; desktop phone-frame must NOT use fixed
   (fixed escapes the 430px column → loading then empty black in the frame) */
.videoPlayer{
  position:fixed !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}
html.kariz-pc-frame .videoPlayer,
html.kariz-pc-wide .videoPlayer{
  position:absolute !important;
  left:0 !important;
  right:0 !important;
  width:100% !important;
  max-width:100% !important;
  transform:none !important;
}
#almas-xg-host,
.almas-xg-host{
  position:absolute !important;
  left:0 !important;
  top:0 !important;
  width:100% !important;
  height:100% !important;
  max-height:100% !important;
  z-index:5 !important;
  background:#000 !important;
  overflow:hidden !important;
  opacity:1 !important;
  visibility:visible !important;
}
#almas-xg-host.xgplayer,
#almas-xg-host .xgplayer{
  width:100% !important;
  height:100% !important;
  max-height:100% !important;
  margin:0 !important;
  background:#000 !important;
}
#almas-xg-host video,
#almas-xg-host .xgplayer video{
  width:100% !important;
  height:100% !important;
  object-fit:contain !important;
}
/* controls layout */
#almas-xg-host .xgplayer-controls,
#almas-xg-host xg-controls{
  position:absolute !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  height:48px !important;
  z-index:99 !important;
  background-image:linear-gradient(180deg,transparent,rgba(0,0,0,.55),rgba(0,0,0,.85)) !important;
}
/* skin hides controls for inactive / nostart / no-controls — keep that */
#almas-xg-host.xgplayer-inactive .xgplayer-controls,
#almas-xg-host.xgplayer-nostart .xgplayer-controls,
#almas-xg-host.xgplayer-no-controls .xgplayer-controls,
#almas-xg-host.xgplayer.xgplayer-inactive .xgplayer-controls,
#almas-xg-host.xgplayer-skin-default.xgplayer-inactive .xgplayer-controls,
.almas-xg-host.xgplayer-inactive .xgplayer-controls,
#almas-xg-host .xgplayer.xgplayer-inactive .xgplayer-controls{
  display:none !important;
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
}
/* FORCE SHOW — beats inactive AND nostart AND no-controls */
#almas-xg-host.almas-xg-showbar .xgplayer-controls,
#almas-xg-host.almas-xg-showbar xg-controls,
#almas-xg-host.almas-xg-showbar.xgplayer-inactive .xgplayer-controls,
#almas-xg-host.almas-xg-showbar.xgplayer-nostart .xgplayer-controls,
#almas-xg-host.almas-xg-showbar.xgplayer-no-controls .xgplayer-controls,
#almas-xg-host.almas-xg-showbar .xgplayer .xgplayer-controls,
.almas-xg-host.almas-xg-showbar .xgplayer-controls{
  display:flex !important;
  opacity:1 !important;
  visibility:visible !important;
  pointer-events:auto !important;
  z-index:99 !important;
}
.videoPlayer .fs-topbar{ z-index:30 !important; }
.videoPlayer .vip-lock{ z-index:40 !important; }
.videoPlayer .video-loading,
.videoPlayer .video-play-gate,
.videoPlayer .native-cover{
  z-index:3 !important;
  pointer-events:none !important;
}
.videoPlayer{
  background:#000 !important;
}
/* Always hide native uni-video on player route — never show native chrome */
html.almas-xg-route .videoPlayer uni-video,
html.almas-xg-route .videoPlayer .uni-video-container,
html.almas-xg-route .videoPlayer .uni-video-wrapper,
html.almas-xg-route .videoPlayer .uni-video-video,
html.almas-xg-route .videoPlayer .uni-video-bar,
html.almas-xg-route .videoPlayer .uni-video-cover,
html.almas-xg-route .videoPlayer .uni-video-slots,
html.almas-xg-route .videoPlayer > video,
.videoPlayer:has(#almas-xg-host) uni-video,
.videoPlayer:has(#almas-xg-host) .uni-video-container,
.videoPlayer:has(#almas-xg-host) .uni-video-wrapper,
.videoPlayer:has(#almas-xg-host) .uni-video-video,
.videoPlayer:has(#almas-xg-host) .uni-video-bar,
.videoPlayer:has(#almas-xg-host) .uni-video-cover,
.videoPlayer:has(#almas-xg-host) .uni-video-slots,
.videoPlayer:has(#almas-xg-host) > video{
  opacity:0 !important;
  pointer-events:none !important;
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  left:-9999px !important;
  top:0 !important;
  visibility:hidden !important;
  z-index:0 !important;
}
html.almas-xg-route .videoPlayer .video-loading,
html.almas-xg-route .videoPlayer .video-play-gate,
html.almas-xg-route .videoPlayer .native-cover,
.videoPlayer:has(#almas-xg-host) .video-loading,
.videoPlayer:has(#almas-xg-host) .video-play-gate,
.videoPlayer:has(#almas-xg-host) .native-cover{
  display:none !important;
  opacity:0 !important;
  pointer-events:none !important;
}
/* xg video must stay visible */
#almas-xg-host video,
#almas-xg-host .xgplayer video{
  opacity:1 !important;
  visibility:visible !important;
  pointer-events:auto !important;
  width:100% !important;
  height:100% !important;
  left:0 !important;
  top:0 !important;
  position:absolute !important;
  object-fit:contain !important;
  z-index:1 !important;
}
/* hide css-fullscreen (样式全屏) button — keep real fullscreen */
#almas-xg-host .xgplayer-cssfullscreen,
#almas-xg-host .xgplayer-cssfullscreen-path,
#almas-xg-host xg-cssfullscreen,
#almas-xg-host .xgplayer-icon-cssfullscreen{
  display:none !important;
  width:0 !important;
  height:0 !important;
  overflow:hidden !important;
  pointer-events:none !important;
  opacity:0 !important;
}
/* while auto-advancing, kill replay flash */
#almas-xg-host.almas-xg-autonext .xgplayer-replay,
#almas-xg-host.almas-xg-autonext .xgplayer-replayText{
  display:none !important;
}
/* fullscreen top: back + movie name — show/hide with controls */
.almas-fs-top{
  display:none;
  position:absolute !important;
  left:18px !important;
  right:18px !important;
  top:18px !important;
  z-index:2147482000 !important;
  align-items:center;
  gap:12px;
  padding:0;
  box-sizing:border-box;
  background:none !important;
  box-shadow:none !important;
  pointer-events:none;
  transition:opacity .2s ease;
}
.almas-fs-top.is-show{
  display:flex !important;
  opacity:1 !important;
}
.almas-fs-back{
  pointer-events:auto;
  appearance:none;
  border:0;
  background:rgba(0,0,0,.35);
  width:46px;
  height:46px;
  border-radius:23px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding:0;
  flex-shrink:0;
}
.almas-fs-back svg{
  display:block;
  width:28px;
  height:28px;
}
.almas-fs-name{
  pointer-events:none;
  color:#fff !important;
  font-size:20px;
  font-weight:700;
  line-height:1.35;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:calc(100% - 66px);
  text-shadow:0 1px 3px rgba(0,0,0,.6);
  direction:rtl;
  unicode-bidi:plaintext;
  text-align:left;
}
:fullscreen > .almas-fs-top,
:-webkit-full-screen > .almas-fs-top{
  position:fixed !important;
  left:22px !important;
  right:22px !important;
  top:22px !important;
}
