/* 马善政只写汉字；它缺的「嬛」和全部标点、数字、竖排标点落到文楷 */
@font-face { font-family: 'ZH Brush'; src: url(fonts/brush.woff2) format('woff2'); font-display: swap; unicode-range: U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF; }
@font-face { font-family: 'ZH Kai'; src: url(fonts/kai.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'ZH Fang'; src: url(fonts/fang.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --ink: #0a1019;         /* 最深处 */
  --shiqing: #172334;     /* 石青：清宫外褂的颜色，整套界面的底 */
  --shiqing-hi: #24344c;
  --ivory: #efe6d6;       /* 牙白：正文 */
  --mute: #8e9cb1;
  --gold: #d9ae67;        /* 烛金 */
  --glyph: #2c3b51;
  --cui: #74c4b6;         /* 点翠：涨 */
  --rouge: #e2585c;       /* 胭脂：危险 */
  --hair: rgba(217, 174, 103, .22);
  --edict: #e9c66b;
  --brush: 'ZH Brush', 'ZH Kai', 'Kaiti SC', 'STKaiti', 'KaiTi', serif;
  --fang: 'ZH Fang', 'FangSong', 'STFangsong', 'Songti SC', serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--ink);
  color: var(--ivory);
  font: 17px/1.7 var(--fang);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  position: fixed; inset: 0;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; touch-action: manipulation; }
button:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }
.tcy { font-style: normal; text-combine-upright: all; -webkit-text-combine: horizontal; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { position: relative; height: 100%; max-width: 460px; margin: 0 auto; overflow: hidden; background: var(--ink); }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.on, .screen.leaving { display: flex; }

/* 一颗东珠：可以点的地方都挂着它 */
.pearl {
  display: block; width: 11px; height: 11px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 34% 30%, #fff 0, #f3eee4 22%, #c9c1b4 62%, #7c766d 100%);
  box-shadow: 0 0 10px rgba(255, 238, 205, .35);
}

/* 文字链接：没有框，只有一道很淡的底线 */
.link {
  font: 15px/1.5 var(--fang); letter-spacing: .1em; color: #d3dae3; padding: 8px 0 4px;
  background: linear-gradient(var(--hair), var(--hair)) left bottom / 100% 1px no-repeat;
}
.link span { margin-left: .4em; color: var(--mute); font-size: 12.5px; letter-spacing: 0; }
.link:active { color: #fff; }

/* ───────── 封面 ───────── */
#title { background: var(--ink); }
.cover-still { position: absolute; inset: 0; }
.cover-still img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 49% 50%; }
.cover-still::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(8, 12, 20, .9) 92%); }
#title.gl .cover-still { visibility: hidden; }
#title:not(.gl) #cover-gl, #end.nogl #end-gl { visibility: hidden; }
#cover-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
/* 片名在帘子前面：毛笔字形当遮罩，底下一层牙白到淡金 */
.cover-title { position: absolute; z-index: 2; left: 7.5%; top: calc(var(--safe-t) + 7.5%); display: flex; align-items: flex-start; gap: 10px; pointer-events: none; filter: drop-shadow(0 2px 14px rgba(0, 0, 0, .75)); transition: opacity .45s; }
.cover-title .mark { width: min(92px, 20vw); aspect-ratio: 320 / 858; background: linear-gradient(180deg, #fbf3e2, #efdcb4 60%, #d7b276); -webkit-mask: url(img/title.png) center / contain no-repeat; mask: url(img/title.png) center / contain no-repeat; }
.cover-title .sub { writing-mode: vertical-rl; margin-top: 6px; font: 400 min(21px, 4.7vw)/1 var(--brush); letter-spacing: .28em; color: rgba(243, 234, 218, .9); }
#title.parting .cover-title { opacity: 0; }
.cover-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  padding: 0 20px calc(var(--safe-b) + 24px) 26px;
  transition: opacity .45s, transform .6s;
}
.cover-text { min-width: 0; }
.lede { text-wrap: pretty; margin: 0; font-size: 16.5px; line-height: 1.85; color: #f1e9db; letter-spacing: .04em; text-shadow: 0 1px 10px rgba(0, 0, 0, .8); }
.tally { text-wrap: balance; margin: 6px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--mute); min-height: 1.6em; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.cover-links { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 12px; }

.go { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 4px 2px; flex: none; color: #f6eedf; }
.go span { writing-mode: vertical-rl; font: 46px/1 var(--brush); letter-spacing: .14em; text-shadow: 0 0 22px rgba(255, 214, 150, .28), 0 2px 10px rgba(0, 0, 0, .7); transition: transform .2s; }
.go .pearl { width: 13px; height: 13px; animation: breathe 3.2s ease-in-out infinite; }
.go:active span { transform: scale(.96); }
@keyframes breathe { 50% { box-shadow: 0 0 18px 2px rgba(255, 226, 170, .7); } }
#title.parting .cover-foot { opacity: 0; transform: translateY(10px); pointer-events: none; }
#title.leaving { z-index: 8; opacity: 0; transition: opacity .7s ease-in; pointer-events: none; }

/* ───────── 游戏 ───────── */
/* 石青暗花缎：底是一块外褂料子，团花缠枝只靠光泽显出来 */
#game { isolation: isolate; background: radial-gradient(120% 70% at 50% 46%, rgba(36, 52, 76, .2) 0%, rgba(16, 24, 36, .35) 50%, rgba(8, 12, 19, .92) 100%), url(img/ground.webp) center / cover, var(--shiqing); }
/* 甘露寺：石青褪成缁衣的灰 */
#game::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.4s;
  background: radial-gradient(130% 75% at 50% 45%, #33302c 0%, #24221f 45%, #100f0d 100%);
}
#game.si::before { opacity: 1; }
#game > * { position: relative; }
#game > .toast { position: absolute; }

.top { flex: none; padding: calc(var(--safe-t) + 12px) 18px 0; }
.stats { display: flex; justify-content: space-around; }
.stat { position: relative; width: 56px; display: flex; flex-direction: column; align-items: center; }
.glyph { position: relative; width: 36px; height: 36px; }
.glyph i { position: absolute; inset: 0; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.glyph .base { background: var(--glyph); }
.glyph .fill { background: linear-gradient(180deg, #f0d398, var(--gold)); clip-path: inset(50% 0 0 0); transition: clip-path .7s cubic-bezier(.3, .7, .2, 1); }
#game.si .glyph .base { background: #3a3631; }
.stat.danger .fill { background: var(--rouge); animation: throb 1.4s ease-in-out infinite; }
@keyframes throb { 50% { opacity: .5; } }
.stat.up .glyph { animation: up .8s ease-out; }
.stat.down .glyph { animation: down .8s ease-out; }
@keyframes up { 25% { filter: drop-shadow(0 0 8px var(--cui)) brightness(1.35); transform: translateY(-3px); } }
@keyframes down { 25% { filter: drop-shadow(0 0 8px var(--rouge)) brightness(.8); transform: translateY(3px); } }
.stat .name { font-size: 11.5px; color: var(--mute); margin-top: 11px; letter-spacing: .24em; text-indent: .24em; }
.dot { position: absolute; top: 37px; left: 50%; width: 0; height: 0; border-radius: 50%; transform: translate(-50%, 3px); opacity: 0; transition: all .18s;
  background: radial-gradient(circle at 34% 30%, #fff, #e9e3d7 45%, #9d978c); box-shadow: 0 0 8px rgba(255, 238, 205, .6); }
.dot.s1 { width: 6px; height: 6px; opacity: 1; }
.dot.s2 { width: 10px; height: 10px; opacity: 1; }

.rankline { display: flex; justify-content: center; align-items: baseline; gap: 10px; margin-top: 8px; }
.rankline b { font: 400 23px/1.2 var(--brush); letter-spacing: .12em; color: var(--gold); transition: color .4s; }
.rankline span { font-size: 13px; color: var(--mute); letter-spacing: .14em; }
.rankline.glow b { animation: glow 2.2s ease-out; }
@keyframes glow { 0% { color: #fff3d6; text-shadow: 0 0 18px var(--gold); } 100% { text-shadow: none; } }
/* 位分：一串东珠，穿在一根线上 */
.ladder { position: relative; display: flex; justify-content: center; align-items: center; gap: 13px; margin-top: 5px; height: 12px; transition: opacity .6s; }
.ladder::before { content: ''; position: absolute; left: 50%; width: 152px; transform: translateX(-50%); top: 50%; height: 1px; background: rgba(217, 174, 103, .28); }
.ladder i { position: relative; width: 6px; height: 6px; border-radius: 50%; background: #2a3a50; box-shadow: inset 0 0 0 1px rgba(217, 174, 103, .35); }
.ladder i.on { background: radial-gradient(circle at 34% 30%, #fff, #ece6da 40%, #a59e92); box-shadow: none; }
.ladder i.cur { width: 10px; height: 10px; box-shadow: 0 0 10px rgba(255, 232, 190, .75); }

.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 8px; min-height: 0; }
.say {
  width: 100%; max-width: 360px; margin: 0 0 14px; padding: 0 6px; min-height: 6.7em; display: flex; align-items: flex-end;
  font-size: 17.5px; line-height: 1.75; letter-spacing: .03em; color: var(--ivory);
  transition: opacity .25s;
}
.say span { display: block; }
.say em { font-style: normal; color: #93a2b6; }
#game.si .say em { color: #a39b8f; }
.say.fade { opacity: 0; }

/* 人像居中，两个选项像一副对联挂在两边 */
.hall { --kl: 0; --kr: 0; --dw: min(67vw, 290px, calc((100vh - 392px) * .75)); --dw: min(67vw, 290px, calc((100dvh - 392px) * .75)); display: flex; align-items: flex-start; justify-content: center; gap: 6px; width: 100%; }
.lian {
  --k: 0; --o: 0;
  width: 38px; height: calc(var(--dw) * 4 / 3); overflow: hidden; flex: none; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0 0;
  opacity: calc(.78 + .22 * var(--k) - .5 * var(--o));
  position: relative; z-index: 4;
  transform: translate(calc(var(--dir) * var(--k) * 7px), calc(var(--k) * -3px)) scale(calc(1 + .05 * var(--k)));
  transition: opacity .12s, transform .12s, color .12s;
  color: color-mix(in srgb, #f6d79a calc(var(--k) * 100%), var(--ivory));
}
.lian.l { --k: var(--kl); --o: var(--kr); --dir: -1; }
.lian.r { --k: var(--kr); --o: var(--kl); --dir: 1; }
.lian span { display: block; writing-mode: vertical-rl; max-height: calc(var(--dw) * 4 / 3 - 30px); font: 400 var(--fs, 21px)/1.12 var(--brush); letter-spacing: .08em; text-shadow: 0 0 6px rgba(0, 0, 0, .85), 0 2px 12px rgba(0, 0, 0, .6); }
.lian span i { font-style: normal; }
.lian.act span { font-family: var(--fang); letter-spacing: .08em; color: color-mix(in srgb, #f6d79a calc(var(--k) * 100%), #cfc5b4); }
.lian .pearl { width: 9px; height: 9px; transition: box-shadow .2s, transform .2s; }
.lian.armed .pearl { transform: scale(1.35); box-shadow: 0 0 14px 3px rgba(255, 214, 140, .8); animation: breathe 1.4s ease-in-out infinite; }
.lian:disabled { cursor: default; }

.deck { position: relative; perspective: 1000px; width: var(--dw); aspect-ratio: 3 / 4; flex: none; }
.sheet { position: absolute; inset: 0; border-radius: 3px; background: #1b283a; box-shadow: 0 0 0 1px rgba(217, 174, 103, .1); }
#game.si .sheet { background: #2a2724; }
.sheet.s1 { transform: translateY(6px) scale(.965); }
.sheet.s2 { transform: translateY(12px) scale(.93); opacity: .55; }
.card {
  position: absolute; inset: 0; border-radius: 3px; overflow: hidden; background: #441916;
  box-shadow: 0 26px 50px rgba(0, 0, 0, .6), 0 0 0 1px rgba(217, 174, 103, .5);
  transform-origin: 50% 135%; touch-action: none; cursor: grab; will-change: transform;
}
.card:active { cursor: grabbing; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; transition: filter .6s; }
/* 裱一道细金线，再压一圈暗角 */
.card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 32%, transparent 55%, rgba(12, 6, 6, .42)); box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .12), inset 0 0 0 7px rgba(240, 214, 160, .28); }
.card.dim img { filter: brightness(.22) contrast(1.3) blur(1.5px); }
.card.dead img { filter: grayscale(1) contrast(1.1) brightness(.8); }

.who { margin-top: 14px; text-align: center; min-height: 56px; }
.who b { display: block; font: 400 27px/1.15 var(--brush); letter-spacing: .16em; text-indent: .16em; }
.who span { display: block; font-size: 13.5px; color: var(--mute); margin-top: 4px; letter-spacing: .06em; }

.foot { display: flex; align-items: center; gap: 12px; padding: 8px 14px calc(var(--safe-b) + 12px) 20px; font-size: 13.5px; color: #c4ccd7; flex: none; }
.foot #time { letter-spacing: .1em; transition: color .4s; white-space: nowrap; }
.foot #time.newyear { color: var(--gold); }
/* 标签只占一行，多了横着滑；首尾 auto 边距让少的时候居中 */
.tags {
  flex: 1; min-width: 0; display: flex; gap: 12px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 10px), transparent); mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 10px), transparent);
}
.tags::-webkit-scrollbar { display: none; }
.tags > :first-child { margin-left: auto; }
.tags > :last-child { margin-right: auto; }
.tag { flex: none; display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: #d2d9e1; white-space: nowrap; }
.tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #a8b3c2; }
.tag.preg::before { background: var(--cui); box-shadow: 0 0 6px var(--cui); }
.tag.son::before, .tag.girl::before { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.tag.proof { color: #f0c3b8; }
.tag.proof::before { background: var(--rouge); }
.ico { width: 34px; height: 30px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 5px; flex: none; }
.ico i { height: 1.5px; background: #c4ccd7; display: block; width: 18px; }
.ico i:nth-child(2) { width: 12px; }

.hint {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 40px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(8, 12, 20, .9) 38%);
  font-size: 13.5px; line-height: 1.65; color: #eae2d3; pointer-events: none;
}
.toast {
  position: absolute; left: 50%; bottom: calc(var(--safe-b) + 10px); transform: translate(-50%, 6px); z-index: 6;
  padding: 6px 18px; border-radius: 2px; background: rgba(9, 14, 22, .9); box-shadow: 0 0 0 1px var(--hair);
  font-size: 14.5px; color: #f3dfb4; letter-spacing: .08em; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { color: #ffb3a6; }

/* ───────── 圣旨 ───────── */
.edict { position: absolute; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; background: rgba(6, 10, 16, 0); transition: background .4s; }
.edict.on { background: rgba(6, 10, 16, .74); }
.scroll { position: relative; display: flex; align-items: stretch; height: min(66vh, 470px); filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .6)); }
.roller { width: 16px; flex: none; border-radius: 8px; background: linear-gradient(90deg, #3b1c0e, #8b5a2b 35%, #c99a54 50%, #8b5a2b 65%, #3b1c0e); position: relative; z-index: 1; }
.roller::before, .roller::after { content: ''; position: absolute; left: 2px; right: 2px; height: 14px; border-radius: 4px; background: #2a1209; }
.roller::before { top: -10px; } .roller::after { bottom: -10px; }
.paper {
  width: 0; overflow: hidden; transition: width .9s cubic-bezier(.3, .7, .2, 1);
  background:
    linear-gradient(180deg, rgba(120, 70, 10, .25) 0 10px, transparent 10px calc(100% - 10px), rgba(120, 70, 10, .25) calc(100% - 10px)),
    repeating-linear-gradient(90deg, rgba(160, 110, 30, .08) 0 1px, transparent 1px 22px),
    linear-gradient(90deg, #d9ad4a, var(--edict) 18%, #f6dc8c 50%, var(--edict) 82%, #d9ad4a);
  display: flex; align-items: center; justify-content: center;
}
.edict.on .paper { width: min(74vw, 300px); }
.paper p {
  margin: 0; writing-mode: vertical-rl; height: 86%; padding: 0 18px; white-space: normal;
  font: 400 22px/1.8 var(--brush); letter-spacing: .12em; color: #3d1a0c; opacity: 0; transition: opacity .6s .7s;
}
.paper p b { font-weight: 400; color: #8f1d12; }
.paper p b, .paper p .nb { white-space: nowrap; }
.edict.on .paper p { opacity: 1; }

/* ───────── 结局：帘子放下来 ───────── */
#end { background: transparent; }
#end-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .6s; }
#end.show #end-gl { opacity: 1; }
.end-ghost { display: none; }
#end.nogl { background: rgba(10, 14, 20, 0); transition: background 1.2s; }
#end.nogl.show { background: rgba(10, 14, 20, .985); }
#end.nogl .end-ghost {
  display: block; position: absolute; left: 11%; top: 4%; width: 78%; aspect-ratio: 3 / 4; object-fit: cover; opacity: 0;
  filter: grayscale(1); transition: opacity 2.4s .4s;
  -webkit-mask-image: radial-gradient(70% 62% at 50% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(70% 62% at 50% 40%, #000 30%, transparent 75%);
}
#end.nogl.show .end-ghost { opacity: .3; }
#end.nogl.live .end-ghost { filter: none; }
.end-in { position: relative; z-index: 2; width: 100%; height: 100%; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 30px) 24px calc(var(--safe-b) + 20px) 26px; }
/* 标题一整行贴着帘子下沿；下面左边是这一世，右边竖写结局词 */
.end-head { margin-top: auto; }
.end-kind { margin: 0; font-size: 13px; color: var(--mute); letter-spacing: .3em; opacity: 0; transition: opacity .8s; }
.end-title { margin: 4px 0 0; white-space: nowrap; font: 400 60px/1.1 var(--brush); letter-spacing: .08em; opacity: 0; transform: translateY(8px); transition: opacity 1s .2s, transform 1s .2s; text-shadow: 0 2px 18px rgba(0, 0, 0, .7); }
#end.live .end-title { background: linear-gradient(180deg, #fff1cf, #e2b86c); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 2px 14px rgba(0, 0, 0, .6)); }
#end.show .end-kind, #end.show .end-title { opacity: 1; transform: none; }
.end-body { display: flex; align-items: flex-end; gap: 20px; margin-top: 16px; }
.end-meta { flex: 1; min-width: 0; margin: 0; font-size: 13.5px; color: var(--mute); line-height: 1.8; opacity: 0; transition: opacity .8s .8s; }
#end.show .end-meta { opacity: 1; }
.end-meta b { color: var(--gold); font-weight: 400; }
.end-meta .deeds { display: block; color: #e3dccf; margin-bottom: 8px; }
.epi {
  flex: none; margin: 0; writing-mode: vertical-rl; height: min(290px, 34vh); max-width: 56vw; overflow: hidden;
  font: 400 clamp(17px, 2.5vh, 21px)/1.85 var(--brush); letter-spacing: .12em; color: #f1e8d8; text-shadow: 0 2px 10px rgba(0, 0, 0, .8);
}
.epi i { font-style: normal; opacity: 0; transition: opacity .35s; }
.epi i.on { opacity: 1; }
.end-links { margin-top: 16px; display: flex; align-items: center; gap: 24px; opacity: 0; transition: opacity .6s; pointer-events: none; }
#end.done .end-links { opacity: 1; pointer-events: auto; }
.go.small { flex-direction: row; gap: 10px; padding: 6px 0; margin-right: auto; }
.go.small span { writing-mode: horizontal-tb; font-size: 24px; letter-spacing: .1em; }
.go.small .pearl { width: 10px; height: 10px; }

/* ───────── 结局簿 / 人物 ───────── */
#book { background: linear-gradient(180deg, rgba(23, 35, 52, .3) 0%, rgba(8, 12, 19, .9) 100%), url(img/ground.webp) center / cover, var(--shiqing); }
.book-head { display: flex; align-items: baseline; gap: 14px; padding: calc(var(--safe-t) + 16px) 20px 10px; flex: none; position: relative; }
.book-head h2 { margin: 0; font: 400 26px/1.2 var(--brush); letter-spacing: .12em; }
.book-head span { color: var(--mute); font-size: 13.5px; margin-left: auto; }
.back { font-size: 15px; color: #d3dae3; padding: 4px 0; }
.book-body { flex: 1; overflow-y: auto; padding: 4px 16px calc(var(--safe-b) + 24px); -webkit-overflow-scrolling: touch; position: relative; }
.book-body h3 { font: 400 13px/1.4 var(--fang); color: var(--mute); letter-spacing: .3em; margin: 20px 4px 10px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { position: relative; border-radius: 3px; overflow: hidden; background: #1a2638; aspect-ratio: 3 / 4; text-align: left; box-shadow: 0 0 0 1px rgba(217, 174, 103, .3); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 8px 7px; background: linear-gradient(0deg, rgba(9, 13, 21, .95), transparent); }
.tile .cap b { display: block; font: 400 18px/1.2 var(--brush); letter-spacing: .06em; }
.tile .cap small { display: block; font-size: 11px; color: var(--mute); line-height: 1.4; margin-top: 2px; }
.tile.locked { box-shadow: 0 0 0 1px rgba(142, 156, 177, .12); }
.tile.locked img { filter: brightness(.12) blur(3px); }
.tile.locked .cap b { color: #55647a; font-family: var(--fang); letter-spacing: .2em; }
.tile .cap b.long { font-size: 15px; letter-spacing: 0; }
.tile.fresh::before { content: ''; position: absolute; top: 7px; right: 7px; z-index: 1; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #fff6dc, var(--gold)); box-shadow: 0 0 10px var(--gold); }

.detail { position: absolute; inset: 0; z-index: 30; background: rgba(8, 12, 19, .95); display: flex; flex-direction: column; justify-content: center; padding: 30px; }
.detail .k { color: var(--mute); font-size: 13px; letter-spacing: .3em; }
.detail h4 { margin: 2px 0 0; font: 400 44px/1.2 var(--brush); letter-spacing: .08em; }
.detail p.e { font: 400 21px/1.9 var(--brush); letter-spacing: .08em; color: #f0e7d8; margin: 18px 0 0; }
.detail p.m { color: var(--mute); font-size: 13.5px; margin-top: 18px; }

.sheetmenu { position: absolute; inset: 0; z-index: 20; background: rgba(6, 10, 16, .66); display: flex; align-items: flex-end; }
.sm-in { width: 100%; padding: 8px 24px calc(var(--safe-b) + 18px); display: flex; flex-direction: column; background: #121c2a; box-shadow: 0 -1px 0 var(--hair); border-radius: 12px 12px 0 0; }
.row { text-align: left; padding: 15px 2px; font-size: 16px; letter-spacing: .08em; color: #dfe4ea; border-bottom: 1px solid rgba(142, 156, 177, .14); }
.row.strong { border-bottom: 0; font: 22px/1.3 var(--brush); color: var(--gold); letter-spacing: .2em; padding-top: 18px; }

/* 矮屏幕（Safari 扣掉工具栏、小安卓）：字小一档，卡片按剩余高度算 */
@media (max-height: 720px) {
  .top { padding-top: calc(var(--safe-t) + 8px); }
  .glyph { width: 32px; height: 32px; }
  .dot { top: 33px; }
  .stat .name { margin-top: 8px; }
  .rankline { margin-top: 4px; }
  .rankline b { font-size: 21px; }
  .say { font-size: 16px; min-height: 6.6em; margin-bottom: 10px; }
  .who { margin-top: 8px; min-height: 48px; }
  .who b { font-size: 23px; }
  .hall { --dw: min(67vw, 290px, calc((100vh - 340px) * .75)); --dw: min(67vw, 290px, calc((100dvh - 340px) * .75)); }
  .foot { padding-top: 4px; padding-bottom: calc(var(--safe-b) + 8px); }
  .go span { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .glyph .fill { transition: none; }
  .stat.danger .fill { animation: none; }
  .paper { transition: none; }
  .go .pearl, .lian.armed .pearl { animation: none; }
}
@media (min-width: 461px) {
  body { background: #070b11; }
  #app { box-shadow: 0 0 80px rgba(0, 0, 0, .6); }
}
