/* 摄像头小窗：横屏显示
   手机前置常输出竖幅（如 720×1280）。默认保持画面正立、横向裁切铺满 16:9，
   避免人像横过来看不清手势；想看到完整画面可点左上角按钮切换为旋转铺满。 */
#camera-inset {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  /* 手机上适当放大，裁切后仍能看清手部 */
  width: min(var(--camera-width, 220px), 52vw, 46vh);
}

#camera-inset video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #0b1812;
  transform: scaleX(-1);
}

/* 旋转模式：竖幅源整体转 90°，铺满窗口，能看到完整画面 */
#camera-inset.cam-rot video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56.25%;
  height: 177.78%;
  object-position: center;
  transform: translate(-50%, -50%) rotate(90deg) scaleX(-1);
}

/* 小窗上的两个按钮：做小做淡，尽量不挡画面 */
#camera-inset button {
  position: absolute;
  top: 4px;
  padding: 2px 5px;
  font-size: 9px;
  line-height: 1.3;
  border-radius: 5px;
  background: #0b1812c7;
  color: #e8ddc4;
  opacity: .8;
  z-index: 3;
}

#camera-inset button:active { opacity: 1; }

#cam-rotate { left: 4px; }
#hide-camera { right: 4px; }
