body.gm-no-x,
html.gm-no-x {
  overflow-x: hidden;
}

.gm-pseudo-fullscreen-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
}

.gm-pseudo-fullscreen-panel {
  position: relative;
  width: 100%;
  max-width: 1400px;
  height: 56.25vw;
  max-height: 90vh;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}

.gm-pseudo-fullscreen-panel .aspect-video {
  height: 100%;
}

.gm-pseudo-fullscreen-close {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 10002;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.gm-pfs-toggle-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 10003;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
}

.gm-pfs-rotate-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 10003;
  display: none;
  transform: translate(-50%, -50%);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 10px 14px;
}

@media (max-width: 768px) {
  .gm-pseudo-fullscreen-panel {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }
}

#player_wrap .aspect-video video,
#player_wrap > video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.video-js,
.video-js * {
  box-sizing: border-box;
}

.video-js,
.video-js .vjs-tech,
#player,
#player.video-js {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
}

.video-js .vjs-tech,
#player {
  object-fit: contain !important;
  object-position: center center !important;
}

body.gm-pseudo-fullscreen-active.gm-pfs-landscape .video-js,
body.gm-pseudo-fullscreen-active.gm-pfs-landscape .video-js .vjs-tech,
body.gm-pseudo-fullscreen-active.gm-pfs-landscape #player {
  width: auto !important;
  max-width: 100% !important;
  height: 100% !important;
  display: block !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  object-position: center center !important;
}

body.gm-pseudo-fullscreen-active.gm-pfs-landscape .gm-pseudo-fullscreen-backdrop {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
}

body.gm-pseudo-fullscreen-active.gm-pfs-landscape .gm-pseudo-fullscreen-panel {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #000 !important;
}

body.gm-pseudo-fullscreen-active.gm-pfs-landscape #player_wrap .aspect-video,
body.gm-pseudo-fullscreen-active.gm-pfs-landscape #player_wrap.aspect-video {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  padding-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}

body.gm-pseudo-fullscreen-active.gm-pfs-landscape {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

@media (orientation: landscape) and (max-width: 768px) {
  .gm-pseudo-fullscreen-active .gm-pseudo-fullscreen-panel {
    height: 100vh !important;
    max-height: 100vh !important;
  }

  .gm-pseudo-fullscreen-active .video-js,
  .gm-pseudo-fullscreen-active #player,
  .gm-pseudo-fullscreen-active .vjs-tech {
    width: auto !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }
}

@supports (padding: env(safe-area-inset-right)) {
  body.gm-pseudo-fullscreen-active .gm-pseudo-fullscreen-backdrop {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
  }
}

#gm_pfs_toolbar {
  display: none;
  position: fixed;
  z-index: 10005;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--pfs-tb-gap, 12px);
  padding: 8px 0;
  background: transparent;
  pointer-events: none;
  box-sizing: border-box;
}

body.gm-pseudo-fullscreen-active #gm_pfs_toolbar {
  display: flex;
}

#gm_pfs_toolbar button {
  width: var(--pfs-btn-size, 38px);
  height: var(--pfs-btn-size, 38px);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s;
}

#gm_pfs_toolbar button:active {
  background: rgba(0, 0, 0, 0.65);
}

#gm_pfs_toolbar button svg {
  width: var(--pfs-icon-size, 20px);
  height: var(--pfs-icon-size, 20px);
}

#gm_pfs_toolbar .pfs-like-icon {
  color: #ff4d6d;
}

#gm_pfs_toc {
  display: none;
  position: fixed;
  z-index: 10006;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 6px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#gm_pfs_toc::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#gm_pfs_toc .pfs-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

#gm_pfs_toc .pfs-toc-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

#gm_pfs_toc .pfs-toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 2px 30px;
}

#gm_pfs_toc .pfs-toc-item {
  width: 100%;
  overflow: hidden;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#gm_pfs_toc .pfs-toc-item.active {
  background: rgba(255, 255, 255, 0.18);
}

#gm_pfs_toc .pfs-toc-item:active {
  background: rgba(255, 255, 255, 0.12);
}

.gm-pfs-fly-heart {
  position: fixed;
  z-index: 10010;
  color: #ff4d6d;
  font-size: 26px;
  pointer-events: none;
  will-change: transform, opacity;
}

.gm-prefetch-progress {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 40;
  display: none;
  pointer-events: none;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.10);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 10px;
}
