/* 烛照 — a night reading room: ink, vellum, gilt, ember, violet. Single dark theme. */

/* The Latin display face is served from this site. It used to come from Google
   Fonts, which mainland China cannot reach -- so every user there was reading
   Georgia. Latin subset only, about 21 KB a weight. */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("vendor/cg-500.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("vendor/cg-600.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url("vendor/cg-500i.woff2") format("woff2"); }

:root {
  --ink: #0f0e14;
  --ink-2: #16141d;
  --panel: #1c1925;
  --panel-2: #241f2f;
  --line: #2f2a3a;
  --vellum: #efe6d2;
  --muted: #9b9384;
  --gold: #d4af5a;
  --gold-2: #f0d48a;
  --ember: #e0663d;
  --ember-2: #ff8a5c;
  --jade: #6fbf9a;
  --violet: #3b2a5a;
  --mist: rgba(239, 230, 210, .08);
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --r: 14px;
  --cw: 92px;
  /* the printed Rider-Waite card is 2.75 x 4.75 inches; every card-shaped
     element uses this so the scans are never cropped or stretched */
  --card-ar: 0.58;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --latin: "Cormorant Garamond", "Georgia", serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--ink); color: var(--vellum);
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  background-image:
    radial-gradient(60% 40% at 50% -10%, rgba(212, 175, 90, .14), transparent 70%),
    radial-gradient(45% 32% at 92% 100%, rgba(59, 42, 90, .5), transparent 70%);
  background-attachment: fixed;
}
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; text-wrap: balance; line-height: 1.25; }
p { margin: 0; }
.latin { font-family: var(--latin); }
.num { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.center { text-align: center; }
.rowh { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.center-row { justify-content: center; }
.grow { flex: 1; }
.note { color: var(--muted); font-size: 12px; }
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-family: var(--latin); font-weight: 600; }

/* starfield */
.dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* frame */
.app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; min-height: 100dvh; padding-block: 0 104px; padding-inline: 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding-block: 14px 6px; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand h1 { font-size: 20px; letter-spacing: .04em; }
.brand .latin { color: var(--gold); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; }
.wallet { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 13px; }
.wallet b { color: var(--gold-2); font-family: var(--latin); font-size: 16px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.coin { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--gold-2), #8a6a25); display: inline-block; }
.view { display: none; flex-direction: column; gap: 18px; padding-block: 8px 0; }
.view.active { display: flex; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec-head h2 { font-size: 18px; }
.sec-head h3 { font-size: 15px; }
.sec-head .more { color: var(--muted); font-size: 13px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: rgba(224, 102, 61, .14); color: var(--ember-2); border: 1px solid rgba(224, 102, 61, .3); }
.tag.gold { background: rgba(212, 175, 90, .12); color: var(--gold-2); border-color: rgba(212, 175, 90, .35); }
.tag.jade { background: rgba(111, 191, 154, .12); color: var(--jade); border-color: rgba(111, 191, 154, .35); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 15px; transition: transform .12s ease, filter .12s ease; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--ember), #c44a26); color: #fff; box-shadow: 0 10px 24px rgba(224, 102, 61, .3); }
.btn.gold { background: linear-gradient(135deg, var(--gold-2), #b8913c); color: #241a05; }
.btn.ghost { border: 1px solid var(--line); color: var(--vellum); background: var(--panel); }
.btn.block { width: 100%; }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: default; }

/* home */
.hero { position: relative; padding: 22px 20px 20px; border-radius: 20px; background: linear-gradient(160deg, var(--panel-2), var(--ink-2)); border: 1px solid var(--line); overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 240px; height: 240px; border-radius: 50%; border: 1px solid rgba(212, 175, 90, .25); box-shadow: 0 0 0 24px rgba(212, 175, 90, .05), 0 0 0 48px rgba(212, 175, 90, .03); pointer-events: none; }
.hero h2 { font-size: 26px; margin-top: 8px; }
.hero h2 em { font-style: normal; color: var(--gold-2); }
.hero p { color: var(--muted); margin-top: 8px; max-width: 26ch; }
.hero .cta { margin-top: 16px; }
.ask { padding: 14px; border-radius: 16px; background: var(--mist); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.ask textarea { width: 100%; resize: none; background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--vellum); font-size: 15px; line-height: 1.5; }
.ask textarea::placeholder { color: #6a6455; }
.ask-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ask-row .note.warn { color: var(--ember-2); }
.hooks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hook { position: relative; text-align: left; padding: 14px 14px 12px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-height: 104px; transition: border-color .15s ease, transform .15s ease; }
.hook:hover { border-color: var(--gold); transform: translateY(-2px); }
.hook .q { font-family: var(--serif); font-size: 16px; font-weight: 700; line-height: 1.3; padding-right: 22px; }
.hook .hint { color: var(--muted); font-size: 12px; }
.hook .glyph { position: absolute; right: 12px; top: 10px; font-family: var(--latin); font-size: 22px; color: var(--gold); opacity: .8; }
.hook.wide { grid-column: 1 / -1; min-height: 0; }
.wall { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.wall-card { flex: 0 0 236px; scroll-snap-align: start; padding: 12px 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.wall-card .who { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.wall-card .txt { font-size: 13px; line-height: 1.55; }
/* product card styles parked 2026-09-19 — see _parked/shop-and-live-video.md */

/* sense + suggest */
.sense { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; }
.sense-ring { position: relative; width: 108px; height: 108px; }
.sense-ring span { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--gold); opacity: 0; animation: pulse 1.6s ease-out infinite; }
.sense-ring span:nth-child(2) { animation-delay: .5s; }
.sense-ring span:nth-child(3) { animation-delay: 1s; }
@keyframes pulse { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.sense-txt { font-family: var(--serif); font-size: 18px; letter-spacing: .08em; }
.suggest { display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 20px; border-radius: 20px; background: radial-gradient(70% 60% at 50% 0%, var(--violet), var(--ink-2)); border: 1px solid var(--line); }
.suggest h2 { font-size: 24px; color: var(--gold-2); }
.sg-q { padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px dashed var(--line); font-family: var(--serif); font-size: 15px; }
/* one spread per row: the old horizontal scroller clipped the first and last
   card, so people could not see what they were choosing between */
.spreads { display: flex; flex-direction: column; gap: 8px; }
.sp { width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n p" "m p"; column-gap: 12px; row-gap: 2px; align-items: center; }
.sp.on { border-color: var(--gold); background: rgba(212, 175, 90, .1); }
.sp .n { grid-area: n; font-family: var(--serif); font-size: 15px; font-weight: 700; }
.sp .m { grid-area: m; font-size: 12px; color: var(--muted); }
.sp .p { grid-area: p; color: var(--gold-2); font-family: var(--latin); font-size: 16px; font-weight: 600; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }

/* stage */
.stage { border-radius: 20px; background: radial-gradient(75% 60% at 50% 25%, var(--violet), var(--ink-2) 72%); border: 1px solid var(--line); padding: 16px 14px 18px; display: flex; flex-direction: column; gap: 14px; align-items: center; min-height: 420px; }
.stage-head { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.stage .question { font-family: var(--serif); font-size: 17px; }
.stage .sub { color: var(--muted); font-size: 13px; min-height: 1.4em; }
.calm { position: relative; display: grid; place-items: center; width: 100%; height: 220px; }
.calm .ring { position: absolute; width: 130px; height: 130px; border-radius: 50%; border: 1px solid var(--gold); box-shadow: 0 0 40px rgba(212, 175, 90, .25) inset; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.72); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }
.calm .count { font-family: var(--latin); font-size: 54px; color: var(--gold-2); }
.pile { position: relative; width: 100%; height: 200px; }
.pile .pcard { position: absolute; left: 50%; top: 40px; width: 58px; height: 94px; margin-left: -29px; transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.pile .spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 8px var(--gold-2); animation: spark 1.4s ease-out forwards; }
@keyframes spark { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.fan { position: relative; width: 100%; height: 230px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.fan::-webkit-scrollbar { display: none; }
.fan-track { position: relative; height: 100%; }
.fan .fcard { position: absolute; top: 26px; width: 72px; height: 124px; transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.2, .7, .2, 1), filter .2s ease, opacity .3s ease; padding: 0; }
.fan .fcard:hover { filter: brightness(1.25); }
.fan .fcard.taken { opacity: 0; pointer-events: none; }
.flyer { position: fixed; z-index: 70; pointer-events: none; transition: transform .38s cubic-bezier(.3, .7, .3, 1); filter: drop-shadow(0 0 14px rgba(240, 212, 138, .75)); }
.flyer > .tarot { width: 100%; height: 100%; aspect-ratio: auto; }
.intro-float { position: fixed; right: 12px; top: 54px; z-index: 60; color: var(--muted); font-size: 13px; padding: 6px 10px; background: rgba(22, 20, 29, .8); border-radius: 999px; border: 1px solid var(--line); }

/* slots */
.slots { display: flex; gap: 8px; justify-content: center; width: 100%; flex-wrap: wrap; }
.slots.n1 { --cw: 156px; }
.slots.n3 { --cw: 88px; }
.slots.n5 { --cw: 84px; display: grid; grid-template-columns: repeat(3, var(--cw)); justify-content: center; gap: 8px; }
.slots.n7 { --cw: 100%; display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.slots.n10 { --cw: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.slots.ring { display: block; position: relative; width: 100%; aspect-ratio: 1; margin-block: 20px 8px; --cw: 56px; }
.slots.ring .slot { position: absolute; width: var(--cw); transform: translate(-50%, -50%); }
.slot { width: var(--cw); max-width: 100%; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.slot .label { font-size: 11px; color: var(--muted); letter-spacing: .06em; line-height: 1.3; }
.slot.on .label { color: var(--gold-2); }
.slot .holder { width: 100%; aspect-ratio: var(--card-ar); border-radius: 8px; border: 1px dashed var(--line); display: grid; place-items: center; color: #3a3448; font-family: var(--latin); font-size: 18px; perspective: 900px; }
.slot.on .holder { border-color: var(--gold); box-shadow: 0 0 16px rgba(212, 175, 90, .25); }
.slot .holder.filled { border: 0; box-shadow: none; }
.slot .holder.cutbtn { padding: 0; position: relative; display: grid; }

/* card */
.tarot { width: 100%; aspect-ratio: var(--card-ar); position: relative; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.tarot.flipped { transform: rotateY(180deg); }
.tarot > div { position: absolute; inset: 0; border-radius: 8px; backface-visibility: hidden; overflow: hidden; }
.back { background: linear-gradient(160deg, #241d3a, #100e18); border: 1px solid var(--gold); display: grid; place-items: center; box-shadow: 0 8px 18px rgba(0, 0, 0, .5); }
.back svg { width: 100%; height: 100%; display: block; }
.face { transform: rotateY(180deg); transition: transform .5s cubic-bezier(.2, .7, .2, 1); background: linear-gradient(170deg, #f3ead6, #d9c9a3); border: 1px solid #b8913c; color: #2a2016; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 6px 4px; box-shadow: 0 10px 22px rgba(0, 0, 0, .5); }
.face.rev { transform: rotateY(180deg) rotate(180deg); }
.face .rn { font-family: var(--latin); font-size: 12px; letter-spacing: .1em; font-weight: 600; }
.face .art { flex: 1; width: 100%; display: grid; place-items: center; min-height: 0; }
.face .art svg { width: 78%; height: 100%; max-height: 100%; }
/* the fallback layout fills the face; the scan lies on top of it, edge to edge */
.face .fb { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 6px 5px 5px; }
.face .pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.face .nm { font-family: var(--serif); font-size: 12px; font-weight: 700; line-height: 1.2; }
.face .en { font-family: var(--latin); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; color: #6b5a3a; }
.sweep { position: absolute; inset: 0; border-radius: 8px; pointer-events: none; z-index: 3; background: linear-gradient(105deg, transparent 35%, rgba(255, 245, 200, .85) 50%, transparent 65%); background-size: 300% 100%; background-position: 130% 0; }
.sweep.go { animation: sweep .65s ease-out; }
@keyframes sweep { from { background-position: 130% 0; } to { background-position: -60% 0; } }
.slot .holder.filled .tarot-wrap { width: 100%; }

/* reading — free tier */
.reading { display: flex; flex-direction: column; gap: 14px; animation: rise .5s ease; }
@keyframes rise { from { transform: translateY(26px); opacity: 0; } }
.punch { position: relative; padding: 18px; border-radius: 16px; background: linear-gradient(135deg, rgba(59, 42, 90, .75), rgba(212, 175, 90, .12)); border: 1px solid rgba(240, 212, 138, .35); overflow: hidden; }
.punch .kwrap { display: flex; flex-direction: column; gap: 6px; }
.punch .kw { font-family: var(--serif); font-size: 34px; line-height: 1.1; color: var(--gold-2); font-weight: 700; min-height: 1.1em; }
.punch .kw.go { animation: gilt 1.1s ease-out both; }
.punch .kw.go::after { content: ""; position: absolute; left: -40%; top: 0; width: 40%; height: 100%; background: linear-gradient(105deg, transparent, rgba(255, 245, 200, .35), transparent); animation: gild 1.4s ease-out both; pointer-events: none; }
@keyframes gilt { from { font-weight: 400; letter-spacing: .3em; opacity: 0; } to { font-weight: 700; letter-spacing: 0; opacity: 1; } }
@keyframes gild { from { left: -45%; } to { left: 120%; } }
.punch .line { margin-top: 10px; font-size: 16px; line-height: 1.7; }
.punch .sign { color: var(--gold-2); font-size: 13px; }
.hookline { margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .28); border-left: 2px solid var(--gold); font-size: 13px; }
.rarity { margin-top: 8px; font-size: 12px; color: var(--muted); }
.punch .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.punch .actions .btn { flex: 1; min-width: 0; }
.unlock-btn { white-space: normal; text-align: center; line-height: 1.35; }

/* reading — paid tier */
.block { padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.block h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.prose { white-space: pre-wrap; line-height: 1.8; font-size: 15px; }
.prose.stream::after { content: "▍"; color: var(--gold); animation: blink 1s steps(2) infinite; }
.prose.skippable { cursor: pointer; }
.ai-mark { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; text-align: right; }
@keyframes blink { 50% { opacity: 0; } }
.video { position: relative; aspect-ratio: 9 / 12; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, #2a2438, #0f0e14); border: 1px solid var(--line); display: grid; place-items: center; }
.video .candle { position: absolute; bottom: 18%; width: 6px; height: 56px; background: linear-gradient(#f3ead6, #b8913c); border-radius: 3px; }
.video .flame { position: absolute; bottom: calc(18% + 56px); width: 14px; height: 24px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff5c2, var(--ember) 60%, transparent 72%); filter: blur(.5px); animation: flicker 1.6s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scaleX(1) translateY(0); } to { transform: scaleX(.85) translateY(-2px); } }
.video .play { position: relative; width: 62px; height: 62px; border-radius: 50%; background: rgba(239, 230, 210, .14); border: 1px solid rgba(239, 230, 210, .5); display: grid; place-items: center; font-size: 22px; }
.video .cap { position: absolute; left: 12px; right: 12px; bottom: 12px; font-size: 12px; color: var(--muted); text-align: center; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch .sw { width: 46px; height: 26px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); position: relative; flex: none; transition: background .2s ease; }
.switch .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background .2s ease; }
.switch .sw.on { background: rgba(212, 175, 90, .25); border-color: var(--gold); }
.switch .sw.on::after { transform: translateX(20px); background: var(--gold-2); }
.sub-line { font-size: 12px; color: var(--muted); text-align: center; text-decoration: underline; text-underline-offset: 3px; }

/* tasks */
.daily-card { flex-direction: row; gap: 14px; align-items: stretch; }
.daily-card .tarot-wrap { width: 96px; flex: none; }
.daily-card .text { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.daily-card .text h3 { font-size: 18px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week .d { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; font-size: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.week .d.on { background: rgba(212, 175, 90, .18); border-color: var(--gold); color: var(--gold-2); }
.week .d.today { outline: 2px solid var(--ember); outline-offset: -2px; }
.list { display: flex; flex-direction: column; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.list .item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14px; text-align: left; width: 100%; }
.list .item:first-child { border-top: 0; }
.list .item .r { color: var(--muted); font-size: 13px; flex: none; }
.task { align-items: center; }
.task .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.task .t .note { line-height: 1.4; }
.task .rowh { flex: none; gap: 8px; }
.task .rw { color: var(--gold-2); font-family: var(--latin); font-size: 15px; font-weight: 600; }
.task .done { color: var(--jade); font-size: 13px; }
.wheel-box { align-items: center; }
.wheel-box canvas { width: 260px; max-width: 100%; height: auto; }

/* me */
.me-head { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: linear-gradient(135deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); }
.me-name { font-weight: 600; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--gold-2), #8a6a25); display: grid; place-items: center; font-family: var(--latin); font-size: 24px; color: #241a05; font-weight: 600; }
.topup { padding: 16px; border-radius: 18px; border: 1px solid var(--gold); background: linear-gradient(150deg, rgba(212, 175, 90, .14), rgba(59, 42, 90, .3)); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 0 0 1px rgba(212, 175, 90, .15), var(--shadow); }
.topup .top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.topup .bal { font-family: var(--latin); font-size: 34px; color: var(--gold-2); font-weight: 600; line-height: 1; }
.topup .strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.topup .mini { flex: 0 0 auto; min-width: 104px; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; text-align: left; }
.topup .mini.hot { border-color: var(--gold); }
.topup .mini .pr { font-family: var(--latin); font-size: 20px; color: var(--vellum); font-weight: 600; }
.topup .mini .co { font-size: 13px; color: var(--gold-2); }
.topup .mini .gf { font-size: 11px; color: var(--jade); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.stat .v { font-family: var(--latin); font-size: 24px; color: var(--gold-2); font-weight: 600; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.stat .k { font-size: 12px; color: var(--muted); }
.invite { padding: 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(224, 102, 61, .2), rgba(212, 175, 90, .12)); border: 1px solid rgba(240, 212, 138, .35); display: flex; flex-direction: column; gap: 8px; }
.invite .code { font-family: var(--latin); font-size: 28px; letter-spacing: .2em; color: var(--gold-2); font-weight: 600; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan { padding: 12px 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; text-align: center; position: relative; }
.plan.best { border-color: var(--gold); background: rgba(212, 175, 90, .08); }
.plan .nm { font-family: var(--serif); font-weight: 700; font-size: 15px; }
.plan .pr { font-family: var(--latin); font-size: 22px; color: var(--gold-2); font-weight: 600; }
.plan .pr small { font-size: 12px; }
.plan .an { font-size: 11px; color: var(--jade); line-height: 1.4; }
.history .item .r { font-family: var(--latin); }

/* sheets, toast, poster */
.sheet-bg { position: fixed; inset: 0; background: rgba(6, 5, 10, .72); display: flex; align-items: flex-end; justify-content: center; z-index: 80; }
.sheet { position: relative; width: 100%; max-width: 480px; max-height: 88dvh; overflow: auto; background: var(--ink-2); border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 18px 18px 28px; display: flex; flex-direction: column; gap: 14px; animation: up .25s ease; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet h3 { font-size: 20px; }
.sheet .x { position: absolute; right: 14px; top: 12px; color: var(--muted); font-size: 22px; width: 32px; height: 32px; border-radius: 50%; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { text-align: left; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.opt.gold { border-color: var(--gold); background: rgba(212, 175, 90, .08); }
.opt .n { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-family: var(--latin); font-size: 13px; }
.opt .grow { display: flex; flex-direction: column; gap: 2px; }
.opt .t { font-weight: 600; font-size: 15px; }
.opt .d { font-size: 12px; color: var(--muted); }
.packs { display: flex; gap: 10px; overflow-x: auto; padding: 12px 2px 6px; }
.pack { position: relative; flex: 0 0 auto; width: 150px; text-align: left; padding: 14px 12px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.pack.on { border-color: var(--gold); background: rgba(212, 175, 90, .1); box-shadow: 0 0 0 1px var(--gold) inset; }
.pack .p { font-family: var(--latin); font-size: 26px; color: var(--vellum); font-weight: 600; line-height: 1.1; }
.pack .p small { font-size: 14px; }
.pack .c { font-size: 15px; color: var(--gold-2); font-weight: 600; }
.pack .g { color: var(--jade); font-size: 12px; }
.pack .v { color: var(--muted); font-size: 11px; }
.pack .v s { opacity: .8; }
.pack .badge { position: absolute; right: 8px; top: -9px; }
.pay-row { display: flex; gap: 8px; }
.pay-row .btn { flex: 1; }
.poster { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }
/* the cut card and the jumper take their place after the ritual box fades out;
   without this they pop in and read as a glitch rather than a reveal */
.xslot { animation: rise .42s cubic-bezier(.2, .7, .2, 1) both; }
.xs-note { display: block; margin-top: 4px; font-size: 11px; line-height: 1.4; color: var(--muted); text-align: center; }
/* the scan is left untouched, so the Chinese name sits under the card */
.cname { display: block; margin-top: 5px; min-height: 1.2em; font-family: var(--serif); font-size: 12px; font-weight: 700; line-height: 1.2; color: var(--vellum); text-align: center; }
.xslot:nth-child(2) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.crisis-lines { display: flex; flex-direction: column; gap: 8px; }
.crisis-line { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--mist); border: 1px solid var(--line); flex-wrap: wrap; }
.cl-num { font-family: var(--latin); font-size: 24px; font-weight: 600; color: var(--gold-2); text-decoration: none; letter-spacing: .04em; font-variant-numeric: lining-nums tabular-nums; }
.toast { position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%); background: var(--vellum); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); z-index: 90; animation: up .2s ease; max-width: 88vw; text-align: center; }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; pointer-events: none; padding: 0 16px 12px; z-index: 40; }
.tabs .bar { pointer-events: auto; width: 100%; max-width: 448px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(22, 20, 29, .94); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 18px; padding: 6px; box-shadow: var(--shadow); }
.tabs .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; color: var(--muted); font-size: 11px; }
.tabs .tab .ic { font-family: var(--latin); font-size: 18px; line-height: 1; }
.tabs .tab.on { color: var(--gold-2); background: rgba(212, 175, 90, .12); }

/* onboarding */
.intro { position: fixed; inset: 0; z-index: 100; background: radial-gradient(70% 50% at 50% 20%, #241b3d, var(--ink) 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 20px 40px; text-align: center; }
.intro .skip { position: absolute; right: 16px; top: 16px; color: var(--muted); font-size: 13px; padding: 6px 10px; }
.intro h2 { font-size: 24px; max-width: 18ch; }
.intro .lines { display: flex; flex-direction: column; gap: 14px; max-width: 22ch; }
.intro .lines p { font-family: var(--serif); font-size: 18px; opacity: 0; animation: fadein .8s ease forwards; }
@keyframes fadein { to { opacity: 1; } }
.intro .spray { position: relative; width: 100%; height: 210px; }
.intro .spray .fly { position: absolute; left: 50%; top: 50%; width: 76px; margin: -60px 0 0 -38px; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.intro .stagearea { width: 100%; max-width: 420px; }
.intro .btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .12s !important; }
  .dust { display: none; }
}
@media (max-width: 400px) {
  .hero h2 { font-size: 23px; }
  .punch .kw { font-size: 30px; }
  .app { padding-inline: 14px; }
}

/* ---------- v4: the ritual table ---------- */
:root { --cloth: #0b0a10; }
.stage { position: relative; overflow: hidden; background: var(--cloth); }
.stage > *:not(.cloth):not(.mute):not(.mute-tip) { position: relative; z-index: 1; }
.cloth { position: absolute; inset: 0; z-index: 0; pointer-events: none; transform: scaleX(.02); transform-origin: 50% 50%; transition: transform .8s cubic-bezier(.2, .7, .2, 1);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 3px),
    radial-gradient(120% 85% at 50% 38%, #16131f, #07060c 72%); }
.cloth.spread { transform: scaleX(1); }
.cloth .candle { position: absolute; right: 24px; bottom: 16px; width: 6px; height: 42px; border-radius: 3px; background: linear-gradient(#f3ead6, #b8913c); }
.cloth .flame { position: absolute; right: 27px; bottom: 58px; width: 12px; height: 20px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff5c2, var(--ember) 60%, transparent 72%); filter: blur(.4px); animation: flicker 1.6s ease-in-out infinite alternate; }
.mute { position: absolute; right: 10px; top: 10px; z-index: 3; width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); color: var(--gold-2); font-size: 13px; }
.mute.off { color: var(--muted); }
.mute-tip { position: absolute; right: 48px; top: 14px; z-index: 3; font-size: 11px; color: var(--muted); background: rgba(0, 0, 0, .55); padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); }
.stage .sub small { display: block; font-size: 11px; color: #6f6858; margin-top: 3px; }
.ritual { position: relative; width: 100%; min-height: 264px; display: grid; place-items: center; }
.rs-card .back, .sc .back, .cp-card .back, .press-card .back, .xslot .back { position: absolute; inset: 0; }

/* act 1: the querent knocks three times */
.knock-wrap { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.rit-stack { position: relative; width: 92px; height: 159px; }
.rit-stack .rs-card { position: absolute; inset: 0; }
.knockpad { display: block; padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.knockpad.hit { animation: knockhit .26s ease-out; }
@keyframes knockhit { 0% { transform: translateY(0) scale(1); } 34% { transform: translateY(4px) scale(.972); } 100% { transform: translateY(0) scale(1); } }
.knockpad.wait .rs-card { animation: knockwait 2.6s ease-in-out infinite; border-radius: 8px; }
@keyframes knockwait { 0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 90, 0); } 50% { box-shadow: 0 0 20px 1px rgba(212, 175, 90, .3); } }
.knockpad.sealed { cursor: default; }
.knock { position: absolute; left: -8px; right: -8px; top: 0; height: 6px; opacity: 0; background: linear-gradient(90deg, transparent, rgba(255, 245, 200, .95), transparent); }
.knock.go { animation: knockdown .42s ease-out; }
@keyframes knockdown { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(157px); } }
.knock-dots { display: flex; gap: 10px; }
.knock-dots i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--line); transition: background .3s ease, border-color .3s ease, box-shadow .3s ease; }
.knock-dots i.on { background: var(--gold); border-color: var(--gold-2); box-shadow: 0 0 10px rgba(212, 175, 90, .75); }

/* act 2: the press */
.press { position: relative; width: 156px; height: 196px; display: grid; place-items: center; padding: 0;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.press-card { position: absolute; width: 98px; height: 169px; transition: filter .25s ease; }
.press.holding .press-card { animation: breathe2 3s ease-in-out infinite; }
@keyframes breathe2 { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.press.flash .press-card { filter: drop-shadow(0 0 24px rgba(240, 212, 138, .95)) brightness(1.35); }
.press-ring { position: absolute; width: 154px; height: 154px; transform: rotate(-90deg); pointer-events: none; }
.pr-track { fill: none; stroke: rgba(239, 230, 210, .14); stroke-width: 4; }
.pr-bar { fill: none; stroke: var(--gold-2); stroke-width: 4; stroke-linecap: round; }
.press.snap .pr-bar { transition: stroke-dashoffset .4s ease; }
.press-glow { position: absolute; inset: 0; pointer-events: none; border-radius: 12px; }
.press.holding .press-glow { background: radial-gradient(42% 30% at 50% 62%, rgba(240, 212, 138, .28), transparent 72%); }
.pspark { position: absolute; left: 50%; top: 62%; width: 4px; height: 4px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 8px var(--gold-2); animation: psink .9s ease-out forwards; }
@keyframes psink { from { transform: translate(var(--x), var(--y)) scale(1); opacity: .95; } to { transform: translate(calc(var(--x) * .18), calc(var(--y) * .18 - 12px)) scale(.15); opacity: 0; } }

/* act 3: mahjong wash */
.wash { position: relative; width: 100%; height: 210px; display: grid; place-items: center; }
.wash .sc { position: absolute; width: 46px; height: 79px; will-change: transform; }
.wash .sc.jumped { z-index: 4; filter: drop-shadow(0 0 14px rgba(240, 212, 138, .8)); }
.wash .sc.jumped .face { position: absolute; inset: 0; transform: none; }

/* act 4: the cut */
.cuts { display: flex; gap: 12px; justify-content: center; align-items: flex-end; padding-bottom: 22px; }
.cutpile { position: relative; width: 76px; height: 131px; padding: 0; transition: transform .4s cubic-bezier(.2, .7, .2, 1), opacity .4s ease, filter .4s ease; }
.cutpile .cp-card { position: absolute; inset: 0; }
.cutpile .cp-label { position: absolute; left: 0; right: 0; bottom: -20px; font-size: 12px; color: var(--muted); }
.cuts.stacking .cutpile { transform: translateY(8px) scale(.94); opacity: .5; }
.cuts.stacking .cutpile.chosen { transform: translateY(-18px) scale(1.06); opacity: 1; z-index: 3; filter: drop-shadow(0 0 16px rgba(240, 212, 138, .65)); }

/* acts 5-7 */
/* wide enough that every one of the 24 cards keeps a tappable strip */
.stage .fan { margin-inline: -14px; width: calc(100% + 28px); height: 192px;
  transition: height .5s cubic-bezier(.2, .7, .2, 1), opacity .45s ease;
  /* the deck fades out at both edges rather than stopping dead, so the cut-off
     cards read as "it keeps going" instead of "it is broken" */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%); }
/* the last card is out: the spread is swept off the table */
.stage .fan.gathered { height: 60px; opacity: 0; pointer-events: none; }
.fanbar { position: relative; width: 116px; height: 3px; border-radius: 99px; background: rgba(239, 230, 210, .13); margin-top: -4px; }
.fanbar i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--gold); opacity: .8; transition: left .12s linear; }
/* at 77 cards each one shows only a sliver of its neighbour, so every card casts
   a shadow onto the one beneath: that edge is what reads as a stack of cards
   rather than a row of gold lines */
.fan .fcard .back { transition: transform .18s ease, filter .18s ease; box-shadow: -5px 0 9px rgba(0, 0, 0, .62); }
.fan .fcard.lift { z-index: 5; }
.fan .fcard.lift .back { transform: translateY(-18px) scale(1.07); filter: brightness(1.4) drop-shadow(0 0 14px rgba(240, 212, 138, .7)); }
.fan .fcard.chosen .back { filter: brightness(1.5); }
.extras { display: flex; gap: 12px; justify-content: center; width: 100%; flex-wrap: wrap; }
.xslot { width: 80px; }
.flip-hint { font-size: 12px; color: var(--gold-2); text-align: center; padding: 6px 10px; border: 1px dashed rgba(240, 212, 138, .35); border-radius: 10px; }
.face.bounce { animation: revbounce .5s ease; }
@keyframes revbounce { 0% { transform: rotateY(180deg) rotate(180deg) scale(1); } 45% { transform: rotateY(180deg) rotate(180deg) scale(1.07); } 100% { transform: rotateY(180deg) rotate(180deg) scale(1); } }

.xrow { display: flex; gap: 10px; }
.xcard { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.xc-card { width: 44px; flex: none; }
.xc-txt { min-width: 0; }
.xc-t { font-size: 13px; font-weight: 600; }
.xc-t b { color: var(--gold-2); font-family: var(--serif); font-size: 15px; }

/* ---------- v3: locked decoy preview ---------- */
.decoy { position: relative; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; user-select: none; -webkit-user-select: none; }
.decoy-top { display: flex; align-items: center; gap: 8px; }
.decoy-lock { width: 20px; height: 20px; color: var(--gold); display: inline-grid; place-items: center; flex: none; }
.decoy-lock svg { width: 100%; height: 100%; }
.dl { font-size: 14px; line-height: 1.75; margin: 0; }
.dl-head { color: var(--vellum); }
.dl-blur { filter: blur(4.5px); opacity: .7; pointer-events: none; }
.decoy-foot { font-size: 12px; color: var(--gold-2); border-top: 1px dashed var(--line); padding-top: 8px; }

/* ---------- v3: share nudge bar ---------- */
.sharebar { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 30px 12px 14px; border-radius: 16px; border: 1px solid rgba(240, 212, 138, .35); background: linear-gradient(120deg, rgba(212, 175, 90, .16), rgba(59, 42, 90, .55)); transform: translateY(16px); opacity: 0; transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .45s ease; }
.sharebar.in { transform: none; opacity: 1; }
.sb-txt { flex: 1; min-width: 0; }
.sb-title { font-family: var(--serif); font-weight: 700; font-size: 15px; }
.sb-plats { display: flex; gap: 6px; flex: none; }
.plat { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 36px; }
.plat > span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--gold-2); font-size: 13px; font-weight: 600; transition: border-color .15s ease; }
.plat i { font-style: normal; font-size: 10px; color: var(--muted); }
.plat:hover > span { border-color: var(--gold); }
.sb-x { position: absolute; right: 4px; top: 2px; width: 26px; height: 26px; color: var(--muted); font-size: 18px; }

/* ---------- v3: share panel ---------- */
.ptabs { display: flex; gap: 6px; }
.ptab { flex: 1; padding: 8px 4px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.ptab.on { border-color: var(--gold); background: rgba(212, 175, 90, .12); color: var(--gold-2); }
.copybox { width: 100%; background: var(--panel); color: var(--vellum); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; line-height: 1.65; resize: vertical; }
.guide { padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; }
.reward-pop { position: fixed; inset: 0; z-index: 95; background: rgba(6, 5, 10, .72); display: grid; place-items: center; padding: 24px; }
.rp-card { width: 100%; max-width: 300px; padding: 20px; border-radius: 18px; background: var(--ink-2); border: 1px solid var(--gold); text-align: center; display: flex; flex-direction: column; gap: 6px; animation: up .25s ease; }
.rp-total { font-family: var(--latin); font-size: 46px; color: var(--gold-2); font-weight: 600; line-height: 1; }
.rp-list { list-style: none; margin: 6px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

/* ---------- v3: share board + landing page ---------- */
.board { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.bd { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.bd.me { border-color: var(--gold); background: rgba(212, 175, 90, .1); }
.bd-n { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: rgba(212, 175, 90, .15); color: var(--gold-2); }
.bd-name { white-space: nowrap; }
.landing { display: flex; flex-direction: column; gap: 14px; }
.land-q { font-family: var(--serif); font-size: 20px; }
.land-cards { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.lc { width: 72px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.lc .tarot-wrap { width: 100%; }
.stats { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 10px 6px; }
.stat .v { font-size: 20px; }
.stat .k { font-size: 11px; }
