/* -------- Modal 背景 -------- */
#modalOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

/* Modal 內容容器 */
#modalContent {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  box-sizing: border-box;
}

/* Modal 主要圖片 */
#modalImage {
  max-width: 1024px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 1s ease;
}

/* -------- Modal 中央文字 -------- */
#modalText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  color: white;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  text-shadow: 2px 2px 5px black;
  padding: 0 5%;
  word-break: break-word;
  pointer-events: none;
}

/* 播放進度文字 */
#progressText {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: red;
  font-size: 4vw;
  font-weight: bold;
  pointer-events: none;
}

/* -------- 通用圓形按鈕（靜音 & 關閉） -------- */
.modal-button {
  position: absolute;
  top: -20px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1100;
  font-size: 50px;
  font-weight: bold;
  color: red;
  text-decoration: none;
  line-height: 1;
  user-select: none;
}

/* 靜音按鈕位置 */
#muteBtn {
  right: 60px;
}

/* 關閉按鈕位置 */
#closeBtn {
  right: 10px;
}

/* 靜音圖片大小 */
#muteBtn img {
  width: 40px;
  height: 40px;
  background-color: transparent;
  display: block;
}

/* -------- 左右箭頭 -------- */
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8vw;
  color: white;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px 16px;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  z-index: 1100;
}

#leftArrow { left: -40px; }
#rightArrow { right: -40px; }

/* -------- 桌面版調整 -------- */
@media (min-width: 940px) {
  #modalText {
    font-size: 48px;
    width: 95%;
  }

  #progressText {
    font-size: 22px;
  }

  .arrow {
    font-size: 40px;
    padding: 18px 22px;
  }

  #leftArrow { left: -60px; }
  #rightArrow { right: -60px; }

  .modal-button {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  #muteBtn img {
    width: 24px;
    height: 24px;
  }
}