:root {
  --blush: #F4C9D8;
  --lavender: #D9C9EC;
  --coral: #F2A9BE;
  --mauve: #B79CB0;
  --pearl: #FDF8F5;
  --gold: #E8D5A8;
  --ink: #5A4A56;
  --ink-soft: #8A7583;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "LXGW WenKai TC", "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", serif;
  color: var(--ink);
  background: var(--pearl);
}

body {
  background:
    radial-gradient(circle at 15% 10%, rgba(244,201,216,0.55), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(217,201,236,0.5), transparent 50%),
    radial-gradient(circle at 20% 90%, rgba(242,169,190,0.35), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(217,201,236,0.4), transparent 50%),
    var(--pearl);
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 48px;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  animation: fadeIn 0.5s ease;
}
.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}
.screen.leaving { animation: fadeOut 0.35s ease forwards; }

/* ---------- Entry ---------- */
.brand {
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--mauve);
  margin-bottom: 32px;
}
.entry-title {
  text-align: center;
  font-size: 30px;
  line-height: 1.6;
  margin: 0 0 10px;
}
.entry-subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 14px;
  line-height: 1.7;
}
.entry-sub {
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 40px;
  line-height: 1.8;
}
.view-result-link {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--mauve);
  cursor: pointer;
  margin: -8px 0 20px;
  padding: 4px;
  text-decoration: none; /* 這個 class 現在也套用在 <a> 連結上（例如首頁的「認識八大神獸」），按鈕本身沒有底線，這裡明講避免連結預設底線跑出來 */
}
.view-result-link:hover {
  color: var(--ink);
}
.path-btn {
  display: block;
  width: 100%;
  padding: 20px 24px;
  margin-bottom: 16px;
  border: 1px solid rgba(183,156,176,0.35);
  border-radius: 18px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(6px);
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  font-family: inherit;
}
.path-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px rgba(183,156,176,0.55);
  background: rgba(255,255,255,0.8);
}
.path-btn .path-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}
.path-btn .path-desc {
  font-size: 13px;
  color: var(--ink-soft);
}
.cooldown-note {
  font-size: 12px;
  color: var(--mauve);
  margin-top: 6px;
}

/* ---------- Quiz ---------- */
.progress-track {
  height: 4px;
  background: rgba(183,156,176,0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 32px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--lavender));
  transition: width 0.4s ease;
}
.question-prompt {
  font-size: 19px;
  line-height: 1.9;
  margin-bottom: 28px;
  min-height: 96px;
}
.option-card {
  display: block;
  width: 100%;
  padding: 18px 20px;
  margin-bottom: 14px;
  border: 1px solid rgba(183,156,176,0.3);
  border-radius: 16px;
  background: rgba(255,255,255,0.6);
  text-align: left;
  font-size: 15px;
  line-height: 1.7;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
/* 只有在使用者「真的移動過滑鼠」之後才允許 hover 效果生效（見 app.js 的 hover-ready 機制）。
   避免新題目剛好渲染在滑鼠原本停留的座標上時，瀏覽器誤把 :hover 套用到某一個選項，
   讓兩個選項在使用者做出選擇前就已經看起來不一樣、像是在暗示答案。 */
body.hover-ready .option-card:hover {
  background: rgba(255,255,255,0.9);
  border-color: var(--coral);
  transform: translateX(2px);
}
.back-link {
  align-self: flex-start;
  font-size: 13px;
  color: var(--mauve);
  cursor: pointer;
  margin-bottom: 20px;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}

/* ---------- Transition ---------- */
.transition-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.transition-icon {
  font-size: 48px;
  margin-bottom: 20px;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 1; }
}
.transition-text {
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}

/* ---------- Result ---------- */
.result-illustration {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 20px 40px -20px rgba(183,156,176,0.5);
}
.result-illustration img {
  width: 100%;
  display: block;
}
.result-reveal-heading {
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
  margin: 4px 0 10px;
}
.result-name {
  text-align: center;
  font-size: 48px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.3em;
  margin-bottom: 10px;
}
.result-tagline {
  text-align: center;
  font-size: 21px;
  line-height: 1.7;
  margin-bottom: 24px;
  font-weight: 600;
}
.result-lore {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.9;
  padding: 14px 16px;
  background: rgba(217,201,236,0.18);
  border-radius: 12px;
  margin-bottom: 20px;
}
.result-core {
  font-size: 15px;
  line-height: 2;
  margin-bottom: 20px;
}
.result-contrast, .result-rare {
  font-size: 14px;
  line-height: 1.9;
  padding: 16px 18px;
  border-radius: 14px;
  margin-bottom: 16px;
}
.result-contrast {
  background: rgba(244,201,216,0.28);
  border: 1px solid rgba(242,169,190,0.35);
}
.result-rare {
  background: linear-gradient(135deg, rgba(232,213,168,0.35), rgba(217,201,236,0.28));
  border: 1px solid rgba(232,213,168,0.5);
}
.rare-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.15em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: #6b5a33;
  margin-bottom: 8px;
}
.rare-badge-secondary {
  background: rgba(183,156,176,0.25);
  color: var(--ink-soft);
  margin-left: 8px;
}
.cta-block {
  text-align: center;
  padding: 20px;
  margin: 12px 0 20px;
  border-top: 1px dashed rgba(183,156,176,0.4);
  border-bottom: 1px dashed rgba(183,156,176,0.4);
}
.cta-block p {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 14px;
}
.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--pearl);
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-secondary {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--mauve);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 10px;
  text-decoration: none; /* 這個 class 現在也套用在 <a> 連結上（結果頁的「深入解析」按鈕） */
}
.closing-line {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.9;
  margin: 20px 0;
  font-style: italic;
}
.share-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

/* ---------- Match ---------- */
.match-pair {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.match-card {
  flex: 1;
  text-align: center;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(183,156,176,0.25);
  cursor: pointer;
}
.match-card img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 8px;
}
.match-card .match-role { font-size: 11px; color: var(--mauve); margin-bottom: 2px; }
.match-card .match-name { font-size: 15px; font-weight: 600; }
.match-link-symbol {
  text-align: center;
  font-size: 22px;
  color: var(--coral);
  margin: -8px 0 20px;
}
.match-label {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}
.match-label-desc {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 20px;
  line-height: 1.8;
}
.match-full-text {
  font-size: 14.5px;
  line-height: 2;
  padding: 18px;
  background: rgba(255,255,255,0.5);
  border-radius: 14px;
  margin-bottom: 20px;
}

.footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--mauve);
  margin-top: auto;
  padding-top: 24px;
}
