/* ================================================================
   深夜書店：閱讀人格測驗 — 樣式（視覺小說式）
   Token 對齊 ../css/style.css（水彩鉛筆風五色色票）
   故事進行中：全螢幕場景 + 底部漸層 scrim + 逐字浮現文字
   結果頁：紙卡樣式（分享卡氛圍）
   ================================================================ */

:root {
  --parchment: #F8F1E4;
  --cream: #FAF3E7;
  --sage: #6B8064;
  --lavender: #9B8FB5;
  --walnut: #3D2F1F;
  --walnut-soft: #6B5641;
  --amber: #C9B89A;

  --font-serif: 'Noto Serif TC', 'EB Garamond', Georgia, serif;
  --font-sans: 'Noto Sans TC', 'Inter', -apple-system, sans-serif;
  --font-italic: 'EB Garamond', 'Noto Serif TC', serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --ease-watercolor: cubic-bezier(0.22, 0.61, 0.36, 1);

  --type-color: var(--sage);
  --type-color-dark: var(--sage);
  --type-color-wash: #E4E9DE;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  color: var(--walnut);
  background: #191410; /* 圖片載入前的深色底、避免白閃 */
  line-height: 1.75;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* 紙感雜訊疊層 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.24 0 0 0 0 0.18 0 0 0 0 0.12 0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none;
  opacity: 0.4;
  z-index: 6;
  mix-blend-mode: multiply;
}

/* ---------------- 場景背景層 ---------------- */
.scene-bg-layer {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 1.1s var(--ease-watercolor);
  z-index: 0;
}
#scene-bg { opacity: 1; }
#scene-bg-prev { opacity: 0; z-index: -1; }

/* 全域輕微暗角，讓 UI 浮在畫上 */
.scene-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(18, 13, 8, 0.32) 100%);
  transition: background 0.8s var(--ease-watercolor), backdrop-filter 0.8s var(--ease-watercolor);
  pointer-events: none;
}
/* 轉場 / 回顧時整體壓暗 */
.scene-veil.dim {
  background: rgba(18, 13, 8, 0.62);
  backdrop-filter: blur(2px);
}

.type-tint {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: var(--type-color-wash);
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 1.2s var(--ease-watercolor);
  pointer-events: none;
}
.type-tint.on { opacity: 0.45; }

/* ---------------- 頂欄 ---------------- */
.quiz-brand {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 24px;
  z-index: 10;
  font-family: var(--font-italic);
  font-style: italic;
  color: rgba(250, 243, 231, 0.85);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(18, 13, 8, 0.6);
}
.quiz-brand:hover { color: #fff; }

#progress-dots {
  position: fixed;
  top: max(26px, env(safe-area-inset-top));
  right: 64px;
  z-index: 10;
  display: flex;
  gap: 6px;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(250, 243, 231, 0.32);
  transition: background 0.4s var(--ease-watercolor), transform 0.4s var(--ease-watercolor);
}
.dot.filled { background: rgba(250, 243, 231, 0.95); transform: scale(1.15); }

/* 音效開關 */
.mute-toggle {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 18px;
  z-index: 10;
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: rgba(250, 243, 231, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mute-toggle svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 4px rgba(18,13,8,0.6)); }
.mute-toggle .icon-off { display: none; }
.mute-toggle.muted .icon-on { display: none; }
.mute-toggle.muted .icon-off { display: block; }
.mute-toggle.muted { color: rgba(250, 243, 231, 0.45); }

/* ---------------- 舞台 ---------------- */
.quiz-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

#quiz-root {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  min-height: 100dvh;
  transition: opacity 0.36s var(--ease-watercolor);
}
#quiz-root.leaving { opacity: 0; }

/* ---------------- 逐字浮現 ---------------- */
.ch {
  opacity: 0;
  transition: opacity 0.5s var(--ease-watercolor);
}
.shown .ch { opacity: 1; }
.skip .ch { opacity: 1 !important; transition-delay: 0ms !important; transition-duration: 0.15s !important; }

/* ---------------- 開場 / 轉場（置中構圖） ---------------- */
.vn-center {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 0 6vw calc(9vh + env(safe-area-inset-bottom));
}

.vn-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: rgba(250, 243, 231, 0.75);
  text-shadow: 0 1px 6px rgba(18, 13, 8, 0.7);
  margin-bottom: 10px;
}

.vn-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  letter-spacing: 0.12em;
  color: var(--cream);
  text-shadow: 0 2px 18px rgba(18, 13, 8, 0.85);
  margin-bottom: 22px;
}

.vn-open-text,
.vn-transition {
  font-family: var(--font-serif);
  font-size: clamp(0.98rem, 2.6vw, 1.12rem);
  line-height: 2.15;
  letter-spacing: 0.02em;
  color: var(--cream);
  text-shadow: 0 1px 10px rgba(18, 13, 8, 0.9);
  max-width: min(600px, 90vw); /* 中文一行約 26 字，桌機不再突兀斷行 */
  margin-bottom: 30px;
  cursor: pointer;
}
.vn-transition { font-family: var(--font-italic); font-style: italic; }

/* 主要按鈕（推開門 / 看看你的深夜原形）— 霧面毛玻璃 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--cream);
  background: rgba(250, 243, 231, 0.13);
  border: 1px solid rgba(250, 243, 231, 0.42);
  border-radius: 30px;
  padding: 13px 30px;
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  text-shadow: 0 1px 6px rgba(18, 13, 8, 0.6);
  transition: transform 0.25s var(--ease-watercolor), background 0.3s var(--ease-watercolor),
              border-color 0.3s var(--ease-watercolor),
              box-shadow 0.3s var(--ease-watercolor), opacity 0.6s var(--ease-watercolor);
  box-shadow: 0 6px 22px rgba(18, 13, 8, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary svg { width: 17px; height: 17px; transition: transform 0.25s var(--ease-watercolor); }
.btn-primary:hover {
  transform: translateY(-2px);
  background: rgba(250, 243, 231, 0.24);
  border-color: rgba(250, 243, 231, 0.65);
  box-shadow: 0 10px 28px rgba(18, 13, 8, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover svg { transform: translateX(3px); }
.vn-start { opacity: 0; pointer-events: none; }
.vn-start.shown { opacity: 1; pointer-events: auto; }

/* 打字途中的「點擊跳過」透明層：蓋住畫面，點任一處＝跳過逐字（不會誤觸選項） */
.tap-skip {
  position: fixed;
  inset: 0;
  z-index: 8;
  cursor: pointer;
  background: transparent;
}
/* 敘事結尾的「點擊繼續」全螢幕層 */
.tap-advance {
  position: fixed;
  inset: 0;
  z-index: 8;
  cursor: pointer;
  background: transparent;
}
/* 自動播放被擋時的聲音提示 */
.sound-hint {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 8px);
  z-index: 11;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: rgba(250, 243, 231, 0.92);
  background: rgba(20, 15, 10, 0.66);
  border: 1px solid rgba(250, 243, 231, 0.25);
  border-radius: 20px;
  padding: 8px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease-watercolor), transform 0.6s var(--ease-watercolor);
}
.sound-hint.shown { opacity: 1; transform: translate(-50%, 0); }

/* 右下角前進提示 */
.vn-advance {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: calc(26px + env(safe-area-inset-bottom));
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: rgba(250, 243, 231, 0.9);
  text-shadow: 0 1px 8px rgba(18, 13, 8, 0.85);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s var(--ease-watercolor), transform 0.6s var(--ease-watercolor);
}
.vn-advance.shown { opacity: 1; transform: translateY(0); animation: advance-bob 1.8s ease-in-out 0.6s infinite; }
.vn-advance svg { width: 18px; height: 18px; }
@keyframes advance-bob {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* ---------------- 題目（底部對話框構圖） ---------------- */
.vn-box {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 max(5vw, 20px) calc(4.5vh + env(safe-area-inset-bottom));
  max-width: 860px;
  margin: 0 auto;
  position: relative;
}
/* 底部漸層 scrim：文字可讀、圖不被整張蓋掉 */
.vn-box::before {
  content: '';
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 68vh;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(18, 13, 8, 0.28) 34%,
    rgba(18, 13, 8, 0.72) 68%,
    rgba(18, 13, 8, 0.88) 100%);
  pointer-events: none;
  z-index: -1;
}

.vn-text {
  font-family: var(--font-serif);
  font-size: clamp(1.02rem, 2.7vw, 1.18rem);
  line-height: 2.0;
  letter-spacing: 0.02em;
  color: var(--cream);
  text-shadow: 0 1px 10px rgba(18, 13, 8, 0.85);
  margin-bottom: 16px;
  max-width: 680px; /* 桌機一行約 30 字，讀起來舒服也不會提早斷行 */
  cursor: pointer;
}

.vn-prompt {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  color: rgba(250, 243, 231, 0.85);
  text-shadow: 0 1px 6px rgba(18, 13, 8, 0.8);
  margin-bottom: 14px;
  opacity: 0;
  transition: opacity 0.6s var(--ease-watercolor);
}
.vn-prompt.shown { opacity: 1; }

.vn-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vn-options .vn-option {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none; /* 浮現前不可點，避免打字途中誤觸 */
}
.vn-options.shown .vn-option {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.vn-option {
  font-family: var(--font-sans);
  font-size: 0.94rem;
  line-height: 1.6;
  text-align: left;
  color: var(--cream);
  background: rgba(38, 29, 20, 0.66);
  border: 1px solid rgba(250, 243, 231, 0.22);
  border-left: 3px solid rgba(201, 184, 154, 0.55);
  border-radius: 4px;
  padding: 13px 18px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.3s var(--ease-watercolor), border-color 0.3s var(--ease-watercolor),
              transform 0.5s var(--ease-watercolor), opacity 0.5s var(--ease-watercolor);
}
.vn-option:hover {
  background: rgba(61, 47, 31, 0.85);
  border-left-color: var(--cream);
  transform: translateX(4px);
}
.vn-option.picked {
  background: rgba(107, 128, 100, 0.85);
  border-left-color: var(--cream);
}
.vn-options.locked .vn-option:not(.picked) { opacity: 0.35; pointer-events: none; }

/* ---------------- 回顧 ---------------- */
.vn-center.recap { justify-content: center; }
.recap-lines { margin-bottom: 26px; max-width: 520px; }
.recap-line {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.9;
  color: rgba(250, 243, 231, 0.92);
  text-shadow: 0 1px 6px rgba(18, 13, 8, 0.7);
  margin-bottom: 10px;
  opacity: 0;
  animation: recap-fade-in 0.8s var(--ease-watercolor) forwards;
}
@keyframes recap-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- 結果頁（紙卡） ---------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--walnut-soft);
  margin-bottom: 10px;
}
.quiz-title {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--walnut);
}

.result-wrap {
  position: relative;
  z-index: 2;
  max-width: 468px;
  margin: 0 auto;
  padding: 5vh 16px calc(5vh + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---- 人格卡＝分享出去的樣子（手繪場景 + 霧面米卡） ---- */
.result-card {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  padding-top: 150px;
  background: linear-gradient(180deg, rgba(18,13,8,0.28) 0%, rgba(18,13,8,0) 26%),
              url("assets/share/card-bg.jpg") center top / cover, #241c14;
  box-shadow: 0 2px 4px rgba(18,13,8,0.2), 0 28px 64px rgba(18,13,8,0.5);
  opacity: 0;
  transform: translateY(18px) scale(0.99);
  transition: opacity 0.7s var(--ease-watercolor), transform 0.7s var(--ease-watercolor);
}
.result-card.in { opacity: 1; transform: none; }
/* 依人格代表色的色溫層（每型不同氛圍） */
.rc-tint {
  position: absolute; inset: 0; z-index: 0;
  background: var(--type-color-wash);
  opacity: 0.26;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.rc-brand {
  font-family: var(--font-serif);
  font-size: 0.82rem; letter-spacing: 0.22em;
  color: var(--walnut-soft);
  margin-bottom: 10px;
}
.rc-avatar-wrap {
  position: relative;
  z-index: 2;
  width: 132px; height: 132px;
  margin: -78px auto -42px;
  display: flex; align-items: center; justify-content: center;
}
.rc-avatar-wrap::before {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--type-color-wash) 0%, rgba(255,240,210,0.16) 55%, transparent 72%);
  filter: blur(3px);
}
.rc-avatar {
  position: relative;
  width: 120px; height: 120px; object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,0.42));
}

.rc-panel {
  position: relative;
  margin: 0 13px 13px;
  padding: 56px 24px 26px;
  background: linear-gradient(180deg, rgba(250,244,232,0.74), rgba(246,238,221,0.78));
  backdrop-filter: blur(7px) saturate(1.05);
  -webkit-backdrop-filter: blur(7px) saturate(1.05);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 22px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.55);
  text-align: center;
}

.rc-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.2em;
  color: var(--walnut-soft);
  margin-bottom: 6px;
}
.rc-name {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 2.35rem; letter-spacing: 0.05em;
  color: var(--type-color-dark);
  margin-bottom: 8px;
}
.rc-tagline {
  font-family: var(--font-italic); font-style: italic;
  font-size: 1.08rem; color: var(--walnut-soft);
  margin-bottom: 24px;
}
.rc-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 18px; }
.rc-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--type-color-dark); opacity: 0.5; }
.rc-dots i:nth-child(2) { opacity: 0.8; }

.rc-desc {
  font-family: var(--font-serif);
  font-size: 0.98rem; line-height: 1.9;
  color: var(--walnut);
  margin-bottom: 20px;
}

/* 特質：柔和水彩標籤（無硬框、手作感） */
.rc-traits { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 26px; }
.rc-tag {
  font-family: var(--font-serif);
  font-size: 0.82rem; color: var(--walnut);
  background: var(--type-color-wash);
  border-radius: 999px;
  padding: 6px 15px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 999px rgba(255,251,244,0.28);
}

/* 合拍：圓形頭像 + 說明，不用框 */
.rc-rel-block { margin-bottom: 24px; }
.rc-relhead {
  font-family: var(--font-italic); font-style: italic;
  font-size: 0.88rem; color: var(--lavender);
  margin-bottom: 14px;
}
.rc-rels { display: flex; gap: 10px; justify-content: center; }
.rc-rel { display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 108px; }
.rc-rel-label { font-size: 0.72rem; color: var(--walnut-soft); margin-bottom: 8px; }
.rc-rel-ava {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, rgba(255,255,255,0.7), rgba(255,255,255,0.1) 72%);
  box-shadow: 0 0 0 2px var(--rc), 0 4px 12px rgba(61,47,31,0.14);
  margin-bottom: 8px;
}
.rc-rel-ava img { width: 52px; height: 52px; object-fit: contain; }
.rc-rel-name { font-family: var(--font-serif); font-size: 0.84rem; font-weight: 600; color: var(--walnut); line-height: 1.35; }

/* 卡內書單 */
.rc-books { margin-bottom: 24px; }
.rc-book { font-family: var(--font-serif); font-size: 0.92rem; color: var(--walnut); margin-bottom: 5px; }
.rc-book span { font-family: var(--font-italic); font-style: italic; color: var(--walnut-soft); font-size: 0.8rem; margin-left: 8px; }

/* 卡內頁尾：QR + CTA */
.rc-foot {
  display: flex; align-items: center; gap: 16px; justify-content: center;
  padding-top: 20px;
  border-top: 1px solid rgba(61,47,31,0.14);
}
.rc-qr { width: 74px; height: 74px; border-radius: 10px; image-rendering: pixelated; flex-shrink: 0; }
.rc-foot-text { text-align: left; }
.rc-foot-q { font-family: var(--font-serif); font-weight: 600; font-size: 0.98rem; color: var(--walnut); margin-bottom: 4px; }
.rc-foot-cta { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.03em; color: var(--type-color-dark); }

.dl-note { text-align: center; }
.dl-note-title {
  font-size: 0.82rem; letter-spacing: 0.04em;
  color: rgba(250,243,231,0.78);
  text-shadow: 0 1px 8px rgba(18,13,8,0.8);
  margin-bottom: 12px;
}
/* 置頂的主要下載塊 */
.dl-note-primary {
  padding: 18px 18px 16px;
  background: rgba(20, 15, 10, 0.42);
  border: 1px solid rgba(250,243,231,0.22);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 22px;
}
.dl-note-primary .dl-note-title {
  font-family: var(--font-serif);
  font-size: 0.98rem; letter-spacing: 0.02em;
  color: var(--cream);
  margin-bottom: 14px;
}
.dl-note-primary .store-badge { padding: 9px 16px; }

/* ---- 下載 / 分享面板（浮在場景上） ---- */
.result-panel {
  text-align: center;
  padding: 4px 2px 0;
}
.share-label {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--cream);
  text-shadow: 0 1px 10px rgba(18,13,8,0.9);
  max-width: 440px;
  margin: 0 auto 18px;
}

/* 三顆操作鈕：分享(主) / 下載(次) / 重測(弱) */
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.act-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: 0.02em;
  border-radius: 14px;
  padding: 14px 26px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease-watercolor), box-shadow 0.3s var(--ease-watercolor),
              background 0.3s var(--ease-watercolor), border-color 0.3s var(--ease-watercolor);
}
.act-btn svg { width: 18px; height: 18px; }
.act-btn:disabled { opacity: 0.7; cursor: default; transform: none; }

/* 分享（主要）：暖色實心漸層，最搶眼 */
.act-share {
  color: #2A1E12;
  background: linear-gradient(135deg, var(--type-color-wash), #FBEFD9);
  box-shadow: 0 6px 20px rgba(18,13,8,0.35);
  font-weight: 700;
}
.act-share:hover { transform: translateY(-2px); background: linear-gradient(135deg, #fff, var(--type-color-wash)); box-shadow: 0 10px 26px rgba(18,13,8,0.45); }

/* 下載（次要）：霧面毛玻璃 */
.act-download {
  color: var(--cream);
  background: rgba(250, 243, 231, 0.12);
  border-color: rgba(250,243,231,0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-shadow: 0 1px 6px rgba(18,13,8,0.5);
}
.act-download:hover { transform: translateY(-2px); background: rgba(250,243,231,0.22); border-color: rgba(250,243,231,0.65); }

/* 重測（最弱）：純文字感 */
.act-restart {
  color: rgba(250,243,231,0.82);
  background: transparent;
  border-color: rgba(250,243,231,0.22);
  font-weight: 500;
  text-shadow: 0 1px 6px rgba(18,13,8,0.7);
}
.act-restart:hover { color: var(--cream); border-color: rgba(250,243,231,0.45); }

.store-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.store-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  background: rgba(20, 15, 10, 0.85);
  border: 1px solid rgba(250,243,231,0.28);
  border-radius: 9px;
  color: var(--cream);
  text-decoration: none;
  transition: transform 0.25s var(--ease-watercolor), border-color 0.3s var(--ease-watercolor);
}
.store-badge:hover { transform: translateY(-1px); border-color: rgba(250,243,231,0.55); }
.store-badge svg { width: 18px; height: 18px; flex-shrink: 0; }
.store-badge span { display: flex; flex-direction: column; line-height: 1.1; font-weight: 600; font-size: 0.8rem; }
.store-badge small { font-size: 0.52rem; font-weight: 400; letter-spacing: 0.06em; opacity: 0.72; }

/* ---- 分析圖（IG 限動 9:16，1080×1920，離屏渲染）：手繪場景 + 霧面米卡 ---- */
.share-card {
  position: fixed;
  left: -99999px;
  top: 0;
  width: 1080px;
  height: 1920px;
  overflow: hidden;
  background: #191410;
  font-family: var(--font-sans);
}
.sc-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* 依人格色調的色溫層（normal blend，html2canvas 可正確輸出） */
.sc-tint { position: absolute; inset: 0; background: var(--type-color-wash); opacity: 0.2; }
.sc-topwash {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,13,8,0.55) 0%, rgba(18,13,8,0.15) 22%, rgba(18,13,8,0) 40%);
}
.sc-brand {
  position: absolute; top: 70px; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 34px; letter-spacing: 0.28em;
  color: rgba(250, 243, 231, 0.92);
  text-shadow: 0 2px 16px rgba(0,0,0,0.6);
}
/* 頭像：站在場景光暈裡，壓在米卡上緣 */
.sc-avatar-wrap {
  position: absolute; top: 210px; left: 50%;
  width: 340px; height: 340px;
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.sc-avatar-wrap::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, var(--type-color-wash) 0%, rgba(255,240,210,0.15) 55%, transparent 72%);
  filter: blur(4px);
}
.sc-avatar { position: relative; width: 300px; height: 300px; object-fit: contain; filter: drop-shadow(0 22px 34px rgba(0,0,0,0.5)); }
/* 霧面米卡（半透明，讓手繪書店透出來） */
.sc-panel {
  position: absolute; left: 52px; right: 52px; bottom: 48px; top: 418px;
  background: linear-gradient(180deg, rgba(250,244,232,0.82), rgba(247,239,224,0.85));
  border: 1.5px solid rgba(255,255,255,0.55);
  border-radius: 40px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.45), inset 0 2px 0 rgba(255,255,255,0.6);
  padding: 120px 58px 40px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.sc-eyebrow { font-family: var(--font-mono); font-size: 26px; letter-spacing: 0.28em; color: #7A6248; margin-bottom: 6px; }
.sc-name {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 92px; letter-spacing: 0.06em;
  color: var(--type-color-dark);
  margin-bottom: 10px;
}
.sc-tagline { font-family: var(--font-italic); font-style: italic; font-size: 38px; color: #6B5641; margin-bottom: 26px; }
.sc-dots { display: flex; gap: 14px; justify-content: center; margin-bottom: 16px; }
.sc-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--type-color-dark); opacity: 0.5; }
.sc-dots i:nth-child(2) { opacity: 0.85; }
.sc-desc {
  font-family: var(--font-serif); font-size: 29px; line-height: 1.72;
  color: #3D2F1F; max-width: 840px; margin-bottom: 18px;
}
.sc-traits { display: flex; flex-wrap: wrap; gap: 13px; justify-content: center; max-width: 860px; margin-bottom: 20px; }
.sc-chip {
  font-family: var(--font-serif);
  font-size: 26px; color: #3D2F1F;
  background: var(--type-color-wash);
  border-radius: 999px; padding: 12px 28px; white-space: nowrap;
  box-shadow: inset 0 0 0 999px rgba(255,251,244,0.26);
}
.sc-rels { display: flex; gap: 30px; justify-content: center; margin-bottom: 18px; }
.sc-rel { display: flex; flex-direction: column; align-items: center; }
.sc-rel-label { font-size: 24px; color: #7A6248; margin-bottom: 12px; }
.sc-rel-ava {
  width: 118px; height: 118px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, rgba(255,255,255,0.75), rgba(255,255,255,0.1) 72%);
  box-shadow: 0 0 0 4px var(--rc), 0 6px 16px rgba(61,47,31,0.16);
  margin-bottom: 14px;
}
.sc-rel-ava img { width: 92px; height: 92px; object-fit: contain; }
.sc-rel-name { font-family: var(--font-serif); font-size: 27px; font-weight: 600; color: #3D2F1F; }
/* 卡內書單 */
.sc-books { margin-bottom: 6px; }
.sc-books-head { font-family: var(--font-italic); font-style: italic; font-size: 26px; color: #7A6248; margin-bottom: 10px; }
.sc-book { font-family: var(--font-serif); font-size: 28px; color: #3D2F1F; margin-bottom: 5px; }
.sc-book span { font-family: var(--font-italic); font-style: italic; font-size: 23px; color: #7A6248; margin-left: 10px; }
/* 頁尾：QR + CTA */
.sc-foot {
  display: flex; align-items: center; gap: 26px;
  margin-top: auto; padding-top: 26px;
  border-top: 2px solid rgba(61,47,31,0.14);
  width: 100%; justify-content: center;
}
.sc-qr { width: 150px; height: 150px; border-radius: 14px; image-rendering: pixelated; flex-shrink: 0; }
.sc-foot-text { text-align: left; }
.sc-foot-q { font-family: var(--font-serif); font-size: 36px; font-weight: 600; color: #3D2F1F; margin-bottom: 10px; }
.sc-foot-cta { font-family: var(--font-mono); font-size: 25px; letter-spacing: 0.04em; color: var(--type-color-dark); font-weight: 600; }

/* ---------------- 響應式 ---------------- */
@media (max-width: 640px) {
  .vn-box { padding-bottom: calc(3.5vh + env(safe-area-inset-bottom)); }
  .vn-text { font-size: 0.98rem; line-height: 1.95; }
  .vn-option { font-size: 0.9rem; padding: 12px 14px; }
  .vn-center { padding-bottom: calc(7vh + env(safe-area-inset-bottom)); }
  #progress-dots { right: 58px; }
  .result-wrap { padding: 4vh 12px calc(4vh + env(safe-area-inset-bottom)); gap: 18px; }
  .result-card { padding-top: 132px; }
  .rc-avatar-wrap { width: 118px; height: 118px; margin: -70px auto -40px; }
  .rc-avatar { width: 106px; height: 106px; }
  .rc-panel { padding: 52px 18px 24px; }
  .rc-name { font-size: 2.05rem; }
  .rc-rels { gap: 6px; }
  .rc-rel-ava { width: 56px; height: 56px; }
  .rc-rel-ava img { width: 46px; height: 46px; }
  .rc-foot { gap: 12px; }
  .result-actions { gap: 8px; }
  .act-btn { padding: 12px 18px; font-size: 0.9rem; }
  .dl-block { flex-direction: column; text-align: center; gap: 12px; padding: 16px; }
  .dl-text { text-align: center; }
  .store-row { justify-content: center; }
}

/* 短螢幕（橫向手機）壓縮行高 */
@media (max-height: 480px) {
  .vn-text { font-size: 0.9rem; line-height: 1.7; margin-bottom: 8px; }
  .vn-option { padding: 8px 14px; font-size: 0.85rem; }
  .vn-options { gap: 6px; }
  .vn-title { font-size: 2rem; margin-bottom: 12px; }
}
