/* =====================================================================
   夜局 · Midnight Parlour
   深酒红 × 近黑 × 香槟金。所有模式共用下面的变量；模式 CSS 只用变量就能拿到整体风格。
   ===================================================================== */
:root {
  /* 底色 */
  --bg: #0b0609;            /* 页面近黑 */
  --bg2: #150a10;           /* 次级底色 / 输入框 */
  --card: #1b0e15;          /* 卡片 / 按钮底 */
  --card2: #26121c;         /* 卡片高光端 */
  --line: #3a2229;          /* 细边线 */
  --line2: #5a3a2e;         /* 带金调的边线（强调） */
  --text: #f4e8dc;          /* 象牙白 */
  --mute: #a68d88;          /* 次要文字 */
  /* 强调 */
  --accent: #d93a5e;        /* 玫瑰绯红 */
  --accent2: #8c1534;       /* 深绯红 */
  --wine: #4a0f22;          /* 酒红 */
  --gold: #d9b26f;          /* 香槟金 */
  --gold2: #f3dcaa;         /* 浅金 / 高光 */
  --gold3: #9a6c2e;         /* 暗金 */
  --goldg: linear-gradient(135deg, #fbe8bd 0%, #dcb169 45%, #9a6c2e 100%);
  /* 尺度：浅玫瑰 → 绯红 → 血红 */
  --l1: #efb1bd; --l2: #e6809a; --l3: #dc5274; --l4: #c22a4f; --l5: #a3123a;
  /* 字体 */
  --serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", "Source Han Serif", serif;
  --latin: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  /* 形 */
  --r: 18px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --shadow: 0 18px 40px -18px #000c, 0 2px 0 #ffffff06 inset;
  --glow: 0 0 40px -6px #d93a5e55;
  color-scheme: dark;
}
.lv1 { --lc: var(--l1); } .lv2 { --lc: var(--l2); } .lv3 { --lc: var(--l3); } .lv4 { --lc: var(--l4); } .lv5 { --lc: var(--l5); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15.5px/1.6 var(--sans);
  min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums;
  background:
    radial-gradient(90% 45% at 50% -8%, #5a1229 0%, #2a0915 38%, transparent 72%),
    radial-gradient(70% 40% at 85% 108%, #3a0c1d 0%, transparent 70%),
    radial-gradient(60% 35% at 0% 70%, #24101466 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
/* 丝绒颗粒 + 暗角 */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; }
body::before {
  opacity: .07; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after { background: radial-gradient(120% 90% at 50% 40%, transparent 55%, #000a 100%); }
::selection { background: #d93a5e66; }

#app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 4px) max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
main { display: flex; flex-direction: column; gap: 14px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
b, strong { font-weight: 600; }
a { color: inherit; }

/* ---------- 按钮 ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
button {
  position: relative;
  background: linear-gradient(180deg, #ffffff0b, #ffffff02 60%), var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
  cursor: pointer; color: var(--text); letter-spacing: .02em;
  transition: transform .18s var(--ease), background .25s, border-color .25s, box-shadow .25s, opacity .2s;
}
button:hover { border-color: var(--line2); }
button:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: default; }
button:disabled:active { transform: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.primary {
  background: linear-gradient(180deg, #c4304f 0%, #921737 52%, #650c25 100%);
  border: 1px solid #e5b9784d; color: #fff3e3; font-weight: 600; letter-spacing: .1em;
  box-shadow: inset 0 1px 0 #ffffff33, inset 0 -1px 0 #0006, 0 10px 26px -12px #c2224acc;
  text-shadow: 0 1px 0 #0005;
}
.primary:hover { border-color: #e5b978aa; }
.danger {
  background: radial-gradient(120% 140% at 50% 0%, #6d1028 0%, #2a0510 70%);
  border: 1px solid #d93a5e66; color: #ffe9ea; box-shadow: 0 0 34px -8px #d93a5e88, inset 0 1px 0 #ffffff1c;
}
.big { font-size: 17px; padding: 16px; width: 100%; border-radius: 16px; }
.ghost { background: none; border: 0; padding: 8px 10px; font-size: 18px; color: var(--mute); box-shadow: none; }
.ghost:hover { color: var(--gold2); }
.small, .ghost.small { font-size: 13px; padding: 6px 10px; }
.gold { background: var(--goldg); color: #2a1408; border: 0; font-weight: 700; box-shadow: inset 0 1px 0 #fff8, 0 10px 26px -12px #d9b26faa; }
.hint { color: var(--mute); text-align: center; margin: 0; font-size: 13.5px; letter-spacing: .02em; }
.pa { color: var(--gold2); } .pb { color: #f2a0b4; } .pc { color: #c9b3f0; }
.pa, .pb, .pc { font-weight: 600; }
.eyebrow { font: italic 500 13px/1 var(--latin); letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.orn { display: flex; align-items: center; gap: 10px; color: var(--gold); opacity: .7; font-size: 10px; }
.orn::before, .orn::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold3)); }
.orn::after { transform: scaleX(-1); }

/* ---------- 顶栏 ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0 10px; }
.bar h2 { font: 600 17px/1.2 var(--serif); letter-spacing: .22em; text-align: center; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(180deg, var(--gold2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bar > span { width: 40px; flex: none; }
.bar .ghost { width: 40px; height: 40px; flex: none; padding: 0; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: #ffffff06; color: var(--gold); font-size: 22px; line-height: 1; }
.bar .ghost svg { width: 18px; height: 18px; }
.safe { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px;
  font-size: 11.5px; color: var(--mute); letter-spacing: .06em; text-align: center; padding: 7px 12px; margin-bottom: 16px;
  border-radius: 999px; background: #ffffff05; border: 1px solid #ffffff0a; }
.safe b { color: var(--gold2); font-weight: 500; }
.safe > i { width: 3px; height: 3px; border-radius: 50%; background: var(--gold3); flex: none; }

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 34px 0 22px; display: flex; flex-direction: column; align-items: center; }
.emblem { width: 96px; height: 96px; filter: drop-shadow(0 0 22px #d9b26f40); }
.emblem svg { width: 100%; height: 100%; display: block; overflow: visible; }
.emblem .shine { animation: twinkle 3.6s ease-in-out infinite; transform-origin: 84px 28px; transform-box: view-box; }
.hero h1, .gate h1 {
  font: 900 56px/1.05 var(--serif); letter-spacing: .32em; margin: 10px 0 0 .32em;
  background: linear-gradient(180deg, #fff2d6 0%, #e6c180 48%, #a8783a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 18px #d9b26f2e);
}
.sub { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; }
.sub em { font: italic 500 13px/1 var(--latin); letter-spacing: .5em; margin-left: .5em; color: var(--gold); text-transform: uppercase; }
.sub span { font: 500 13px/1.4 var(--serif); letter-spacing: .3em; color: var(--mute); margin-left: .3em; }
.hero p { color: var(--mute); margin: 18px 0 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.who { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border-radius: 999px; font-size: 13px; color: var(--text);
  background: #ffffff07; border: 1px solid #ffffff10; }
.pill { border-radius: 999px; padding: 9px 16px 9px 12px; font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px;
  background: #ffffff06; border: 1px solid color-mix(in srgb, var(--lc, var(--gold)) 55%, transparent); }
.pill .lvd { width: 8px; height: 8px; border-radius: 50%; background: var(--lc, var(--gold)); box-shadow: 0 0 10px var(--lc, var(--gold)); }
.pill small { color: var(--mute); font-size: 12px; }
.pill .set { color: var(--gold); padding-left: 10px; border-left: 1px solid var(--line); }
.foot { text-align: center; color: var(--mute); font-size: 11.5px; letter-spacing: .08em; margin-top: 30px; opacity: .8; }
.foot .ghost { color: var(--gold); }

.cat { display: flex; align-items: baseline; gap: 10px; margin: 16px 2px 0; font: 600 15px/1.3 var(--serif); letter-spacing: .24em; color: var(--text); }
.cat::after { content: ""; flex: 1; height: 1px; align-self: center; background: linear-gradient(90deg, var(--line2), transparent); }
.cat em { order: 2; font: italic 500 12px/1 var(--latin); letter-spacing: .28em; color: var(--gold); text-transform: uppercase; }
.cat span { order: 1; }
.cat::after { order: 3; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 15px 14px 14px; min-height: 132px; overflow: hidden;
  border-radius: var(--r); border: 1px solid #ffffff10;
  background:
    radial-gradient(120% 80% at 100% 0%, #d9b26f12, transparent 55%),
    linear-gradient(165deg, #261019 0%, #160a10 100%);
  box-shadow: var(--shadow);
}
.mode::after { content: ""; position: absolute; inset: 5px; border-radius: 14px; border: 1px solid #d9b26f14; pointer-events: none; }
.mode:hover { border-color: #d9b26f40; }
.mode .ic { width: 42px; height: 42px; margin-bottom: 10px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: var(--gold2);
  background: radial-gradient(circle at 35% 30%, #3a1a24, #140a0e); border: 1px solid #d9b26f55; box-shadow: 0 0 18px -4px #d9b26f40, inset 0 1px 0 #ffffff14; }
.mode .ic svg { width: 21px; height: 21px; }
.mode .ic.emo { filter: saturate(.75); }
.mode b { font: 600 16px/1.35 var(--serif); letter-spacing: .06em; }
.mode small { color: var(--mute); font-size: 12px; line-height: 1.45; }
.mode em { position: absolute; top: 14px; right: 14px; font: italic 600 12px/1 var(--latin); color: var(--gold); letter-spacing: .06em;
  padding: 4px 7px; border-radius: 999px; border: 1px solid #d9b26f40; }
.mode .lock { font-style: normal; font-size: 12px; margin-left: 4px; opacity: .8; }
.mode:last-child:nth-child(odd) { grid-column: span 2; min-height: auto; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-content: center; padding: 16px; }
.mode:last-child:nth-child(odd) .ic { grid-row: span 2; margin: 0; }
.mode.dim { opacity: .42; filter: saturate(.6); }
.modes.c-hot .mode { background: radial-gradient(120% 90% at 100% 0%, #d93a5e2a, transparent 60%), linear-gradient(165deg, #34101e, #170810); }
.modes.c-hot .mode .ic { border-color: #d93a5e88; color: #ffc2cf; }
.modes.c-couple .mode { background: radial-gradient(120% 90% at 100% 0%, #e6809a1c, transparent 60%), linear-gradient(165deg, #2b1019, #160a10); }
.modes.c-board .mode { background: radial-gradient(120% 90% at 100% 0%, #d9b26f22, transparent 60%), linear-gradient(165deg, #2a1418, #150a0e); }

/* ---------- 年龄门 ---------- */
.gate { position: relative; overflow: hidden; min-height: calc(100dvh - 40px); min-height: calc(100vh - 40px); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; text-align: center; padding: 30px 8px; }
.gate::before { content: ""; position: absolute; left: 50%; top: 30%; width: 380px; height: 380px; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, #d9b26f22 0%, #a3123a1c 35%, transparent 70%); animation: breathe 6s ease-in-out infinite; pointer-events: none; }
.gate .emblem { width: 112px; height: 112px; }
.gate h1 { font-size: 64px; margin-top: 4px; }
.gate .seal { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-variant-numeric: lining-nums; margin: 8px 0 4px;
  font: 600 20px/1 var(--latin); color: var(--gold2); border: 1px solid var(--gold3); box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 4px #d9b26f40; }
.gate .seal sup { font-size: 12px; }
.gate p { color: var(--mute); margin: 0; font-size: 14px; line-height: 1.8; max-width: 320px; }
.gate p b { color: var(--text); }
.gate .primary { margin-top: 14px; max-width: 340px; }
.leave { color: var(--mute); font-size: 13px; letter-spacing: .2em; text-decoration: none; padding: 8px 16px; opacity: .7; }
.rise { opacity: 0; animation: rise 1s var(--ease) forwards; animation-delay: var(--d, 0s); }
.gate h1.rise { animation-name: unblur; animation-duration: 1.6s; }

/* ---------- 设置 ---------- */
section { position: relative; background: linear-gradient(170deg, #22101a, #150a10); border: 1px solid #ffffff0e; border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
section h3 { display: flex; align-items: baseline; gap: 10px; font: 600 15.5px/1.3 var(--serif); letter-spacing: .14em; }
section h3 em { font: italic 600 14px/1 var(--latin); color: var(--gold); letter-spacing: .1em; }
section h3 small { color: var(--mute); font: 400 12px var(--sans); letter-spacing: .02em; margin-left: auto; }
.prow { display: flex; align-items: center; gap: 8px; }
.dot, .prow > i, .turn i, .plist i { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; box-shadow: 0 0 0 2px #0007, 0 0 10px -1px #fff3; }
.prow input { flex: 1; min-width: 0; }
input, select, textarea { background: #0c0609; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; transition: border-color .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--gold3); outline: none; }
input::placeholder, textarea::placeholder { color: #6f5a58; }
select { max-width: 40%; appearance: none; -webkit-appearance: none; padding-right: 26px;
  background: #0c0609 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23d9b26f' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 10px center; }
.add { border-style: dashed; color: var(--mute); }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: #0a0507; border: 1px solid var(--line); }
.seg > button { flex: 1; border: 0; background: none; border-radius: 12px; padding: 11px 10px; color: var(--mute); box-shadow: none; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.seg > button small { font-size: 11px; opacity: .75; letter-spacing: .04em; }
.seg > button b { font: 600 15px/1.3 var(--serif); letter-spacing: .14em; }
.seg > button.on { color: var(--gold2); background: linear-gradient(180deg, #4a1426, #2a0b16); box-shadow: inset 0 0 0 1px #d9b26f40, 0 6px 18px -8px #000; }
.seg.col { flex-direction: column; }
.seg.col > button { flex-direction: row; justify-content: space-between; text-align: left; padding: 12px 14px; }
.seg.col > button::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line2); flex: none; }
.seg.col > button.on::after { border-color: var(--gold); background: radial-gradient(circle, var(--gold) 0 4px, transparent 5px); }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper span { flex: 1; color: var(--text); font: 500 15px var(--serif); letter-spacing: .1em; }
.stepper button { width: 38px; height: 38px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 18px; color: var(--gold); background: #ffffff06; border-color: #d9b26f40; }
.stepper b { min-width: 30px; text-align: center; font: 600 22px/1 var(--serif); color: var(--gold2); font-variant-numeric: tabular-nums; }

.pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.heart { color: var(--accent); font-size: 12px; text-shadow: 0 0 12px #d93a5e; }
.pin { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 4px 4px 10px; border-radius: 14px; background: #0c0609; border: 1px solid var(--line); }
.pin:focus-within { border-color: var(--gold3); }
.pin input { flex: 1; min-width: 0; width: 100%; background: none; border: 0; padding: 8px 2px; font-size: 15px; }
.gbtn { width: 32px; height: 32px; padding: 0; flex: none; border-radius: 50%; font-size: 15px; display: grid; place-items: center; }
.gbtn.m { color: #a9c0ec; border-color: #a9c0ec55; background: #a9c0ec12; }
.gbtn.f { color: var(--l2); border-color: #e6809a66; background: #e6809a14; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.levels { display: flex; flex-direction: column; gap: 8px; }
.lv { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 11px 14px 11px 12px;
  background: #0d0709; border-color: var(--line); }
.lv::before { content: ""; grid-row: span 2; width: 4px; align-self: stretch; border-radius: 4px; background: var(--lc); opacity: .55; }
.lv b { font: 600 15px/1.35 var(--serif); letter-spacing: .08em; }
.lv small { color: var(--mute); font-size: 12px; grid-column: 2; }
.lv.on { border-width: 1px; border-color: var(--lc); background: linear-gradient(90deg, color-mix(in srgb, var(--lc) 22%, transparent), transparent 80%), #120a0d;
  box-shadow: 0 0 24px -10px var(--lc), inset 0 1px 0 #ffffff10; }
.lv.on::before { opacity: 1; box-shadow: 0 0 10px var(--lc); }
.lv.on b { color: #fff; }
.lv1.on, .pill.lv1 { border-color: var(--l1); } .lv2.on, .pill.lv2 { border-color: var(--l2); }
.lv3.on, .pill.lv3 { border-color: var(--l3); } .lv4.on, .pill.lv4 { border-color: var(--l4); }
.lv5.on, .pill.lv5 { border-color: var(--l5); }
.lv5.on { background: linear-gradient(90deg, #a3123a40, #3a0a16 80%); }

.switch { display: flex; gap: 12px; align-items: center; font-size: 13.5px; color: var(--mute); line-height: 1.45; cursor: pointer; }
.switch input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; padding: 0; border-radius: 999px; position: relative;
  background: #0c0609; border: 1px solid var(--line2); transition: background .25s, border-color .25s; cursor: pointer; }
.switch input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--mute); transition: transform .25s var(--ease), background .25s; }
.switch input[type=checkbox]:checked { background: linear-gradient(180deg, #a01d3e, #5e0c23); border-color: #d9b26f66; }
.switch input[type=checkbox]:checked::after { transform: translateX(18px); background: var(--gold2); box-shadow: 0 0 10px #d9b26f88; }

.switch span { color: var(--text); } .switch span small { color: var(--mute); font-size: 12px; }
.setup-head { text-align: center; margin: -2px 0 14px; display: flex; flex-direction: column; gap: 6px; }
.field input { color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--mute); letter-spacing: .08em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border-radius: 999px; padding: 7px 14px; font-size: 13.5px; background: #0d0709; }
.chip.pick { border-color: var(--gold); color: var(--gold); background: #d9b26f14; }
.chip.on { background: #2a0811; border-color: #d93a5e66; text-decoration: line-through; text-decoration-color: var(--accent); color: #8c6f70; }

/* ---------- 游戏通用 ---------- */
.turn { display: flex; align-items: center; justify-content: center; gap: 9px; font: 600 19px/1.3 var(--serif); letter-spacing: .08em; padding: 2px 0; }
.turn small { font: 500 12.5px/1 var(--serif); color: var(--mute); letter-spacing: .3em; margin-right: 2px; }
.turn i { width: 9px; height: 9px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.pick { height: 216px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 20px; overflow: hidden; border: 1px solid #d9b26f40;
  box-shadow: 0 24px 40px -22px #000, inset 0 1px 0 #ffffff1c; animation: deal .7s var(--ease) both; }
.pick::before { content: ""; position: absolute; inset: 7px; border-radius: 14px; border: 1px solid #d9b26f3a; pointer-events: none; }
.pick::after { content: "◆"; position: absolute; bottom: 18px; font-size: 8px; color: var(--gold); opacity: .6; }
.pick em { font: italic 500 14px/1 var(--latin); letter-spacing: .34em; margin-left: .34em; text-transform: uppercase; color: var(--gold); }
.pick b { font: 700 28px/1.2 var(--serif); letter-spacing: .18em; margin-left: .18em; color: #fff3e3; }
.pick small { font-size: 12px; color: #ffffffa0; letter-spacing: .1em; }
.pick.t { background: radial-gradient(100% 70% at 50% 0%, #6a3d78 0%, transparent 70%), linear-gradient(165deg, #34193d, #120815); }
.pick.d { background: radial-gradient(100% 70% at 50% 0%, #d93a5e88 0%, transparent 70%), linear-gradient(165deg, #7a1430, #22050e); animation-delay: .08s; }
.fate { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--gold2); background: #ffffff05; border-color: #d9b26f33; }
.fate svg { width: 16px; height: 16px; }

/* —— 任务卡：主角 —— */
.card { position: relative; background: linear-gradient(170deg, var(--card2), #12080d); border: 1px solid #ffffff10; border-radius: 22px; padding: 22px; text-align: center;
  box-shadow: var(--shadow); animation: rise .5s var(--ease) both; }
.card.task {
  --lc: var(--gold);
  overflow: hidden; padding: 30px 24px 24px; min-height: 230px; display: flex; flex-direction: column; justify-content: center;
  border: 1px solid var(--gold3); border-color: color-mix(in srgb, var(--lc) 50%, var(--gold));
  background:
    radial-gradient(110% 60% at 50% 0%, color-mix(in srgb, var(--lc) 26%, transparent) 0%, transparent 70%),
    radial-gradient(90% 50% at 50% 110%, #d9b26f12 0%, transparent 70%),
    linear-gradient(172deg, #241019 0%, #130910 100%);
  box-shadow: 0 30px 60px -28px color-mix(in srgb, var(--lc) 70%, transparent), 0 0 0 1px #00000080, inset 0 1px 0 #ffffff14;
  animation: flipIn .8s var(--ease) both; transform-origin: 50% 60%;
}
.card.task.lv1 { --lc: var(--l1); } .card.task.lv2 { --lc: var(--l2); } .card.task.lv3 { --lc: var(--l3); } .card.task.lv4 { --lc: var(--l4); } .card.task.lv5 { --lc: var(--l5); }
/* 金箔内框 */
.card.task::before { content: ""; position: absolute; inset: 8px; border-radius: 15px; pointer-events: none;
  border: 1px solid #d9b26f50; box-shadow: inset 0 0 0 3px #00000030, inset 0 0 0 4px #d9b26f18; }
/* 揭晓时的一道光 */
.card.task::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, #fff4dc1c 45%, #fff4dc33 50%, #fff4dc1c 55%, transparent 100%);
  transform: translateX(-160%) skewX(-12deg); animation: sheen 1.6s .55s var(--ease) forwards; }
.card.task.lv5 { animation: flipIn .8s var(--ease) both, ember 3.2s 1s ease-in-out infinite; }
.card .tag { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--mute); letter-spacing: .2em; }
.card.task .tag { position: relative; z-index: 1; color: var(--gold); font-family: var(--serif); }
.tag .kind { color: var(--gold2); }
.tag .lvn { color: color-mix(in srgb, var(--lc) 70%, #fff); }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 5px; height: 5px; transform: rotate(45deg); border: 1px solid color-mix(in srgb, var(--lc) 80%, #fff); opacity: .5; }
.pips i.on { background: var(--lc); opacity: 1; box-shadow: 0 0 6px var(--lc); }
.card .idx { position: absolute; top: 16px; left: 18px; font: 600 15px/1 var(--latin); color: var(--gold); letter-spacing: .04em; opacity: .9; z-index: 1; }
.card .idx.r { top: auto; left: auto; bottom: 16px; right: 18px; transform: rotate(180deg); }
.card .eyebrow { margin-top: 4px; }
.card p.big { position: relative; z-index: 1; font: 600 21px/1.65 var(--serif); letter-spacing: .03em; margin: 16px 0 10px; color: #fbefe2; text-wrap: pretty; padding: 0; width: auto; }
.card.task p.big { font-size: 21.5px; }
.card .hint { margin-top: 6px; }
.fav { position: absolute; top: 9px; right: 10px; z-index: 2; width: 38px; height: 38px; padding: 0; display: grid; place-items: center;
  background: none; border: 0; box-shadow: none; font-size: 19px; color: var(--mute); }
.fav.on { color: var(--accent); text-shadow: 0 0 12px #d93a5e; animation: beat .4s var(--ease); }
.card.empty { padding: 30px 22px; color: var(--mute); }
.card.empty p { margin: 0; line-height: 1.8; }
.timer { position: relative; z-index: 1; margin-top: 12px; width: 100%; border-radius: 999px; padding: 11px 16px; font-size: 14.5px; letter-spacing: .08em;
  color: var(--gold2); background: #00000040; border: 1px solid #d9b26f55; font-variant-numeric: tabular-nums; }
.timer:disabled { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 0 #d9b26f66; animation: tick 1s ease-out infinite; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }
.acts > .primary { flex: 1.5; }
.acts > button:not(.primary) { font-size: 14px; color: #e6d4c6; padding-left: 8px; padding-right: 8px; }

/* ---------- 棋盘（基础，模式 CSS 可覆盖） ---------- */
.board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.cell { position: relative; aspect-ratio: 1; border-radius: 9px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--mute); }
.cell.l2 { background: #2a1220; } .cell.l3 { background: #3a1222; } .cell.l4 { background: #4c1226; } .cell.l5 { background: #5e0e27; border-color: #a3123a66; }
.cell.fwd { color: #8fd6b2; } .cell.back { color: #f0a08a; } .cell.swap { color: #a9c0ec; } .cell.end, .cell.start { color: var(--gold); font-weight: 700; border-color: var(--gold3); }
.tokens { position: absolute; inset: 2px; display: flex; flex-wrap: wrap; gap: 1px; align-content: flex-end; justify-content: center; }
.tokens i { width: 16px; height: 16px; border-radius: 50%; font-size: 10px; font-style: normal; color: #1a0a10; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px #000a; }
.rolled { display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 600; }
.die-face { width: 46px; height: 46px; border-radius: 11px; background: linear-gradient(145deg, #fdf6ea, #dccab0); color: #3a0c1c; font: 700 24px/1 var(--latin); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px -6px #000, inset 0 -2px 0 #0002; animation: roll .6s var(--ease); }
.win { text-align: center; font: 700 24px/1.4 var(--serif); letter-spacing: .1em; color: var(--gold2); text-shadow: 0 0 24px #d9b26f66; }

/* ---------- 轮盘 ---------- */
.wheel-wrap { position: relative; width: 292px; height: 292px; margin: 14px auto 10px; }
.wheel-wrap::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(#d9b26f 0 .8deg, transparent .8deg 15deg); -webkit-mask: radial-gradient(circle, transparent 152px, #000 153px 156px, transparent 157px); mask: radial-gradient(circle, transparent 152px, #000 153px 156px, transparent 157px); opacity: .55; }
.wheel-wrap::after { content: ""; position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; transform: translate(-50%, -50%); border-radius: 50%; z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 38% 32%, #fff1cc, #d9b26f 40%, #7a5220 100%); box-shadow: 0 0 0 4px #1a0a10, 0 0 0 5px #d9b26f66, 0 6px 16px #000c; }
.wheel { width: 100%; height: 100%; border-radius: 50%; position: relative; overflow: hidden; border: 0;
  transition: transform 4s cubic-bezier(.15, .8, .2, 1);
  box-shadow: 0 0 0 2px #d9b26f, 0 0 0 7px #1a0a10, 0 0 0 8px #d9b26f66, 0 0 60px -6px #d93a5e66, inset 0 0 40px #000b; }
.wheel::before { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, #d9b26f99 0deg .6deg, transparent .6deg var(--seg, 45deg)),
              radial-gradient(circle, #ffffff12 0 30%, transparent 60%); }
.wheel span { position: absolute; left: 50%; top: 50%; font: 600 13px/1 var(--serif); letter-spacing: .06em; white-space: nowrap; color: #f8e9d6; text-shadow: 0 1px 4px #000; }
.pointer { position: absolute; left: 50%; top: -16px; transform: translateX(-50%); z-index: 3; width: 22px; height: 34px; border: 0;
  background: var(--goldg); clip-path: polygon(50% 100%, 0 30%, 18% 0, 82% 0, 100% 30%); filter: drop-shadow(0 4px 6px #000); }

/* ---------- 左轮 ---------- */
.cylwrap { position: relative; width: 230px; height: 230px; margin: 22px auto 6px; }
.cylwrap::before { content: ""; position: absolute; left: 50%; top: -14px; transform: translateX(-50%); z-index: 2; width: 14px; height: 18px;
  background: var(--goldg); clip-path: polygon(50% 100%, 0 0, 100% 0); filter: drop-shadow(0 2px 4px #000); }
.cyl { position: relative; display: block; width: 230px; height: 230px; margin: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #1a0d12 0 22px, transparent 23px),
              conic-gradient(from 30deg, #3b2a2a, #1d1416, #4a3634, #1d1416, #3b2a2a, #1d1416, #4a3634, #1d1416, #3b2a2a),
              #2a1c1e;
  box-shadow: 0 0 0 2px #d9b26f55, 0 0 0 9px #140a0d, 0 0 0 10px #d9b26f33, 0 26px 50px -16px #000, inset 0 0 30px #000c;
  transform: rotate(calc(var(--s, 0) * -60deg)); animation: cylTurn .55s var(--ease); }
.cyl::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f3dcaa, #9a6c2e); box-shadow: 0 0 0 4px #120a0c; }
.cyl i { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #0b0507 0 9px, transparent 10px), radial-gradient(circle at 36% 32%, #ffe7b5, #d9a85a 45%, #7a4f1e 100%);
  border: 3px solid #0e0709; box-shadow: inset 0 -3px 6px #0007, 0 0 14px -2px #d9b26f55; }
.cyl i:nth-child(1) { transform: rotate(0deg) translateY(-72px); }
.cyl i:nth-child(2) { transform: rotate(60deg) translateY(-72px); }
.cyl i:nth-child(3) { transform: rotate(120deg) translateY(-72px); }
.cyl i:nth-child(4) { transform: rotate(180deg) translateY(-72px); }
.cyl i:nth-child(5) { transform: rotate(240deg) translateY(-72px); }
.cyl i:nth-child(6) { transform: rotate(300deg) translateY(-72px); }
.cyl i.spent { background: radial-gradient(circle at 50% 45%, #000 0 20px, #1a0f12 22px); border-color: #2a1c1e; box-shadow: inset 0 4px 10px #000; }
.cyl i.next { box-shadow: inset 0 -3px 6px #0007, 0 0 0 2px #d93a5e, 0 0 22px #d93a5eaa; }
.bang { text-align: center; font: 900 64px/1.1 var(--serif); letter-spacing: .2em; margin-left: .2em; color: #ffd9de;
  text-shadow: 0 0 18px #d93a5e, 0 0 50px #a3123a; animation: bang .6s var(--ease) both; }
.flash { position: fixed; inset: 0; z-index: 40; pointer-events: none; background: radial-gradient(circle at 50% 40%, #ff4d6d88, #a3123a55 40%, transparent 75%); animation: flash .9s ease-out forwards; }

/* ---------- 骰子 ---------- */
.dice3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 6px; perspective: 600px; }
.die { aspect-ratio: 1; border-radius: 20px; background: #0c0609; border: 1px dashed #d9b26f55; display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--mute); font: 600 15px/1.35 var(--serif); letter-spacing: .1em; padding: 8px; }
.die.on { background: linear-gradient(150deg, #fffaf1 0%, #f0e3cf 55%, #d6c2a4 100%); color: #4a0f22; border: 0; letter-spacing: .02em; font-size: 16px;
  box-shadow: 0 16px 26px -12px #000, inset 0 -4px 0 #00000014, inset 0 2px 0 #fff, 0 0 0 1px #d9b26f88; animation: roll3d .8s var(--ease) both; }
.die.on:nth-child(2) { animation-delay: .1s; } .die.on:nth-child(3) { animation-delay: .2s; }

/* ---------- 谁最可能 / 自定义 ---------- */
.plist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plist button { display: flex; align-items: center; gap: 9px; justify-content: center; font: 500 15px var(--serif); letter-spacing: .06em; padding: 13px 10px; }
.form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.form .row { align-items: stretch; }
.form select { max-width: none; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 10px; align-items: center; background: linear-gradient(170deg, #1f0e17, #140a0f); border: 1px solid #ffffff0d; border-radius: 14px; padding: 9px 4px 9px 12px; }
.item span:nth-child(2), .item > span:only-of-type { flex: 1; font-size: 14px; line-height: 1.55; }
.item > span:first-child:not(.badge) { flex: 1; font-size: 14px; }
.item .ghost { font-size: 14px; }
.badge { font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; color: var(--text); background: #00000040; }
.badge.lv1, .badge.lv2, .badge.lv3, .badge.lv4, .badge.lv5 { border-color: var(--lc); color: color-mix(in srgb, var(--lc) 70%, #fff); }

/* ---------- 会员 ---------- */
.plan { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 12px; align-items: center; text-align: left; padding: 16px 18px; border-radius: var(--r); overflow: hidden;
  background: linear-gradient(170deg, #22101a, #140a0f); }
.plan b { font: 600 17px/1.3 var(--serif); letter-spacing: .1em; }
.plan span { grid-row: span 2; font: 600 24px/1 var(--latin); color: var(--gold2); }
.plan small { color: var(--mute); font-size: 12px; }
.plan.best { border-color: var(--gold); background: radial-gradient(120% 100% at 0% 0%, #d9b26f22, transparent 60%), linear-gradient(170deg, #2e131f, #160a10); box-shadow: 0 0 30px -10px #d9b26f88; }
.plan .ribbon { position: absolute; top: 0; right: 18px; padding: 3px 9px 4px; font: 600 10.5px/1 var(--sans); letter-spacing: .2em; color: #2a1408; background: var(--goldg); border-radius: 0 0 8px 8px; font-style: normal; }
.plan.best span { margin-top: 10px; }

/* ---------- 浮层 ---------- */
.toast { position: fixed; left: 50%; bottom: calc(36px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: min(88vw, 420px);
  padding: 13px 20px; border-radius: 16px; text-align: center; font-size: 14.5px; line-height: 1.55; letter-spacing: .03em;
  background: linear-gradient(180deg, #2a121ddd, #140a0fee); border: 1px solid #d9b26f55; color: var(--text);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 20px 40px -12px #000, 0 0 24px -8px #d9b26f55; animation: toastIn .45s var(--ease) both, toastOut .4s 2s ease-in forwards; }
.toast b { color: var(--gold2); }
.cover { position: fixed; inset: 0; z-index: 99; background: #fbfaf6; color: #2b2b2b; padding: calc(56px + env(safe-area-inset-top)) 28px 60px; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
.cover h3 { font-size: 26px; font-weight: 700; color: #111; margin-bottom: 8px; }
.cover ul { line-height: 2.4; padding-left: 20px; border-top: 1px solid #eee; margin-top: 12px; padding-top: 6px; }
.cover small { position: absolute; bottom: calc(20px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #d0d0d0; font-size: 11px; }

/* ---------- 动效 ---------- */
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes unblur { from { opacity: 0; filter: blur(14px); letter-spacing: .6em; } to { opacity: 1; filter: drop-shadow(0 2px 18px #d9b26f2e); } }
@keyframes flipIn {
  0% { transform: perspective(1000px) rotateY(-88deg) translateY(10px) scale(.92); opacity: 0; filter: brightness(1.8); }
  55% { transform: perspective(1000px) rotateY(10deg) scale(1.01); opacity: 1; filter: brightness(1.15); }
  100% { transform: none; opacity: 1; filter: none; }
}
@keyframes sheen { to { transform: translateX(330%) skewX(-12deg); } }
@keyframes ember { 0%, 100% { box-shadow: 0 30px 60px -28px #a3123a, 0 0 0 1px #000, 0 0 26px -8px #a3123a88; } 50% { box-shadow: 0 30px 60px -24px #c22a4f, 0 0 0 1px #000, 0 0 44px -4px #c22a4faa; } }
@keyframes deal { from { transform: translateY(24px) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes beat { 40% { transform: scale(1.35); } }
@keyframes tick { 0% { box-shadow: 0 0 0 0 #d9b26f55; } 100% { box-shadow: 0 0 0 10px #d9b26f00; } }
@keyframes roll { from { transform: rotate(-200deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes roll3d { 0% { transform: rotateX(-260deg) rotateZ(-40deg) translateY(-30px) scale(.6); opacity: 0; } 70% { transform: rotateX(12deg) scale(1.04); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes cylTurn { from { transform: rotate(calc((var(--s, 0) - 1) * -60deg)); } }
@keyframes bang { 0% { transform: scale(2.2); opacity: 0; filter: blur(8px); } 40% { transform: scale(.94); opacity: 1; filter: none; } 100% { transform: none; } }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
@keyframes toastIn { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes toastOut { to { transform: translate(-50%, 8px); opacity: 0; } }
@keyframes breathe { 0%, 100% { opacity: .7; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes twinkle { 0%, 100% { opacity: .5; transform: scale(.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .wheel { transition-duration: 4s !important; }
  .card.task::after { display: none; }
  .toast { animation: none !important; }
}
@media (max-width: 359px) {
  .hero h1 { font-size: 48px; } .pick { height: 190px; } .pick b { font-size: 24px; }
  .wheel-wrap { transform: scale(.9); margin: 0 auto; }
}

/* 防横向溢出：旋转中的轮盘、.bang 放大动画在 375px 下会把页面撑宽（main 不裁，免得卡片阴影被切） */
html, body { overflow-x: clip; }
.bang { pointer-events: none; }
