:root {
  --pink: #ff8fb8;
  --pink-deep: #ff6f9f;
  --pink-soft: #ffe3ee;
  --cream: #fff8fb;
  --ink: #4a2a38;
  --ink-soft: #8a6475;
  --mint: #3fbf98;
  --red: #ff4d6a;
  --bezel: #2b1d24;
  --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(circle at 30% 20%, #ffd6e6, #f3c4dc 45%, #d9b8e8);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }

/* ---------- 手機外框 ---------- */
.phone {
  position: relative;
  width: min(100vw, 420px);
  height: min(100dvh, 880px);
  background: var(--cream);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 10px solid var(--bezel);
  border-radius: 46px;
  box-shadow: 0 30px 80px rgba(80, 30, 60, .35);
}
.notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 26px; background: var(--bezel);
  border-radius: 0 0 16px 16px; z-index: 60;
}
/* 真的用手機玩時，直接全螢幕 */
@media (max-width: 500px), (max-height: 720px) {
  .phone { width: 100vw; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .notch { display: none; }
}

/* ---------- App 頂欄 ---------- */
.appbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 34px 18px 8px;
}
@media (max-width: 500px), (max-height: 720px) {
  .appbar { padding-top: max(14px, env(safe-area-inset-top)); }
}
.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.brand b { color: var(--pink-deep); }
.brand-flower { width: 24px; height: 24px; display: inline-block; }
.day {
  font-size: 13px; background: var(--pink-soft); padding: 4px 10px;
  border-radius: 99px; font-variant-numeric: tabular-nums;
}

/* ---------- 數值：BMI 放大，其他三個又小又閃 ---------- */
.stats { display: flex; gap: 12px; padding: 4px 16px 12px; }
.bmi-panel {
  flex: 1; position: relative;
  background: linear-gradient(135deg, #ff9ec4, var(--pink-deep));
  color: #fff; border-radius: 22px; padding: 10px 14px 12px;
  box-shadow: 0 8px 20px rgba(255, 110, 160, .35);
}
.bmi-label { font-size: 12px; opacity: .9; }
.bmi-value { font-size: 46px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.bmi-target { font-size: 12px; opacity: .95; }
.bmi-panel.down { animation: glow .8s; }
.bmi-panel.up { animation: shake .45s; }
@keyframes glow { 40% { box-shadow: 0 0 0 6px rgba(255, 255, 255, .7), 0 8px 26px rgba(255, 110, 160, .6); transform: scale(1.03); } }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

.minor { width: 104px; display: flex; flex-direction: column; justify-content: center; gap: 9px; }
.stat { position: relative; display: flex; align-items: center; gap: 3px; animation: flicker 3.4s infinite steps(1); }
.stat:nth-child(2) { animation-delay: -1.2s; }
.stat:nth-child(3) { animation-delay: -2.5s; }
.stat .icon { font-size: 12px; width: 15px; }
.stat .lbl { font-size: 9px; color: var(--ink-soft); width: 22px; }
.bar { flex: 1; height: 4px; background: #f0dbe4; border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 50%; background: #c8a3b5; border-radius: 9px; transition: width .5s, background .3s; }
.stat.danger .bar i { background: var(--red); }
.stat.up .bar i { background: var(--mint); }
.stat.down .bar i { background: var(--red); }
@keyframes flicker {
  0%, 100% { opacity: .6; } 6% { opacity: .15; } 8% { opacity: .6; }
  48% { opacity: .3; } 51% { opacity: .6; } 77% { opacity: .2; } 78% { opacity: .6; }
}

/* 拖曳時預告會影響哪些數值（不告訴你是增是減） */
.dot {
  position: absolute; top: -3px; right: -5px; width: 0; height: 0;
  border-radius: 50%; background: var(--ink); transition: width .15s, height .15s;
}
.bmi-panel > .dot { top: 10px; right: 12px; background: #fff; }
.pv > .dot { width: 7px; height: 7px; }
.pv-big > .dot { width: 12px; height: 12px; }

/* ---------- 卡片 ---------- */
.stage {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center; padding: 6px 0 10px;
}
.card-back {
  position: absolute; width: 78%; max-width: 310px; height: calc(100% - 40px); max-height: 420px;
  background: #ffe9f1; border-radius: 26px; transform: rotate(-3deg) translateY(6px);
}
.card {
  position: relative; width: 84%; max-width: 330px; height: 100%; max-height: 440px;
  background: #fff; border-radius: 26px; padding: 22px 20px 16px;
  box-shadow: 0 14px 36px rgba(120, 40, 80, .18);
  display: flex; flex-direction: column; align-items: center;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  transition: transform .26s ease-out, opacity .26s;
}
.card.dragging { transition: none; cursor: grabbing; }
.card.enter { animation: enter .35s ease-out; }
@keyframes enter { from { transform: translateY(28px) scale(.94); opacity: 0; } }

.card-day {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 1px; color: var(--ink-soft);
  background: var(--pink-soft); padding: 2px 10px; border-radius: 99px;
}
.speaker { display: flex; flex-direction: column; align-items: center; margin-top: 14px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; font-size: 36px;
  background: color-mix(in srgb, var(--c) 22%, white); border: 3px solid var(--c);
}
.avatar .flower { width: 50px; height: 50px; }
.name { font-weight: 700; margin-top: 6px; }
.role { font-size: 11px; color: var(--ink-soft); }
.text {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  font-size: 18px; line-height: 1.65; text-align: center; margin: 14px 0 6px;
}
.hint { font-size: 11px; color: var(--ink-soft); letter-spacing: 1px; }

.choice-label {
  position: absolute; top: 14px; max-width: 62%; padding: 6px 12px;
  border-radius: 12px; font-weight: 700; font-size: 14px; line-height: 1.35;
  background: var(--ink); color: #fff; opacity: 0; transition: opacity .12s; pointer-events: none;
}
.choice-label.left { right: 14px; }
.choice-label.right { left: 14px; background: var(--pink-deep); }
.card[data-side="left"] .choice-label.left,
.card[data-side="right"] .choice-label.right { opacity: 1; }

/* App 推薦文章（台灣案例） */
.card.article-card { padding: 20px 18px 14px; }
.article { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; text-align: left; overflow: hidden; }
.article-tag {
  align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--pink-deep);
  background: var(--pink-soft); padding: 3px 10px; border-radius: 99px;
}
.article-title { font-size: 21px; line-height: 1.35; font-weight: 800; margin-top: 6px; }
.article-src { font-size: 12px; color: var(--ink-soft); }
.article-sum { font-size: 15px; line-height: 1.7; margin-top: 6px; }
.article-cite { font-size: 11px; color: var(--ink-soft); margin-top: auto; }
.quip {
  width: 100%; display: flex; gap: 8px; align-items: center; text-align: left;
  font-size: 13px; line-height: 1.5; border-top: 1px dashed #f0cfdc; padding-top: 10px; margin: 8px 0 8px;
}
.quip .avatar { width: 34px; height: 34px; font-size: 19px; border-width: 2px; flex: none; }
.quip .avatar .flower { width: 26px; height: 26px; }
.quip b { display: block; font-size: 11px; color: var(--ink-soft); }

/* 選完後的回應 */
.reply {
  position: absolute; left: 16px; right: 16px; bottom: 92px; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 18px; padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(120, 40, 80, .2);
  font-size: 14px; line-height: 1.5;
  opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .25s; pointer-events: none;
}
.reply.show { opacity: 1; transform: none; }
.reply .avatar { width: 38px; height: 38px; font-size: 22px; border-width: 2px; flex: none; }
.reply .avatar .flower { width: 30px; height: 30px; }
.reply b { display: block; font-size: 12px; color: var(--ink-soft); }

/* ---------- 按鈕 ---------- */
.controls { display: flex; gap: 10px; padding: 8px 16px 18px; }
@media (max-width: 500px), (max-height: 720px) {
  .controls { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}
.controls button {
  flex: 1; min-height: 50px; border: 0; border-radius: 16px; padding: 10px 8px;
  font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer;
  background: #fff; box-shadow: 0 3px 10px rgba(120, 40, 80, .12);
}
.controls #btnRight { background: var(--pink); color: #fff; }
.controls button:disabled { opacity: .5; }

/* ---------- 全螢幕畫面（開場、章節標題、結局） ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 40; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 28px; text-align: center; background: var(--cream); overflow-y: auto;
}
.overlay.show { display: flex; animation: fade .35s; }
.overlay.dark { background: #0d0d0d; color: #f4f4f4; }
@keyframes fade { from { opacity: 0; } }

.btn {
  margin-top: 14px; min-width: 200px; min-height: 50px; padding: 12px 26px;
  border: 0; border-radius: 99px; background: var(--pink-deep); color: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 110, 160, .35);
}
.btn.ghost { background: transparent; color: var(--ink-soft); box-shadow: none; font-weight: 500; font-size: 14px; }
.overlay.dark .btn { background: #f4f4f4; color: #0d0d0d; box-shadow: none; }

.splash .flower { width: 150px; height: 150px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(4deg); } }
.title-big { font-size: 40px; font-weight: 800; margin-top: 12px; }
.title-big b { color: var(--pink-deep); }
.slogan { color: var(--ink-soft); margin-top: 4px; }

.bubble {
  position: relative; background: #fff; border-radius: 22px; padding: 16px 18px;
  margin: 16px 0 6px; font-size: 16px; line-height: 1.65;
  box-shadow: 0 8px 24px rgba(120, 40, 80, .12);
}
.bubble strong { display: block; font-size: 20px; margin-top: 8px; color: var(--pink-deep); }
.mini-flower .flower { width: 90px; height: 90px; }

.type { font-size: 32px; font-weight: 700; letter-spacing: 3px; min-height: 1.5em; }
.type::after { content: "▍"; animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.tap-hint { position: absolute; bottom: 44px; left: 0; right: 0; font-size: 13px; opacity: 0; transition: opacity .6s; }
.tap-hint.show { opacity: .6; }
.tap-layer { position: absolute; inset: 0; background: transparent; border: 0; cursor: pointer; }

.chapter-no { font-size: 13px; letter-spacing: 6px; color: var(--pink-deep); font-weight: 700; }
.chapter-title { font-size: 30px; font-weight: 800; margin: 6px 0 20px; }
.bg-list { list-style: none; text-align: left; font-size: 15px; line-height: 1.75; }
.bg-list li { position: relative; padding-left: 16px; margin-bottom: 10px; }
.bg-list li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--pink); }

/* Boss 開始前的「怎麼玩」 */
.boss-intro { max-width: 320px; margin: -6px 0 14px; font-size: 15px; line-height: 1.6; opacity: .85; }
.howto {
  width: 100%; max-width: 330px; padding: 12px 14px 4px; border-radius: 16px; text-align: left;
  background: rgba(255, 143, 184, .14); border: 1px solid rgba(255, 143, 184, .35);
}
.howto-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.howto-head b { font-size: 15px; color: var(--pink-deep); letter-spacing: 2px; }
.howto-head span { font-size: 12.5px; padding: 2px 10px; border-radius: 99px; background: rgba(255, 143, 184, .22); }
.howto ol { list-style: none; }
.howto li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; font-size: 14.5px; line-height: 1.55; }
.howto-icon { flex: none; width: 26px; text-align: center; font-size: 19px; line-height: 1.2; font-weight: 700; }
.overlay.night .howto-head b, .overlay.dusk .howto-head b, .overlay.neon .howto-head b { color: #ffb3cf; }

.end-title { font-size: 26px; font-weight: 800; margin: 8px 0 14px; }
.end-text { font-size: 16px; line-height: 1.75; max-width: 320px; }
.app-push {
  margin: 22px 0 8px; display: flex; gap: 10px; align-items: center; text-align: left;
  background: rgba(255, 255, 255, .1); border-radius: 16px; padding: 10px 14px; font-size: 13px;
}
.app-push .flower { width: 30px; height: 30px; flex: none; }
.summary { display: flex; gap: 14px; justify-content: center; margin: 18px 0 6px; font-size: 14px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.note { margin-top: 18px; font-size: 13px; color: var(--ink-soft); }

.summary.small { font-size: 12px; color: var(--ink-soft); margin-top: 0; flex-direction: column; gap: 4px; }
.overlay.dark .summary.small, .overlay.night .summary.small { color: #b9a9c9; }

/* ---------- 內容提醒、求助資訊 ---------- */
.content-note { margin-top: 14px; max-width: 310px; font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); }
.content-note:first-of-type { margin-top: 22px; }
.sound-toggle { margin-top: 4px; }
.push-body.restored { cursor: default; border: 2px solid var(--mint); }
.help-line { margin-top: 10px; max-width: 300px; font-size: 13px; line-height: 1.6; color: #ffd86b; }

/* ---------- 崩潰 ---------- */
.overlay.crash { background: #120a0e; }
.go-on { margin-top: 12px; font-size: 15px; color: #ff9ec4; font-weight: 700; }

/* ---------- 報告者模式 ---------- */
.presenter-btn {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  border: 0; border-radius: 99px; padding: 8px 14px; cursor: pointer;
  background: rgba(43, 29, 36, .85); color: #fff; font-size: 13px;
}
.menu { width: min(100%, 320px); display: flex; flex-direction: column; gap: 8px; }
.menu button {
  min-height: 46px; border: 0; border-radius: 14px; padding: 10px 16px; cursor: pointer;
  background: #fff; box-shadow: 0 3px 10px rgba(120, 40, 80, .12);
  font-size: 15px; font-weight: 600; text-align: left;
}
.menu button.sub { margin-left: 20px; font-size: 14px; font-weight: 500; }
.deck-group { width: min(100%, 320px); margin-top: 14px; text-align: left; }
.deck-author {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 15px; font-weight: 800; color: var(--pink-deep); padding: 0 4px 6px; border-bottom: 2px solid var(--pink-soft); margin-bottom: 8px;
}
.deck-author span { font-size: 11px; font-weight: 500; color: var(--ink-soft); }
.deck { width: min(100%, 320px); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deck-card {
  min-height: 110px; border: 0; border-radius: 16px; padding: 12px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(160deg, #fff, #ffe9f1); box-shadow: 0 6px 16px rgba(120, 40, 80, .15);
}
.deck-concept { font-size: 15px; font-weight: 800; line-height: 1.35; }
.theory-static {
  width: min(100%, 320px); margin: 14px 0 4px; padding: 22px 20px; border-radius: 22px; background: #fff;
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  box-shadow: 0 14px 36px rgba(120, 40, 80, .22);
}
.qr {
  width: 256px; min-height: 256px; padding: 8px; margin: 6px 0 10px; border-radius: 16px; background: #fff;
  display: grid; place-items: center; font-size: 13px; box-shadow: 0 8px 24px rgba(120, 40, 80, .12);
}
.share-url { font-size: 13px; color: var(--ink-soft); word-break: break-all; }

/* 永久裂痕（蓋在整支手機上） */
.cracks {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 45; pointer-events: none;
}
.cracks polyline {
  fill: none; stroke: rgba(60, 20, 35, .55); stroke-width: 2;
  stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.cracks polyline.glint { stroke: rgba(255, 255, 255, .7); stroke-width: 1; transform: translate(.4px, .2px); }

/* ---------- Boss：夜奶節奏戰 ---------- */
.overlay.night { background: linear-gradient(180deg, #1b1537, #2a1f4a 60%, #3a2350); color: #efe7ff; }
.overlay.night .btn { background: #ffd86b; color: #2a1f4a; box-shadow: none; }
.overlay.night .bg-list li::before { background: #ffd86b; }
.overlay.boss { padding: 0; justify-content: stretch; }
.nf { position: relative; flex: 1; width: 100%; display: flex; flex-direction: column; padding: 44px 22px 30px; overflow: hidden; }
/* 星空、月亮：月亮從左走到右＝23:00 到 06:00 */
.nf-sky { position: absolute; inset: 0; pointer-events: none; }
.nf-sky i {
  position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: #fff;
  opacity: .5; animation: twinkle var(--d) ease-in-out infinite alternate;
}
@keyframes twinkle { to { opacity: 1; transform: scale(1.4); } }
.nf-moon { position: absolute; top: 14%; left: 8%; font-size: 42px; transition: left .3s linear; filter: drop-shadow(0 0 14px rgba(255, 230, 150, .7)); }
.nf-top { position: relative; display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: #b9a9e8; }
.nf-clock { font-size: 34px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.nf-night { position: relative; display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: #b9a9e8; }
.nf-night .bar { height: 5px; background: rgba(255, 255, 255, .12); }
.nf-night .bar i { width: 0; background: #ffd86b; transition: width .3s linear; }
.nf-sleep { position: relative; display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.nf-sleep .bar { height: 10px; background: rgba(255, 255, 255, .15); }
.nf-sleep .bar i { width: 100%; background: linear-gradient(90deg, #9b8cff, #c6b8ff); transition: width .1s linear; }
.nf-room { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
/* 嬰兒床：寶寶在床裡，床欄在前面 */
.nf-crib { position: relative; padding: 14px 18px 0; }
.nf-crib-rail {
  position: absolute; left: 0; right: 0; bottom: -10px; height: 56px; border-radius: 0 0 22px 22px;
  background: repeating-linear-gradient(90deg, #6b4b2e 0 7px, transparent 7px 22px);
  border-bottom: 10px solid #6b4b2e; pointer-events: none;
}
.nf-crib::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 42px; height: 8px; border-radius: 4px; background: #7a5737;
}
.nf-baby {
  position: relative; width: 180px; height: 180px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle, #4a3a7a, #2e2457); touch-action: manipulation;
}
.nf-baby:active { transform: scale(.96); }
.nf-face { position: relative; font-size: 92px; line-height: 180px; display: block; }
.nf-ring {
  position: absolute; inset: 0; border-radius: 50%; border: 4px solid #ffd86b;
  opacity: 0; pointer-events: none;
}
.nf-baby.crying .nf-face { animation: wail .3s infinite alternate; }
@keyframes wail { to { transform: rotate(-6deg) scale(1.06); } }
.nf-msg { min-height: 1.5em; font-size: 18px; font-weight: 700; color: #ffd86b; }
.nf-msg.pop { animation: pop .4s; }
@keyframes pop { from { transform: scale(1.4); opacity: 0; } }
/* 伴侶：右下角的小房間 */
.nf-partner {
  position: relative; align-self: flex-end; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .08); font-size: 13px; color: #d9cff5;
}
.nf-partner b { font-size: 22px; }
.nf-partner.away { opacity: .7; }
.nf-partner.up { background: rgba(255, 216, 107, .25); color: #fff; }
.nf-push {
  position: absolute; top: 40px; left: 14px; right: 14px; padding: 12px 14px;
  background: rgba(255, 255, 255, .95); color: var(--ink); border-radius: 16px; font-size: 13px; text-align: left;
  transform: translateY(calc(-100% - 60px)); transition: transform .35s; box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.nf-push.show { transform: none; }

/* ---------- Boss：24 小時俄羅斯方塊 ---------- */
.overlay.day { background: linear-gradient(180deg, #fff8fb, #ffeaf3); }
.overlay.day .app-push { background: #fff; box-shadow: 0 6px 18px rgba(120, 40, 80, .12); color: var(--ink); }
.tt { position: relative; flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 44px 14px 26px; text-align: left; }
.tt-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-soft); }
.tt-top b { font-size: 18px; color: var(--ink); }
.tt-board {
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 6px;
  padding: 8px; border-radius: 18px; background: #fff; box-shadow: 0 8px 22px rgba(120, 40, 80, .12);
}
.tt-cell {
  aspect-ratio: 1; min-height: 50px; border: 0; border-radius: 10px; background: #f6e9ef; cursor: pointer;
  font-size: 24px; display: grid; place-items: center; touch-action: manipulation;
}
/* 方塊種類：格子、預覽、圖例共用同一組顏色（另外都有圖示，不只靠顏色分辨） */
.tk-feed { --sw: #ffd9a8; }
.tk-care { --sw: #ff9ec4; }
.tk-sleep { --sw: #c6b8ff; }
.tk-exercise { --sw: #7fd8b5; }
.tk-partner { --sw: #dcebf9; }
.tt-cell[class*="tk-"], .tt-mini i[class*="tk-"] { background: var(--sw); }
.tt-cell.tk-partner { font-size: 14px; opacity: .8; }
.tt-cell.pop { animation: pop .35s; }
.tt-cell.bad { animation: shake .35s; }
.tt-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--ink-soft); }
.tt-legend span::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 4px;
  border-radius: 3px; background: var(--sw); vertical-align: -1px;
}
.tt-tray {
  display: flex; gap: 12px; align-items: center; padding: 14px 12px;
  border-radius: 18px; background: #fff; box-shadow: 0 8px 22px rgba(120, 40, 80, .12);
}
.tt-tray.drop { animation: drop .35s ease-out; }
@keyframes drop { from { transform: translateY(-28px); opacity: 0; } }
.tt-mini { display: grid; grid-template-columns: repeat(var(--w), 18px); gap: 3px; min-width: 40px; }
.tt-mini i { width: 18px; height: 18px; border-radius: 5px; }
.tt-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tt-info b { font-size: 16px; }
.tt-info span { font-size: 12px; color: var(--ink-soft); }
.tt-timer { flex: none; height: 6px; margin-top: 4px; }
.tt-timer i { width: 100%; background: var(--pink-deep); transition: none; }
.tt-btns { display: flex; flex-direction: column; gap: 6px; }
.tt-btn {
  min-width: 56px; min-height: 42px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--pink-soft); font-size: 20px; touch-action: manipulation;
}
.tt-btn.ghost { min-height: 30px; background: transparent; color: var(--ink-soft); font-size: 13px; }
.tt-btn[hidden] { display: none; }
.tt-msg { min-height: 1.5em; text-align: center; font-weight: 700; color: var(--pink-deep); }
.tt-msg.pop { animation: pop .4s; }

/* ---------- App 3.0：精神條被藏起來 ---------- */
.stat.locked { animation: none; opacity: .55; }
.stat.locked .bar { background: repeating-linear-gradient(45deg, #e6d3dc 0 4px, #f3e6ec 4px 8px); }
.stat.locked .bar i { visibility: hidden; }
.stat.locked .lbl::after { content: " 🔒"; }

/* ---------- Boss：聚餐視線閃躲 ---------- */
.overlay.dusk { background: linear-gradient(180deg, #2b1b26, #4a2a38 60%, #5c3344); color: #fbeef3; }
.overlay.dusk .btn { background: #ffb36b; color: #3a1f2b; box-shadow: none; }
.overlay.dusk .bg-list li::before { background: #ffb36b; }
.overlay.dusk .summary.small { color: #e5c9d5; }
.gz { position: relative; flex: 1; width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 44px 18px 26px; }
.gz-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: #e5c9d5; }
.gz-top b { font-size: 18px; color: #fff; }
.gz-breath { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.gz-breath .bar { height: 10px; background: rgba(255, 255, 255, .15); }
.gz-breath .bar i { width: 100%; background: linear-gradient(90deg, #ffb36b, #ffd9a8); transition: width .2s; }
.gz-table {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 14px 8px 12px; border-radius: 24px; background: radial-gradient(ellipse at center, #5a3a3a, #3a2230 70%);
}
/* 圓桌：橢圓桌布、餐盤、菜 */
.gz-cloth {
  position: relative; width: 92%; flex: 1; max-height: 230px; margin: 6px 0;
  border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, #f3d7c3, #c9956f 75%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 -8px 18px rgba(0, 0, 0, .15);
  display: flex; align-items: center; justify-content: center;
}
.gz-dishes { display: flex; gap: 10px; font-size: 30px; }
.gz-plates { position: absolute; inset: 0; }
.gz-plates span {
  position: absolute; width: 34px; height: 34px; border-radius: 50%; background: #fff;
  box-shadow: inset 0 0 0 5px #f1e4e4, 0 2px 4px rgba(0, 0, 0, .2);
}
.gz-plates span:nth-child(1) { left: 6%; top: 18%; }
.gz-plates span:nth-child(2) { right: 6%; top: 18%; }
.gz-plates span:nth-child(3) { left: 14%; bottom: 10%; }
.gz-plates span:nth-child(4) { right: 14%; bottom: 10%; }
.gz-guests { width: 100%; display: flex; justify-content: space-around; }
.gz-guest { position: relative; width: 64px; display: flex; flex-direction: column; align-items: center; }
.gz-face { font-size: 38px; transition: transform .2s; }
.gz-say {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 130px;
  padding: 5px 9px; border-radius: 10px; background: #fff; color: var(--ink); font-size: 12px; line-height: 1.4;
  opacity: 0; transition: opacity .15s; pointer-events: none; z-index: 2;
}
.gz-guest:first-child .gz-say { left: 0; transform: none; }
.gz-guest:last-child .gz-say { left: auto; right: 0; transform: none; }
.gz-beam {
  width: 46px; height: min(36vh, 280px); margin-top: -4px; clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(255, 240, 150, .85), rgba(255, 240, 150, 0)); opacity: 0; transition: opacity .15s;
}
/* 矮螢幕（iPhone SE 等）光束短一點，下面三顆按鈕才不會被切掉 */
@media (max-height: 700px) {
  .gz-beam { height: min(28vh, 280px); }
}
.gz-guest.gazing .gz-say, .gz-guest.gazing .gz-beam { opacity: 1; }
.gz-guest.gazing .gz-face { transform: scale(1.15); }
.gz-guest.blocked .gz-beam { opacity: .25; }
.gz-me { font-size: 72px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
.gz-msg { min-height: 1.5em; text-align: center; font-weight: 700; color: #ffd9a8; }
.gz-msg.pop { animation: pop .4s; }
.gz-covers { display: flex; gap: 8px; }
.gz-btn {
  flex: 1; min-height: 64px; border: 0; border-radius: 16px; cursor: pointer; touch-action: manipulation;
  background: #fff; color: var(--ink); font-size: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.gz-btn span { font-size: 12px; font-weight: 600; }
.gz-btn:active { transform: scale(.96); }
.gz-btn:disabled { opacity: .35; }

/* ---------- 推播干擾（滑卡時蓋住卡片） ---------- */
.push {
  position: absolute; top: 24%; left: 12px; right: 12px; z-index: 33;
  display: flex; align-items: stretch; gap: 6px;
  transform: translateY(-30px); opacity: 0; pointer-events: none; transition: transform .3s, opacity .3s;
}
.push.show { transform: none; opacity: 1; pointer-events: auto; animation: buzz .5s .3s; }
@keyframes buzz { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.push-body {
  flex: 1; display: flex; gap: 10px; align-items: center; text-align: left; padding: 12px 14px;
  border: 0; border-radius: 18px; cursor: pointer; font-size: 14px; line-height: 1.45;
  background: rgba(255, 255, 255, .97); box-shadow: 0 12px 30px rgba(60, 20, 40, .3);
}
.push-body .flower { width: 34px; height: 34px; flex: none; }
.push-body b { display: block; font-size: 11px; color: var(--ink-soft); }
.push-close {
  width: 48px; border: 0; border-radius: 18px; cursor: pointer; font-size: 18px;
  background: rgba(255, 255, 255, .97); box-shadow: 0 12px 30px rgba(60, 20, 40, .3);
}

/* ---------- Boss：推播打地鼠 ---------- */
.overlay.neon { background: radial-gradient(circle at 50% 25%, #6d1747, #1d0a18 70%); color: #ffe3f0; }
.overlay.neon .btn { background: #ff3d8b; color: #fff; box-shadow: 0 0 24px rgba(255, 61, 139, .6); }
.overlay.neon .bg-list li::before { background: #ff3d8b; }
.overlay.neon .app-push { color: #ffe3f0; }
.wk { flex: 1; width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 44px 16px 26px; }
.wk-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: #f4b6d2; }
.wk-top b { font-size: 18px; color: #fff; }
.wk-money { text-align: center; font-size: 14px; }
.wk-money b { font-size: 26px; color: #ff6fae; }
.wk-money.pop { animation: pop .35s; }
.wk-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 10px; }
.wk-slot { position: relative; min-height: 0; border-radius: 22px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.wk-pop { position: absolute; inset: 0; border-radius: 22px; animation: popin .18s ease-out; }
@keyframes popin { from { transform: scale(.6); opacity: 0; } }
.wk-pop.ad { background: #fff; color: var(--ink); box-shadow: 0 0 18px rgba(255, 61, 139, .5); }
.wk-buy {
  position: absolute; inset: 0; width: 100%; border: 0; border-radius: 22px; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 18px 8px 8px;
  font-size: 12px; line-height: 1.35; color: var(--ink);
}
.wk-buy b { font-size: 11px; color: #fff; background: #ff3d8b; border-radius: 99px; padding: 3px 6px; }
.wk-x {
  position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; z-index: 1;
  border: 0; border-radius: 50%; background: #f1e4ea; color: var(--ink-soft); font-size: 13px; cursor: pointer;
}
.wk-pop.friend {
  width: 100%; border: 0; cursor: pointer; padding: 10px; font-size: 13px; line-height: 1.4; text-align: left;
  background: #dcebf9; color: #1f3550; display: flex; flex-direction: column; gap: 4px; justify-content: center;
}
.wk-who { font-size: 11px; font-weight: 700; }
.wk-msg { min-height: 1.5em; text-align: center; font-weight: 700; color: #ffb3d4; }
.wk-msg.pop { animation: pop .4s; }

/* ---------- 結局：App 當機 ---------- */
.overlay.crashed { background: #0b0b0f; }
.glitch-flower .flower { width: 120px; height: 120px; animation: jitter .18s steps(2) infinite; filter: hue-rotate(160deg) saturate(2.5); }
@keyframes jitter { 50% { transform: translate(3px, -2px) skewX(6deg); } }
.glitch { position: relative; animation: glitch 1.2s infinite steps(1); }
@keyframes glitch {
  0%, 100% { text-shadow: none; transform: none; }
  10% { text-shadow: 3px 0 #ff2d6f, -3px 0 #2de2ff; transform: translateX(-2px); }
  12% { text-shadow: none; transform: none; }
  55% { text-shadow: -4px 0 #ff2d6f, 4px 0 #2de2ff; transform: translateX(3px) skewX(-8deg); }
  58% { text-shadow: none; transform: none; }
}
.crash-btns { display: flex; gap: 8px; margin-top: 10px; }
.crash-btns .btn.ghost { min-width: 120px; color: #ddd; border: 1px solid #444; }

/* ---------- 結局：後台（黑底綠字） ---------- */
.overlay.terminal { background: #050805; color: #4dff88; }
.term { width: min(100%, 340px); text-align: left; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; }
.term-title { color: #b6ffcf; font-weight: 700; margin-bottom: 10px; }
.term-line, .term-note { opacity: 0; animation: type-in .35s forwards; margin-bottom: 6px; }
.term-note { color: #7fa88d; font-size: 11px; margin-top: 10px; }
@keyframes type-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.overlay.terminal .btn { background: #4dff88; color: #050805; box-shadow: none; font-family: ui-monospace, Menlo, monospace; }

/* ---------- 結局畫面 ---------- */
.overlay.ending { background: linear-gradient(180deg, #fff8fb, #ffeef5); }
.overlay.ending .app-push, .overlay.share .app-push { background: #fff; color: var(--ink); box-shadow: 0 6px 18px rgba(120, 40, 80, .12); }
.overlay.ending-crash, .overlay.ending-fail { background: linear-gradient(180deg, #24161d, #3a2230); color: #fbeef3; }
.overlay.ending-crash .app-push, .overlay.ending-fail .app-push { background: rgba(255, 255, 255, .1); color: #fbeef3; box-shadow: none; }
.scene-line {
  width: min(100%, 320px); display: flex; gap: 10px; align-items: center; text-align: left;
  margin-top: 10px; padding: 10px 12px; border-radius: 16px; background: #fff; box-shadow: 0 4px 14px rgba(120, 40, 80, .1);
  font-size: 14px; line-height: 1.5; animation: type-in .4s both;
}
.scene-line:nth-of-type(2) { animation-delay: .5s; }
.scene-line:nth-of-type(3) { animation-delay: 1s; }
.scene-line .avatar { width: 38px; height: 38px; font-size: 22px; border-width: 2px; flex: none; }
.scene-line b { display: block; font-size: 12px; color: var(--ink-soft); }
.screening {
  width: min(100%, 320px); margin-top: 16px; padding: 14px 16px; border-radius: 16px; text-align: left;
  background: #fff; border: 2px solid #c6b8ff; font-size: 14px; line-height: 1.6;
}
.screening b { display: block; margin-bottom: 4px; }
.screening .help-line { color: #5b3fb8; font-weight: 700; max-width: none; }

/* ---------- 重寫 App ---------- */
.chapter-title.small { font-size: 18px; margin: 8px 0 12px; }
.old-metrics { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; margin-top: 8px; font-size: 14px; color: var(--ink-soft); }
.old-metrics span { width: 100%; font-size: 12px; }
.old-metrics s { text-decoration-thickness: 2px; text-decoration-color: var(--red); }
.metric-grid { width: min(100%, 340px); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric {
  min-height: 56px; border: 2px solid transparent; border-radius: 14px; padding: 8px 10px; cursor: pointer;
  background: #fff; box-shadow: 0 3px 10px rgba(120, 40, 80, .1);
  display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; text-align: left;
}
.metric span { font-size: 22px; }
.metric.on { border-color: var(--mint); background: #eafaf3; }
.btn:disabled { opacity: .4; cursor: default; }
.v2-cards { width: min(100%, 340px); display: flex; flex-direction: column; gap: 8px; text-align: left; }
.v2-card { padding: 12px 14px; border-radius: 16px; background: #fff; border-left: 5px solid var(--mint); box-shadow: 0 3px 10px rgba(120, 40, 80, .1); }
.v2-head { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.v2-card p { margin: 4px 0; font-size: 14px; line-height: 1.55; }
.v2-card small { font-size: 11px; color: var(--ink-soft); }
.viewpoint {
  width: min(100%, 340px); margin-top: 16px; padding: 16px; border-radius: 18px; text-align: left;
  background: var(--ink); color: #fff; font-size: 14px; line-height: 1.7;
}
.viewpoint > b { display: block; font-size: 16px; margin-bottom: 6px; color: #ffd86b; }
.viewpoint p { margin-bottom: 6px; }
.viewpoint blockquote { margin-top: 10px; padding-left: 10px; border-left: 3px solid #ffd86b; font-size: 14px; }
.viewpoint cite { display: block; font-style: normal; font-size: 11px; opacity: .75; margin-top: 2px; }

/* ---------- 結局分享卡 ---------- */
.share-card {
  width: min(100%, 320px); padding: 18px; border-radius: 24px; text-align: left; color: #fff;
  background: linear-gradient(150deg, #ff8fb8, #b8a1e8); box-shadow: 0 14px 36px rgba(120, 40, 80, .28);
}
.share-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.share-top .flower { width: 28px; height: 28px; }
.share-top em { margin-left: auto; font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .25); }
.share-title { font-size: 28px; font-weight: 800; margin: 12px 0 4px; }
.share-desc { font-size: 14px; opacity: .95; }
.share-stats { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.share-stats li { padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, .2); font-size: 13px; }

/* Boss 結算放在理論卡上方時 */
.end-text.small { font-size: 14px; line-height: 1.6; }

/* 白底的卡片一律用深色字，不要繼承深色主題（夜奶、聚餐、打地鼠）的淺色字 */
.tc-front, .theory-static, .deck-card, .scene-line, .screening, .v2-card,
.metric, .res-row, .res-table, .menu button, .bubble { color: var(--ink); }
/* 理論卡是按鈕：用滑鼠或手指點的時候不要出現外框，用鍵盤時才顯示 */
.theory-card:focus:not(:focus-visible) { outline: none; }
.theory-card:focus-visible { outline: 3px solid var(--pink-deep); outline-offset: 4px; border-radius: 24px; }
.overlay.night .note, .overlay.dusk .note, .overlay.neon .note, .overlay.dark .note { color: #e2d2dc; }

/* 圖鑑裡還沒收集的卡 */
.deck-card.locked { background: repeating-linear-gradient(45deg, #f4e6ec 0 6px, #fbf2f6 6px 12px); box-shadow: none; color: var(--ink-soft); cursor: default; }
.menu-label { margin-top: 8px; font-size: 12px; color: var(--ink-soft); text-align: left; }
.res-head.small { margin-top: 6px; font-size: 13px; }
.res-head.small b { font-size: 15px; }

/* 彩排碼表（?timer） */
.play-timer {
  position: fixed; top: 12px; right: 12px; z-index: 100; padding: 6px 12px; border-radius: 99px;
  background: rgba(43, 29, 36, .85); color: #fff; font-size: 13px; font-variant-numeric: tabular-nums;
}

/* ---------- 全班結果 ---------- */
.overlay.scroll { justify-content: flex-start; }
.results { width: min(100%, 340px); display: flex; flex-direction: column; gap: 12px; text-align: left; }
.res-hero { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.res-hero b { font-size: 56px; font-weight: 800; line-height: 1; }
.res-hero span { font-size: 15px; color: var(--ink-soft); }
.res-meta { text-align: center; font-size: 12px; color: var(--ink-soft); }
.res-demo {
  display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 99px;
  background: #fff2c6; color: #7a5b00; font-weight: 700;
}
.res-row { background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 3px 10px rgba(120, 40, 80, .08); }
.res-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.res-head b { font-size: 20px; font-weight: 800; }
/* 進度條：同一個色系，深色是數值、淺色是底 */
.meter { height: 8px; margin: 6px 0 4px; border-radius: 99px; background: #f9d3e0; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: #d6336c; transition: width .6s; }
.res-tag { font-size: 11px; color: var(--ink-soft); }
.cmp { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.cmp > span { width: 30px; flex: none; }
.cmp > b { width: 62px; flex: none; text-align: right; font-size: 13px; }
.cmp-bar { flex: 1; height: 12px; }
.cmp-bar i { display: block; height: 100%; border-radius: 0 4px 4px 0; transition: width .6s; }
.cmp-bar i.me { background: #d6336c; }
.cmp-bar i.pt { background: #9a8a93; }
.res-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; font-size: 13px; }
.res-table th, .res-table td { padding: 8px 10px; border-bottom: 1px solid #f3e3ea; text-align: left; }
.res-table td:not(:first-child), .res-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 理論卡 ---------- */
.theory-card {
  position: relative; width: min(100%, 320px); height: 470px; margin: 14px 0 4px;
  border: 0; background: none; perspective: 1000px; cursor: pointer; text-align: left;
}
.tc-face {
  position: absolute; inset: 0; border-radius: 22px; padding: 22px 20px;
  display: flex; flex-direction: column; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .6s; box-shadow: 0 14px 36px rgba(120, 40, 80, .22);
}
.tc-back {
  align-items: center; justify-content: center; gap: 12px; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, #ff9ec4, #b8a1e8);
}
.tc-back .flower { width: 110px; height: 110px; }
.tc-front { background: #fff; transform: rotateY(180deg); gap: 8px; overflow-y: auto; }
.theory-card.flipped .tc-back { transform: rotateY(-180deg); }
.theory-card.flipped .tc-front { transform: rotateY(0); }
.tc-author { font-size: 12px; letter-spacing: 2px; color: var(--pink-deep); font-weight: 700; }
.tc-concept { font-size: 20px; font-weight: 800; line-height: 1.3; }
.tc-source { font-size: 12px; color: var(--ink-soft); }
.tc-quote { font-size: 13.5px; line-height: 1.6; border-left: 3px solid var(--pink); padding-left: 10px; }
.tc-exp, .tc-plain { font-size: 13.5px; line-height: 1.55; background: var(--pink-soft); border-radius: 12px; padding: 8px 10px; }
.tc-plain { background: #efe9ff; }
.tc-exp b, .tc-plain b { display: block; font-size: 11px; color: var(--ink-soft); }

/* ---------- 小綻 ---------- */
.flower .petals { fill: #ff9ec4; transition: fill 1.2s; }
.flower .core { fill: #ffd86b; }
.flower .eye { fill: #5a2a3a; }
.flower .pupil { fill: #fff; }
.flower .blush { fill: #ff7aa8; opacity: .55; }
.flower .mouth { fill: none; stroke: #5a2a3a; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.flower .mouth.grin { fill: #fff; }
.flower .mouth.thin { stroke-width: 1.2; }

/* 頂欄右側：天數＋音效開關 */
.appbar-right { display: flex; align-items: center; gap: 6px; }
.sound-btn {
  width: 32px; height: 32px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--pink-soft); font-size: 15px; line-height: 32px;
}

/* ---------- 可愛逐漸崩壞：每一章 App 越來越飽和、越來越不對勁 ---------- */
.phone { transition: filter 1.2s; }
/* 掃描線在全螢幕畫面（理論卡、結局）底下，不影響閱讀 */
.phone::after {
  content: ""; position: absolute; inset: 0; z-index: 39; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(0deg, rgba(40, 0, 20, .09) 0 1px, transparent 1px 3px);
  transition: opacity 1.2s;
}
.phone[data-stage="1"] { filter: saturate(1.15); }
.phone[data-stage="2"] { filter: saturate(1.35) hue-rotate(-6deg); }
.phone[data-stage="2"]::after { opacity: .35; }
.phone[data-stage="3"] { filter: saturate(1.7) hue-rotate(-12deg) contrast(1.06); }
.phone[data-stage="3"]::after { opacity: .7; animation: scan 6s linear infinite; }
.phone[data-stage="4"]::after { opacity: 1; animation: scan 1.5s linear infinite; }
@keyframes scan { to { background-position: 0 60px; } }
.phone[data-stage="3"] .flower .petals { fill: #ff4f93; }
.phone[data-stage="2"] .bmi-panel { animation: glitch-soft 7s infinite steps(1); }
.phone[data-stage="3"] .bmi-panel { animation: glitch-soft 3.5s infinite steps(1); }
@keyframes glitch-soft {
  0%, 100% { transform: none; }
  91% { transform: translate(2px, -1px) skewX(-3deg); }
  93% { transform: translate(-3px, 1px); }
  95% { transform: none; }
}
.phone[data-stage="3"] .avatar .flower, .phone[data-stage="3"] .brand-flower .flower { animation: twitch 2.4s infinite steps(1); }
@keyframes twitch { 0%, 100% { transform: none; } 88% { transform: rotate(-8deg) scale(1.05); } 90% { transform: rotate(6deg); } 92% { transform: none; } }
/* 數值變化的閃動要蓋過上面的抖動 */
.phone[data-stage] .bmi-panel.down { animation: glow .8s; }
.phone[data-stage] .bmi-panel.up { animation: shake .45s; }

/* 手機橫拿時畫面太矮，卡片和按鈕會擠在一起，請玩家轉回直的 */
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  body::after {
    content: "📱\A請把手機轉成直的\A這個遊戲要直著玩";
    white-space: pre; text-align: center;
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: var(--cream); color: var(--ink);
    font-size: 20px; font-weight: 700; line-height: 1.8;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; }
}

/* 月子餐兩難 */
.ml { height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px max(16px, env(safe-area-inset-bottom)); }
.ml-top { display: flex; justify-content: space-between; align-items: baseline; }
.ml-top span { font-size: 13px; opacity: .75; }
.ml-meter { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ml-meter span { flex: none; width: 74px; }
.ml-meter .bar { height: 10px; background: #f0dbe4; }
.ml-meter .bar i { display: block; height: 100%; width: 0; transition: width .3s, background .3s; }
.ml-meter em { flex: none; width: 72px; text-align: right; font-style: normal; font-size: 12.5px; }
.ml-voices { display: flex; flex-direction: column; gap: 8px; }
.ml-say { padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; background: #fff; box-shadow: 0 2px 8px rgba(120, 40, 80, .1); }
.ml-say b { display: block; font-size: 12px; margin-bottom: 2px; color: var(--ink-soft); }
.ml-say.mil { border-left: 4px solid #d4a373; }
.ml-say.app { border-left: 4px solid var(--pink); }
.ml-dishes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; }
.ml-dish { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 112px; padding: 12px 4px; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 3px 10px rgba(120, 40, 80, .12); cursor: pointer; touch-action: manipulation; }
.ml-dish:active { transform: scale(.96); }
.ml-ic { font-size: 34px; line-height: 1.1; }
.ml-dish b { font-size: 13.5px; text-align: center; }
.ml-dish small { font-size: 12px; color: var(--ink-soft); }
.ml-timer { flex: none; height: 6px; background: #f0dbe4; }
.ml-timer i { display: block; height: 100%; width: 100%; background: var(--pink-deep); }
.ml-msg { min-height: 1.5em; text-align: center; font-weight: 700; }
.ml-msg.pop { animation: pop .4s; }

/* 成就清單 */
.ach { width: 100%; max-width: 340px; margin: 14px 0 4px; padding: 12px 14px; border-radius: 16px; text-align: left; background: rgba(255, 143, 184, .12); border: 1px solid rgba(255, 143, 184, .3); }
.ach-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.ach-head span { font-size: 13px; opacity: .75; }
.ach ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ach li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; }
.ach li.lock { opacity: .5; }
.ach-ic { flex: none; width: 26px; text-align: center; font-size: 19px; }
.ach li b { display: block; font-size: 14px; }
.ach li small { display: block; font-size: 12.5px; opacity: .8; }
.ach li em { font-style: normal; font-size: 11px; margin-left: 4px; padding: 1px 6px; border-radius: 99px; background: var(--pink-deep); color: #fff; }
.ach li.fresh { animation: popin .5s; }
