/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS — 全專案顏色、字型設計系統
   ═══════════════════════════════════════════════════════════ */
:root {
  /* 主色 */
  --color-ink:         #0a0a1a;
  --color-ink-2:       #0f0f22;
  --color-night:       #141432;
  --color-vellum:      #f4ebd3;
  --color-parchment:   #e8dcb8;
  --color-gold:        #c8a14a;
  --color-gold-bright: #e3bf6a;
  --color-gold-dim:    #8a6d2d;
  --color-wine:        #5a1f2e;
  /* 證書墨色（羊皮紙背景專用） */
  --color-cert-ink:    #2a1f0a;
  --color-cert-ink-2:  #4a3a1a;
  /* 半透明色 */
  --color-smoke:       rgba(244, 235, 211, 0.55);
  --color-smoke-dim:   rgba(244, 235, 211, 0.28);
  --color-rule:        rgba(200, 161, 74, 0.35);

  /* 字型 */
  --font-serif: "Shippori Mincho B1", "Noto Serif TC", "Cormorant Garamond", Georgia, serif;
  --font-sans:  "Noto Sans TC", -apple-system, sans-serif;
  --font-mono:  "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
}

/* ═══════════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--color-ink);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(200,161,74,0.11), transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(90,31,46,0.42),   transparent 60%),
    var(--color-ink);
  color: var(--color-vellum);
  font-family: var(--font-sans);
  font-size: 16px;
}

.hidden { display: none; }


/* ── 點擊漣漪 ───────────────────────────────────────────── */
.click-ripple {
  position: fixed;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--color-gold-bright);
  box-shadow: 0 0 10px var(--color-gold), inset 0 0 6px rgba(200, 161, 74, 0.3);
  pointer-events: none;
  z-index: 9999;
  animation: rippleOut 600ms ease-out forwards;
}

@keyframes rippleOut {
  0%   { opacity: 1;  transform: translate(-50%, -50%) scale(0.4); }
  100% { opacity: 0;  transform: translate(-50%, -50%) scale(1); }
}

.click-ripple-2 {
  width: 120px;
  height: 120px;
  border-width: 1px;
  border-color: rgba(227, 191, 106, 0.35);
  box-shadow: none;
  animation-delay: 80ms;
  animation-fill-mode: both;
}


/* Scrollbar */
::-webkit-scrollbar        { width: 4px; }
::-webkit-scrollbar-track  { background: var(--color-ink); }
::-webkit-scrollbar-thumb  { background: var(--color-gold-dim); border-radius: 2px; }

/* 頁首品牌標記 */
.brand-wisp {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--color-gold);
  text-transform: uppercase;
}

/* Eyebrow 小標（全域共用） */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--color-gold);
  text-transform: uppercase;
}

/* 儀式性副文（serif italic，共用於 home-sub / pick-sub / result lede） */
.serif-lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--color-smoke);
  line-height: 1.5;
}

/* 儀式性大標（serif italic，高字重） */
.headline {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-vellum);
  text-wrap: balance;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes eyePulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.05); }
}
@keyframes starDrift {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

/* Home 元素錯開進場 */
@keyframes homeEnter {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.home-enter {
  animation: homeEnter 600ms cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0ms) both;
}

/* btn-begin 啟用彈入 */
@keyframes btnActivate {
  0%   { transform: scale(0.96); }
  60%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}
.btn-activate {
  animation: btnActivate 350ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Pick — team-grid 篩選淡換 */
@keyframes gridFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.team-grid.grid-fade-in {
  animation: gridFadeIn 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Pick — 選隊伍 micro-animation */
@keyframes cardSelect {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.96); }
  70%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.team-card.card-select-anim {
  animation: cardSelect 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fade-in { animation: fadeIn 400ms cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Scroll reveal：初始隱藏，IntersectionObserver 加 .in-view 後才顯現 */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   STAGE & STARFIELD
   ═══════════════════════════════════════════════════════════ */
#stage {
  position: relative;
  min-height: 100dvh;
  background: transparent; /* starfield 在 body 層，不能蓋住 */
}

.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 1;
}
/* 兩層星點，速度不同產生視差感 */
.starfield::before,
.starfield::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 200%;
  background-image:
    radial-gradient(2.5px 2.5px at 10% 15%,  rgba(244,235,211,1.00) 0%, transparent 100%),
    radial-gradient(2px   2px   at 25% 70%,  rgba(244,235,211,0.90) 0%, transparent 100%),
    radial-gradient(3px   3px   at 40%  8%,  rgba(200,161,74, 1.00) 0%, transparent 100%),
    radial-gradient(2px   2px   at 60% 45%,  rgba(244,235,211,0.85) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at 75% 80%,  rgba(244,235,211,1.00) 0%, transparent 100%),
    radial-gradient(2px   2px   at 88% 20%,  rgba(244,235,211,0.90) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at  3% 55%,  rgba(200,161,74, 0.90) 0%, transparent 100%),
    radial-gradient(2px   2px   at 50% 90%,  rgba(244,235,211,0.95) 0%, transparent 100%),
    radial-gradient(2px   2px   at 18% 38%,  rgba(244,235,211,0.85) 0%, transparent 100%),
    radial-gradient(2px   2px   at 92% 60%,  rgba(244,235,211,0.80) 0%, transparent 100%),
    radial-gradient(3px   3px   at 35% 50%,  rgba(200,161,74, 0.80) 0%, transparent 100%),
    radial-gradient(2px   2px   at 70% 25%,  rgba(244,235,211,0.90) 0%, transparent 100%),
    radial-gradient(2px   2px   at 55% 65%,  rgba(244,235,211,0.85) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at 80%  5%,  rgba(244,235,211,1.00) 0%, transparent 100%),
    radial-gradient(2px   2px   at 15% 85%,  rgba(244,235,211,0.85) 0%, transparent 100%),
    radial-gradient(2px   2px   at 47% 32%,  rgba(244,235,211,0.80) 0%, transparent 100%),
    radial-gradient(3px   3px   at 63% 12%,  rgba(200,161,74, 0.95) 0%, transparent 100%),
    radial-gradient(2px   2px   at 82% 48%,  rgba(244,235,211,0.85) 0%, transparent 100%),
    radial-gradient(2px   2px   at  7% 28%,  rgba(244,235,211,0.90) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at 33% 78%,  rgba(244,235,211,0.95) 0%, transparent 100%),
    radial-gradient(2px   2px   at 44% 55%,  rgba(244,235,211,0.80) 0%, transparent 100%),
    radial-gradient(2px   2px   at 67% 88%,  rgba(244,235,211,0.85) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at 22% 62%,  rgba(244,235,211,0.90) 0%, transparent 100%),
    radial-gradient(2px   2px   at 95% 40%,  rgba(244,235,211,0.80) 0%, transparent 100%),
    radial-gradient(3px   3px   at 52% 18%,  rgba(200,161,74, 0.85) 0%, transparent 100%),
    radial-gradient(2px   2px   at 38% 92%,  rgba(244,235,211,0.85) 0%, transparent 100%),
    radial-gradient(2px   2px   at 78% 62%,  rgba(244,235,211,0.80) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at 13% 45%,  rgba(244,235,211,0.90) 0%, transparent 100%),
    radial-gradient(2px   2px   at 57% 35%,  rgba(244,235,211,0.85) 0%, transparent 100%),
    radial-gradient(2px   2px   at 86% 75%,  rgba(244,235,211,0.80) 0%, transparent 100%);
  animation: starDrift 40s linear infinite;
}
.starfield::after {
  animation-duration: 65s;
  animation-direction: reverse;
  opacity: 0.90;
  /* 第二層只保留 15 顆（半層），整體視覺密度約 1.5 層 */
  background-image:
    radial-gradient(2px   2px   at 25% 70%,  rgba(244,235,211,0.90) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at 75% 80%,  rgba(244,235,211,1.00) 0%, transparent 100%),
    radial-gradient(2px   2px   at 88% 20%,  rgba(244,235,211,0.90) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at  3% 55%,  rgba(200,161,74, 0.90) 0%, transparent 100%),
    radial-gradient(2px   2px   at 50% 90%,  rgba(244,235,211,0.95) 0%, transparent 100%),
    radial-gradient(2px   2px   at 92% 60%,  rgba(244,235,211,0.80) 0%, transparent 100%),
    radial-gradient(2px   2px   at 70% 25%,  rgba(244,235,211,0.90) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at 80%  5%,  rgba(244,235,211,1.00) 0%, transparent 100%),
    radial-gradient(2px   2px   at 47% 32%,  rgba(244,235,211,0.80) 0%, transparent 100%),
    radial-gradient(3px   3px   at 63% 12%,  rgba(200,161,74, 0.95) 0%, transparent 100%),
    radial-gradient(2px   2px   at 82% 48%,  rgba(244,235,211,0.85) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at 33% 78%,  rgba(244,235,211,0.95) 0%, transparent 100%),
    radial-gradient(2px   2px   at 67% 88%,  rgba(244,235,211,0.85) 0%, transparent 100%),
    radial-gradient(3px   3px   at 52% 18%,  rgba(200,161,74, 0.85) 0%, transparent 100%),
    radial-gradient(2px   2px   at 86% 75%,  rgba(244,235,211,0.80) 0%, transparent 100%);
}

/* ═══════════════════════════════════════════════════════════
   SECTION 1: HOME
   ═══════════════════════════════════════════════════════════ */
.home-wrap {
  position: relative;
  /* z-index 移除：避免建立 stacking context，讓 mix-blend-mode:screen 能與 starfield 合成 */
  background: transparent;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
}
.home-header {
  width: 100%;
  max-width: 1080px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}
.home-inner {
  max-width: 720px;
  width: 100%;
  text-align: center;
}

/* Oracle Eye */
/* Tailwind preflight 把 svg 設為 display:block，text-align:center 失效
   改用 flex + justify-content:center 明確置中 */
.home-eye {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}
.home-eye svg {
  width: 88px;
  height: 88px;
  color: var(--color-gold);
  filter: drop-shadow(0 0 20px rgba(227,191,106,0.4));
  animation: eyePulse 4s ease-in-out infinite;
}

/* 主標題 */
.home-title {
  font-size: 104px;
  margin: 0 0 32px;
}
.home-title .em { font-style: normal; color: var(--color-gold-bright); }

/* 標題內嵌金球影片 */
.title-ball {
  display: inline-block;
  height: 1.3em;        /* 跟著字級等比縮放 */
  width: auto;
  vertical-align: middle;
  transform: translateY(-0.15em); /* 中文字身偏高，視覺補正 */
  margin: 0 -0.5em;
  object-fit: contain;
  background: transparent;
  /* filter: drop-shadow(0 2px 8px rgba(200, 161, 74, 0.5)); */
}

/* 副標 */
.home-sub {
  max-width: 540px;
  margin: 0 auto 44px;
}
.home-sub .tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.2em;
  color: var(--color-gold);
  display: block;
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* ─── 倒數計時 ─── */
.countdown {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 0 auto 52px;
  padding: 16px 0;
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
  max-width: 580px;
}
.countdown .unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  position: relative;
}

.countdown .num {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 500;
  line-height: 1;
  color: var(--color-vellum);      /* vellum，不是金色 */
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.countdown .lbl {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--color-gold);         /* 金色，不是 smoke */
  margin-top: 8px;
  text-transform: uppercase;
}
.countdown-caption {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--color-smoke);
  text-transform: uppercase;
  margin-top: -36px;
  margin-bottom: 52px;
  text-align: center;
}

/* ─── 名字輸入 ─── */
.name-field {
  width: 100%;
  max-width: 460px;
  margin: 0 auto 28px;
}
.name-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.35em;
  color: var(--color-gold);
  margin-bottom: 14px;
  text-transform: uppercase;
  text-align: center;
}
/* 輸入框 + 清除按鈕的容器 */
.name-input-wrap {
  position: relative;
}
/* 只有底線，無外框 */
.name-field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-rule);
  padding: 14px 40px 16px 12px; /* 右側留空給 x btn */
  color: var(--color-vellum);
  font-family: var(--font-serif);
  font-size: 26px;
  font-style: normal;
  text-align: center;
  outline: none;
  transition: border-color 200ms;
}
.name-field input::placeholder { color: var(--color-smoke-dim); font-style: normal; }
.name-field input:focus { border-bottom-color: var(--color-gold); }

/* X 清除按鈕 */
.btn-clear-name {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-smoke);
  border-radius: 50%;
  transition: color 150ms ease, background 150ms ease;
  padding: 0;
}
.btn-clear-name:hover {
  color: var(--color-vellum);
  background: rgba(244,235,211,0.08);
}
.btn-clear-name .lucide { width: 14px; height: 14px; }

#btn-begin { padding-left: 64px; padding-right: 64px; }

.ebc-wordmark {
  display: block;
  height: 20px;
  width: auto;
  margin: 40px auto 0;
}

/* Footer 固定在底部 */
.footer-wisp {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--color-smoke);
  text-transform: uppercase;
  z-index: 2;
  pointer-events: none;
}

/* RWD（720px 對齊原版） */
@media (max-width: 720px) {
  .home-title      { font-size: clamp(56px, 18vw, 104px); white-space: nowrap; } /* mobile 等比縮放，約佔總寬 80% */
  .home-eye svg    { width: 64px; height: 64px; }
  .title-ball      { height: 1.4em; }
  .countdown       { gap: 10px; padding: 20px 0; }
  .countdown .unit { min-width: 52px; }
  .countdown .num  { font-size: 32px; }
  #btn-begin       { width: 100%; padding-left: 24px; padding-right: 24px; }
}

/* ═══════════════════════════════════════════════════════════
   LUCIDE ICONS
   ═══════════════════════════════════════════════════════════ */
/* createIcons 替換後 SVG 帶有 .lucide class */
.lucide {
  display: inline-block;
  vertical-align: middle;
  width: 1.25em;  /* 隨父元素 font-size 縮放，加大 25% */
  height: 1.25em;
  flex-shrink: 0;
}

/* team-card 右上角圓形勾選：縮小 icon 適配 16×16 容器 */
.team-card .check .lucide {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}


/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 120ms ease-out, box-shadow 200ms ease, background 200ms ease, border-color 200ms ease, color 200ms ease, opacity 200ms ease;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(180deg, var(--color-gold-bright), var(--color-gold));
  color: var(--color-ink);
  border-color: var(--color-gold-bright);
  box-shadow:
    0 0 0 1px rgba(227,191,106,0.3),
    0 10px 40px -10px rgba(227,191,106,0.5);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(227,191,106,0.5),
    0 15px 50px -10px rgba(227,191,106,0.7);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow:
    0 0 0 1px rgba(227,191,106,0.3),
    0 4px 16px -4px rgba(227,191,106,0.4);
}
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--color-vellum);
  border-color: var(--color-rule);
}
.btn-ghost:hover  { border-color: var(--color-gold); color: var(--color-gold-bright); }
.btn-ghost:active { transform: scale(0.98); }

/* Focus ring（鍵盤無障礙） */
.btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}
.team-card:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* 安靜的文字按鈕（用於 back、展開等） */
.btn-quiet {
  background: transparent;
  color: var(--color-smoke);
  border: none;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: color 200ms;
}
.btn-quiet:hover { color: var(--color-gold); }

/* Header nav 按鈕：與 brand-wisp 完全相同視覺語言，hover 只有箭頭動 */
.btn-nav {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--color-gold);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-nav .lucide {
  transition: transform 200ms ease;
}
.btn-nav:hover .lucide { transform: translateX(-3px); }

/* ═══════════════════════════════════════════════════════════
   SECTION 2: PICK
   ═══════════════════════════════════════════════════════════ */
.pick-wrap {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding: 40px 24px 200px;
  max-width: 1200px;
  margin: 0 auto;
}
.pick-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
.pick-title-block {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}
.pick-title-block .eyebrow { margin-bottom: 24px; }
.pick-title { font-size: clamp(36px, 5vw, 60px); margin: 0 0 32px; }

/* 聯盟篩選 chips（膠囊形） */
.pick-controls {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.chip {
  background: transparent;
  border: 1px solid var(--color-rule);
  color: var(--color-smoke);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 99px;   /* 膠囊形 */
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.chip:hover { border-color: var(--color-gold); color: var(--color-vellum); }
.chip.active {
  background: var(--color-gold);
  color: var(--color-ink);
  border-color: var(--color-gold);
}

/* 搜尋欄 */
.pick-search {
  display: block;
  background: transparent;
  border: 1px solid var(--color-rule);
  border-radius: 2px;
  padding: 10px 16px;
  color: var(--color-vellum);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  width: 260px;
  outline: none;
  text-align: center;
  transition: border-color 200ms;
}
.pick-search::placeholder { color: var(--color-smoke-dim); }
.pick-search:focus { border-color: var(--color-gold); }

/* 球隊格狀卡片 */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.team-card {
  position: relative;
  /* 水平排列：flag 在左，文字在右 */
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 18px 14px;
  background: linear-gradient(180deg, rgba(244,235,211,0.07), rgba(244,235,211,0.03));
  border: 1px solid rgba(244,235,211,0.08);
  border-radius: 3px;
  cursor: pointer;
  transition: transform 180ms ease-out, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  color: var(--color-vellum);
}
.team-card:hover {
  border-color: var(--color-gold);
  background: linear-gradient(180deg, rgba(227,191,106,0.08), rgba(227,191,106,0.02));
  transform: translateY(-1px);
}
.team-card.selected {
  border-color: var(--color-gold-bright);
  background: linear-gradient(180deg, rgba(227,191,106,0.18), rgba(227,191,106,0.05));
  box-shadow: 0 0 0 1px var(--color-gold-bright), 0 0 30px -5px rgba(227,191,106,0.4);
}

/* 國旗圖片（flagcdn.com SVG，取代系統 emoji 確保 Windows/Mac 一致） */
.flag-img {
  display: inline-block;
  height: 1em;        /* 自動跟隨父層 font-size 縮放 */
  width: auto;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: middle;
}

/* Flag */
.team-card .flag {
  width: 30px;             /* 固定寬度，確保右側文字位置一致 */
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
/* 旗幟圖片在固定框內等比縮放，比例特殊的旗幟（如瑞士）不會撐開 */
.team-card .flag .flag-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 隊名 */
.team-card .t-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.team-card .t-confed {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--color-smoke-dim);
  text-transform: uppercase;
  margin-top: 3px;
}

/* 熱門層次（依 WC_WEIGHTS 分 tier） */
/* tier-hot（前7強）：預設淡金邊 + 旗幟全亮 */
.team-card.tier-hot {
  border-color: rgba(200, 161, 74, 0.32);
}
.team-card.tier-hot .t-name {
  color: var(--color-vellum);
}
/* tier-hot 小金點指示符 */
.team-card.tier-hot:not(.selected)::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-gold);
  opacity: 0.75;
}

/* tier-fav / tier-low：維持正常亮度，不壓暗 */

/* 選中時確保完整亮度 */
.team-card.selected .t-name {
  color: var(--color-vellum);
}

/* 選取勾選（圓形金底） */
.team-card.selected .check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-gold-bright);
  color: var(--color-ink);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── 浮動確認列 ─── */
/* 外層：全寬漸層遮罩，pointer-events none */
.pick-confirm {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, var(--color-ink) 55%, rgba(10,10,26,0.85) 80%, transparent);
  padding: 60px 24px 28px;
  z-index: 10;
  display: flex;
  justify-content: center;
  pointer-events: none;
  /* 出現動畫 */
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 280ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0ms;
}
.pick-confirm.hidden {
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  visibility: hidden; /* 子層 pointer-events 一併失效 */
  /* hidden 時仍保持 display:flex 讓 transition 生效，僅靠 opacity+transform 隱藏 */
}

/* 內層：浮動卡片，pointer-events auto */
.pick-confirm-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--color-ink-2);
  border: 1px solid var(--color-rule);
  border-radius: 4px;
  padding: 14px 16px 14px 22px;
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.8);
  max-width: 560px;
  width: 100%;
}
.pick-confirm-inner .picked {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}
.pick-confirm-inner .picked .flag {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pick-confirm-inner .picked .txt  { display: flex; flex-direction: column; }
.pick-confirm-inner .picked .eyebrow { margin-bottom: 2px; }
.pick-confirm-inner .picked .n {
  font-family: var(--font-serif);
  font-style: normal;
  font-size: 20px;
  color: var(--color-vellum);
}

/* ═══════════════════════════════════════════════════════════
   SECTION 3: RESULT
   ═══════════════════════════════════════════════════════════ */

/* 截圖完成後顯示的證書圖片 */
.cert-img {
  display: block;
  width: 480px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  animation: certFadeIn 400ms ease both;
}
@keyframes certFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 截圖進行中 skeleton */
.cert-skeleton {
  width: 480px;
  max-width: 100%;
  aspect-ratio: 480 / 660; /* 初始估算，captureCertificate 會動態更新 */
  margin: 0 auto;
  background: transparent;
  border: 1px solid rgba(200, 161, 74, 0.4);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.cert-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(200, 161, 74, 0.22) 50%,
    transparent 100%
  );
  animation: cert-shimmer 1.8s ease-in-out infinite;
}
@keyframes cert-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* 截圖失敗文字 */
.cert-loading {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--color-smoke-dim);
  text-transform: uppercase;
  text-align: center;
  padding: 80px 24px;
}

/* 證書外框（含透視容器） */
.certificate-frame {
  position: relative;
  margin: 0 auto 0;
  max-width: 720px;
}

/* 證書主體 */
.certificate {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(227,191,106,0.12), transparent 70%),
    linear-gradient(0deg, rgba(245,236,212,0.55), rgba(245,236,212,0.55)),
    url('img/parchment-texture.jpg') center / cover no-repeat;
  color: var(--color-cert-ink);
  padding: 40px 40px 48px;
  border-radius: 2px;
  /* 特色多層框線：金邊 + 深色間距 + 外發光 */
  box-shadow:
    0 0 0 1px rgba(200,161,74,0.5),
    0 0 0 8px #0f0f22,
    0 0 0 9px var(--color-gold),
    0 40px 80px -20px rgba(0,0,0,0.6),
    0 0 120px -20px rgba(227,191,106,0.4);
  overflow: hidden;
  text-align: center;
}

/* 雙層內邊框 */
.certificate::before {
  content: '';
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(138,109,45,0.4);
  pointer-events: none;
  z-index: 1;
}
.certificate::after {
  content: '';
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(138,109,45,0.25);
  pointer-events: none;
  z-index: 1;
}

/* 四角裝飾（對齊內框位置） */
.cert-corner              { position: absolute; width: 24px; height: 24px; opacity: 0.6; z-index: 2; }
.cert-corner img          { width: 100%; height: 100%; display: block; }
.cert-corner.tl           { top: 26px;    left: 26px;    transform: scaleY(-1); }
.cert-corner.tr           { top: 26px;    right: 26px;   transform: scale(-1); }
.cert-corner.bl           { bottom: 26px; left: 26px; }
.cert-corner.br           { bottom: 26px; right: 26px;   transform: scaleX(-1); }

.cert-inner { position: relative; text-align: center; z-index: 2; }

.cert-seal     { display: flex; justify-content: center; margin-bottom: 8px; }
.cert-seal svg { width: 52px; height: 52px; color: var(--color-gold-dim); }

/* 標題 */
.cert-title {
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--color-wine);
  margin-bottom: 8px;
  font-weight: 500;
}
.cert-title-main {
  font-family: var(--font-serif);
  font-size: 42px;
  color: var(--color-cert-ink);
  line-height: 1;
  margin-bottom: 4px;
  font-weight: 500;
}

/* 分隔線（漸層淡出） */
.cert-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px auto 22px;
  color: var(--color-gold-dim);
  max-width: 320px;
}
.cert-divider::before,
.cert-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-gold-dim), transparent);
}

/* 前言 */
.cert-preamble {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--color-cert-ink-2);
  line-height: 1.5;
  max-width: 440px;
  margin: 0 auto 16px;
}

/* 預言者名字（主角） */
.cert-name {
  font-family: 'Songti TC', 'Songti SC', 'STSong', Georgia, serif;
  font-size: 40px;
  color: var(--color-cert-ink);
  line-height: 1.1;
  font-weight: 500;
  margin: 8px auto 4px;
  border-bottom: 1px solid rgba(138,109,45,0.3);
  padding-bottom: 10px;
  max-width: 500px;
}

.cert-midtext {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--color-cert-ink-2);
  margin: 18px 0 8px;
}

/* 球隊名稱 */
.cert-team {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 600;
  color: var(--color-wine);
  line-height: 1.1;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 16px 0;
}
.cert-team .flag {
  font-size: 34px;
  display: flex;       /* 讓 img 在 span 內也走 flex 對齊，避免 vertical-align 造成靠底 */
  align-items: center;
  margin-top: 3px;
}

/* 底部三欄 */
.cert-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 24px;
  border-top: 1px dashed rgba(138,109,45,0.4);
  gap: 24px;
}
.cert-foot-item              { text-align: left;   flex: 1; }
.cert-foot-item:last-child   { text-align: right; }
.cert-foot-item .k {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--color-gold-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.cert-foot-item .v {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--color-cert-ink);
  white-space: nowrap;
}

.cert-foot-seal {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.cert-foot-seal img {
  width: 80px;
  height: auto;
  display: block;
}

/* 證書截圖永遠走桌機版樣式，不隨 viewport 縮放 */

/* 預言 omen 區塊 */
.omen {
  border: 1px solid var(--color-rule);
  border-radius: 3px;
  padding: 36px 44px;
  background: linear-gradient(180deg, rgba(244,235,211,0.03), transparent);
  max-width: 720px;
  margin: 0 auto 40px;
  position: relative;
}
/* L 形金色角標 */
.omen::before,
.omen::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-gold);
}
.omen::before { top: -1px;    left: -1px;  border-right: none; border-bottom: none; }
.omen::after  { bottom: -1px; right: -1px; border-left:  none; border-top:    none; }

.omen-lines { display: flex; flex-direction: column; gap: 16px; }

.omen-line {
  display: flex;
  gap: 18px;
  align-items: baseline;
}
.omen-line .marker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--color-gold);
  min-width: 48px;
  padding-top: 6px;
  text-transform: uppercase;
}
.omen-line .text {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.4;
  color: var(--color-vellum);
  flex: 1;
}
.omen-line .text .hi {
  color: var(--color-gold-bright);
  font-weight: 500;
}
.omen-line .text .num {
  font-family: var(--font-mono);
  color: var(--color-gold-bright);
  font-size: 20px;
  font-weight: 500;
}

@media (max-width: 720px) {
  .omen                { padding: 24px 20px; text-align: center; }
  .omen-line           { flex-direction: column; align-items: center; gap: 4px; }
  .omen-line .text     { font-size: 18px; flex: unset; }
  .team-grid           { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  /* Pick confirm 手機改上下排列 */
  .pick-confirm-inner  { flex-direction: column; align-items: stretch; gap: 12px; }
  .pick-confirm-inner #btn-confirm { width: 100%; justify-content: center; }
}

/* 統計區塊（上邊框，無完整外框） */
.section-card {
  border-top: 1px solid var(--color-rule);
  padding-top: 40px;
  margin-bottom: 40px;
}
.section-hdr {
  text-align: center;
  margin-bottom: 32px;
}
.section-hdr .eyebrow { margin-bottom: 10px; }
.section-hdr h2 {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--color-vellum);
}

/* 分佈圖列表 */
.dist { display: flex; flex-direction: column; gap: 2px; }

.dist-row {
  display: grid;
  grid-template-columns: 28px 28px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 2px;
  transition: background 150ms;
}
.dist-row .rk { font-family: var(--font-mono); font-size: 12px; color: var(--color-smoke); text-align: right; }
.dist-row .fl {
  width: 100%;          /* 跟隨 grid column（28px）不寫死 */
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dist-row .fl .flag-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Bar 容器 */
.dist-row .bar-wrap {
  position: relative;
  height: 28px;
  background: rgba(244,235,211,0.04);
  border-radius: 1px;
  overflow: hidden;
}
/* Bar 本體：半透明白色漸層（不是金色實色） */
.dist-row .bar {
  position: absolute;
  inset: 0 auto 0 0;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 3px,
      rgba(244,235,211,0.06) 3px,
      rgba(244,235,211,0.06) 4px
    ),
    linear-gradient(90deg, rgba(244,235,211,0.18), rgba(244,235,211,0.32));
  border-right: 1px solid rgba(244,235,211,0.4);
  transform-origin: left;
  transform: scaleX(0);
  animation: barGrow 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-play-state: paused;
}
.dist.in-view .dist-row .bar {
  animation-play-state: running;
}

@keyframes barGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
/* 隊伍名稱標籤（疊在 bar 上方） */
.dist-row .label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--color-vellum);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dist-row .pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-smoke);
  letter-spacing: 0.05em;
  min-width: 56px;
  text-align: right;
}

/* 使用者自己選的那排 */
.dist-row.you {
  background: linear-gradient(90deg, rgba(227,191,106,0.12), rgba(227,191,106,0.02));
  border-left: 2px solid var(--color-gold-bright);
  padding-left: 12px;
}
.dist-row.you .rk  { color: var(--color-gold-bright); }
.dist-row.you .pct { color: var(--color-gold-bright); }
.dist-row.you .bar {
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-bright));
  border-right-color: var(--color-gold-bright);
}
/* You tag：墨色文字 on 金底（與一般 tag 相反） */
.dist-row.you .you-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--color-ink);
  background: var(--color-gold-bright);
  padding: 2px 6px;
  margin-left: 8px;
  text-transform: uppercase;
  border-radius: 1px;
}

.dist-fold { text-align: center; margin-top: 14px; }

/* ═══════════════════════════════════════════════════════════
   INTERLUDE: DIVINING（Act II→III 過場 loading）
   ═══════════════════════════════════════════════════════════ */
/* 整頁容器：全螢幕垂直置中，兩段上下排列 */
.divine-wrap {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 56px;
}

/* 水晶球舞台 */
.divine-stage {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 旋轉光環 */
.d-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--color-rule);
  border-top-color: var(--color-gold-bright);
  animation: d-spin 2.4s linear infinite;
}
.d-ring.locked {
  border-color: var(--color-gold-bright);
  animation: none;
  box-shadow: 0 0 24px rgba(227,191,106,0.35);
}
@keyframes d-spin { to { transform: rotate(360deg); } }

/* 水晶球本體 */
.d-crystal {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(244,235,211,0.25), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(20,20,50,0.9), rgba(10,10,26,0.98));
  box-shadow:
    inset 0 -16px 32px rgba(0,0,0,0.6),
    0 0 0 1px rgba(227,191,106,0.25),
    0 0 40px rgba(227,191,106,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 300ms ease-out;
}
.d-crystal.locked {
  box-shadow:
    inset 0 -16px 32px rgba(0,0,0,0.6),
    0 0 0 1px rgba(227,191,106,0.5),
    0 0 60px rgba(227,191,106,0.4);
}

/* 旗幟（亂跳中 / 鎖定後放大） */
.d-flag {
  font-size: 48px; /* 固定字級，大小變化改由 d-lock scale 處理 */
  line-height: 1;
  /* 動畫期間不加 filter，避免 Safari GPU compositing layer 非同步造成光暈殘影 */
}
/* 定格後才出現光暈，此時 img 不再換 src，無殘影問題 */
.d-flag.locked .flag-img {
  filter: drop-shadow(0 0 14px rgba(227,191,106,0.7));
}
.d-flag.locked {
  animation: d-lock 600ms cubic-bezier(0.2, 1.4, 0.3, 1) both;
}
@keyframes d-lock {
  0%   { transform: scale(0.5); opacity: 0; filter: blur(6px); }
  60%  { transform: scale(1.12); opacity: 1; filter: blur(0); }
  100% { transform: scale(1);    opacity: 1; }
}

/* 文字區 */
.divine-copy {
  text-align: center;
  max-width: 480px;
  width: 100%;
}
.divine-copy .eyebrow { margin-bottom: 14px; }

/* 主標題：「The vision sharpens…」→「It is seen.」 */
.divine-title {
  font-size: clamp(30px, 4vw, 42px);
  margin: 0 0 18px;
}
.divine-title.title-change {
  animation: fadeInPhase 450ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* 階段描述文字（每換 phase 重播入場動畫） */
.divine-phase {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--color-smoke);
  min-height: 28px;
  margin-bottom: 28px;
  animation: fadeInPhase 400ms ease both;
}
@keyframes fadeInPhase {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 進度條 */
.divine-meter {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
}
/* 背景軌道線 */
.divine-meter::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: rgba(244,235,211,0.1);
}
/* 進度條本體 */
.divine-meter-bar {
  height: 1px;
  background: var(--color-gold-bright);
  transition: width 80ms linear;
  box-shadow: 0 0 6px rgba(227,191,106,0.6);
}
/* 底部標籤：百分比 + 名字・隊伍 */
.divine-meter-label {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--color-smoke);
  text-transform: uppercase;
}

/* RWD */
@media (max-width: 720px) {
  .divine-stage  { width: 180px; height: 180px; }
  .d-crystal     { width: 120px; height: 120px; }
}

/* ═══════════════════════════════════════════════════════════
   SECTION 3: RESULT — 頁面結構（wrap / top / hero / ctas）
   ═══════════════════════════════════════════════════════════ */
/* 整體容器：與 React 版對齊，max-width 1080px */
.result-wrap {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding: 40px 24px 80px;
  max-width: 1200px; /* 與 home-wrap / pick-wrap 統一 */
  margin: 0 auto;
}

/* 頂部兩端對齊列 */
.result-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
.result-top-date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--color-smoke);
  text-transform: uppercase;
}

/* grid item 預設 min-width: auto，div 不會縮小到格子寬度以下 */
#certificate { min-width: 0; }

/* 左右分欄容器：hero 左、certificate 右 */
.result-split {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 56px;
  align-items: start;
  position: relative;
  z-index: 2;          /* 讓 share-popover 浮在後面的 omens / distribution 之上 */
  margin-bottom: 56px;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
/* Hero 內操作列 */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}
.hero-actions .btn { height: 52px; }
#btn-download { flex: 1; max-width: 220px; }
.hero-action-icon {
  flex-shrink: 0;
  width: 52px;
  padding: 0;
}

/* Share popover */
.share-wrap {
  position: relative;
  flex-shrink: 0;
}
.share-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--color-ink-2);
  border: 1px solid var(--color-rule);
  border-radius: 4px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 148px;
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.6);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 10;
}
/* 三角形外層（border 色） */
.share-popover::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 18px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--color-rule);
}
/* 三角形內層（填背景色，蓋掉 border） */
.share-popover::after {
  content: '';
  position: absolute;
  top: -6px;
  right: 19px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--color-ink-2);
}
.share-popover.hidden {
  display: none;
}
.share-popover.closing {
  display: flex;
  opacity: 0;
  transform: translateY(-4px);
}
.share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--color-vellum);
  font-family: var(--font-sans);
  font-size: 13px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  width: 100%;
  text-align: left;
}
.share-item:hover {
  background: rgba(200,161,74,0.1);
  color: var(--color-gold-bright);
}
.share-item .lucide {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 主標題區（左欄，左對齊 + sticky） */
.result-hero {
  text-align: left;
  align-self: start;   /* 強制 grid 頂端對齊 */
  position: sticky;
  top: 24px;
}
.result-hero .eyebrow { margin-bottom: 16px; }
.result-hero h1 {
  font-size: clamp(36px, 4vw, 56px);
  margin: 0 0 20px;
}
.result-hero .lede {
  max-width: 420px;
}

/* CTA 按鈕群組 */
.result-ctas {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.result-ctas .btn {
  flex: 1;
  max-width: 240px;
}


/* Result / Distribution RWD（放在所有 CSS 之後，避免被覆蓋） */
.hero-actions-mobile { display: none; } /* desktop: 隱藏 mobile 複製版 */

@media (max-width: 720px) {
  .result-split              { grid-template-columns: 1fr; gap: 32px; }
  .result-hero               { position: static; text-align: center; }
  .result-hero .lede         { max-width: 100%; }
  .result-hero .hero-actions { display: none; }   /* mobile: 隱藏 desktop 版 */
  .hero-actions-mobile       { display: flex; justify-content: center; width: 100%; margin-top: 0; }
  .hero-actions-mobile .btn  { flex: 1; justify-content: center; }
  .dist-row                  { padding: 10px 0; }
  .dist-row.you              { padding-left: 0; }
  .result-ctas .btn          { max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  /* 保留 opacity 淡入，移除位移動畫 */
  @keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  @keyframes fadeInPhase {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  @keyframes homeEnter {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  @keyframes btnActivate {
    from { transform: scale(1); }
    to   { transform: scale(1); }
  }
  @keyframes gridFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  @keyframes cardSelect {
    from { transform: scale(1); }
    to   { transform: scale(1); }
  }
  /* 停用裝飾性動畫 */
  .starfield::before,
  .starfield::after {
    animation: none;
  }
  #oracle-eye {
    animation: none;
    opacity: 1;
  }

  /* section 切換只淡入 */
  .fade-in {
    animation: fadeIn 300ms ease both;
  }
  /* divining 旋轉保留但改慢 */
  #d-ring {
    animation-duration: 4s;
  }
}
