/* =====================================================================
   MyFaceFate — "Celestial Modern" theme
   Midnight indigo · champagne gold · rose & violet aurora
   ===================================================================== */
:root {
  --bg: #fffaf4;
  --bg2: #f6f0ff;
  --card: #ffffff;
  --ink: #1b1640;
  --ink2: #5f5880;
  --line: #ece4fb;
  --night: #16123a;
  --night2: #2d2370;
  --gold: #ffc94d;
  --gold2: #f2a93b;
  --coral: #ff6f91;
  --teal: #2fc4b2;
  --violet: #7c5cff;
  --sky: #4a8fe7;
  --shadow: 0 1px 2px rgba(27, 22, 64, .04), 0 12px 32px -14px rgba(60, 40, 140, .22);
  --shadow-lg: 0 24px 60px -24px rgba(60, 40, 140, .45);
  --radius: 22px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --display: "Fraunces", Georgia, serif;
  --hanzi: "Noto Serif SC", "Songti SC", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0c26; --bg2: #1a1540; --card: #1b1644; --ink: #f4f0ff; --ink2: #b4abd6; --line: #2f2766;
    --shadow: 0 12px 32px -14px rgba(0, 0, 0, .7); --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  --bg: #0f0c26; --bg2: #1a1540; --card: #1b1644; --ink: #f4f0ff; --ink2: #b4abd6; --line: #2f2766;
  --shadow: 0 12px 32px -14px rgba(0, 0, 0, .7); --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.65; overflow-x: hidden; -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at 0% -10%, rgba(255, 111, 145, .13), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(124, 92, 255, .14), transparent 60%),
    radial-gradient(700px 400px at 50% 110%, rgba(47, 196, 178, .08), transparent 60%);
  background-attachment: fixed;
}
img, canvas, svg, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--violet); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }

/* ── Header ───────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40; color: #fff;
  background:
    radial-gradient(1px 1px at 12% 30%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1px 1px at 38% 70%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 66% 25%, rgba(255,214,120,.8), transparent 60%),
    radial-gradient(1px 1px at 88% 60%, rgba(255,255,255,.6), transparent 60%),
    linear-gradient(100deg, var(--night), var(--night2));
  box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .6);
}
.header-inner { display: flex; align-items: center; gap: 20px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  font-family: var(--hanzi); font-weight: 700; font-size: 24px; color: var(--night);
  background: linear-gradient(135deg, #ffe08a, var(--gold2)); box-shadow: 0 4px 16px rgba(255, 201, 77, .45), inset 0 -2px 0 rgba(0,0,0,.12);
}
.logo-mark.sm { width: 30px; height: 30px; font-size: 17px; border-radius: 9px; display: inline-grid; vertical-align: middle; margin-right: 6px; }
.logo-text { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.05; letter-spacing: -.3px; }
.logo-text em, .f-logo em { font-style: italic; font-weight: 600; color: var(--gold); }
.logo-text small { display: block; font-family: var(--font); font-weight: 500; font-size: 11px; opacity: .72; letter-spacing: .3px; margin-top: 2px; }
.tabs { display: flex; gap: 6px; margin-left: auto; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: rgba(255, 255, 255, .08); color: #e9e4ff; padding: 8px 15px; border-radius: 999px;
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: .2s;
}
.tab:hover { background: rgba(255, 255, 255, .16); }
.tab.active { background: var(--gold); color: var(--night); font-weight: 800; box-shadow: 0 4px 14px rgba(255, 201, 77, .35); }

/* ── Layout ─────────────────────────── */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; margin-top: 8px; }
.sidebar { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 16px; }
.panel { display: none; animation: fadeUp .45s ease; }
.panel.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: 1.6px; color: var(--coral); text-transform: uppercase; }
.eyebrow.gold { color: var(--gold); }
.section-head { margin: 44px 0 18px; }
.section-head.center { text-align: center; }
.section-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 3.2vw, 34px); margin: 0 0 6px; line-height: 1.2; letter-spacing: -.4px; }
.section-head p { margin: 0; color: var(--ink2); }
.grad { background: linear-gradient(90deg, var(--coral), var(--violet) 55%, var(--sky)); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: italic; }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px;
  padding: 11px 18px; font-size: 15px; font-weight: 800; transition: transform .15s, box-shadow .2s, border-color .2s; text-decoration: none; color: var(--ink);
}
.btn:active { transform: scale(.97); }
.btn-xl { padding: 16px 26px; font-size: 17px; border-radius: 18px; }
.btn-primary { background: linear-gradient(120deg, var(--coral), var(--violet)); color: #fff; box-shadow: 0 12px 26px -10px rgba(255, 111, 145, .75); }
.btn-primary:hover { box-shadow: 0 16px 32px -10px rgba(124, 92, 255, .75); transform: translateY(-1px); }
.btn-ghost { background: var(--card); border: 2px solid var(--line); cursor: pointer; }
.btn-ghost:hover { border-color: var(--violet); }
.btn-gold { background: linear-gradient(120deg, #ffe08a, var(--gold2)); color: var(--night); box-shadow: 0 12px 26px -12px rgba(242, 169, 59, .8); }

/* ── Hero ───────────────────────────── */
.hero {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; margin-top: 14px;
  background:
    radial-gradient(500px 300px at 85% 20%, rgba(124, 92, 255, .18), transparent 60%),
    radial-gradient(400px 260px at 10% 100%, rgba(255, 111, 145, .16), transparent 60%),
    linear-gradient(135deg, #fff6f0 0%, #f6efff 55%, #eaf6ff 100%);
  border-radius: 30px; padding: 40px 36px; border: 1px solid var(--line); position: relative; overflow: hidden; box-shadow: var(--shadow);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: radial-gradient(500px 300px at 85% 20%, rgba(124,92,255,.3), transparent 60%), linear-gradient(135deg, #24163d, #1c1650 55%, #12254a); } }
:root[data-theme="dark"] .hero { background: radial-gradient(500px 300px at 85% 20%, rgba(124,92,255,.3), transparent 60%), linear-gradient(135deg, #24163d, #1c1650 55%, #12254a); }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 5.2vw, 56px); line-height: 1.05; margin: 6px 0 14px; letter-spacing: -1px; }
.lead { color: var(--ink2); font-size: 17px; margin: 0 0 22px; max-width: 560px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.drop-hint { margin-top: 12px; padding: 10px; border: 2px dashed var(--line); border-radius: 14px; text-align: center; font-size: 13px; color: var(--ink2); transition: .2s; }
.drop-hint.over { border-color: var(--coral); background: rgba(255, 111, 145, .08); color: var(--coral); }
.trust { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink2); }
.trust b { color: var(--ink); }
.photo-tips { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.photo-tips li { font-size: 12.5px; background: var(--card); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; color: var(--ink2); font-weight: 600; }
.hero-visual { display: grid; place-items: center; }
.orb {
  position: relative; width: min(290px, 70vw); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #ffe0ea 28%, #c8b6ff 68%, #6f58e8 100%);
  display: grid; place-items: center;
  box-shadow: 0 24px 70px -20px rgba(124, 92, 255, .75), inset 0 -24px 44px rgba(45, 35, 112, .35), 0 0 0 10px rgba(255,255,255,.35), 0 0 0 11px rgba(124,92,255,.15);
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-10px); } }
.face-sketch { width: 55%; fill: none; stroke: #2d2370; stroke-width: 3; stroke-linecap: round; opacity: .8; }
.orb-tag { position: absolute; font-size: 12.5px; font-weight: 800; padding: 5px 11px; border-radius: 999px; background: #fff; color: var(--night); box-shadow: var(--shadow); animation: float 4s ease-in-out infinite; white-space: nowrap; }
.orb-tag.t1 { right: -8%; top: 52%; color: #b77b00; }
.orb-tag.t2 { left: -6%; top: 26%; color: var(--violet); animation-delay: .5s; }
.orb-tag.t3 { right: 2%; top: 4%; color: var(--sky); animation-delay: 1s; }
.orb-tag.t4 { left: 4%; bottom: 6%; color: var(--coral); animation-delay: 1.5s; }

.ear-picker { margin-top: 16px; padding: 14px 18px; }
.ear-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 8px; }
.ear-head span { font-size: 13px; color: var(--ink2); }
.chips, .filter { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; transition: .15s; }
.chip:hover { border-color: var(--violet); }
.chip.active { background: var(--night); border-color: var(--night); color: #fff; }

/* ── How it works / FAQ ─────────────── */
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.how-step { position: relative; text-align: center; padding: 26px 20px; }
.how-step .num { position: absolute; top: 14px; left: 16px; font-family: var(--display); font-weight: 800; font-size: 15px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); color: var(--violet); }
.how-step .big { font-size: 40px; }
.how-step h3 { font-family: var(--display); margin: 6px 0 4px; font-size: 20px; }
.how-step p { margin: 0; color: var(--ink2); font-size: 14.5px; }
.faq details { margin-bottom: 10px; padding: 0; }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 800; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--violet); transition: .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 20px 16px; color: var(--ink2); }

/* ── Analyzing ─────────────────────────── */
.analyzing { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.scan-box { position: relative; border-radius: 16px; overflow: hidden; background: #000; }
.scan-box canvas { width: 100%; }
.scan-line { position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent); box-shadow: 0 0 20px 6px rgba(255, 201, 77, .6); animation: scan 1.6s ease-in-out infinite alternate; }
@keyframes scan { from { top: 4%; } to { top: 94%; } }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--coral); border-right-color: var(--violet); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#scanMsg { font-family: var(--display); font-size: 22px; font-weight: 700; margin: 12px 0; }
.scan-steps { padding-left: 20px; margin: 0; color: var(--ink2); }
.scan-steps li { transition: .3s; }
.scan-steps li.done { color: var(--teal); font-weight: 700; }
.scan-steps li.done::marker { content: "✔ "; }

/* ── Result ─────────────────────────────── */
.result { margin-top: 20px; display: flex; flex-direction: column; gap: 20px; }
.res-top { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; }
.photo-card { padding: 12px; }
.photo-card canvas { width: 100%; border-radius: 14px; }
.layer-toggle { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.hook-card { background: radial-gradient(400px 260px at 100% 0%, rgba(255,201,77,.18), transparent 60%), linear-gradient(140deg, var(--night), #3b2a8f 58%, #c2457a); color: #fff; border: 0; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.hook-card::after { content: "相"; position: absolute; right: -10px; bottom: -50px; font-family: var(--hanzi); font-size: 210px; opacity: .07; pointer-events: none; }
.hook-line { font-family: var(--display); font-style: italic; font-weight: 600; font-size: clamp(23px, 3vw, 31px); line-height: 1.25; margin: 4px 0 14px; }
.shape-badge { display: inline-flex; gap: 8px; align-items: center; background: rgba(255, 255, 255, .14); padding: 6px 13px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.total { display: flex; align-items: center; gap: 16px; margin: 18px 0 8px; }
.total-ring { width: 96px; height: 96px; flex: none; }
.total-ring text { font-family: var(--display); font-weight: 800; }
.total-title { font-size: 19px; font-family: var(--display); }
.total p { margin: 2px 0 0; opacity: .9; font-size: 14px; }
.mini-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 12px; font-size: 13px; }
.mini-bar span { display: flex; justify-content: space-between; }
.mini-bar i { display: block; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .18); overflow: hidden; margin-top: 2px; }
.mini-bar i b { display: block; height: 100%; border-radius: 6px; }
.fun-pill { display: inline-block; margin: 14px 0 0; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.12); opacity: .85; }

.summary-card h3, .block-title { font-family: var(--display); font-weight: 700; font-size: 25px; margin: 0 0 12px; letter-spacing: -.3px; }
.summary-card { border-top: 4px solid var(--gold); }
.summary-card p { font-size: 17px; line-height: 1.85; margin: 0; }
.summary-card p::first-letter { font-size: 1.6em; }

.radar-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.radar { width: 100%; max-width: 380px; margin: 0 auto; overflow: visible; }
.radar .grid { fill: none; stroke: var(--line); }
.radar .axis-label { font-size: 11px; fill: var(--ink2); font-weight: 700; font-family: var(--font); }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--bg2); font-weight: 600; }
.rank-list .n { font-family: var(--display); font-weight: 800; font-size: 18px; width: 22px; color: var(--violet); }
.rank-list .s { margin-left: auto; font-weight: 800; }

.part-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.part-card { border-top: 5px solid var(--c, var(--violet)); }
.part-card h4 { margin: 0; font-size: 18px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-family: var(--display); }
.part-card .organ { font-size: 12px; color: var(--ink2); font-weight: 600; font-family: var(--font); }
.tagrow { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.tagrow span { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--bg2); color: var(--ink2); font-weight: 600; }
.part-card p { margin: 0; font-size: 15px; }

.fortune-list { display: flex; flex-direction: column; gap: 14px; }
.fcard { border-left: 6px solid var(--c); }
.fhead { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.fhead .em { font-size: 30px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: color-mix(in srgb, var(--c) 18%, transparent); flex: none; }
.fhead h4 { margin: 0; font-size: 20px; font-family: var(--display); }
.fhead .score { margin-left: auto; font-family: var(--display); font-weight: 800; font-size: 32px; color: var(--c); white-space: nowrap; }
.fhead .score small { font-size: 13px; color: var(--ink2); font-family: var(--font); font-weight: 600; }
.fbar { height: 8px; border-radius: 8px; background: var(--bg2); overflow: hidden; margin-bottom: 12px; }
.fbar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 60%, #fff), var(--c)); border-radius: 8px; transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.fopen { font-weight: 800; font-size: 16.5px; margin: 0 0 6px; }
.fbody { margin: 0 0 12px; }
.fbox { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fbox div { background: var(--bg2); border-radius: 14px; padding: 11px 13px; font-size: 13.5px; line-height: 1.55; }
.fbox b { display: block; font-size: 12px; color: var(--c); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .5px; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; }
.metric { font-size: 13px; }
.metric .top { display: flex; justify-content: space-between; gap: 8px; }
.metric .top em { font-style: normal; color: var(--ink2); font-weight: 700; }
.mtrack { position: relative; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #8fd3f4, #ece4fb 50%, #ffb1c1); margin-top: 3px; }
.mtrack i { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--night); border: 2px solid #fff; transform: translate(-50%, -50%); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.note { font-size: 12.5px; color: var(--ink2); margin: 12px 0 0; }

.match-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.match { text-align: center; padding: 18px 12px; border-radius: 18px; background: var(--bg2); }
.match .av { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; margin: 0 auto 8px; color: #fff; box-shadow: 0 8px 20px -8px rgba(0,0,0,.35); }
.match b { display: block; line-height: 1.25; }
.match .pct { font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--coral); }
.match p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink2); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ── Face Map / Palaces ───────────────────── */
.palace-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.palace-map svg { width: 100%; max-width: 380px; margin: 0 auto; }
.palace-map .dot { cursor: pointer; transition: .2s; }
.palace-map .dot:hover circle, .palace-map .dot.on circle { r: 4.6; fill: var(--coral); }
.palace-map text { font-size: 3.3px; font-weight: 800; fill: #1b1640; stroke: #fff; stroke-width: .9px; paint-order: stroke; pointer-events: none; font-family: var(--font); }
.palace-info h3 { font-family: var(--display); font-size: 28px; margin: 0; }
.palace-info .hanzi { font-family: var(--hanzi); font-size: 18px; color: var(--ink2); font-weight: 700; margin-left: 4px; }
.palace-info .place { color: var(--coral); font-weight: 800; margin: 4px 0 10px; }
.palace-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }

.organ-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.organ { text-align: center; padding: 18px 10px; }
.organ .big { font-size: 34px; }
.organ b { display: block; font-size: 18px; font-family: var(--display); }
.organ .t { color: var(--violet); font-weight: 800; font-size: 12.5px; }
.organ p { font-size: 12.5px; color: var(--ink2); margin: 6px 0 0; }

.dict { display: flex; flex-direction: column; gap: 14px; }
.dict-part h3 { margin: 0 0 10px; font-size: 21px; font-family: var(--display); }
.dict-part h3 small { color: var(--ink2); font-size: 13px; font-family: var(--font); font-weight: 600; }
.dict-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.dict-row div { background: var(--bg2); border-radius: 14px; padding: 12px; font-size: 13.5px; }
.dict-row b { display: block; color: var(--violet); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.dict-sub { font-weight: 800; font-size: 14px; margin: 6px 0; }

/* ── Luck Guide ───────────────────── */
.fortune-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.guide { border-top: 5px solid var(--c); }
.guide h3 { margin: 0 0 8px; font-size: 21px; font-family: var(--display); }
.guide .look { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.guide .look span { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, transparent); font-weight: 700; }
.guide p { margin: 0 0 8px; font-size: 14.5px; }
.guide .tipline { font-size: 13.5px; background: var(--bg2); border-radius: 12px; padding: 10px 12px; margin: 0; }
.tip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tip-grid .card { padding: 18px; }
.tip-grid h4 { margin: 0 0 8px; font-family: var(--display); font-size: 17px; }
.tip-grid p { margin: 0 0 8px; font-size: 13.5px; }
.tip-grid p b { color: var(--coral); display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; }

/* ── Famous Faces ───────────────────────────── */
.fig-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.fig-grid .fig-ad { grid-column: 1 / -1; }
.fig { position: relative; overflow: hidden; }
.fig-head { display: flex; gap: 12px; align-items: center; }
.fig .av { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; flex: none; }
.fig h3 { margin: 0; font-size: 20px; font-family: var(--display); line-height: 1.2; }
.fig .meta { font-size: 12.5px; color: var(--ink2); }
.fig .region { margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg2); align-self: flex-start; white-space: nowrap; }
.fig .shape { font-size: 13px; font-weight: 800; margin: 12px 0 4px; }
.fig p { font-size: 14.5px; margin: 8px 0; }
.fig .fbars { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.fig .fbars div { display: grid; grid-template-columns: 70px 1fr 34px; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 600; }
.fig .fbars i { height: 6px; border-radius: 6px; background: var(--bg2); overflow: hidden; }
.fig .fbars i b { display: block; height: 100%; }
.fig .more { border: 0; background: none; color: var(--violet); font-weight: 800; padding: 0; font-size: 13.5px; }
.fig p.clip { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Ancient Secrets ───────────────────────────── */
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.book { position: relative; overflow: hidden; padding-top: 76px; }
.book .spine { position: absolute; top: 0; left: 0; right: 0; height: 58px; background: linear-gradient(110deg, var(--c), color-mix(in srgb, var(--c) 70%, #16123a)); color: #fff; font-family: var(--hanzi); font-size: 24px; font-weight: 700; display: flex; align-items: center; padding: 0 18px; letter-spacing: 6px; }
.book h3 { margin: 0; font-size: 21px; font-family: var(--display); }
.book .era { font-size: 12px; color: var(--ink2); font-weight: 700; }
.book p { font-size: 14px; }
.concept { margin-top: 16px; }
.concept h3 { margin-top: 0; font-family: var(--display); }
.sanjeong { display: grid; gap: 8px; }
.sanjeong div { display: grid; grid-template-columns: 80px 150px 1fr; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--bg2); align-items: center; }
.sanjeong b { font-family: var(--display); font-size: 18px; color: var(--violet); }
.sanjeong span { font-weight: 600; font-size: 14px; }
.sanjeong em { font-style: normal; color: var(--ink2); font-size: 14px; }

/* ── Sidebar ───────────────────────── */
.today { background: linear-gradient(140deg, #fff4d6, #ffe3ec); border: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .today { background: linear-gradient(140deg, #3a2e16, #3b1c33); } }
:root[data-theme="dark"] .today { background: linear-gradient(140deg, #3a2e16, #3b1c33); }
.today p:last-child { font-family: var(--display); font-size: 17px; line-height: 1.5; margin: 0; }

/* ── Ad slots ─────────────────────── */
.ad-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; border-radius: 14px; }
.ad-slot.live::before { content: "Advertisement"; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink2); opacity: .7; margin-bottom: 4px; }
.ad-slot.placeholder {
  background: repeating-linear-gradient(45deg, var(--bg2), var(--bg2) 10px, transparent 10px, transparent 20px);
  border: 1.5px dashed var(--line); color: var(--ink2); font-size: 12px; font-weight: 700; letter-spacing: 1px;
}
.ad-slot.placeholder::before { content: "AD · " attr(data-size); }
.ad-top { min-height: 90px; margin: 14px auto 6px; max-width: 728px; }
.ad-infeed { min-height: 250px; margin: 8px 0; }
.ad-side { min-height: 600px; }
.ad-bottom { min-height: 50px; width: 320px; max-width: 100%; }
.ad-anchor { display: none; }

/* ── Footer ───────────────────────────── */
.disclaimer { font-size: 12.5px; color: var(--ink2); margin: 40px 0 0; padding: 16px; border-radius: 14px; background: var(--bg2); }
.site-footer { margin-top: 44px; padding: 30px 0 96px; background: var(--night); color: #d9d2ff; font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.site-footer p { margin: 2px 0; }
.f-logo { font-family: var(--display); font-weight: 800; font-size: 22px; color: #fff; }
.site-footer .small { font-size: 12.5px; opacity: .75; }
.site-footer a { color: inherit; }

/* ── Camera modal ─────────────────────── */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(10, 6, 30, .92); display: grid; place-items: center; padding: 16px; }
.cam-box { position: relative; width: min(480px, 100%); aspect-ratio: 3 / 4; border-radius: 24px; overflow: hidden; background: #000; }
.cam-box video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; transform: scaleX(-1); background: #000; }
.cam-box video.rear { transform: none; }
.cam-guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-count { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 120px; color: var(--gold); text-shadow: 0 4px 30px rgba(0, 0, 0, .6); pointer-events: none; }
.cam-ctrl { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: space-around; align-items: center; z-index: 3; }
.cam-ctrl .btn { font-size: 16px; padding: 14px 18px; }
.cam-ctrl .btn-ghost { background: rgba(0, 0, 0, .6); color: #fff; border: 2px solid rgba(255, 255, 255, .7); }
.cam-ctrl .btn-primary { background: linear-gradient(120deg, #18a565, #20b2aa); }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: var(--coral); box-shadow: 0 0 0 4px rgba(255, 111, 145, .4); }
.shutter:active { transform: scale(.92); }
.shutter:disabled { opacity: .35; cursor: not-allowed; }
.flash { position: fixed; inset: 0; background: #fff; z-index: 120; animation: flash .4s ease forwards; pointer-events: none; }
@keyframes flash { to { opacity: 0; } }
.cam-status {
  position: absolute; top: 14px; left: 12px; right: 12px; margin: 0; z-index: 3;
  text-align: center; font-size: 16px; font-weight: 700; line-height: 1.45; color: #fff;
  padding: 10px 14px; border-radius: 16px; background: rgba(20, 12, 50, .78);
}
.cam-status.ok { background: rgba(22, 150, 90, .92); }
.cam-status.bad { background: rgba(200, 60, 80, .92); }
.cam-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; background: #000; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--night); color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 130; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); text-align: center; font-weight: 600; }

/* ── Notice card ───────── */
.notice { margin-top: 16px; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; align-items: center; border: 2px solid var(--coral); }
.notice canvas { width: 100%; border-radius: 14px; background: #000; }
.notice h3 { margin: 0 0 6px; font-size: 22px; color: var(--coral); font-family: var(--display); }
.notice p { font-size: 16px; margin: 0 0 14px; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } .orb, .orb-tag { animation: none; } }

/* ── Responsive ─────────────────────────── */
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .ad-side { min-height: 250px; }
  .organ-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .header-inner { gap: 8px; }
  .tabs { margin-left: 0; width: 100%; }
  .hero { grid-template-columns: 1fr; padding: 26px 18px; text-align: center; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .trust { justify-content: center; }
  .hero-visual { order: -1; }
  .orb { width: 190px; }
  .orb-tag { font-size: 11px; }
  .cta-row .btn { flex: 1 1 100%; }
  .analyzing, .res-top, .radar-card, .palace-wrap, .notice { grid-template-columns: minmax(0, 1fr); }
  .notice canvas { max-width: 220px; margin: 0 auto; }
  .part-grid, .fortune-guide, .fig-grid, .metric-grid, .how-grid { grid-template-columns: minmax(0, 1fr); }
  .fbox, .tip-grid, .book-grid, .dict-row { grid-template-columns: minmax(0, 1fr); }
  .organ-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .match { padding: 12px 6px; }
  .match b { font-size: 13px; }
  .match .av { width: 48px; height: 48px; font-size: 24px; }
  .match p { display: none; }
  .mini-bars { grid-template-columns: 1fr; }
  .sanjeong div { grid-template-columns: 70px 1fr; }
  .sanjeong em { grid-column: 1 / -1; }
  .ad-top { min-height: 100px; max-width: 320px; }
  .ad-anchor { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; justify-content: center; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
  .ad-close { position: absolute; right: 8px; top: -14px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--night); color: #fff; }
  .sidebar .ad-side { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ── Step boxes: gender & age picker ───────── */
.step-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 15px; margin: 0 0 10px; }
.step-title small { font-weight: 500; color: var(--ink2); font-size: 13px; }
.step-no { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; color: #fff; background: linear-gradient(120deg, var(--coral), var(--violet)); flex: none; }
.step-box { background: color-mix(in srgb, var(--card) 75%, transparent); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; margin: 0 0 18px; backdrop-filter: blur(6px); }
.pp-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.pp-row em { font-style: normal; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink2); width: 58px; flex: none; }
.profile-tag { display: inline-flex; align-items: center; margin-left: 6px; background: rgba(255,201,77,.2); color: var(--gold); padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; }
@media (max-width: 760px) {
  .step-title { justify-content: center; }
  .pp-row { flex-direction: column; align-items: center; gap: 4px; }
  .pp-row em { width: auto; }
  .pp-row .chips { justify-content: center; }
  .profile-tag { margin: 8px 0 0; }
}

/* ── Instant photo: auto-shoot bar, camera name, gender pop-up ───────── */
.auto-hint { margin: 10px 0 0; font-size: 13px; color: var(--ink2); font-weight: 600; }
.cam-autobar { position: absolute; left: 0; bottom: 0; height: 6px; width: 0; background: #34e08a; z-index: 3; transition: width .6s linear; }
.cam-name { position: absolute; left: 0; right: 0; bottom: 96px; z-index: 3; margin: 0; text-align: center; font-size: 12.5px; color: rgba(255,255,255,.85); text-shadow: 0 1px 3px #000; }
#genderModal { z-index: 110; }
.gender-box { width: min(440px, 100%); text-align: center; padding: 28px 24px; }
.gender-box h3 { font-family: var(--display); font-size: 23px; margin: 0 0 8px; line-height: 1.25; }
.gender-box p { color: var(--ink2); margin: 0 0 18px; font-size: 15px; }
.gender-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.btn-big-g { flex-direction: column; gap: 4px; font-size: 40px; padding: 18px 10px; border-radius: 20px; background: var(--bg2); border: 2px solid var(--line); }
.btn-big-g span { font-size: 17px; font-weight: 800; color: var(--ink); }
.btn-big-g:hover { border-color: var(--violet); }
.gender-box .btn-ghost { width: 100%; }

/* Notice card without a photo: use the full width */
.notice.nophoto { grid-template-columns: minmax(0, 1fr); border-color: var(--violet); }
.notice.nophoto h3 { color: var(--violet); }
