:root {
  --bg: #FBF8F3;
  --white: #ffffff;
  --text: #1a1a1a;
  --text-dim: #6b6b6b;
  --text-muted: #a8a8a8;
  --accent: #1a1a1a;
  --border: #e4e0d8;
  --serif: 'Noto Serif SC', serif;
  --sans: 'Outfit', -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.7;
  min-height: 100vh;
}

/* ---- Lang Bar ---- */
.lang-bar {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lang-btn {
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  transition: color 0.2s;
}

.lang-btn.active {
  color: var(--text);
  font-weight: 500;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-dot {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* ---- Root Layout ---- */
.root {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

/* ---- Card ---- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 3rem 2.5rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

/* ---- Divider ---- */
.divider {
  border: none;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
  margin: 0 auto 1.25rem;
}

/* ---- Brand ---- */
.brand {
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ---- Title ---- */
.title {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.d-block { display: block; }

.sub {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  font-family: var(--sans);
  font-weight: 300;
}

.footnote {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 1rem;
  font-family: var(--sans);
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
  padding: 0.9rem 3rem;
  font-family: var(--serif);
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: opacity 0.25s;
}

.btn:hover { opacity: 0.8; }
.btn:active { opacity: 0.92; }

.btn-link {
  display: inline-block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  font-family: var(--sans);
  transition: color 0.2s;
}

.btn-link:hover { color: var(--text); }

/* ---- Quiz Card ---- */
.quiz-card { max-width: 500px; }

.progress-line {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 1px;
  background: var(--accent);
  width: 0%;
  transition: width 0.4s ease;
}

.step {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.q-text {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 2rem;
  min-height: 3.2rem;
}

.opts {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.opt {
  display: block;
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--serif);
  font-size: 0.88rem;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1.4;
}

.opt:hover {
  background: #f0ede6;
  border-color: #c8c4ba;
}

.opt:active {
  background: #e5e1d8;
  transform: scale(0.99);
}

.opt.selected {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

/* ---- Result Card ---- */
.result-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  max-width: 520px;
}

.r-glow {
  position: absolute;
  top: 40px;             /* 相片背後柔光（原本喺相片上面露出嚟） */
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  opacity: 0.10;
  pointer-events: none;
  transition: background 0.5s;
}

/* 飲品實拍：完整正方形、居中、細邊框（唔裁切，保住杯口） */
.r-photo {
  display: block;
  width: min(100%, 300px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 50%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin: 0 auto 1.5rem;
}

.r-mood {
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  font-style: italic;
}

.r-name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  transition: color 0.5s;
}

.r-tagline {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: var(--sans);
  margin-bottom: 1.25rem;
}

.r-section {
  margin-bottom: 1rem;
}

.r-label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* WCAG AA: #767676 = 4.54:1 on white. Was var(--text-muted) #a8a8a8 = 2.38:1 (fail). */
  color: #767676;
  margin-bottom: 0.25rem;
}

.r-body {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-dim);
}

.r-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ---- Result Particles ---- */
.r-particles {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  bottom: -10px;
  border-radius: 50%;
  opacity: 0;
  animation: particle-rise 3s ease-out forwards;
}

@keyframes particle-rise {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  20% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-120px) scale(1);
  }
}

/* ---- Result Entrance Animation ---- */
.result-card .r-photo,
.result-card .r-mood,
.result-card .divider,
.result-card .r-name,
.result-card .r-tagline,
.result-card .r-section,
.result-card .r-actions {
  animation: fade-up 0.5s ease both;
}

.result-card .r-photo { animation-delay: 0.1s; }
.result-card .r-mood { animation-delay: 0.2s; }
.result-card .divider { animation-delay: 0.4s; }
.result-card .r-name { animation-delay: 0.5s; }
.result-card .r-tagline { animation-delay: 0.7s; }
.result-card .r-section:nth-of-type(1) { animation-delay: 0.9s; }
.result-card .r-section:nth-of-type(2) { animation-delay: 1.0s; }
.result-card .r-section:nth-of-type(3) { animation-delay: 1.1s; }
.result-card .r-section:nth-of-type(4) { animation-delay: 1.2s; }
.result-card .r-actions { animation-delay: 1.4s; }

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .root { padding: 1rem; }
  .card { padding: 2rem 1.5rem; }
  .title { font-size: 2.2rem; }
  .lang-bar { top: 1rem; right: 1rem; }
  .r-actions { flex-direction: column; gap: 1rem; }
}


/* ============================================
   Glass Effect（玻璃質感）
   ============================================ */

/* 主卡片：玻璃 */
.card, .quiz-card {
  background: rgba(255, 255, 255, 0.52) !important;
  backdrop-filter: blur(20px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  box-shadow:
    0 12px 44px rgba(120, 110, 95, 0.13),
    0 2px 8px rgba(120, 110, 95, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

/* 按鈕：玻璃 */
.btn {
  background: rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(14px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 4px 18px rgba(120, 110, 95, 0.09), inset 0 1px 0 rgba(255,255,255,0.65) !important;
  transition: background .28s ease, box-shadow .28s ease, color .28s ease !important;
}
/* ===== 神秘揭曉舞台（獨立全屏） ===== */
.reveal-stage {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #FBF8F3 0%, #F4EBDB 48%, #EDE2D2 100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity;
}
.reveal-stage.on {
  visibility: visible;
  pointer-events: auto;
}
/* 舞台顯示期間，完全遮住後面結果頁（避免若隱若現） */
body.staging .root {
  visibility: hidden;
}

/* 舞台：背景光暈（呼吸） */
.reveal-stage::before {
  content: '';
  position: absolute;
  width: 130vw;
  height: 130vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--stage-glow, rgba(107,32,128,0.16)) 0%, rgba(255,255,255,0) 68%);
  animation: stageBreathe 7.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes stageBreathe {
  0%, 100% { transform: scale(1); opacity: .75; }
  50%      { transform: scale(1.18); opacity: 1; }
}

/* 舞台氣泡 */
.stage-bubbles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.stage-bubble {
  position: absolute;
  bottom: -50px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.95), rgba(255,255,255,.35) 42%, rgba(255,255,255,.06) 72%);
  box-shadow: inset 0 0 8px rgba(255,255,255,.55), 0 0 12px rgba(255,255,255,.28);
  will-change: transform, opacity;
  animation: stageBubbleRise linear infinite;
}
@keyframes stageBubbleRise {
  0%   { transform: translate3d(0, 0, 0) scale(.65); opacity: 0; }
  12%  { opacity: .85; }
  85%  { opacity: .55; }
  100% { transform: translate3d(14px, -108vh, 0) scale(1.15); opacity: 0; }
}

/* 舞台內容要在氣泡之上 */
.reveal-kicker, .reveal-name { position: relative; z-index: 3; }

.reveal-kicker {
  font-size: clamp(0.95rem, 4.2vw, 1.35rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8d8170;
  margin: 0 0 24px;
  opacity: 0;
  text-align: center;
  padding: 0 20px;
  line-height: 1.5;
}
.reveal-name {
  font-size: clamp(2.5rem, 11vw, 4.4rem);
  font-weight: 400;
  color: #1a1a1a;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  padding: 0 16px;
  letter-spacing: -0.01em;
}

/* 舊嘅 inline 揭曉句（保留但隱藏，避免影響） */
.reveal-line { display: none; }

.btn:hover {
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow: 0 6px 20px rgba(120, 110, 95, 0.12) !important;
}
.btn:active {
  background: rgba(245, 240, 232, 0.9) !important;
}

/* 選項卡：玻璃 */
.opt {
  background: rgba(255, 255, 255, 0.46) !important;
  backdrop-filter: blur(12px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.66) !important;
  box-shadow: 0 3px 14px rgba(120, 110, 95, 0.07) !important;
  transition: background .26s ease, box-shadow .26s ease, color .26s ease !important;
}
.opt:hover {
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 5px 18px rgba(120, 110, 95, 0.10) !important;
}

/* 結果卡：玻璃 */
.ritual-card, .result-card, .r-card {
  background: rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(14px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 6px 22px rgba(120, 110, 95, 0.09) !important;
}

/* 語言切換：透明（唔要白底） */
.lang-btn {
  background: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* 背景：柔和漸變（令玻璃有嘢可以透） */
body {
  background: linear-gradient(150deg, #FBF8F3 0%, #F1E7D6 28%, #E2ECF3 62%, #F6E9DC 100%) !important;
  background-attachment: fixed !important;
}


/* ============================================
   Glass 文字顏色修正（黑字）
   ============================================ */

/* 全域文字：黑 */
body, .card, .quiz-card, .title, .sub, .desc, .footnote,
.progress-line + *, .step, .r-name, .r-tagline, .r-why {
  
}

/* 按鈕：玻璃底 + 黑字 */
.btn, .btn-link {
  
}
.btn:hover, .btn:active, .btn-link:hover {
  
}

/* 選項卡：黑字 */
.opt, .opt * {
  
}
.opt:hover, .opt:active, .opt.selected {
  
}

/* 次要文字：深灰（唔用淺灰，保持可讀） */
.sub, .desc, .footnote, .r-tagline, .step, .progress-text {
  color: #2b2b2b !important;
}

/* 語言切換：黑字 */
.lang-btn {  }
.lang-btn.active {  font-weight: 600 !important; }


/* ============================================
   修正：移除彈跳（保持靜態，只變色）
   ============================================ */
.btn, .opt, .btn-link {
  transform: none !important;
}
.btn:hover, .btn:active, .opt:hover, .opt:active, .btn-link:hover {
  transform: none !important;
}


/* ============================================
   修正：選項卡狀態（唔彈、睇得到）
   ============================================ */

/* 撳落：只變色，唔縮 */
.opt:active {
  background: rgba(255, 255, 255, 0.78) !important;
  transform: none !important;
}

/* 選中：柔和玻璃高亮（唔用深黑背景） */
.opt.selected {
  background: rgba(214, 230, 240, 0.82) !important;
  
  border: 1px solid rgba(130, 165, 190, 0.55) !important;
  box-shadow: 0 0 0 2px rgba(150, 185, 210, 0.22), 0 4px 16px rgba(120, 150, 175, 0.12) !important;
}

/* 選中時文字保持黑 */
.opt.selected, .opt.selected * {
  
}


/* ===== 飲品名：全程一行（唔換行） ===== */
.r-name {
  white-space: nowrap;
  overflow: visible;
}


/* ===== Eve Bliss Logo ===== */
.eve-logo {
  display: block;
  width: 108px;
  height: auto;
  margin: 0 auto 18px;
  opacity: 0.82;
}
.eve-logo.result {
  width: 92px;
  margin: 22px auto 16px;
  opacity: 0.7;
}

/* ===== Instagram Follow（短版 + 唔會超寬）===== */
.ig-follow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.25rem;
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text, #1a1a1a);
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.ig-follow svg { flex: 0 0 auto; }
.ig-follow span { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.ig-follow:hover, .ig-follow:active {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.3);
  color: var(--text, #1a1a1a);
}

/* ===== 正方形 eve icon（統一尺寸）===== */
.eve-icon,
.eve-logo.result.eve-icon {
  width: 80px;
  height: auto;
  margin: 0 auto 1.15rem;
  opacity: 0.85;
  display: block;
}

/* ===== 按鈕／選項文字顏色（玻璃底 → 必須深色）=====
   ⚠️ 唔好包含 .r-name（佢要跟 mood accent color）
   ================================================= */
.btn,
a.btn,
.opt,
.lang-btn,
.ig-follow {
  color: var(--text, #1a1a1a);
}
.btn:hover,
.btn:active,
a.btn:hover,
a.btn:active,
.opt:hover,
.opt:active,
.lang-btn:hover,
.lang-btn:active,
.lang-btn.active {
  color: var(--text, #1a1a1a);
}
.opt.selected {
  color: var(--text, #1a1a1a);
}

/* ===== 首頁標題：一行過 ===== */
.title {
  white-space: nowrap;
  font-size: clamp(1.75rem, 7.2vw, 3rem);
  letter-spacing: -0.01em;
}
.title .d-block { display: inline; }
