/* === 基本重置樣式 === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  width: 100%;
  height: 100%;
  font-family: sans-serif;
  overflow: hidden;
}

/* === 主容器 === */
.wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* === 背景圖層（預設為 1024x768 尺寸）=== */
/* ✅ 若畫面非 1920x1080，預設使用這張背景圖 */
.bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: url("/assets/images/background-start.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* === 對話框區塊 === */
.speech {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  width: 600px;
  max-width: 90%;
  z-index: 3;
  opacity: 0;
  animation: showBubble 0.5s ease-out forwards;
  animation-delay: 1s;
}
.speech img {
  width: 100%;
  height: auto;
  display: block;
}

/* === 人物區塊（右下角）=== */
.interviewer-block {
  position: absolute;
  bottom: 30px;
  right: 5%;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  z-index: 1;
}
.name-tag {
  height: 60px;
}
.character-box {
  position: relative;
  width: 400px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.character-box img {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  object-fit: contain;
}

/* === 角色切換動畫（frame1 → frame2）=== */
.frame1 {
  opacity: 1;
  animation: hideFrame 2s steps(1) forwards;
}
.frame2 {
  opacity: 0;
  animation: showFrame 2s steps(1) forwards;
}
@keyframes hideFrame {
  50% { opacity: 1; }
  51% { opacity: 0; }
}
@keyframes showFrame {
  50% { opacity: 0; }
  51% { opacity: 1; }
}

/* === 對話框進場動畫（桌機）=== */
@keyframes showBubble {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

/* === 對話框進場動畫（小螢幕）=== */
@keyframes showBubble-sm {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.6);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(0.8);
  }
}

/* === 響應式調整：手機與小平板尺寸 === */
/* ✅ 小於 768px 寬時自動縮小角色與對話框 */
@media (max-width: 768px) {
  .speech {
    width: 90%;
    transform: translateX(-50%) scale(0.75);
    animation-name: showBubble-sm;
    animation-duration: 0.4s;
    animation-delay: 0.6s;
  }

  .character-box {
    width: 250px;
  }

  .name-tag {
    height: 40px;
  }

  .interviewer-block {
    gap: 12px;
    right: 3%;
    bottom: 20px;
  }
}

@media (min-width: 1024px) and (min-height: 768px) {
  .bg {
    background-image: url("/assets/images/background-start-1024x768.png");
  }
}
