/* ============================================================
   第一层：平原视频背景 + 上层透明渲染区域
   本文件只负责铺满视口与图层叠放，不包含任何 UI 样式。
   ============================================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  overscroll-behavior: none;
}

body {
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* ---------- 场景根节点 ---------- */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
  /* 场景独立层，后续上层效果只在此层内叠加 */
  isolation: isolate;
}

/* ---------- 视频底层 ---------- */

.video-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
  pointer-events: none;
}

.scene-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  /* 保持原始比例，覆盖整个窗口 */
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;

  /* 叠化由 JS 逐帧写入 opacity，这里只做合成优化 */
  opacity: 1;
  will-change: opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* 初始层级：A 在上、B 在下；运行期间由 JS 交换 */
#video-a { z-index: 2; }
#video-b { z-index: 1; }

/* 彻底隐藏原生播放器控件（部分浏览器仍会注入） */
.scene-video::-webkit-media-controls,
.scene-video::-webkit-media-controls-enclosure,
.scene-video::-webkit-media-controls-panel,
.scene-video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---------- 上层透明渲染区域（预留） ---------- */

.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
}
