/* =====================================================================
   Where's 妹豬 — start page
   英文字型：Itty Bitty Notebook（手寫體）
   中文字型：微軟正黑體
   ===================================================================== */

@font-face {
  font-family: 'IttyBitty';
  src: url('assets/fonts/IttyBittyNotebook.woff') format('woff'),
       url('assets/fonts/IttyBittyNotebook.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JhengHei';
  /* 精簡版（只含這個頁面用到的字，243 KB）；
     換成 msjh-full.ttf 就有完整字庫（21 MB） */
  src: url('assets/fonts/msjh-subset.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #2b2433;
  --cream: #fff6e9;
  --pink: #ff8fae;
  --pink-deep: #e9678a;
  --shadow: 0 10px 0 rgba(43, 36, 51, .28), 0 16px 30px rgba(12, 16, 32, .35);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #0e1526;
  color: var(--cream);
  font-family: 'JhengHei', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ 舞台 */
.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
}

/* 背景輪播 */
.bg-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.bg-layer.is-on { opacity: 1; }
.bg-layer img {
  width: 100%;
  height: 100%;
  /* 背景永遠鋪滿，但左右邊界不被拉扯：寬螢幕時保留草地、
     窄螢幕時裁掉的也只是重複出來的雲朵 */
  object-fit: cover;
  object-position: center bottom;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* 整體柔光，讓字更清楚 */
.bg-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(12, 18, 38, .28), rgba(12, 18, 38, 0) 60%),
    linear-gradient(180deg, rgba(12, 18, 38, .22) 0%, rgba(12, 18, 38, 0) 26%,
                            rgba(12, 18, 38, 0) 62%, rgba(12, 18, 38, .38) 100%);
}

/* ------------------------------------------------- 標題 + 選單（上方） */
.intro {
  position: absolute;
  /* 標題整塊往下移 100px */
  top: calc(clamp(12px, 2.8vh, 36px) + 100px);
  left: 50%;
  transform: translateX(-50%);
  width: min(94vw, 1040px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 7;
}

.game-title {
  margin: 0;
  line-height: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .22em;
  flex-wrap: wrap;
}
.game-title .en {
  font-family: 'IttyBitty', 'Comic Sans MS', cursive;
  font-size: clamp(38px, 6.6vw, 92px);
  color: #fffdf6;
  letter-spacing: .02em;
  -webkit-text-stroke: 3px rgba(43, 36, 51, .55);
  paint-order: stroke fill;
  text-shadow: 0 8px 0 rgba(43, 36, 51, .22);
  transform: rotate(-2deg);
}
.game-title .zh {
  font-family: 'JhengHei', sans-serif;
  /* 和英文一樣的大小，底部對齊 */
  font-size: clamp(38px, 6.6vw, 92px);
  color: #ffd7e3;
  letter-spacing: .06em;
  -webkit-text-stroke: 3px rgba(43, 36, 51, .72);
  paint-order: stroke fill;
  text-shadow: 0 8px 0 rgba(43, 36, 51, .25);
}

/* ------------------------------------------------------------ 角色 */
.char {
  position: absolute;
  bottom: -1vh;
  height: clamp(175px, 33vh, 350px);
  width: auto;
  z-index: 5;
  filter: drop-shadow(0 14px 16px rgba(14, 20, 40, .42));
  animation: bob 3.6s ease-in-out infinite;
}
.char-girl {
  left: 32%;
  transform: translateX(-50%) rotate(-3deg);
}
.char-boy {
  left: 68%;
  transform: translateX(-50%) rotate(3deg);
  animation-delay: -1.8s;
}
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -14px; }
}

.mascot {
  position: absolute;
  /* 選單整塊下移 100px，妹豬跟著下移才不會擋到按鈕與句子 */
  top: calc(clamp(120px, 21vh, 210px) + 100px);
  right: clamp(16px, 6vw, 120px);
  width: clamp(88px, 11vw, 170px);
  z-index: 6;
  filter: drop-shadow(0 10px 12px rgba(14, 20, 40, .4));
  animation: float 4.4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { translate: 0 0; rotate: -2deg; }
  50%      { translate: 0 -16px; rotate: 3deg; }
}

/* 飄起來的小愛心 */
.hearts {
  position: absolute;
  left: 50%;
  bottom: clamp(120px, 22vh, 260px);
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
}
.heart {
  position: absolute;
  left: 0;
  color: var(--pink);
  opacity: .0;
  text-shadow: 0 4px 10px rgba(14, 20, 40, .35);
  animation: rise 5.2s ease-in infinite;
}
.heart--1 { font-size: 26px; left: -34px; animation-delay: .2s; }
.heart--2 { font-size: 17px; left: 22px;  animation-delay: 1.7s; color: #ffd0dd; }
.heart--3 { font-size: 21px; left: -8px;  animation-delay: 3.1s; }
@keyframes rise {
  0%   { opacity: 0; translate: 0 0; scale: .6; }
  18%  { opacity: .85; }
  100% { opacity: 0; translate: 0 -120px; scale: 1.15; }
}

/* ------------------------------------------------------------ 選單 */
.buttons {
  display: flex;
  gap: clamp(14px, 2vw, 28px);
  justify-content: center;
  flex-wrap: wrap;
  /* 與標題「Where's 妹豬」之間保持 100px 的距離 */
  margin-top: 100px;
}

.btn {
  /* 英文用 IttyBitty 手寫體；中文（章節／繼續／返回…）跟標題「妹豬」一樣用 JhengHei */
  font-family: 'IttyBitty', 'JhengHei', 'Comic Sans MS', cursive;
  font-size: clamp(26px, 3.1vw, 44px);
  line-height: 1.1;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid rgba(43, 36, 51, .9);
  border-radius: 20px;
  padding: .178em .7em .122em;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover {
  transform: translateY(-4px) rotate(-1.5deg);
  background: #fffdf6;
}
.btn:active {
  transform: translateY(5px);
  box-shadow: 0 4px 0 rgba(43, 36, 51, .3), 0 6px 12px rgba(12, 16, 32, .3);
}
.btn--ghost {
  background: rgba(255, 246, 233, .82);
  color: #4a3f55;
}
.btn--small {
  font-size: clamp(20px, 2vw, 28px);
  /* 中文字（正黑體）在行框內偏上，所以上方內距多一點，字才會落在正中間 */
  padding: .257em .62em .043em;
  margin-top: 6px;
}

.invite {
  /* 與 START 按鈕之間保持 100px 的距離 */
  margin: 100px 0 0;
  font-size: clamp(17px, 2vw, 28px);
  letter-spacing: .12em;
  line-height: 1.6;
  color: #fff8ee;
  text-shadow: 0 2px 8px rgba(12, 16, 32, .8), 0 0 22px rgba(12, 16, 32, .55);
}

/* ------------------------------------------------------------ 指示點 */
.bg-dots {
  position: absolute;
  top: clamp(14px, 3vh, 34px);
  right: clamp(14px, 3vw, 44px);
  display: flex;
  gap: 10px;
  z-index: 8;
}
.dot {
  width: 13px;
  height: 13px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 246, 233, .85);
  background: rgba(255, 246, 233, .25);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.dot.is-on {
  background: var(--pink);
  transform: scale(1.28);
}

/* ------------------------------------------------------------ 視窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 20, 40, .62);
  backdrop-filter: blur(6px);
  animation: fade .28s ease;
}
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal__card {
  width: min(560px, 94vw);
  max-height: 86vh;
  overflow: auto;
  padding: clamp(20px, 3vw, 34px);
  background: var(--cream);
  color: #3a3243;
  border: 4px solid rgba(43, 36, 51, .85);
  border-radius: 22px;
  box-shadow: 0 22px 44px rgba(8, 12, 26, .5);
  text-align: center;
}
.modal__card--story { width: min(520px, 94vw); }

.modal__chapter {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: .5em;
  color: var(--pink-deep);
}
.modal__title {
  margin: 0 0 14px;
  font-size: clamp(24px, 2.6vw, 34px);
  letter-spacing: .12em;
  color: #3a3243;
}
.modal__list {
  margin: 0 0 16px;
  padding-left: 1.2em;
  text-align: left;
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.85;
}
.modal__list b { color: var(--pink-deep); }
.modal__goal {
  margin: 0 0 6px;
  font-size: clamp(13px, 1.05vw, 16px);
  line-height: 1.7;
  color: #6b6070;
}
.modal__text {
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 2;
  margin: 0 0 12px;
}
.modal__text--soft { color: #8a7f92; font-size: clamp(12px, 1vw, 14px); }

/* ------------------------------------------------------------ 小螢幕 */
/* 畫面偏矮時角色縮一點，讓 invite 句子不會壓到角色的頭 */
@media (max-height: 800px) {
  .char { height: clamp(140px, 26vh, 280px); }
}

@media (max-width: 760px) {
  .char { height: clamp(150px, 30vh, 240px); }
  .char-girl { left: 26%; }
  .char-boy  { left: 74%; }
  /* 選單往下移了，妹豬跟著下來才不會擋到按鈕 */
  .mascot { width: 72px; top: calc(46vh + 100px); right: 8px; }
  .game-title { gap: .16em; }
  .game-title .en,
  .game-title .zh { font-size: clamp(30px, 8.4vw, 52px); }
  .btn { font-size: clamp(21px, 5.4vw, 30px); padding: .14em .62em .2em; }
  .invite { font-size: clamp(14px, 3.6vw, 19px); letter-spacing: .06em; }
  .hearts { bottom: clamp(96px, 18vh, 180px); }
}

@media (max-height: 620px) {
  .intro { top: calc(8px + 100px); }
  .game-title .en,
  .game-title .zh { font-size: clamp(26px, 5vw, 46px); }
  .btn { font-size: clamp(19px, 2.6vw, 30px); }
  .invite { font-size: clamp(13px, 1.5vw, 18px); margin-top: 100px; }
  .mascot { top: calc(34vh + 100px); }
}

@media (prefers-reduced-motion: reduce) {
  .char, .mascot { animation: none; }
  .bg-layer { transition: opacity .01s ease; }
}

/* 按下 START 時爆發的愛心 */
.heart--burst {
  position: absolute;
  bottom: 0;
  animation: burst 2.4s ease-out forwards;
}
@keyframes burst {
  0%   { opacity: 0; translate: 0 0; scale: .4; }
  15%  { opacity: .95; }
  100% { opacity: 0; translate: 0 -180px; scale: 1.3; }
}

/* =====================================================================
   開始頁底部：章節選擇
   ===================================================================== */
.chapter-select {
  position: fixed;
  left: 50%;
  bottom: clamp(14px, 3vh, 34px);
  transform: translateX(-50%);
  z-index: 20;               /* 比章節（25）低，進入章節後就自動被蓋住 */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.chapter-select__menu {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(14, 21, 38, .74);
  border: 2px solid rgba(255, 246, 233, .34);
  backdrop-filter: blur(7px);
  box-shadow: 0 8px 22px rgba(8, 12, 26, .38);
}
.chapter-select__menu[hidden] { display: none; }
.chapter-select__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 16px 9px;
  font-family: inherit;
  color: #fff8ee;
  background: rgba(255, 246, 233, .12);
  border: 2px solid rgba(255, 246, 233, .35);
  border-radius: 12px;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease;
}
.chapter-select__item:hover {
  transform: translateY(-2px);
  background: rgba(255, 246, 233, .24);
}
.chapter-select__no {
  font-size: clamp(10px, .95vw, 12px);
  letter-spacing: .3em;
  opacity: .85;
}
.chapter-select__name {
  font-size: clamp(14px, 1.3vw, 18px);
  letter-spacing: .08em;
}
.chapter-select__toggle { margin-top: 0; }

/* =====================================================================
   心動進度條（右上角）
   故事演得越多、章數越多，Daniel 對 Vincy 的心動得越深。
   ===================================================================== */
.love {
  position: fixed;
  top: clamp(48px, 6.2vh, 72px);
  right: clamp(12px, 3vw, 44px);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: clamp(6px, .8vw, 12px);
  padding: 7px clamp(10px, 1.1vw, 16px);
  border-radius: 999px;
  background: rgba(14, 21, 38, .55);
  border: 2px solid rgba(255, 246, 233, .3);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(8, 12, 26, .38);
  color: #fff8ee;
  font-size: clamp(11px, 1vw, 14px);
  letter-spacing: .08em;
  white-space: nowrap;
}
.love__track {
  position: relative;
  width: clamp(96px, 13vw, 168px);
  height: 13px;
  border-radius: 999px;
  background: rgba(10, 16, 32, .62);
  border: 2px solid rgba(255, 246, 233, .34);
}
.love__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd3e0, var(--pink) 70%, var(--pink-deep));
  transition: width .9s cubic-bezier(.35, 1.3, .5, 1);
}
/* 愛心固定在長條的右邊端點：條子填得越滿，就越靠近它 */
.love__marker {
  position: absolute;
  top: 50%;
  right: -9px;
  transform: translateY(-50%);
  color: var(--pink);
  font-size: clamp(15px, 1.5vw, 21px);
  line-height: 1;
  text-shadow: 0 2px 7px rgba(8, 12, 26, .75);
}
.love__spark {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: clamp(10px, 1.05vw, 14px);
  color: var(--pink);
  opacity: 0;
  pointer-events: none;
}
.love.is-full .love__spark { animation: love-spark 2.8s ease-out infinite; }
.love.is-full .love__spark--1 { animation-delay: 0s; }
.love.is-full .love__spark--2 { animation-delay: .9s; left: 34%; }
.love.is-full .love__spark--3 { animation-delay: 1.7s; left: 66%; }
@keyframes love-spark {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(.7); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1.15); }
}
.love__pct {
  font-variant-numeric: tabular-nums;
  opacity: .78;
  min-width: 2.6em;
  text-align: right;
}

/* =====================================================================
   第一章：辦公室
   場景是 1920x1080 的辦公室插畫：整張圖等比放進一個 16:9 的「畫框」
   （.chapter__stage），角色的大小、位置都用畫框的百分比計算，
   所以不管螢幕多寬多扁，上半截都看得到，角色也永遠站在桌子前面。
   ===================================================================== */
.chapter {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: #0e1526;
  overflow: hidden;
  animation: fade .3s ease;
}
.chapter[hidden] { display: none; }

/* ---- 場景 ---- */
.chapter__scene {
  position: relative;
  flex: 0 0 auto;
  /* 對白面板至少留 390px，場景吃掉剩下的（長一點的對白也放得下） */
  height: min(56.25vw, calc(100vh - 390px));
  min-height: 190px;
  overflow: hidden;
  /* 插畫是 16:9，畫面太寬時左右會留白：
     把牆、踢腳線與地板的顏色往兩邊延伸，看起來像辦公室本來就這麼寬 */
  background:
    linear-gradient(180deg, #dbe4ee 0%, #c3d0de 69.63%, rgba(195, 208, 222, 0) 69.63%),
    linear-gradient(180deg, rgba(143, 156, 173, 0) 0 72.78%,
                            rgba(143, 156, 173, .55) 72.78%,
                            rgba(143, 156, 173, 0) 73.9%),
    linear-gradient(180deg, #aab6c6 0 69.63%, #c79a6d 72.78%, #b3855b 100%);
}

/* 16:9 的畫框：整張插畫等比縮進來，角色也跟著一起縮，
   所以不管螢幕多寬多扁，上半截（窗、白板、天花板吊燈）都看得到 */
.chapter__stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: min(100%, 56.25vw);
  aspect-ratio: 16 / 9;
  width: auto;
}
.chapter__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.chapter__layer--bg { z-index: 1; }
.chapter__layer--fg { z-index: 4; pointer-events: none; }
.chapter__actor {
  position: absolute;
  z-index: 5;
  bottom: 6.39%;         /* 站在桌子前面的地板上（= 插畫的 69/1080） */
  height: 27.78%;        /* = 插畫的 300 單位高 */
  width: auto;
  filter: drop-shadow(0 10px 12px rgba(14, 20, 40, .35));
  transition: opacity .7s ease, transform .7s ease;
}
.chapter__actor--dan { left: 30%; }
/* Vincy 坐在 Daniel 那排大長桌的「下一排」：
   位置比長桌低一點、身形大一點，看起來是靠鏡頭比較近的那一排 */
.chapter__actor--vincy {
  left: 70%;
  bottom: 1.8%;
  height: 33%;
  opacity: 0;
  transform: translateY(14px);
}
.chapter.is-vincy .chapter__actor--vincy { opacity: 1; transform: none; }

/* Daniel 的對白泡泡 */
.chapter__bubble {
  position: absolute;
  z-index: 6;
  left: 35%;
  bottom: 37.3%;          /* 泡泡浮在 Daniel 頭頂上方（= 插畫的 403/1080） */
  transform: translateX(-50%);
  max-width: min(58%, 420px);
  padding: 12px 18px;
  border-radius: 18px;
  background: #fffdf6;
  color: #3a3243;
  border: 3px solid rgba(43, 36, 51, .8);
  box-shadow: 0 10px 20px rgba(8, 12, 26, .35);
  font-size: clamp(13px, 1.4vw, 18px);
  line-height: 1.6;
  letter-spacing: .06em;
  animation: pop .35s cubic-bezier(.3, 1.5, .5, 1);
}
.chapter__bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 0;
  height: 0;
  margin-left: -11px;
  border: 11px solid transparent;
  border-top-color: rgba(43, 36, 51, .8);
}
@keyframes pop {
  from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.92); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ---- 對白面板 ---- */
.chapter__panel {
  flex: 1 1 auto;
  width: min(96vw, 900px);
  margin: 0 auto;
  padding: clamp(14px, 2.2vh, 24px) clamp(16px, 3vw, 34px) clamp(18px, 2.6vh, 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  text-align: center;
  color: #3a3243;
  background: var(--cream);
  border-top: 4px solid rgba(43, 36, 51, .85);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -16px 38px rgba(8, 12, 26, .45);
  overflow-y: auto;
}
.chapter__tag {
  margin: 0 0 4px;
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: .5em;
  color: var(--pink-deep);
}
.chapter__title {
  margin: 0 0 10px;
  font-size: clamp(20px, 2.4vw, 30px);
  letter-spacing: .1em;
}
.chapter__text {
  font-size: clamp(14px, 1.45vw, 18px);
  line-height: 1.85;
  color: #4a4055;
  max-width: 60ch;
}
.chapter__text b { color: var(--pink-deep); }
.chapter__next {
  margin-top: clamp(12px, 1.8vh, 20px);
  flex: 0 0 auto;
}

/* ---- 上一頁 / 下一頁：兩個按鈕排在一起 ---- */
.chapter__nav {
  margin-top: clamp(12px, 1.8vh, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 18px);
  flex: 0 0 auto;
}
/* 按鈕已經在 .chapter__nav 裡排版了，不要再各自加上面的間距 */
.chapter__nav .btn--small { margin-top: 0; }
.chapter__back[hidden] { display: none; }

/* 標籤或標題被拿掉時（例如第一章的「一封信」「手機」），直接收起來 */
.chapter__tag:empty, .chapter__title:empty { display: none; }

/* ---- 對白泡泡裡的說話者名字 ---- */
.chapter__bubble .bubble__who {
  display: block;
  margin-bottom: 3px;
  font-size: .76em;
  letter-spacing: .16em;
  color: var(--pink-deep);
}

/* =====================================================================
   小遊戲：手機上的 LinkedIn 搜尋
   ===================================================================== */
.minigame {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  width: 100%;
  margin-top: 4px;
}
.minigame[hidden] { display: none; }

/* 小遊戲進行中：場景縮成一條，手機放到最大 */
.chapter.is-game .chapter__scene { height: min(56.25vw, calc(100vh - 520px)); }
.chapter.is-game .chapter__title { display: none; }
.chapter.is-game .chapter__panel { justify-content: center; }
.chapter.is-game .chapter__nav { margin-top: clamp(10px, 1.4vh, 16px); }
.chapter.is-game .chapter__nav .btn--small { margin-top: 0; }
/* 場景變矮了，泡泡改貼著上面 */
.chapter.is-game .chapter__bubble { bottom: auto; top: 10px; }

.phone {
  position: relative;
  flex: 0 0 auto;
  height: min(40vh, 400px);
  width: auto;
  aspect-ratio: 9 / 16.5;
  border-radius: 30px;
  padding: 8px;
  background: linear-gradient(160deg, #2c3442, #12161f);
  box-shadow: 0 16px 32px rgba(8, 12, 26, .45), inset 0 0 0 2px rgba(255, 255, 255, .08);
}
.phone__notch {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 34%;
  height: 13px;
  margin-left: -17%;
  border-radius: 0 0 9px 9px;
  background: #12161f;
  z-index: 2;
}
.phone__screen {
  position: absolute;
  inset: 8px;
  border-radius: 22px;
  overflow: hidden;
  background: #eef2f7;
  display: flex;
  flex-direction: column;
  font-size: 12px;
}
/* 手機裡面可以捲動的內容區 */
.li__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.li__scroll::-webkit-scrollbar { width: 0; }

/* LinkedIn 頁面 */
.li__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 18px 10px 8px;
  background: #0a66c2;
  color: #fff;
  font-weight: 700;
  letter-spacing: .02em;
}
.li__logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 800;
  background: #fff;
  color: #0a66c2;
  border-radius: 3px;
  padding: 0 4px;
  line-height: 1.25;
}
.li__brand { font-size: 12.5px; }
.li__form {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  background: #e3eaf2;
  border-bottom: 1px solid #d0d9e2;
}
.li__searchicon {
  position: relative;
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border: 2px solid #5a6b7c;
  border-radius: 50%;
}
.li__searchicon::after {
  content: '';
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 6px;
  height: 2px;
  background: #5a6b7c;
  transform: rotate(45deg);
}
.li__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  font-size: 12.5px;
  font-family: inherit;
  color: #26313c;
  background: #fff;
  border: 1px solid #c3ced9;
  border-radius: 5px;
}
.li__input:focus {
  outline: 2px solid #0a66c2;
  outline-offset: -1px;
}
.li__go {
  flex: 0 0 auto;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: #fff;
  background: #0a66c2;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.li__go:hover { background: #0b5aa8; }
.li__hint {
  margin: 6px 9px 0;
  font-size: 10.5px;
  color: #6b7c8d;
  line-height: 1.5;
}
.li__hint.is-bad { color: #c0392b; }
.li__hint.is-ok { color: #1e7a46; }

/* 搜尋結果 */
.li__result {
  margin: 6px 8px;
  animation: rise-in .45s cubic-bezier(.3, 1.3, .5, 1);
}
.li__result[hidden] { display: none; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.li__card {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border: 1px solid #d3dbe4;
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(18, 40, 60, .08);
}
/* LinkedIn 大頭貼：用介紹頁那個 Vincy 角色圖，裁成頭部特寫 */
.li__avatar {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #dde8f3;
  box-shadow: 0 0 0 2px #0a66c2;
}
.li__avatar img {
  position: absolute;
  left: -11px;
  top: -7px;
  width: 57px;            /* 把角色圖的頭部放大到剛好塞滿圓形 */
  height: auto;
  display: block;
}
.li__info { min-width: 0; overflow: hidden; }
.li__name {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #0a2b45;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.li__role {
  margin: 1px 0 0;
  font-size: 9.5px;
  color: #4a5b6a;
  line-height: 1.4;
}
.li__meta {
  margin: 2px 0 0;
  font-size: 9px;
  color: #8a97a3;
}
.li__shot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 7px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #fff;
  background: #1a7f4b;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.li__shot:hover { background: #166b40; }
.li__shot[disabled] { opacity: .5; cursor: default; }
.li__camera {
  position: relative;
  width: 13px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 2px;
}
.li__camera::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 3px;
  width: 5px;
  height: 3px;
  border: 2px solid currentColor;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
}
.li__camera::after {
  content: '';
  position: absolute;
  inset: 2px 3px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

/* 截圖後的相簿 */
.li__album {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 9px 0;
  padding: 7px;
  background: #fff;
  border: 1px solid #d3dbe4;
  border-radius: 9px;
  animation: rise-in .45s cubic-bezier(.3, 1.3, .5, 1);
}
.li__album[hidden] { display: none; }
.li__album .li__avatar {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  box-shadow: 0 0 0 2px #1e7a46;
}
.li__album .li__avatar img {
  width: 54px;
  left: -10px;
  top: -7px;
}
.li__album-label {
  font-size: 10.5px;
  color: #1e7a46;
}

/* 手機底部的 App 選單列 */
.li__nav {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-around;
  gap: 2px;
  padding: 5px 2px 4px;
  background: #fff;
  border-top: 1px solid #d5dde5;
}
.li__navitem {
  flex: 1 1 0;
  text-align: center;
  font-size: 8.5px;
  color: #7b8a99;
  letter-spacing: .02em;
}
.li__navitem i {
  display: block;
  width: 12px;
  height: 12px;
  margin: 0 auto 2px;
  border: 2px solid #9aa8b5;
  border-radius: 3px;
}
.li__navitem.is-on { color: #0a66c2; font-weight: 700; }
.li__navitem.is-on i { border-color: #0a66c2; background: #0a66c2; }

/* 遊戲旁邊的說明 */
.minigame__side { flex: 1 1 auto; min-width: 0; }
.minigame__say,
.minigame__done {
  margin: 0;
  font-size: clamp(13px, 1.35vw, 17px);
  line-height: 1.9;
  color: #4a4055;
  text-align: left;
}
.minigame__done { color: #3a3243; }
.minigame__done b { color: var(--pink-deep); }
.minigame__done[hidden] { display: none; }

/* 截圖的白光 */
.shotflash {
  position: absolute;
  inset: 0;
  z-index: 9;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.shotflash.is-on { animation: flash .55s ease-out; }
@keyframes flash {
  0%   { opacity: 0; }
  14%  { opacity: .95; }
  100% { opacity: 0; }
}

/* 手機上輸入錯名字時的搖晃 */
.li__form.is-wrong { animation: shake .4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* =====================================================================
   第二章：熟絡
   四個場景（羽球場 / 大埔茶餐廳 / 聖誕派對 / 攤位）疊在一起，
   依拍子的 data-scene 淡入淡出；角色的位置也跟著場景走。
   ===================================================================== */
.chapter--2 .chapter__stage { overflow: visible; }

/* 插畫是 16:9，畫面太寬時左右會留白：
   把每一個場景的牆色與地板色往兩邊延伸，看起來像那個場本來就這麼寬 */
.chapter--2[data-scene="badminton"] .chapter__scene {
  background:
    linear-gradient(180deg, #eaf2e6 0%, #cbdfc9 69.63%, rgba(203, 223, 201, 0) 69.63%),
    linear-gradient(180deg, #e6bd85 0 69.63%, #c3945e 72.78%, #b3855b 100%);
}
.chapter--2[data-scene="dinner"] .chapter__scene {
  background:
    linear-gradient(180deg, #f6eedd 0%, #e6d6b8 72.4%, rgba(230, 214, 184, 0) 72.4%),
    linear-gradient(180deg, #cdc4b1 0 72.4%, #b3a894 75.5%, #a89d88 100%);
}
.chapter--2[data-scene="xmas"] .chapter__scene {
  background:
    linear-gradient(180deg, #f6e7d8 0%, #e3cdb8 73.1%, rgba(227, 205, 184, 0) 73.1%),
    linear-gradient(180deg, #d8a978 0 73.1%, #c08d5c 76.5%, #b28051 100%);
}
.chapter--2[data-scene="booth"] .chapter__scene {
  background:
    linear-gradient(180deg, #f2ead9 0%, #e2d5bf 72.8%, rgba(226, 213, 191, 0) 72.8%),
    linear-gradient(180deg, #d8a874 0 72.8%, #c08d5c 76%, #b28051 100%);
}

/* 場景切換 */
.ch2__bg {
  opacity: 0;
  transition: opacity .55s ease;
}
.chapter--2[data-scene="badminton"] .ch2__bg[data-scene="badminton"],
.chapter--2[data-scene="dinner"]    .ch2__bg[data-scene="dinner"],
.chapter--2[data-scene="xmas"]      .ch2__bg[data-scene="xmas"],
.chapter--2[data-scene="booth"]     .ch2__bg[data-scene="booth"] {
  opacity: 1;
}
/* 前景只有晚餐有（飯桌擋在角色前面） */
.ch2__fg { opacity: 0; transition: opacity .55s ease; }
.chapter--2[data-scene="dinner"] .ch2__fg { opacity: 1; }

/* 角色站位：每一個場景都不一樣 */
.ch2__actor {
  transition: opacity .6s ease, left .6s ease, bottom .6s ease, height .6s ease;
}
.chapter--2[data-scene="badminton"] .ch2__actor--dan   { left: 22%; height: 30%; bottom: 5%; }
.chapter--2[data-scene="badminton"] .ch2__actor--vincy { left: 56%; height: 31%; bottom: 4%; }
.chapter--2[data-scene="dinner"] .ch2__actor {
  z-index: 3;             /* 坐在桌後面，讓前景的飯桌擋住下半身 */
  bottom: 26%;
  height: 29%;
}
.chapter--2[data-scene="dinner"] .ch2__actor--dan   { left: 34%; }
.chapter--2[data-scene="dinner"] .ch2__actor--vincy { left: 51%; }
.chapter--2[data-scene="xmas"] .ch2__actor--dan   { left: 28%; height: 30%; bottom: 5%; }
.chapter--2[data-scene="xmas"] .ch2__actor--vincy { left: 53%; height: 31%; bottom: 4%; }
.chapter--2[data-scene="booth"] .ch2__actor--dan   { left: 57%; height: 30%; bottom: 5%; }
.chapter--2[data-scene="booth"] .ch2__actor--vincy { left: 13%; height: 30%; bottom: 5%; }

/* 最後一幕〈熟絡〉：兩個人站得比較近（中間留一點點空間） */
.chapter--2.is-close .ch2__actor--dan   { left: 36%; height: 31%; bottom: 5%; }
.chapter--2.is-close .ch2__actor--vincy { left: 52%; height: 32%; bottom: 4%; }

/* 最後一幕：兩人之間慢慢飄起來的小愛心 */
.chapter-hearts {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
}
.chapter.is-close .chapter-hearts { opacity: 1; }
.chapter-heart {
  position: absolute;
  line-height: 1;
  color: #ff9ab8;
  text-shadow: 0 2px 6px rgba(120, 40, 70, .3);
  opacity: 0;
  animation: chapter-heart-float 3.6s ease-in-out infinite;
}
@keyframes chapter-heart-float {
  0%   { opacity: 0; transform: translateY(8px) scale(.65) rotate(-6deg); }
  25%  { opacity: .95; }
  60%  { opacity: .95; transform: translateY(-12px) scale(1) rotate(3deg); }
  100% { opacity: 0; transform: translateY(-26px) scale(1.12) rotate(8deg); }
}
.chapter-heart--1 { left: 41%; top: 55%; font-size: clamp(11px, 1.3vw, 18px); animation-delay: 0s; }
.chapter-heart--2 { left: 48%; top: 47%; font-size: clamp(13px, 1.6vw, 23px); animation-delay: .7s; }
.chapter-heart--3 { left: 56%; top: 57%; font-size: clamp(11px, 1.2vw, 17px); animation-delay: 1.4s; }
.chapter-heart--4 { left: 37%; top: 66%; font-size: clamp(10px, 1.1vw, 15px); animation-delay: 2.1s; }
.chapter-heart--5 { left: 60%; top: 64%; font-size: clamp(11px, 1.25vw, 17px); animation-delay: 2.8s; }

/* 遊戲需要的空間比較大：場景變高，角色交給躲球那一層負責 */
.chapter.chapter--2.is-game .chapter__scene {
  height: min(74vw, calc(100vh - 340px));
}
.chapter.chapter--2.is-game .ch2__actor { opacity: 0; }

/* =====================================================================
   小遊戲：躲球
   球道在中間：Daniel 站在一排可愛的充氣球瓶前面，
   用 ← → 移動；按空白鍵把球踢出去。
   「閃開」才有分數；被砸中就沒有分數。
   ===================================================================== */
.dodge {
  position: absolute;
  inset: 0;
  z-index: 6;
}
.dodge[hidden] { display: none; }

/* 球道：所有東西都放在同一層，用「前面大、後面小」做出景深。
   （這一層不加 transform：角色直接用版面尺寸畫，才會清楚） */
.dodge__lane {
  position: absolute;
  inset: 0;
}

/* 球道的地面：從鏡頭前方（下面）往後方（上面）收窄 */
.dodge__ground {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255, 246, 233, 0) 60%,
    rgba(255, 246, 233, .10) 100%);
  clip-path: polygon(41% 66%, 59% 66%, 76% 100%, 24% 100%);
}

/* 可愛的球瓶（照參考圖）：白色胖瓶身、頸上兩條紅線、
   大眼睛 + 吐舌頭的小嘴、小手小腳。圖形畫在 index.html 的 #pinShape，
   三隻球瓶共用同一個 inline SVG。 */
.dodge__pins {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 30%;
  width: 26%;
  height: 30%;
  margin-left: -13%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  filter: drop-shadow(0 5px 5px rgba(20, 16, 30, .22));
}
.dodge__sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.dodge__pin {
  display: block;
  width: 32%;
  height: 100%;
  overflow: visible;
  transform-origin: bottom center;
  transition: transform .5s cubic-bezier(.35, 1.6, .5, 1);
}
.dodge__pins.is-down .dodge__pin:nth-child(1) { transform: rotate(-74deg) translateY(4%); }
.dodge__pins.is-down .dodge__pin:nth-child(2) { transform: rotate(66deg) translateY(2%); }
.dodge__pins.is-down .dodge__pin:nth-child(3) { transform: rotate(-52deg) translateY(6%); }

/* 球道上的兩個人 */
.dodge__actor {
  position: absolute;
  bottom: 18%;
  left: 0;
  height: 52%;
  width: auto;
  filter: drop-shadow(0 10px 12px rgba(14, 20, 40, .4));
}
/* Daniel 站在球瓶前面（z-index 比球瓶高） */
.dodge__actor--dan { z-index: 3; }

/* 開場動畫：Vincy 站在前景、比 Daniel 大得多；
   踢一腳之後鏡頭拉近，她就退場了——之後球道上只剩 Daniel 和球瓶 */
.dodge__actor--vincy {
  left: 1%;
  bottom: 1%;
  height: 64%;
  z-index: 5;
  opacity: 0;
  transform: translateX(-18%);
  transition: opacity .45s ease, transform .45s ease;
}
.dodge__actor--vincy.is-on { opacity: 1; transform: none; }
.dodge__actor--vincy.is-out { opacity: 0; transform: translateX(-34%) rotate(-5deg); }
.dodge__actor--vincy.is-kick { animation: ch2-kick .72s cubic-bezier(.34, 1.4, .5, 1); }
@keyframes ch2-kick {
  0%   { transform: translateX(0) rotate(0deg); }
  30%  { transform: translateX(6%) rotate(-16deg); }
  50%  { transform: translateX(11%) rotate(10deg); }
  70%  { transform: translateX(5%) rotate(-5deg); }
  100% { transform: translateX(0) rotate(0deg); }
}

/* 足球：黑白五邊形的貼紙風（圖形在 index.html 的 #ballShape） */
.dodge__ball {
  position: absolute;
  z-index: 4;
  left: 0;
  top: 0;
  overflow: visible;
  filter: drop-shadow(0 6px 6px rgba(14, 20, 40, .32));
}
.dodge__ball[hidden] { display: none; }

/* 球會落在哪裡：地上的圈圈 */
.dodge__mark {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  width: 132px;
  height: 44px;
  margin: -22px 0 0 -66px;
  border: 3px dashed rgba(255, 224, 138, .9);
  border-radius: 50%;
  background: rgba(255, 224, 138, .18);
  animation: mark-pulse 1s ease-in-out infinite;
  pointer-events: none;
}
.dodge__mark[hidden] { display: none; }
@keyframes mark-pulse {
  0%, 100% { opacity: .55; transform: scale(.92); }
  50%      { opacity: 1;   transform: scale(1.06); }
}

/* 得分時浮起來的 +1 */
.dodge__plus {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  font-size: clamp(20px, 3.2vw, 42px);
  font-weight: 700;
  color: #ffe08a;
  text-shadow: 0 3px 10px rgba(8, 12, 26, .85);
  pointer-events: none;
  animation: plus-float .95s ease-out forwards;
}
.dodge__plus[hidden] { display: none; }
@keyframes plus-float {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(.7); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -64px) scale(1.15); }
}

/* ---- 躲球小遊戲的儀表板 ---- */
.minigame--dodge {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: clamp(6px, 1.2vh, 12px);
}
.dodge__hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(8px, 1.4vw, 18px);
}
.dodge__pill {
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(43, 36, 51, .06);
  border: 2px solid rgba(43, 36, 51, .16);
  font-size: clamp(12px, 1.25vw, 16px);
  color: #4a4055;
  letter-spacing: .06em;
}
.dodge__pill b {
  color: var(--pink-deep);
  font-size: 1.18em;
  font-variant-numeric: tabular-nums;
}
.dodge__keys {
  font-size: clamp(11px, 1.05vw, 14px);
  color: #8a8195;
  letter-spacing: .08em;
}

/* 螢幕上的按鍵：← → 移動、空白鍵踢球（手機、滑鼠都按得到） */
.dodge__pad {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 16px);
  margin-top: clamp(4px, .8vh, 8px);
}
.dodge__key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 7px;
  font-family: inherit;
  color: #3a3243;
  background: #fffdf6;
  border: 3px solid rgba(43, 36, 51, .85);
  border-radius: 14px;
  box-shadow: 0 4px 0 rgba(43, 36, 51, .35);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform .1s ease, box-shadow .1s ease, background .14s ease;
}
.dodge__key:hover { background: #fff; }
.dodge__key:active,
.dodge__key.is-down {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(43, 36, 51, .35);
  background: #ffeaf1;
}
.dodge__keycap {
  font-size: clamp(17px, 1.9vw, 26px);
  line-height: 1;
}
.dodge__keytext {
  font-size: clamp(11px, 1.1vw, 14px);
  letter-spacing: .12em;
  color: #8a8195;
}
/* 空白鍵：寬一點，像真的鍵盤 */
.dodge__key--space {
  padding: 6px 18px 7px;
}
.dodge__keycap--space {
  font-size: clamp(11px, 1.05vw, 14px);
  letter-spacing: .1em;
  color: #3a3243;
}
.dodge__padnote {
  margin: clamp(2px, .5vh, 6px) 0 0;
  max-width: 40ch;
  font-size: clamp(11px, 1.05vw, 14px);
  line-height: 1.55;
  letter-spacing: .04em;
  color: #8a8195;
  text-align: center;
}
.dodge__padnote b {
  color: var(--pink-deep);
  font-size: 1.15em;
}
.dodge__tip {
  margin: 0;
  min-height: 1.4em;
  font-size: clamp(12px, 1.25vw, 16px);
  letter-spacing: .04em;
  color: var(--pink-deep);
}

/* =====================================================================
   第三章：偷偷喜歡
   辦公室（兩排座位）→ 高爾夫球場 → 米線店
   ===================================================================== */
.chapter--3 .chapter__stage { overflow: visible; }

.chapter--3[data-scene="office"] .chapter__scene {
  background:
    linear-gradient(180deg, #eef2f7 0%, #dbe3ec 55.5%, rgba(219, 227, 236, 0) 55.5%),
    linear-gradient(180deg, #cfc8ba 0 55.5%, #b3a894 58.5%, #a89f8e 100%);
}
.chapter--3[data-scene="golf"] .chapter__scene {
  background:
    linear-gradient(180deg, #bfe6f7 0%, #eaf7fd 51.9%, rgba(234, 247, 253, 0) 51.9%),
    linear-gradient(180deg, #9ecf8a 0 51.9%, #86bd76 56%, #6fae63 100%);
}
/* 米線店：下午的木色小店 */
.chapter--3[data-scene="noodle"] .chapter__scene {
  background:
    linear-gradient(180deg, #fdf6ec 0%, #f0e2cd 61.1%, rgba(240, 226, 205, 0) 61.1%),
    linear-gradient(180deg, #d9b184 0 61.1%, #c39662 65%, #b98a5c 100%);
}

/* 場景切換 */
.ch3__bg { opacity: 0; transition: opacity .55s ease; }
.chapter--3[data-scene="office"] .ch3__bg[data-scene="office"],
.chapter--3[data-scene="golf"] .ch3__bg[data-scene="golf"],
.chapter--3[data-scene="noodle"] .ch3__bg[data-scene="noodle"] { opacity: 1; }
.ch3__fg { opacity: 0; transition: opacity .55s ease; }
.chapter--3[data-scene="noodle"] .ch3__fg { opacity: 1; }
.ch3__sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* 角色站位 */
.ch3__actor { transition: opacity .6s ease, left .6s ease, bottom .6s ease, height .6s ease; }

/* 辦公室：兩排長桌，每一排兩邊各 4 個座位（上側 1-4、下側 5-8），桌上 4 台螢幕。
     · Daniel → 第一排（近）的下側第 1 個座位 = #5
     · Vincy  → 第二排（遠）的上側第 2 個座位 = #2
   兩個人一個在近側、一個在遠側，站起來就會看到對方。 */
.chapter--3[data-scene="office"] .ch3__actor--dan   { left: 13.1%; bottom: 14.4%; height: 30%; }
.chapter--3[data-scene="office"] .ch3__actor--vincy { left: 36%; bottom: 62.2%; height: 20%; }

/* 高爾夫球場 */
.chapter--3[data-scene="golf"] .ch3__actor--dan   { left: 30%; bottom: 6%; height: 34%; }
.chapter--3[data-scene="golf"] .ch3__actor--vincy { left: 54%; bottom: 5%; height: 35%; }

/* 米線店 */
.chapter--3[data-scene="noodle"] .ch3__actor { z-index: 3; bottom: 26%; height: 29%; }
.chapter--3[data-scene="noodle"] .ch3__actor--dan   { left: 34%; }
.chapter--3[data-scene="noodle"] .ch3__actor--vincy { left: 51%; }

/* 最後一幕：靠在一起 */
.chapter--3.is-close .ch3__actor--dan   { left: 40%; bottom: 5%; height: 35%; }
.chapter--3.is-close .ch3__actor--vincy { left: 52%; bottom: 4%; height: 36%; }

/* 偷看小遊戲：Vincy 抬頭的「！」 */
.ch3__alert {
  position: absolute;
  z-index: 7;
  left: 40.1%;
  bottom: 86%;
  transform: translateX(-50%);
  width: clamp(26px, 3.2vw, 44px);
  height: clamp(26px, 3.2vw, 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(17px, 2.1vw, 28px);
  font-weight: 700;
  color: #fff;
  background: #e0574f;
  border: 3px solid #a13a3c;
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(20, 16, 30, .35);
  animation: ch3-alert-pop .5s ease-in-out infinite alternate;
}
.ch3__alert[hidden] { display: none; }
@keyframes ch3-alert-pop {
  from { transform: translateX(-50%) scale(.9); }
  to   { transform: translateX(-50%) scale(1.06); }
}

/* Vincy 要抬頭／抬头時，整個人亮一下 */
.chapter--3.is-warned .ch3__actor--vincy { filter: drop-shadow(0 0 12px rgba(243, 193, 74, .85)); }
.chapter--3.is-watched .ch3__actor--vincy { filter: drop-shadow(0 0 16px rgba(224, 87, 79, .9)); }

/* 小遊戲進行中：場景矮一點，讓面板放得下儀表板 */
.chapter--3.is-game .chapter__scene { height: min(56.25vw, calc(100vh - 430px)); }

/* ---- 小遊戲：偷看 ---- */
.minigame--peek {
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-top: clamp(4px, 1vh, 10px);
}
.peek__hud {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 14px);
}
.peek__label {
  font-size: clamp(12px, 1.2vw, 15px);
  letter-spacing: .2em;
  color: #6b6274;
}
.peek__bar {
  position: relative;
  width: clamp(140px, 26vw, 240px);
  height: 16px;
  border-radius: 999px;
  background: rgba(43, 36, 51, .12);
  border: 2px solid rgba(43, 36, 51, .25);
  overflow: hidden;
}
.peek__bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd3e0, var(--pink) 70%, var(--pink-deep));
}
.peek__bar.is-caught { animation: ch3-shake .4s ease; }
@keyframes ch3-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}
.peek__hold {
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.peek__hold.is-down {
  transform: translateY(4px);
  background: #ffeaf1;
}
.peek__status {
  margin: 0;
  min-height: 1.4em;
  font-size: clamp(12px, 1.25vw, 16px);
  color: var(--pink-deep);
  letter-spacing: .04em;
}

/* ---- 小遊戲：米線 ---- */
.minigame--noodle {
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
}
.noodle__hint {
  margin: 0;
  font-size: clamp(12px, 1.2vw, 15px);
  color: #6b6274;
  letter-spacing: .06em;
}
.noodle__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 12px);
  width: 100%;
  max-width: 560px;
}
.noodle__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  font-family: inherit;
  font-size: clamp(12px, 1.2vw, 16px);
  color: #3a3243;
  background: #fffdf6;
  border: 3px solid rgba(43, 36, 51, .8);
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(43, 36, 51, .25);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.noodle__item:hover { transform: translateY(-2px); }
.noodle__icon {
  width: clamp(26px, 3vw, 38px);
  height: auto;
  display: block;
}
.noodle__name {
  font-size: clamp(12px, 1.2vw, 16px);
  letter-spacing: .04em;
}
.noodle__item.is-on {
  background: #ffe0ea;
  border-color: var(--pink-deep);
  transform: translateY(2px);
  box-shadow: none;
}
.noodle__item.is-wrong {
  animation: ch3-shake .4s ease;
  border-color: #e0574f;
}
.noodle__bar {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 18px);
}
.noodle__count {
  font-size: clamp(12px, 1.2vw, 15px);
  color: #6b6274;
  letter-spacing: .08em;
}
.noodle__msg {
  margin: 0;
  min-height: 1.3em;
  font-size: clamp(12px, 1.25vw, 16px);
  color: var(--pink-deep);
}

/* =====================================================================
   第四章：年初二（完結篇）
   家中 → 馬場 → 茶餐廳 → 羽毛球場 → 夜街 → 茶餐廳（朋友）
   ===================================================================== */
.chapter--4 .chapter__stage { overflow: visible; }

.chapter--4[data-scene="home"] .chapter__scene {
  background:
    linear-gradient(180deg, #cbe7ef 0%, #a9d2e2 70.4%, rgba(169, 210, 226, 0) 70.4%),
    linear-gradient(180deg, #e0a866 0 70.4%, #d09a54 74%, #c9853f 100%);
}
.chapter--4[data-scene="race"] .chapter__scene {
  background:
    linear-gradient(180deg, #a9dcf2 0%, #eaf7fd 48.1%, rgba(234, 247, 253, 0) 48.1%),
    linear-gradient(180deg, #9ecf8a 0 48.1%, #c9a071 59.3%, #7bb069 70.4%, #6fa85e 100%);
}
.chapter--4[data-scene="cafe"] .chapter__scene {
  background:
    linear-gradient(180deg, #fbf1e2 0%, #f2e2cc 59.3%, rgba(242, 226, 204, 0) 59.3%),
    linear-gradient(180deg, #efdcc0 0 59.3%, #e4cba6 64%, #dcc09b 100%);
}
.chapter--4[data-scene="court"] .chapter__scene {
  background:
    linear-gradient(180deg, #eaf2e6 0%, #cbdfc9 69.63%, rgba(203, 223, 201, 0) 69.63%),
    linear-gradient(180deg, #e6bd85 0 69.63%, #c3945e 72.78%, #b3855b 100%);
}
.chapter--4[data-scene="bedroom"] .chapter__scene {
  background:
    linear-gradient(180deg, #f8e6ee 0%, #e8c9d6 64.8%, rgba(232, 201, 214, 0) 64.8%),
    linear-gradient(180deg, #d9b184 0 64.8%, #c99a63 68%, #b98a5c 100%);
}
.chapter--4[data-scene="hotpot"] .chapter__scene {
  background:
    linear-gradient(180deg, #fbeedb 0%, #eed9bb 64.8%, rgba(238, 217, 187, 0) 64.8%),
    linear-gradient(180deg, #c9a071 0 64.8%, #b78e5f 68%, #a87c4c 100%);
}
/* 左右分割的兩幕：左邊/右邊各佔一半 */
.chapter--4[data-scene="split-date"] .chapter__scene {
  background:
    linear-gradient(90deg, #2b3049 0 50%, #a9dcf2 50% 100%);
}
.chapter--4[data-scene="split-end"] .chapter__scene {
  background:
    linear-gradient(90deg, #a9d2e2 0 50%, #e8c9d6 50% 100%);
}

/* 場景切換 */
.ch4__bg { opacity: 0; transition: opacity .55s ease; }
.chapter--4[data-scene="home"]   .ch4__bg[data-scene="home"],
.chapter--4[data-scene="race"]   .ch4__bg[data-scene="race"],
.chapter--4[data-scene="cafe"]   .ch4__bg[data-scene="cafe"],
.chapter--4[data-scene="court"]  .ch4__bg[data-scene="court"],
.chapter--4[data-scene="bedroom"] .ch4__bg[data-scene="bedroom"],
.chapter--4[data-scene="hotpot"] .ch4__bg[data-scene="hotpot"] { opacity: 1; }

/* 第一幕的「想像」：兩個人各自盤算同一個羽毛球約會 */
.ch4__chat {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s ease;
}
.chapter--4[data-scene="split-date"] .ch4__chat { opacity: 1; }
.ch4__think {
  position: absolute;
  height: auto;
  overflow: visible;
  animation: ch4-think-in .6s ease both;
}
.ch4__think--dan { left: 3%; top: 5%; width: 34%; animation-delay: .15s; }
.ch4__think--vincy { right: 3%; top: 9%; width: 34%; animation-delay: .45s; }
@keyframes ch4-think-in {
  from { opacity: 0; transform: translateY(10px) scale(.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ch4__think-cloud {
  fill: #fffdf7;
  stroke: rgba(43, 36, 51, .5);
  stroke-width: 5;
  stroke-linejoin: round;
}
.ch4__think-tail circle {
  fill: #fffdf7;
  stroke: rgba(43, 36, 51, .5);
  stroke-width: 4;
}

/* 馬場「唔好行散」：人群迷宮 */
.chapter--4.is-maze .chapter__scene { height: min(56.25vw, calc(100vh - 430px)); }
.ch4__maze {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  display: block;
  touch-action: none;
}
.ch4__maze[hidden] { display: none; }
.minigame--maze {
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1vh, 10px);
  margin-top: clamp(4px, 1vh, 8px);
}
.maze__hud {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.maze__label {
  font-size: clamp(11px, 1.05vw, 13px);
  letter-spacing: .2em;
  color: #6b6274;
}
.maze__time {
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 700;
  color: var(--pink-deep);
}
.maze__unit { font-size: clamp(11px, 1.05vw, 13px); color: #6b6274; }
.maze__pad { display: flex; gap: 6px; }
.maze__btn {
  width: clamp(38px, 4vw, 46px);
  height: clamp(34px, 3.6vw, 42px);
  font-size: clamp(15px, 1.5vw, 19px);
  font-family: 'JhengHei', sans-serif;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid rgba(43, 36, 51, .8);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(43, 36, 51, .25);
}
.maze__btn--dash {
  width: auto;
  padding: 0 clamp(10px, 1.4vw, 18px);
  font-size: clamp(12px, 1.2vw, 15px);
  background: #fff1f5;
}
.maze__btn.is-down {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(43, 36, 51, .25);
}
.maze__retry { margin-top: 2px; }
.maze__retry[hidden] { display: none; }
.maze__status {
  min-height: 1.4em;
  font-size: clamp(12px, 1.2vw, 15px);
  color: #e0574f;
}

/* 左右分割的半幅圖（左半邊／右半邊） */
.ch4__half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .55s ease;
}
.ch4__half[data-side="left"] { left: 0; }
.ch4__half[data-side="right"] {
  left: 50%;
  border-left: 3px solid rgba(43, 36, 51, .45);
}
.chapter--4[data-scene="split-date"] .ch4__half[data-pair="split-date"],
.chapter--4[data-scene="split-end"]  .ch4__half[data-pair="split-end"] { opacity: 1; }

.ch4__fg { opacity: 0; transition: opacity .55s ease; }
.chapter--4[data-scene="cafe"]   .ch4__fg[data-scene="cafe"],
.chapter--4[data-scene="hotpot"] .ch4__fg[data-scene="hotpot"] { opacity: 1; }

/* 角色站位 */
.ch4__actor { transition: opacity .6s ease, left .6s ease, bottom .6s ease, height .6s ease; }

.chapter--4[data-scene="home"] .ch4__actor--dan   { left: 34%; bottom: 10%; height: 33%; }
.chapter--4[data-scene="home"] .ch4__actor--vincy { left: 52%; bottom: 10%; height: 33%; }

.chapter--4[data-scene="race"] .ch4__actor--dan   { left: 35%; bottom: 9%; height: 33%; }
.chapter--4[data-scene="race"] .ch4__actor--vincy { left: 54%; bottom: 8%; height: 34%; }

/* 咖啡店 / 花膠雞火鍋：坐在桌子後面 */
.chapter--4[data-scene="cafe"] .ch4__actor,
.chapter--4[data-scene="hotpot"] .ch4__actor { z-index: 3; bottom: 26%; height: 29%; }
.chapter--4[data-scene="cafe"] .ch4__actor--dan   { left: 34%; }
.chapter--4[data-scene="cafe"] .ch4__actor--vincy { left: 51%; }
.chapter--4[data-scene="hotpot"] .ch4__actor--vincy { left: 46%; }
/* 房間：只有 Vincy */
.chapter--4[data-scene="bedroom"] .ch4__actor--vincy { left: 52%; bottom: 12%; height: 33%; }

/* 左右分割：Daniel 在左半邊、Vincy 在右半邊 */
.chapter--4[data-scene="split-date"] .ch4__actor--dan   { left: 20%; bottom: 10%; height: 30%; }
.chapter--4[data-scene="split-date"] .ch4__actor--vincy { left: 70%; bottom: 8%; height: 34%; }
.chapter--4[data-scene="split-end"] .ch4__actor--dan    { left: 20%; bottom: 10%; height: 32%; }
.chapter--4[data-scene="split-end"] .ch4__actor--vincy  { left: 70%; bottom: 14%; height: 30%; }

.chapter--4[data-scene="court"] .ch4__actor--dan   { left: 24%; bottom: 5%; height: 31%; }
.chapter--4[data-scene="court"] .ch4__actor--vincy { left: 55%; bottom: 4%; height: 32%; }

.chapter--4[data-scene="street"] .ch4__actor--dan   { left: 35%; bottom: 25%; height: 33%; }
.chapter--4[data-scene="street"] .ch4__actor--vincy { left: 54%; bottom: 24%; height: 34%; }

/* 只有一個人的時候：solo-dan 只留 Daniel、solo-vincy 只留 Vincy */
.chapter--4.is-solo-dan .ch4__actor--vincy { opacity: 0; }
.chapter--4.is-solo-vincy .ch4__actor--dan { opacity: 0; }

/* 最後一幕：靠在一起 */
.chapter--4.is-close .ch4__actor--dan   { left: 40%; bottom: 25%; height: 33%; }
.chapter--4.is-close .ch4__actor--vincy { left: 52%; bottom: 24%; height: 34%; }

/* 最後一幕是左右分割（兩邊講電話），所以不走「靠在一起」的站位 */
.chapter--4.is-close[data-scene="split-end"] .ch4__actor--dan   { left: 20%; bottom: 10%; height: 32%; }
.chapter--4.is-close[data-scene="split-end"] .ch4__actor--vincy { left: 70%; bottom: 14%; height: 30%; }
/* 兩邊各自飄著小愛心 */
.chapter--4[data-scene="split-end"] .chapter-heart--1 { left: 18%; top: 46%; }
.chapter--4[data-scene="split-end"] .chapter-heart--2 { left: 27%; top: 60%; }
.chapter--4[data-scene="split-end"] .chapter-heart--3 { left: 44%; top: 50%; }
.chapter--4[data-scene="split-end"] .chapter-heart--4 { left: 68%; top: 58%; }
.chapter--4[data-scene="split-end"] .chapter-heart--5 { left: 77%; top: 44%; }

/* =====================================================================
   第五章：靠近
   火鍋店（晚上）→ 晚上的街（大風）
   ===================================================================== */
.chapter--5 .chapter__stage { overflow: visible; }

.chapter--5[data-scene="hotpot"] .chapter__scene {
  background:
    linear-gradient(180deg, #f8e9d6 0%, #e8cfae 61.1%, rgba(232, 207, 174, 0) 61.1%),
    linear-gradient(180deg, #c9a071 0 61.1%, #b78e5f 65%, #a87c4c 100%);
}
.chapter--5[data-scene="street"] .chapter__scene {
  background:
    linear-gradient(180deg, #232a4d 0%, #5b5a86 70.4%, rgba(91, 90, 134, 0) 70.4%),
    linear-gradient(180deg, #8c8496 0 70.4%, #6b6478 76%, #33333f 100%);
}

/* 場景切換 */
.ch5__bg { opacity: 0; transition: opacity .55s ease; }
.chapter--5[data-scene="hotpot"] .ch5__bg[data-scene="hotpot"],
.chapter--5[data-scene="street"] .ch5__bg[data-scene="street"] { opacity: 1; }
.ch5__fg { opacity: 0; transition: opacity .55s ease; }
.chapter--5[data-scene="hotpot"] .ch5__fg { opacity: 1; }
.ch5__sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* 角色站位 */
.ch5__actor { transition: opacity .6s ease, left .6s ease, bottom .6s ease, height .6s ease; }
/* 火鍋店：坐在桌子後面 */
.chapter--5[data-scene="hotpot"] .ch5__actor { z-index: 3; bottom: 24%; height: 30%; }
.chapter--5[data-scene="hotpot"] .ch5__actor--dan   { left: 33%; }
.chapter--5[data-scene="hotpot"] .ch5__actor--vincy { left: 50%; }
/* 晚上的街：站在行人路上 */
.chapter--5[data-scene="street"] .ch5__actor { bottom: 25%; height: 33%; }
.chapter--5[data-scene="street"] .ch5__actor--dan   { left: 34%; }
.chapter--5[data-scene="street"] .ch5__actor--vincy { left: 54%; }
/* 他退後、拉開距離的時候：兩個人分得遠一點 */
.chapter--5.is-gap[data-scene="hotpot"] .ch5__actor--dan   { left: 26%; }
.chapter--5.is-gap[data-scene="hotpot"] .ch5__actor--vincy { left: 56%; }
.chapter--5.is-gap[data-scene="street"] .ch5__actor--dan   { left: 28%; }
.chapter--5.is-gap[data-scene="street"] .ch5__actor--vincy { left: 58%; }

/* 最後一幕：靠在一起 */
.chapter--5.is-close .ch5__actor--dan   { left: 40%; bottom: 25%; height: 33%; }
.chapter--5.is-close .ch5__actor--vincy { left: 52%; bottom: 24%; height: 34%; }

/* 小遊戲進行中：場景矮一點，讓面板放得下 */
.chapter--5.is-game .chapter__scene { height: min(56.25vw, calc(100vh - 430px)); }

/* ---- 小遊戲：打邊爐（拖放） ---- */
.minigame--hotpot {
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1vh, 10px);
  margin-top: clamp(4px, 1vh, 10px);
}
.hotpot__row { display: flex; align-items: center; gap: clamp(10px, 2vw, 26px); }
.hotpot__pot {
  position: relative;
  width: clamp(96px, 12vw, 140px);
  aspect-ratio: 120 / 100;
  transition: transform .16s ease, filter .16s ease;
  touch-action: none;
}
.hotpot__pot.is-over { transform: scale(1.07); filter: drop-shadow(0 0 12px rgba(224, 87, 79, .55)); }
.hotpot__pot.is-cooked { animation: ch5-pot .45s ease; }
@keyframes ch5-pot {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.12) rotate(-2deg); }
}
.hotpot__art { width: 100%; height: 100%; display: block; }
.hotpot__hint {
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  transform: translateX(-50%);
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: .1em;
  color: #8a8194;
  white-space: nowrap;
}
.hotpot__foods { display: flex; gap: clamp(6px, 1vw, 12px); }
.food {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: clamp(62px, 7.4vw, 92px);
  padding: 6px 4px;
  background: #fffdf7;
  border: 2px solid rgba(43, 36, 51, .22);
  border-radius: 14px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.food:hover { transform: translateY(-2px); }
.food.is-drag { cursor: grabbing; box-shadow: 0 12px 20px rgba(30, 20, 40, .28); }
.food.is-wrong { animation: ch3-shake .42s ease; }
.food.is-in { border-color: var(--pink); background: #fff1f5; }
.food__icon { width: clamp(30px, 3.4vw, 44px); height: auto; display: block; }
.food__name { font-size: clamp(11px, 1.1vw, 14px); letter-spacing: .04em; white-space: nowrap; }
.hotpot__msg {
  min-height: 1.5em;
  font-size: clamp(12px, 1.2vw, 15px);
  color: #e0574f;
}

/* 答對配料：Vincy 身上飄出小愛心 */
.ch5__burst {
  position: absolute;
  left: 54%;
  bottom: 40%;
  z-index: 8;
  width: 0;
  height: 0;
  pointer-events: none;
}
.ch5__burst span {
  position: absolute;
  left: 0;
  bottom: 0;
  font-size: clamp(14px, 1.6vw, 22px);
  color: var(--pink);
  opacity: 0;
  transform: translate(var(--dx, 0));
}
.ch5__burst.is-show span {
  animation: ch5-heart-rise 1.9s ease-out forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes ch5-heart-rise {
  0%   { opacity: 0; transform: translate(var(--dx, 0), 0) scale(.6); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), -140px) scale(1.15); }
}

/* 「心理治療」那一幕：Vincy 冷得發抖、呼出白煙 */
.chapter--5.is-cold .ch5__actor--vincy { animation: ch5-shiver .16s ease-in-out infinite; }
@keyframes ch5-shiver {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(1.6px); }
}
.ch5__breath {
  position: absolute;
  left: 63%;
  bottom: 41%;
  z-index: 8;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}
.chapter--5.is-cold .ch5__breath { opacity: 1; }
.ch5__breath span {
  position: absolute;
  left: 0;
  bottom: 0;
  width: clamp(10px, 1.2vw, 15px);
  height: clamp(10px, 1.2vw, 15px);
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  opacity: 0;
  animation: ch5-puff 1.8s ease-out infinite;
}
.ch5__breath span:nth-child(2) { animation-delay: .6s; }
.ch5__breath span:nth-child(3) { animation-delay: 1.2s; }
@keyframes ch5-puff {
  0%   { opacity: 0; transform: translate(0, 0) scale(.5); }
  25%  { opacity: .9; }
  100% { opacity: 0; transform: translate(30px, -38px) scale(1.6); }
}

/* =====================================================================
   第六章：我喜歡你（完結篇）
   家中 → 拉麵店 → 夜街 → 海濱長廊
   ===================================================================== */
.chapter--6 .chapter__stage { overflow: visible; }

.chapter--6[data-scene="home"] .chapter__scene {
  background:
    linear-gradient(180deg, #cbe7ef 0%, #a9d2e2 70.4%, rgba(169, 210, 226, 0) 70.4%),
    linear-gradient(180deg, #e0a866 0 70.4%, #d09a54 74%, #c9853f 100%);
}
.chapter--6[data-scene="ramen"] .chapter__scene {
  background:
    linear-gradient(180deg, #c99a63 0%, #9a6a3a 59.3%, rgba(154, 106, 58, 0) 59.3%),
    linear-gradient(180deg, #8a5a3a 0 59.3%, #7a4f32 65%, #6b4128 100%);
}
/* 左右分割：兩間房 */
.chapter--6[data-scene="split-study"] .chapter__scene {
  background:
    linear-gradient(90deg, #2b3448 0 50%, #e8c9d6 50% 100%);
}
.chapter--6[data-scene="street"] .chapter__scene {
  background:
    linear-gradient(180deg, #232a4d 0%, #5b5a86 70.4%, rgba(91, 90, 134, 0) 70.4%),
    linear-gradient(180deg, #8c8496 0 70.4%, #6b6478 76%, #33333f 100%);
}
.chapter--6[data-scene="promenade"] .chapter__scene {
  background:
    linear-gradient(180deg, #141a2f 0%, #4a4460 46.3%, rgba(74, 68, 96, 0) 46.3%),
    linear-gradient(180deg, #1d3343 0 46.3%, #5c3d26 66%, #7a5334 74%, #5c3d26 100%);
}

.ch6__bg { opacity: 0; transition: opacity .55s ease; }
.chapter--6[data-scene="home"]      .ch6__bg[data-scene="home"],
.chapter--6[data-scene="ramen"]     .ch6__bg[data-scene="ramen"],
.chapter--6[data-scene="street"]    .ch6__bg[data-scene="street"],
.chapter--6[data-scene="promenade"] .ch6__bg[data-scene="promenade"] { opacity: 1; }
.ch6__fg { opacity: 0; transition: opacity .55s ease; }
.chapter--6[data-scene="ramen"] .ch6__fg { opacity: 1; }

/* 左右分割的半幅圖 */
.ch6__half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .55s ease;
}
.ch6__half[data-side="left"] { left: 0; }
.ch6__half[data-side="right"] { left: 50%; border-left: 3px solid rgba(43, 36, 51, .35); }
.chapter--6[data-scene="split-study"] .ch6__half { opacity: 1; }


/* 前景：被子與桌子（畫在角色前面） */
/* Daniel 的幻想氣泡 */
.ch6__think {
  position: absolute;
  left: 12%;
  top: 0;
  width: 22%;
  z-index: 7;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}

/* 前景書桌（只有右半邊） */
.ch6__half-fg {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .55s ease;
  z-index: 4;
}
.ch6__half-fg[data-side="right"] { left: 50%; }
.chapter--6[data-scene="split-study"] .ch6__half-fg { opacity: 1; }

/* 分割的那一幕：Daniel 站在床前面；Vincy 坐在椅子上，桌子擋住下半身 */
.chapter--6[data-scene="split-study"] .ch6__actor { z-index: 3; }
/* Daniel 直接畫在床上（俯視），所以這一幕收起他的 sprite */
.chapter--6[data-scene="split-study"] .ch6__actor--dan { opacity: 0; }
.chapter--6[data-scene="split-study"] .ch6__actor--vincy { left: 64%; bottom: 33%; height: 30%; }

.chapter--6[data-scene="split-study"] .ch6__think {
  opacity: 1;
  animation: ch6-think-in .6s ease both;
}
@keyframes ch6-think-in {
  from { opacity: 0; transform: translateY(10px) scale(.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ch6__think-cloud {
  fill: #fffdf7;
  stroke: rgba(43, 36, 51, .5);
  stroke-width: 5;
  stroke-linejoin: round;
}
.ch6__think-tail circle {
  fill: #fffdf7;
  stroke: rgba(43, 36, 51, .5);
  stroke-width: 4;
}

.ch6__actor { transition: opacity .6s ease, left .6s ease, bottom .6s ease, height .6s ease; }

.chapter--6[data-scene="home"] .ch6__actor--dan   { left: 34%; bottom: 10%; height: 33%; }
.chapter--6[data-scene="home"] .ch6__actor--vincy { left: 52%; bottom: 10%; height: 33%; }

.chapter--6[data-scene="ramen"] .ch6__actor { z-index: 3; bottom: 26%; height: 29%; }
.chapter--6[data-scene="ramen"] .ch6__actor--dan   { left: 34%; }
.chapter--6[data-scene="ramen"] .ch6__actor--vincy { left: 51%; }

.chapter--6[data-scene="street"] .ch6__actor--dan   { left: 34%; bottom: 25%; height: 33%; }
.chapter--6[data-scene="street"] .ch6__actor--vincy { left: 53%; bottom: 24%; height: 34%; }

.chapter--6[data-scene="promenade"] .ch6__actor--dan   { left: 33%; bottom: 12%; height: 34%; }
.chapter--6[data-scene="promenade"] .ch6__actor--vincy { left: 51%; bottom: 11%; height: 35%; }

/* 牽手的那幾幕：靠得很近 */
.chapter--6.is-close .ch6__actor--dan   { left: 38%; bottom: 12%; height: 34%; }
.chapter--6.is-close .ch6__actor--vincy { left: 50%; bottom: 11%; height: 35%; }

/* =====================================================================
   第七章：生日快樂（完結）
   家中的生日會 ＋ 蛋糕；Yes／No 邀請
   ===================================================================== */
.chapter--7 .chapter__stage { overflow: visible; }

.chapter--7[data-scene="birthday"] .chapter__scene {
  background:
    linear-gradient(180deg, #cbe7ef 0%, #a9d2e2 70.4%, rgba(169, 210, 226, 0) 70.4%),
    linear-gradient(180deg, #e0a866 0 70.4%, #d09a54 74%, #c9853f 100%);
}
.ch7__bg { opacity: 0; transition: opacity .55s ease; }
.chapter--7[data-scene="birthday"] .ch7__bg[data-scene="birthday"] { opacity: 1; }
.ch7__fg { opacity: 0; transition: opacity .55s ease; }
.chapter--7[data-scene="birthday"] .ch7__fg { opacity: 1; }

.ch7__actor { transition: opacity .6s ease, left .6s ease, bottom .6s ease, height .6s ease; }
.chapter--7[data-scene="birthday"] .ch7__actor { z-index: 3; bottom: 26%; height: 29%; }
.chapter--7[data-scene="birthday"] .ch7__actor--dan   { left: 34%; }
.chapter--7[data-scene="birthday"] .ch7__actor--vincy { left: 51%; }

/* 牆上的 HAPPY BIRTHDAY 三角旗 */
.ch7__banner {
  position: absolute;
  left: 50%;
  top: calc(11.6% + 15px);  /* 再低 15px（原本 5px，再加 10px） */
  width: 26%;               /* 再細一點 */
  transform: translateX(-50%);
  z-index: 4;          /* 在蛋糕桌前景之上、角色之下 */
  pointer-events: none;
}

/* Yes／No 選擇 */
.ch7__choice {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 1.6vw, 18px);
  margin: clamp(8px, 1.4vh, 14px) auto 0;
  width: 100%;
}
.ch7__choice .btn {
  font-family: 'JhengHei', sans-serif;
  font-weight: 400;          /* 不加粗，跟牆上的字同一款 */
  letter-spacing: 0;
  font-size: clamp(15px, 1.5vw, 21px);
  /* 這個字級較小，內距重新配一次，字才會在按鈕正中間 */
  padding: .145em .7em .155em;
}
.ch7__yes {
  background: #fff1f5;
  border-color: var(--pink-deep);
  /* 全形「！」的筆畫偏左，補一點縮排看起來才置中 */
  text-indent: .16em;
}
.ch7__no { text-indent: -.06em; }
/* display:flex 會蓋過 [hidden]，所以這裡要補一條 */
.ch7__choice[hidden] { display: none; }

/* 扁嘴流淚 */
.ch7__tears {
  position: absolute;
  left: 55%;
  top: 54%;
  z-index: 8;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}
.chapter--7.is-cry .ch7__tears { opacity: 1; }
.ch7__tears span {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(7px, .8vw, 11px);
  height: clamp(11px, 1.3vw, 16px);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: #5aa8d8;
  opacity: 0;
  animation: ch7-tear 1.6s ease-in infinite;
}
.ch7__tears span:nth-child(2) { left: 18px; animation-delay: .5s; }
.ch7__tears span:nth-child(3) { left: -14px; animation-delay: 1s; }
@keyframes ch7-tear {
  0%   { opacity: 0; transform: translateY(0) scale(.6); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(64px) scale(1); }
}
.chapter--7.is-cry .chapter__scene { filter: saturate(.85) brightness(.95); }

/* ---- 小螢幕 ---- */
@media (max-width: 760px) {
  .love { top: 44px; padding: 5px 10px; gap: 6px; }
  .love__track { width: clamp(80px, 26vw, 130px); height: 11px; }
  .chapter__scene { height: min(56.25vw, 40vh); }
  .chapter.is-game .chapter__scene { height: min(56.25vw, 22vh); }
  .chapter__panel { width: 100%; padding: 14px 16px 18px; }
  .minigame { flex-direction: column; gap: 12px; }
  .phone { height: min(36vh, 340px); }
  .minigame__say, .minigame__done { text-align: center; }
  .chapter__bubble { bottom: 42.7%; max-width: 74%; }
  .noodle__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hotpot__row { flex-direction: column; gap: 10px; }
  .hotpot__foods { flex-wrap: wrap; justify-content: center; }
}

@media (max-height: 620px) {
  .chapter__scene { height: min(56.25vw, calc(100vh - 300px)); }
  .chapter__text { line-height: 1.7; }
}
