/* 開くとき */
.livecam_box.open {
  animation: fadeIn 0.25s ease-out forwards;
}

/* フェードイン用アニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 閉じるとき */
.livecam_box.close {
  animation: fadeOut 0.25s ease-out forwards;
}

/* フェードアウト */
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.97);
  }
}





/* ライトボックス全体 */
.livecam_box {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  animation: fadeIn 0.25s ease-out;
}

/* 画像 */
.livecam_box_img {
  max-width: 75vw;
  max-height: 65vh;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  border: 4px solid #fff;
  transform: scale(0.97);
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.livecam_box_img.show {
  opacity: 1;
  transform: scale(1);
}

/* 画像コンテナ（矢印の基準） */
.livecam_inner {
  position: relative;
  display: flex !important;
  align-items: center;
  flex-direction: column;
  /* 画面サイズに応じた最大の高さをあらかじめ確保（これがブレ防止の壁になります） */
  height: 75vh; 
  margin: 0;

   /* ★追加：このエリア自体のクリック判定を「透明（すり抜け）」にする */
  pointer-events: none; 
}

/* 画像ラッパー、矢印、キャプションなど「中身」はクリックできるように戻す */
.livecam_img_wrapper,
.livecam_caption,
.livecam_prev,
.livecam_next {
  /* ★追加：すり抜けを解除し、画像や矢印、文字はちゃんとタップできるようにする */
  pointer-events: auto; 
}

/* 閉じるボタン */
.livecam_box_close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  cursor: pointer;
  color: #333;
}

/* キャプション */
.livecam_caption {
  width: 100%;
  max-width: 70vw;
  font-size: 16px;
  color: #f0f0f0;
  line-height: 1.6;
  opacity: 0;
  animation: fadeIn 0.4s ease-out 0.1s forwards;
  margin-top: 12px;
  word-break: break-word;
}



.livecam_img_wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* 矢印（画像の内側固定） */
.livecam_prev,
.livecam_next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: #eee;
  cursor: pointer;
  padding: 10px;
  user-select: none;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 10;
}

.livecam_prev {
  left: 0;
  transform: translate(-100%, -50%); /* 横方向に自分のサイズ分だけ左に外す */
}
.livecam_next {
  right: 0;
  transform: translate(100%, -50%); /* 横方向に自分のサイズ分だけ右に外す */
}

.livecam_prev:hover,
.livecam_next:hover {
  opacity: 1;
}

/* スマホ調整 */
@media (max-width: 767px) {

  .livecam_prev,
  .livecam_next {
    font-size: 22px;
    padding-left: 10px;
    padding-right: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
  }
  .livecam_prev {
    left: 10px; /* 画像の左端から少し内側に */
    transform: translate(0, -50%); /* 位置調整をリセット */
  }
    .livecam_next {
    right: 10px; /* 画像の右端から少し内側に */
    transform: translate(0, -50%); /* 位置調整をリセット */
  }
  /* 画像 */
.livecam_box_img {
  max-width: 90vw;
}
/* キャプション */
.livecam_caption {
  max-width: 90vw;
}
}