:root {
  --night: #12100d;
  --night-2: #1d1813;
  --cream: #f7f1e6;
  --paper: #fffdf8;
  --ink: #1c1915;
  --ink-soft: #4a443a;
  --muted: #8c8272;
  --line: #e5dbc9;
  --gold: #c8a15c;
  --gold-soft: #e6cf9f;
  --gold-deep: #a97f38;
  --accent: #a8432b;
  --radius: 20px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}
a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 14px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.shell { max-width: 720px; margin: 0 auto; padding: 0 20px 48px; }
.shell-narrow { max-width: 560px; }

/* ---------- brand ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 18px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--gold-soft); font-size: 14px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; font-size: 16px; letter-spacing: .14em; }
.brand-text em { font-style: normal; font-family: var(--sans); font-size: 8px; letter-spacing: .24em; color: var(--muted); margin-top: 3px; }
.brand.light { color: #f2e9d8; }
.brand.light .brand-mark { background: transparent; border: 1px solid rgba(230, 207, 159, .55); color: var(--gold-soft); }
.brand.light .brand-text em { color: rgba(230, 207, 159, .62); }
.back { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); background: rgba(255,255,255,.6); }
.back:hover { text-decoration: none; background: #fff; }

/* ---------- night hero ---------- */
.night {
  position: relative; overflow: hidden; color: #f4ebdd;
  background:
    radial-gradient(90% 60% at 50% -10%, #33291d 0%, rgba(51,41,29,0) 60%),
    radial-gradient(120% 100% at 50% 0%, #1a1612 0%, #0e0c0a 62%, #0a0908 100%);
  border-radius: 0 0 34px 34px;
}
.night::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(2px 2px at 12% 18%, rgba(230,207,159,.5), transparent),
    radial-gradient(1.5px 1.5px at 82% 12%, rgba(230,207,159,.42), transparent),
    radial-gradient(1.5px 1.5px at 68% 30%, rgba(230,207,159,.3), transparent),
    radial-gradient(1.5px 1.5px at 28% 42%, rgba(230,207,159,.22), transparent),
    radial-gradient(2px 2px at 90% 46%, rgba(230,207,159,.25), transparent);
}
.night-inner { position: relative; max-width: 720px; margin: 0 auto; padding: 0 20px 54px; }
.hero { padding: 10px 0 8px; text-align: center; }
.eyebrow {
  font-family: var(--sans); font-size: 10px; letter-spacing: .26em; text-transform: uppercase;
  color: rgba(230, 207, 159, .72); margin-bottom: 20px;
}
.display {
  font-size: clamp(30px, 8.6vw, 44px); line-height: 1.45; font-weight: 600;
  letter-spacing: .02em; margin-bottom: 18px; color: #f6efe2;
}
.display .hl { color: var(--gold-soft); }
.lede { color: var(--ink-soft); font-size: 14px; line-height: 2; margin-bottom: 30px; }
.lede.light { color: rgba(244, 235, 221, .7); }

/* deck of cards */
.deck { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 150px; margin: 0 0 30px; }
.deck::before {
  content: ""; position: absolute; width: 320px; height: 320px; left: 50%; top: 40%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(200, 161, 92, .22), rgba(200, 161, 92, 0) 62%);
  pointer-events: none;
}
.deck-card {
  position: relative; width: 74px; height: 108px; flex: 0 0 auto;
  margin: 0 -6px; border-radius: 9px;
  background: linear-gradient(165deg, var(--g1), var(--g2));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 22px 34px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.4), inset 0 0 24px rgba(255,255,255,.25);
  transform: rotate(var(--rot)) translateY(var(--dy));
  animation: float 7s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.deck-emblem { width: 28px; height: 28px; color: rgba(30,24,18,.72); }
.deck-name { font-size: 10px; letter-spacing: .12em; color: rgba(30,24,18,.75); }
@keyframes float { 0%,100% { transform: rotate(var(--rot)) translateY(var(--dy)); } 50% { transform: rotate(var(--rot)) translateY(calc(var(--dy) - 6px)); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 11px 22px; font-family: var(--sans); font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .25s ease, background .25s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--cream); box-shadow: 0 10px 24px rgba(28,25,21,.22); }
.btn-primary:hover { background: #000; }
.btn-gold {
  background: linear-gradient(135deg, #e2c185, #c8a15c 55%, #a9833f);
  color: #221a10; font-weight: 700; letter-spacing: .06em;
  box-shadow: 0 12px 30px rgba(200,161,92,.28), inset 0 1px 0 rgba(255,255,255,.55);
}
.btn-gold:hover { box-shadow: 0 16px 36px rgba(200,161,92,.4), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-lg { width: 100%; padding: 16px 24px; font-size: 15px; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }

.micro { font-family: var(--sans); font-size: 12px; color: var(--muted); line-height: 1.8; }
.micro.light { color: rgba(230, 207, 159, .55); margin-top: 14px; }
.micro.light a { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- day section ---------- */
.day { padding: 46px 0 0; }
.day-head { display: flex; align-items: center; gap: 14px; margin: 0 0 26px; }
.day-head p { margin: 0; font-size: 12px; letter-spacing: .28em; color: var(--muted); white-space: nowrap; }
.rule { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line) 30%, var(--line) 70%, transparent); }
.cards3 { display: grid; gap: 14px; }
.mini-card {
  position: relative; background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px 20px 18px 22px; overflow: hidden;
}
.mini-card::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(180deg, var(--gold), transparent); }
.mini-card h3 { font-size: 15px; margin-bottom: 6px; letter-spacing: .04em; }
.mini-card h3 span { font-family: var(--sans); font-size: 10px; color: var(--gold-deep); letter-spacing: .18em; margin-right: 8px; }
.mini-card p { font-size: 13px; color: var(--ink-soft); margin: 0; line-height: 1.85; }
.foot { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 18px; }

/* ---------- quiz ---------- */
.quiz-page { min-height: 100vh; }
.progress { height: 2px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress-bar { height: 100%; width: 12%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width .35s ease; }
.step-label { font-family: var(--sans); font-size: 10px; color: var(--muted); letter-spacing: .22em; margin: 16px 0 20px; }
.quiz { min-height: 58vh; }
.q-title { font-size: 21px; line-height: 1.65; margin-bottom: 22px; letter-spacing: .02em; }
.q-index { font-family: var(--sans); font-size: 10px; color: var(--gold-deep); letter-spacing: .2em; display: block; margin-bottom: 8px; }
.opt {
  width: 100%; text-align: left; font-family: var(--serif); font-size: 15px; line-height: 1.7;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 11px; cursor: pointer;
  display: flex; gap: 13px; align-items: flex-start;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.opt:hover { border-color: var(--gold); transform: translateY(-1px); }
.opt .idx {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid var(--line); display: grid; place-items: center;
  font-family: var(--sans); font-size: 11px; color: var(--muted); margin-top: 2px;
}
.opt.sel { border-color: var(--gold-deep); background: #fbf4e6; }
.opt.sel .idx { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff; }
.quiz-nav { display: flex; gap: 10px; margin-top: 18px; }
.quiz-nav .btn { flex: 1; }
.quiz-hint { font-family: var(--sans); font-size: 11px; letter-spacing: .14em; color: var(--muted); text-align: center; margin: 18px 0 0; }

/* ---------- reveal ---------- */
.reveal-layer {
  position: fixed; inset: 0; z-index: 80; display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 28px; padding: 24px;
  background: radial-gradient(70% 55% at 50% 40%, #241d15 0%, #0d0b09 70%);
}
.reveal-layer.on { display: flex; }
.reveal-card {
  width: 200px; height: 280px; border-radius: 14px;
  display: grid; place-items: center; color: #2a2117;
  background: linear-gradient(150deg, #f3e6cd, #d9bd8c);
  box-shadow: 0 30px 60px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.5), inset 0 0 40px rgba(255,255,255,.5);
  animation: flipIn 1s cubic-bezier(.2,.8,.2,1) both;
}
.reveal-card svg { width: 76px; height: 76px; }
.reveal-text { font-family: var(--sans); font-size: 12px; letter-spacing: .26em; color: rgba(230,207,159,.8); margin: 0; }
@keyframes flipIn {
  0% { transform: rotateY(180deg) scale(.9); opacity: 0; }
  60% { transform: rotateY(0) scale(1.02); opacity: 1; }
  100% { transform: rotateY(0) scale(1); opacity: 1; }
}

/* ---------- report ---------- */
.report-shell { padding-bottom: 56px; }
.report-top { position: sticky; top: 0; z-index: 20; background: rgba(247,241,230,.9); backdrop-filter: blur(10px); }
.report-badge {
  font-family: var(--sans); font-size: 10px; letter-spacing: .16em; padding: 5px 11px;
  border-radius: 99px; border: 1px solid var(--line); color: var(--muted);
}
.dots { display: flex; gap: 6px; justify-content: center; padding: 12px 0 20px; }
.dot { width: 6px; height: 6px; border-radius: 99px; background: #ddd1bb; transition: all .3s ease; }
.dot.active { width: 22px; background: var(--gold-deep); }

.page {
  position: relative; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px 24px; margin-bottom: 18px; overflow: hidden;
  box-shadow: 0 14px 30px rgba(90, 70, 40, .05);
}
body.anim .reveal-up { opacity: 0; transform: translateY(14px); }
.reveal-up { transition: opacity .7s ease, transform .7s ease; }
body.anim .reveal-up.in { opacity: 1; transform: none; }
.page::after {
  content: ""; position: absolute; inset: 8px; border: 1px solid rgba(200,161,92,.16);
  border-radius: 14px; pointer-events: none;
}
.page-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.page-no { font-family: var(--sans); font-size: 10px; letter-spacing: .22em; color: var(--gold-deep); }
.page-head h2 { font-size: 18px; letter-spacing: .1em; }
.page .lead { font-size: 16px; color: var(--ink); margin-bottom: 14px; }
.page p { color: var(--ink-soft); font-size: 15px; line-height: 1.95; }

/* cover card */
.cover {
  position: relative; border-radius: 16px; padding: 34px 22px; margin-bottom: 22px; overflow: hidden;
  background: linear-gradient(150deg, var(--g1), var(--g2));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.cover::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(18,14,11,.62), rgba(12,10,9,.9));
}
.cover > * { position: relative; z-index: 1; }
.cover-line { width: 46px; height: 1px; background: rgba(230,207,159,.45); }
.cover-emblem { width: 62px; height: 62px; color: var(--gold-soft); margin: 6px 0; }
.cover-name { font-size: 30px; letter-spacing: .3em; color: #f3e8d3; text-indent: .3em; }
.cover-el { font-family: var(--sans); font-size: 10px; letter-spacing: .24em; color: rgba(230,207,159,.66); }
.cover-no {
  position: absolute; top: 15px; right: 17px; z-index: 1;
  font-family: var(--sans); font-size: 9px; letter-spacing: .18em; color: rgba(230,207,159,.45);
}

.item-list { display: flex; flex-direction: column; gap: 15px; }
.item { border-left: 1px solid var(--gold); padding-left: 15px; }
.item-t { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.item-d { font-size: 14px; color: var(--ink-soft); line-height: 1.85; }

.pair { display: grid; gap: 12px; margin-top: 18px; }
.pair-col { background: #f8f2e6; border-radius: 12px; padding: 14px 16px; }
.pair-col h4 { font-size: 10px; font-family: var(--sans); letter-spacing: .2em; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.pair-col p { margin: 0; font-size: 14px; }
.motto {
  margin: 22px 0 0; padding: 18px; border-radius: 12px;
  background: #f6eddb; color: #7a5522; font-size: 15px; line-height: 1.85;
  border-left: 2px solid var(--gold);
}

.locked { position: relative; }
.locked-content {
  filter: blur(6px); opacity: .5; max-height: 190px; overflow: hidden;
  user-select: none; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
}
.locked-veil {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; padding: 6px 0 2px;
}
.lock-icon { width: 20px; height: 20px; color: var(--gold-deep); }
.locked-veil p { margin: 0; font-size: 13px; color: var(--ink-soft); max-width: 260px; }
.unlock-link { font-family: var(--sans); font-size: 13px; color: var(--gold-deep); border-bottom: 1px solid rgba(169,127,56,.35); padding-bottom: 2px; }
.unlock-link:hover { text-decoration: none; border-bottom-color: var(--gold-deep); }

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(247,241,230,.95); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.sticky-cta div { display: flex; flex-direction: column; line-height: 1.4; }
.sticky-cta strong { font-size: 14px; }
.sticky-cta span { font-family: var(--sans); font-size: 11px; color: var(--muted); }
.sticky-cta .btn { padding: 12px 20px; }
.report-foot { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 16px; }

/* ---------- forms / admin ---------- */
.center-block { max-width: 420px; margin: 9vh auto 0; }
.h1 { font-size: 26px; margin-bottom: 12px; letter-spacing: .06em; }
.stack { display: flex; flex-direction: column; gap: 12px; margin: 22px 0 18px; }
.input {
  width: 100%; padding: 14px 16px; font-family: var(--sans); font-size: 15px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink);
  outline: none; letter-spacing: .08em;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,161,92,.16); }
.input.narrow { max-width: 110px; }
.error { background: #fbeae6; color: #97301e; padding: 10px 14px; border-radius: 10px; font-size: 13px; font-family: var(--sans); }
.ok { background: #eef3e6; color: #3d5c2a; padding: 10px 14px; border-radius: 10px; font-size: 13px; font-family: var(--sans); }

.admin { padding-bottom: 40px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.stat span { display: block; font-size: 22px; font-weight: 600; }
.stat em { font-style: normal; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }
.inline-form .input { flex: 1; min-width: 120px; }
.table-wrap { overflow-x: auto; margin-top: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 12px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .08em; }
tr:last-child td { border-bottom: none; }
.small { font-size: 12px; color: var(--ink-soft); }
.tag-ok { color: #3d5c2a; background: #eef3e6; padding: 2px 8px; border-radius: 99px; }
.tag-idle { color: var(--muted); background: #f1ebdf; padding: 2px 8px; border-radius: 99px; }

/* disclaimer */
.fineprint { font-family: var(--sans); font-size: 11px; color: var(--muted); letter-spacing: .04em; margin: -4px 0 16px; }
.quiz-terms { font-family: var(--sans); font-size: 11px; color: var(--muted); text-align: center; margin: 26px 0 0; }
.disclaimer { margin-top: 20px; padding: 18px 18px 14px; background: #f6efe1; border-radius: 12px; }
.disclaimer h4 { font-family: var(--sans); font-size: 10px; letter-spacing: .2em; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.disclaimer p { font-size: 12px; line-height: 1.9; color: var(--muted); margin: 0 0 8px; }
.disclaimer p:last-child { margin-bottom: 0; }
.disclaimer a { font-family: var(--sans); font-size: 12px; }
.consent { display: flex; gap: 9px; align-items: flex-start; font-family: var(--sans); font-size: 12px; line-height: 1.7; color: var(--ink-soft); margin: 2px 0 4px; text-align: left; }
.consent input { width: 15px; height: 15px; margin-top: 3px; flex: 0 0 auto; accent-color: var(--gold-deep); }
.terms h2 { font-size: 15px; letter-spacing: .06em; margin: 26px 0 8px; }
.terms p, .terms li { font-size: 14px; line-height: 1.95; color: var(--ink-soft); }
.terms ol { margin: 0 0 14px; padding-left: 20px; }
.terms li { margin-bottom: 7px; }

@media (min-width: 760px) {
  .cards3 { grid-template-columns: repeat(3, 1fr); }
  .page { padding: 32px 30px; }
  .deck-card { width: 82px; height: 120px; }
  .sticky-cta { left: 50%; transform: translateX(-50%); max-width: 560px; border-radius: 16px 16px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal-up { opacity: 1; transform: none; }
}
