/*
  量子樂透 · 共用設計系統（燭光 Candlelight）
  依 claude.ai/design 重新設計版本套用：暖黑燭光背景、金色系單一強調色、
  Noto Serif TC／Cormorant Garamond 襯線標題＋Noto Sans TC 內文，
  玻璃感面板、量子坍縮球體、呼吸光暈儀式感動畫。
  供所有靜態內容頁（public/**\/index.html）與互動工具共用。
*/
:root {
  color-scheme: dark;
  --bg: #0c0906;
  --bg-2: #1a140d;
  --surface: #15100a;
  --surface-2: #1c150d;
  --line: rgba(228,177,78,.16);
  --line-soft: rgba(228,177,78,.1);
  --gold-line: rgba(228,177,78,.4);
  --text: #efe8dc;
  --heading: #f6efe1;
  --muted: #97897a;
  --faint: #8a7c6a;
  --dim: #6e6355;
  --eyebrow: #cfa858;
  --gold: #e4b250;
  --gold-bright: #f3ce6e;
  --gold-ink: #e9cd8e;
  --danger: #ff8a80;
  --r-lg: 22px;
  --r-sm: 12px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  font-family: "Noto Sans TC", system-ui, "Microsoft JhengHei", sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(150% 90% at 50% -8%, var(--bg-2) 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.7;
}
a { color: var(--gold-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ringPulse { 0% { transform: scale(.55); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes breath { 0%,100% { opacity: .45; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }

/* ── 站台導覽 ── */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  background-color: rgba(12,9,6,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.site-nav .inner {
  max-width: 1160px; margin: 0 auto; padding: 16px clamp(16px, 4vw, 32px);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.site-nav .brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--heading); font-family: "Noto Serif TC", serif; letter-spacing: .08em; font-size: 17px; }
.site-nav .brand .dot { width: 7px; height: 7px; border-radius: 50%; background-color: var(--gold); box-shadow: 0 0 10px var(--gold); flex: 0 0 auto; }
.site-nav .links { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.site-nav .links a {
  text-decoration: none; color: var(--faint); font-size: 13.5px; letter-spacing: .03em; padding: 8px 12px; border-radius: 999px;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.site-nav .links a:hover, .site-nav .links a[aria-current="page"] { background-color: rgba(228,177,78,.06); color: var(--heading); }

/* ── 頁面外殼 ── */
.page-hero {
  max-width: 760px; margin: 0 auto; padding: clamp(40px, 7vw, 76px) clamp(20px, 5vw, 32px) 0;
  text-align: center; animation: fadeUp .6s var(--ease) both;
}
.page-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 13px; letter-spacing: .22em;
  color: var(--eyebrow); text-transform: none;
  border: none; background: none;
  padding: 0; margin: 0 0 var(--s3);
}
.page-hero .eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background-color: var(--gold); box-shadow: 0 0 10px var(--gold); }
.page-hero h1 { font-family: "Noto Serif TC", serif; font-size: clamp(27px, 5vw, 40px); line-height: 1.35; margin: 0 0 14px; font-weight: 500; letter-spacing: .03em; text-wrap: balance; }
.page-hero .tagline { font-family: "Cormorant Garamond", serif; font-size: clamp(15px, 3vw, 18px); color: var(--muted); letter-spacing: .24em; margin: 0 0 18px; }
.page-hero .lede { color: var(--muted); font-size: 15px; max-width: 62ch; margin: 0 auto; }

/* ── 首頁專屬：呼吸光暈圖示 ── */
.hero-orb { position: relative; width: clamp(120px, 22vw, 156px); height: clamp(120px, 22vw, 156px); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--s3); }
.hero-orb .glow { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(228,177,78,.26), transparent 62%); animation: breath 4.4s ease-in-out infinite; }
.hero-orb .ring { position: absolute; inset: 30%; border-radius: 50%; border: 1px solid rgba(228,177,78,.4); animation: ringPulse 3.6s ease-out infinite; }
.hero-orb .ring.delay { animation-delay: 1.8s; }
.hero-orb .core { width: 14px; height: 14px; border-radius: 50%; background-color: var(--gold-bright); box-shadow: 0 0 30px var(--gold), 0 0 60px rgba(228,177,78,.5); }
.quantum-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

.page-content {
  position: relative; z-index: 1;
  max-width: 720px; margin: 0 auto; padding: clamp(28px, 5vw, 48px) clamp(20px, 5vw, 32px) var(--s5);
}
.page-content section { padding: var(--s4) 0; border-top: 1px solid var(--line-soft); }
.page-content section:first-child { border-top: none; padding-top: var(--s3); }
.page-content h2 { font-family: "Noto Serif TC", serif; font-size: clamp(20px, 3.4vw, 25px); font-weight: 500; margin: 0 0 16px; letter-spacing: .03em; text-wrap: balance; }
.page-content h3 { font-size: 16px; font-weight: 700; margin: 24px 0 10px; color: var(--gold-ink); }
.page-content p { margin: 0 0 14px; color: var(--muted); line-height: 1.9; }
.page-content ul, .page-content ol { margin: 0 0 16px; padding-left: 22px; color: var(--muted); }
.page-content li { margin-bottom: 6px; }
.page-content strong { color: var(--gold-ink); }

/* ── 免責聲明 / 理性購買提醒卡 ── */
.notice-card {
  background-color: rgba(228,177,78,.04); border: 1px solid var(--gold-line);
  border-radius: var(--r-sm); padding: 18px 20px; margin: 0 0 var(--s3);
  font-size: 13.5px; color: var(--muted); line-height: 1.85;
}
.notice-card strong { color: var(--gold-ink); }

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background-color: rgba(228,177,78,.02); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px 20px; }
.faq-item .q { font-weight: 600; color: var(--heading); margin: 0 0 8px; font-size: 14.5px; font-family: "Noto Sans TC", sans-serif; }
.faq-item .a { color: var(--muted); margin: 0; font-size: 14px; line-height: 1.85; }

/* ── CTA 卡（首頁三款玩法 / 相關頁面連結） ── */
.cta-grid { display: grid; gap: var(--s2); grid-template-columns: repeat(3, 1fr); margin: 0 0 var(--s3); }
@media (max-width: 640px) { .cta-grid { grid-template-columns: 1fr; } }
.cta-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 20px;
  background-color: rgba(228,177,78,.03); position: relative; overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.cta-card:hover { transform: translateY(-3px); border-color: var(--gold-line); background-color: rgba(228,177,78,.06); }
.cta-card .name { font-family: "Noto Serif TC", serif; font-size: 20px; font-weight: 500; color: var(--heading); }
.cta-card .rule { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cta-card .go { margin-top: 4px; font-family: "Cormorant Garamond", serif; font-size: 13px; letter-spacing: .1em; color: var(--gold); }

/* ── Footer ── */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--line-soft); margin-top: var(--s5); }
.site-footer .inner { max-width: 1160px; margin: 0 auto; padding: var(--s4) clamp(20px, 5vw, 32px); }
.site-footer .disclaimer { font-size: 12.5px; color: var(--dim); line-height: 1.85; max-width: 68ch; margin: 0 0 var(--s3); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 var(--s2); }
.site-footer .links a { color: var(--muted); font-size: 12.5px; text-decoration: none; }
.site-footer .links a:hover { color: var(--heading); }
.site-footer .copyright { font-size: 12px; color: var(--dim); font-family: "Cormorant Garamond", serif; letter-spacing: .06em; }

/* ══════════════════ 互動抽號工具（可嵌入任一頁） ══════════════════ */
@keyframes ring { 0% { transform: scale(.55); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes drawSpin { to { transform: rotate(360deg); } }
@keyframes glowPulse { 0%,100% { opacity: .2; transform: scale(.9); } 50% { opacity: .7; transform: scale(1.08); } }
@keyframes innerFlow { 0% { transform: translate(-28%, 22%) scale(.75); opacity: .5; } 50% { transform: translate(26%, -20%) scale(1.25); opacity: .95; } 100% { transform: translate(-28%, 22%) scale(.75); opacity: .5; } }

.tool { position: relative; max-width: 480px; margin: 0 auto var(--s4); z-index: 1; }
.tool .games { width: 100%; display: grid; gap: var(--s2); grid-template-columns: repeat(3, 1fr); margin-bottom: var(--s3); }
.tool.locked .games { display: none; }
@media (max-width: 560px) { .tool .games { grid-template-columns: 1fr; } }
.game-btn {
  appearance: none; cursor: pointer; text-align: left; position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background-color: rgba(228,177,78,.03); color: var(--text);
  padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 6px;
  transition: transform .24s var(--ease), border-color .24s var(--ease), box-shadow .24s var(--ease), background-color .24s var(--ease);
  width: 100%; font-family: inherit;
}
.game-btn .idx { font-family: "Cormorant Garamond", serif; font-size: 12px; letter-spacing: .1em; color: var(--dim); }
.game-btn .name { font-family: "Noto Serif TC", serif; font-size: clamp(20px, 4.8vw, 24px); font-weight: 500; letter-spacing: .04em; color: var(--heading); }
.game-btn .rule { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.game-btn::after {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 2px;
  background-color: var(--gold); transform: scaleY(0); transform-origin: top;
  transition: transform .3s var(--ease); border-radius: 2px;
}
.game-btn:hover { transform: translateY(-3px); border-color: var(--gold-line); background-color: rgba(228,177,78,.06); box-shadow: 0 12px 36px rgba(0,0,0,.4); }
.game-btn:hover::after { transform: scaleY(1); }
.game-btn[aria-pressed="true"] { border-color: var(--gold-line); background-color: rgba(228,177,78,.07); }
.game-btn[aria-pressed="true"]::after { transform: scaleY(1); }

:where(.game-btn, .draw-btn, .action-btn, .sound-toggle):focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px; box-shadow: 0 0 0 6px rgba(228,177,78,.14);
}
.step:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.panel {
  position: relative; width: 100%; text-align: center;
  background-image: linear-gradient(180deg, rgba(228,177,78,.05), rgba(228,177,78,.01));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(28px, 6vw, 44px) clamp(20px, 5vw, 30px);
  display: none; box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.panel.show { display: flex; flex-direction: column; align-items: center; gap: var(--s3); animation: focusIn .45s var(--ease); }
@keyframes focusIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.panel.drawing::before {
  content: ""; position: absolute; inset: -60px; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle at 50% 55%, rgba(244,203,108,.5), rgba(228,177,78,.18) 40%, transparent 70%);
  filter: blur(34px); animation: glowPulse 1.5s ease-in-out infinite;
}
.mantra { font-family: "Cormorant Garamond", serif; font-size: clamp(21px, 5.5vw, 28px); font-weight: 600; letter-spacing: .3em; color: var(--gold-ink); margin: 0; padding-left: .3em; }

/* ── 豐盛/顯化音頻儀式模組 ── */
.freq-note {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  font-size: 12.5px; line-height: 1.8; color: var(--muted);
  max-width: 420px; margin: 0 auto; padding: 20px 20px 18px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background-color: rgba(228,177,78,.03);
}
.freq-note::before { content: none; }
.freq-note .sig { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; position: relative; display: flex; align-items: center; justify-content: center; }
.freq-note .sig::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--gold-line); animation: ring 3.2s var(--ease) infinite; }
.freq-note .sig::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background-color: var(--gold-bright); box-shadow: 0 0 14px var(--gold); }
.freq-note .txt { flex: 1 1 auto; font-family: "Cormorant Garamond", serif; font-size: 15px; letter-spacing: .03em; color: var(--gold-ink); }
.freq-note b { color: var(--gold-bright); font-weight: 700; }
.sound-toggle {
  flex: 0 0 auto; appearance: none; cursor: pointer; margin-top: 2px;
  border: 1px solid var(--gold-line); background-color: transparent; color: var(--gold-ink);
  border-radius: 999px; padding: 8px 20px; font-size: 12px; letter-spacing: .14em;
  font-family: "Noto Sans TC", sans-serif; white-space: nowrap;
  transition: border-color .18s var(--ease), color .18s var(--ease), background-color .18s var(--ease);
}
.sound-toggle:hover { border-color: var(--gold); background-color: rgba(228,177,78,.08); }
.sound-toggle[aria-pressed="false"] { color: var(--muted); }

.count-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; }
.count-label { font-size: 13.5px; letter-spacing: .1em; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--gold-line); border-radius: 999px; background-color: rgba(228,177,78,.03); overflow: hidden; }
.step {
  appearance: none; cursor: pointer; border: none; background-color: transparent; color: var(--gold-ink);
  width: 38px; height: 38px; font-size: 20px; line-height: 1; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.step:hover { background-color: rgba(228,177,78,.1); color: var(--heading); }
.step:active { background-color: rgba(228,177,78,.18); }
.step:disabled { color: var(--dim); cursor: not-allowed; background-color: transparent; }
.count-val { min-width: 30px; text-align: center; font-family: "Cormorant Garamond", serif; font-size: 21px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; }
.count-val.bump { animation: bump .14s var(--ease); }
@keyframes bump { from { opacity: .4; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.count-hint { font-size: 12px; letter-spacing: .04em; color: var(--dim); }

.draw-btn {
  position: relative; overflow: hidden; cursor: pointer; border: none; border-radius: 999px;
  padding: 16px 44px; font-size: 15px; letter-spacing: .28em; font-weight: 700; font-family: "Noto Sans TC", sans-serif;
  color: #16110b; background-image: linear-gradient(180deg, var(--gold-bright), #dcae4c);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  box-shadow: 0 0 40px rgba(228,177,78,.32);
  display: inline-flex; align-items: center; gap: 12px;
}
.draw-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 44px rgba(228,177,78,.45); }
.draw-btn:active { transform: translateY(0); }
.draw-btn:disabled { cursor: progress; opacity: .82; }
.draw-btn .spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(22,17,11,.35); border-top-color: #16110b; display: none; animation: drawSpin .7s linear infinite; }
.draw-btn.loading .spinner { display: inline-block; }

.result { margin-top: 0; width: 100%; }
.result:empty { margin-top: 0; }
.result .title { font-family: "Noto Serif TC", serif; font-size: clamp(21px, 5vw, 26px); letter-spacing: .1em; font-weight: 500; color: var(--heading); margin: 0 0 var(--s1); }
.set { padding-top: var(--s2); }
.set + .set { margin-top: var(--s2); border-top: 1px solid var(--line-soft); }
.set-no { font-family: "Cormorant Garamond", serif; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.zone-label { color: var(--dim); font-size: 12px; letter-spacing: .18em; margin: var(--s2) 0 10px; }
.balls { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.ball {
  position: relative; overflow: hidden;
  width: clamp(44px, 11.5vw, 52px); height: clamp(44px, 11.5vw, 52px); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(18px, 4.8vw, 22px); font-weight: 600; color: #f8efdd;
  font-family: "Cormorant Garamond", serif;
  background-image: radial-gradient(circle at 34% 26%, rgba(255,246,224,.85), rgba(228,178,90,.32) 24%, #241a0e 60%, #120d07 100%);
  border: 1px solid rgba(228,177,78,.45);
  box-shadow: 0 0 24px rgba(228,177,78,.2), inset 0 2px 3px rgba(255,245,220,.32), inset 0 -7px 11px rgba(0,0,0,.55);
  animation: collapse .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 65ms);
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.ball::before {
  content: ""; position: absolute; width: 72%; height: 72%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,241,205,.6), transparent 68%); filter: blur(4px);
  animation: innerFlow 5.5s ease-in-out infinite;
}
.ball span { position: relative; z-index: 1; }
.ball.special {
  font-weight: 700; color: #1c1206;
  background-image: radial-gradient(circle at 34% 26%, rgba(255,250,232,.95), #f4d078 30%, #d69f2c 82%);
  border: 1px solid rgba(255,231,160,.8);
  box-shadow: 0 0 32px rgba(228,177,78,.55), inset 0 2px 3px rgba(255,255,240,.6), inset 0 -6px 10px rgba(120,80,10,.4);
}
@keyframes collapse { from { opacity: 0; transform: translateY(-14px) scale(.72); filter: blur(2px); } 60% { opacity: 1; transform: translateY(0) scale(1.05); filter: blur(0); } 100% { opacity: 1; transform: none; filter: none; } }
.ball.ghost { background-image: none; background-color: transparent; border: 1.5px dashed var(--line); box-shadow: none; color: transparent; opacity: .4; animation: none; }
.ball.ghost::before { display: none; }
.ball.skeleton { background-image: none; background-color: transparent; border: 1.5px dashed var(--line); box-shadow: none; color: transparent; animation: skel 1.3s var(--ease) infinite; }
.ball.skeleton::before { display: none; }
@keyframes skel { 0%,100% { opacity: .28; } 50% { opacity: .6; } }
.empty-hint { color: var(--dim); font-style: italic; font-family: "Cormorant Garamond", serif; font-size: 16px; letter-spacing: .04em; margin-top: var(--s1); }

.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: var(--s3); }
.action-btn {
  appearance: none; cursor: pointer; border: 1px solid var(--gold-line); background-color: transparent; color: var(--gold-ink);
  border-radius: 999px; padding: 10px 22px; font-size: 13px; letter-spacing: .12em; font-family: "Noto Sans TC", sans-serif;
  transition: border-color .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease);
}
.action-btn:hover { border-color: var(--gold); background-color: rgba(228,177,78,.08); color: var(--heading); }
.action-btn.primary { background-color: rgba(228,177,78,.08); }

.tool-meta { margin-top: 0; font-size: 12px; color: var(--dim); letter-spacing: .04em; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.src-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); }
.src-badge .src-dot { width: 6px; height: 6px; border-radius: 50%; }
.src-badge.q { color: var(--gold-ink); }
.src-badge.q .src-dot { background-color: var(--gold); box-shadow: 0 0 8px var(--gold); }
.src-badge.f { color: var(--muted); }
.src-badge.f .src-dot { background-color: var(--muted); box-shadow: 0 0 8px rgba(151,137,122,.6); }

.tool-err { color: var(--danger); margin-top: 0; font-size: 14px; min-height: 1.2em; letter-spacing: .02em; }
.tool-err.shake { animation: shake .4s var(--ease); }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

.tool-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background-color: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 999px; font-size: 13px; letter-spacing: .06em;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 50; box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.tool-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 歷史紀錄（首頁，localStorage） ── */
.history { max-width: 720px; margin: clamp(44px, 7vw, 64px) auto 0; position: relative; z-index: 1; }
.history .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.history .head h2 { font-family: "Noto Serif TC", serif; font-size: 20px; font-weight: 500; color: var(--heading); letter-spacing: .06em; margin: 0; }
.history .clear { cursor: pointer; background: none; border: none; padding: 0; font-size: 13px; color: var(--dim); font-family: inherit; }
.history .clear:hover { color: var(--muted); }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-card { padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r-sm); background-color: rgba(228,177,78,.02); }
.history-card .row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.history-card .game { font-family: "Noto Serif TC", serif; font-size: 15px; color: var(--heading); }
.history-card .ts { font-size: 12px; color: var(--dim); }
.history-card .balls { justify-content: flex-start; gap: 7px; }
.history-card .ball { width: 32px; height: 32px; font-size: 14px; }
.history-card .plus { font-family: "Cormorant Garamond", serif; font-size: 15px; color: var(--dim); }

/* ── 分享圖卡 modal ── */
.share-modal {
  position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center;
  padding: 24px; background-color: rgba(6,4,2,.82); backdrop-filter: blur(6px);
}
.share-modal.show { display: flex; }
.share-modal .box { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 92vw; }
.share-modal img { max-width: min(360px, 82vw); max-height: 68vh; border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(0,0,0,.6); border: 1px solid var(--gold-line); }
.share-modal .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.share-modal .dl {
  cursor: pointer; text-decoration: none; font-family: "Noto Sans TC", sans-serif; font-size: 14px; letter-spacing: .16em;
  color: #1c1206; background-image: linear-gradient(180deg, var(--gold-bright), #dcae4c); padding: 13px 30px; border-radius: 999px;
}
.share-modal .close { cursor: pointer; font-family: "Noto Sans TC", sans-serif; font-size: 14px; letter-spacing: .16em; color: var(--gold-ink); background: transparent; border: 1px solid var(--gold-line); padding: 13px 30px; border-radius: 999px; }
.share-modal .hint { font-size: 12px; color: var(--faint); letter-spacing: .02em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
