/* 给图零零完整的一生
   画面主体都在 WebGL 画布里；这里只有压在上面的少量界面。
   用色：近黑 #0A0408、米白 #F5EDE6、特效粉 #FF3D7F（只改 --pink 一处）、亮黄只给最要紧的、青色是她发卡上的那一点蓝。
   老内核：不用 inset、aspect-ratio、flex gap。 */
@font-face { font-family: "Smiley Sans"; src: url("assets/SmileySans-Oblique.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Smiley Sans"; src: url("assets/SmileySans-Oblique.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
:root {
  color-scheme: dark;
  --disp: "Smiley Sans", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --pink: #FF3D7F;
  --ink: #0A0408;
  --paper: #F5EDE6;
  --yellow: #FCEE0A;
  --cyan: #2DE2E6;
  --dim: rgba(245, 237, 230, .62);
  --line: rgba(245, 237, 230, .22);
  --cjk: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "DIN Condensed", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", var(--cjk);
  --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; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); font-family: var(--cjk); overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
/* 只做手机竖版。所有东西都在 #stage 里：窗口比手机宽（电脑、平板横着放）的时候它是居中的一条竖屏，两边留空。
   它带一个 transform，里面 position: fixed 的元素就都以它为准，不用一个个改；宽度和左边距由 js 算（T.stageFit） */
#stage { position: fixed; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; -webkit-transform: translateZ(0); transform: translateZ(0); }
#gl { position: fixed; left: 0; top: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; }

/* ---------- 按钮：硬边、切角、实色 ---------- */
.btn { position: relative; display: inline-block; font-weight: 900; letter-spacing: .02em; line-height: 1; white-space: nowrap; transition: transform .08s, filter .12s; }
.btn:active { transform: translateY(2px) scale(.98); filter: brightness(1.25); }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn.main { background: var(--pink); color: var(--ink); font-size: 21px; padding: 0 22px; height: 58px; font-style: italic;
  -webkit-clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px)); clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px)); }
.btn.main b { font-family: var(--num); font-size: 26px; margin-left: 10px; font-style: italic; }
.btn.main.empty { background: #3a2a32; color: var(--dim); }
.btn.ghost { background: rgba(10, 4, 8, .72); color: var(--paper); border: 1px solid var(--line); font-size: 15px; padding: 0 14px; height: 44px;
  -webkit-clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); }
.btn.ghost.sm { height: 38px; font-size: 14px; }
.btn.ghost.on { background: var(--paper); color: var(--ink); }
.btn.side { height: 58px; padding: 0 12px; min-width: 84px; text-align: center; }
.btn.side span { display: block; font-size: 16px; }
.btn.side small { display: block; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--pink); }
.btn.block { display: block; width: 100%; text-align: center; }

/* ---------- 主画面 ---------- */
#hud { position: fixed; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud.quiet .hud-bottom, #hud.quiet #btnMenu { opacity: .0; pointer-events: none; }
@keyframes hudIn { from { opacity: 0; } to { opacity: 1; } }
.hud-top { position: absolute; left: 0; top: 0; width: 100%; padding: calc(10px + var(--safe-t)) 12px 26px 14px; display: flex; justify-content: space-between; align-items: flex-start;
  background: linear-gradient(rgba(10, 4, 8, .86), rgba(10, 4, 8, .5) 62%, rgba(10, 4, 8, 0)); pointer-events: none !important; }
.hud-top > * { pointer-events: auto; }
.life .lab { font-size: 12px; font-weight: 700; color: var(--dim); letter-spacing: .08em; }
.life .num { margin-top: 2px; white-space: nowrap; }
.life .num b { font-family: var(--num); font-style: italic; font-size: 40px; line-height: 1; color: var(--paper); letter-spacing: .01em; display: inline-block; transform-origin: left bottom; text-shadow: 3px 3px 0 var(--pink); }
.life .num b.bump { animation: bump .32s; }
@keyframes bump { 0% { transform: scale(1.32); color: var(--yellow); } 100% { transform: scale(1); } }
.life .num span { font-family: var(--num); font-size: 15px; color: var(--dim); margin-left: 8px; font-weight: 700; }
/* 图例：三种碎片各一个按钮（色块就是那种碎片的样子），比去点小碎片好点。这一行比上面的读数宽，让它自己往右伸，不把右上角的按钮挤走 */
#cnt { margin-top: 8px; width: 168px; display: flex; white-space: nowrap; }
#cnt button { flex: 0 0 auto; display: flex; align-items: center; height: 32px; padding: 0 9px 0 8px; margin-right: 6px; font-size: 12px; font-weight: 700; color: var(--paper); background: rgba(10,4,8,.6); border: 1px solid var(--line); }
#cnt button:active { background: rgba(255,61,127,.28); }
#cnt b { font-family: var(--num); font-size: 15px; margin-left: 5px; color: var(--paper); }
#cnt .sw { display: inline-block; width: 12px; height: 12px; margin-right: 6px; -webkit-transform: skewX(-12deg); transform: skewX(-12deg); }
#cnt .sw.lit { background: var(--paper); }
#cnt .sw.lock { background: #e8c4d2; opacity: .75; }
#cnt .sw.void { background: repeating-linear-gradient(135deg, #8a6878 0, #8a6878 2px, #1c0d16 2px, #1c0d16 4px); box-shadow: 0 0 0 1px rgba(245,237,230,.35); }
.life .track { position: relative; width: 168px; height: 3px; margin-top: 7px; background: rgba(245,237,230,.16); -webkit-transform: skewX(-24deg); transform: skewX(-24deg); }
.life .track i { position: absolute; left: 0; top: 0; height: 100%; min-width: 5px; background: var(--pink); box-shadow: 0 0 8px rgba(255,61,127,.8); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.hud-title { position: absolute; left: 16px; bottom: calc(112px + var(--safe-b)); padding-left: 15px; font-size: 50px; line-height: 1; pointer-events: none !important; transition: opacity .25s; }
.hud-title::before { content: ''; position: absolute; left: 2px; top: 1px; bottom: 5px; width: 4px; background: var(--pink); -webkit-transform: skewX(-9deg); transform: skewX(-9deg); }
.hud-title i { display: block; font-family: var(--num); font-style: normal; font-size: 10px; letter-spacing: .34em; color: rgba(245,237,230,.55); margin-bottom: 8px; white-space: nowrap; }
.hud-title span { display: block; font-size: .5em; color: var(--paper); letter-spacing: .08em; text-shadow: 0 2px 10px rgba(10,2,7,.9); }
.hud-title em { display: block; margin-top: .09em; font-style: normal; color: var(--pink); text-shadow: 3px 3px 0 var(--ink), 0 4px 18px rgba(10,2,7,.8); white-space: nowrap; }
#hud.quiet .hud-title { opacity: 0; }
.hud-bottom { position: absolute; left: 0; bottom: 0; width: 100%; padding: 30px 12px calc(14px + var(--safe-b)); display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(rgba(10, 4, 8, 0), rgba(10, 4, 8, .62) 45%, rgba(10, 4, 8, .9)); pointer-events: none !important; transition: opacity .2s; }
.hud-bottom > * { pointer-events: auto; }
.hud-bottom .main { flex: 1 1 auto; margin: 0 8px; max-width: 280px; text-align: center; }
.btn.main.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.28); } }

/* 点中一块碎片时的说明 */
#tip { position: fixed; left: 12px; right: 12px; bottom: calc(96px + var(--safe-b)); background: rgba(10, 4, 8, .94); border: 1px solid var(--line); border-left: 4px solid var(--pink); padding: 12px 14px 12px 14px; animation: tipIn .18s both; z-index: 5; }
@keyframes tipIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#tip .k { font-size: 12px; font-weight: 700; color: var(--dim); }
#tip .n { font-size: 22px; font-weight: 900; font-style: italic; margin-top: 3px; }
#tip .s { font-size: 13px; color: var(--dim); margin-top: 5px; line-height: 1.5; }
#tip .row { margin-top: 10px; display: flex; flex-wrap: wrap; }
#tip .row .btn.ghost { height: 46px; line-height: 44px; }
#tip .row .btn { margin-right: 8px; }
#tip.void { border-left-color: var(--cyan); }
#tip .x { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; font-size: 20px; color: var(--dim); }

/* 叙事字幕、提示、底部按钮 */
#cap { position: fixed; left: 0; width: 100%; bottom: calc(15% + var(--safe-b)); text-align: center; padding: 0 22px; font-size: 18px; font-weight: 700; line-height: 1.6; letter-spacing: .04em; color: var(--paper); pointer-events: none; opacity: 0; transition: opacity .45s; text-shadow: 0 0 12px rgba(10, 4, 8, .9), 0 1px 2px rgba(10, 4, 8, .9); z-index: 4; }
#cap.on { opacity: 1; }
#cap b { color: var(--pink); font-family: var(--num); font-size: 1.25em; font-style: italic; }
#cap.big { font-size: 28px; font-weight: 900; font-style: italic; }
#hint { position: fixed; left: 0; width: 100%; bottom: calc(118px + var(--safe-b)); text-align: center; font-size: 15px; font-weight: 700; color: var(--paper); letter-spacing: .1em; pointer-events: none; opacity: 0; transition: opacity .25s; z-index: 4; }
#hint.on { opacity: 1; animation: blink 1.5s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
#acts { position: fixed; left: 0; width: 100%; bottom: calc(26px + var(--safe-b)); text-align: center; z-index: 5; pointer-events: none; }
#acts .btn { pointer-events: auto; margin: 0 6px; min-width: 190px; text-align: center; animation: tipIn .22s both; }
#acts .btn.ghost { min-width: 120px; height: 50px; }
#skip { position: fixed; right: 12px; top: calc(12px + var(--safe-t)); z-index: 6; }

/* ---------- 猜拳 ---------- */
#duel { position: fixed; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
#duel > * { pointer-events: auto; }
.duel-top { position: absolute; left: 0; top: 0; width: 100%; padding: calc(10px + var(--safe-t)) 12px 0 14px; display: flex; justify-content: space-between; align-items: center; }
.duel-top .score { font-family: var(--num); font-style: italic; font-weight: 900; font-size: 30px; }
.duel-top .score i { font-style: normal; font-size: 13px; color: var(--dim); font-family: var(--cjk); margin: 0 6px; }
.duel-top .score b { color: var(--pink); }
.duel-top .score em { display: inline-block; margin-left: 10px; padding: 2px 8px; font-style: normal; font-size: 15px; color: var(--ink); background: var(--yellow); vertical-align: middle; }
#duelClose.got { background: var(--yellow); color: var(--ink); animation: gotPulse 1.1s infinite; }
@keyframes gotPulse { 0%, 100% { -webkit-filter: brightness(1); filter: brightness(1); } 50% { -webkit-filter: brightness(1.22); filter: brightness(1.22); } }
#helpBtn, #shareBtn { position: fixed; right: 12px; top: calc(62px + var(--safe-t)); z-index: 7; height: 34px; padding: 0 12px; font-size: 14px; }
#shareBtn { top: calc(102px + var(--safe-t)); }
#shareBtn[data-m="album"] { right: 38px; }
/* 首页读数下面的排名：点它去榜单 */
.rk { display: inline-block; margin-top: 7px; height: 26px; line-height: 24px; padding: 0 9px 0 10px; font-family: var(--disp); font-size: 14px; letter-spacing: .04em; color: var(--yellow); background: rgba(10,4,8,.72); border: 1px solid rgba(252,238,10,.55);
  -webkit-clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); }
.rk:after { content: ' ›'; }
/* 榜单这一屏：和菜单一样占左边一块，拼图侧身让位 */
#rank { position: fixed; left: 0; top: calc(64px + var(--safe-t)); bottom: calc(10px + var(--safe-b)); width: 78%; padding: 0 0 0 16px; z-index: 6; display: flex; flex-direction: column; }
#rank .rtabs { display: flex; flex: 0 0 auto; }
#rank .rtab { height: 40px; padding: 0 12px; margin-right: 6px; font-family: var(--disp); font-size: 18px; color: var(--dim); background: rgba(10,4,8,.72); border: 1px solid var(--line);
  -webkit-clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); }
#rank .rtab.on { background: var(--pink); color: var(--ink); border-color: var(--pink); }
#rank .rper { flex: 0 0 auto; margin: 10px 0 8px; display: flex; align-items: center; }
#rank .rp { height: 28px; padding: 0 10px; margin-right: 6px; font-size: 13px; font-weight: 700; color: var(--dim); border: 1px solid var(--line); }
#rank .rp.on { color: var(--ink); background: var(--paper); border-color: var(--paper); }
#rank .rsub { margin-left: 4px; font-size: 12px; font-weight: 700; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rank .rlist { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 6px; }
#rank .rrow { display: flex; align-items: center; height: 34px; padding: 0 8px 0 0; border-bottom: 1px solid rgba(245,237,230,.08); animation: miIn .3s both; }
#rank .rrow i { flex: 0 0 34px; font-family: var(--num); font-style: italic; font-weight: 700; font-size: 17px; color: var(--dim); text-align: center; }
#rank .rrow .nm { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rank .rrow b { flex: 0 0 auto; font-family: var(--disp); font-weight: 400; font-size: 16px; color: var(--paper); margin-left: 8px; }
#rank .rrow.top1 i { color: var(--yellow); font-size: 22px; } #rank .rrow.top2 i { color: var(--paper); font-size: 20px; } #rank .rrow.top3 i { color: var(--pink); font-size: 19px; }
#rank .rrow.top1 b { color: var(--yellow); }
#rank .rrow.me { background: rgba(255,61,127,.2); } #rank .rrow.me .nm { color: var(--pink); }
#rank .rmsg { padding: 30px 0; font-size: 14px; font-weight: 700; color: var(--dim); }
#rank .rme { flex: 0 0 auto; margin-top: 8px; padding: 9px 12px; background: var(--paper); color: var(--ink); border-left: 5px solid var(--pink); display: flex; flex-wrap: wrap; align-items: baseline; margin-right: 6px; }
#rank .rme .k { font-size: 13px; font-weight: 900; margin-right: 8px; }
#rank .rme .v { font-family: var(--disp); font-size: 22px; }
#rank .rme .s { flex: 1 0 100%; margin-top: 3px; font-size: 12.5px; font-weight: 700; color: rgba(10,4,8,.7); }
#rank .rbtn { flex: 0 0 auto; margin-top: 10px; }
#rank .rbtn .btn { height: 46px; line-height: 46px; padding: 0 22px; font-size: 18px; }
#helpBtn[data-m="album"] { right: 38px; }
#duelClose.bump { animation: bump .32s; }
.duel-bottom { position: absolute; left: 0; bottom: 0; width: 100%; padding: 0 12px calc(16px + var(--safe-b)); text-align: center; }
.duel-bottom .sub { min-height: 30px; font-size: 20px; color: var(--paper); text-shadow: 0 2px 10px rgba(10,2,7,.9); margin: 10px 0 4px; }
.vs { display: flex; align-items: stretch; justify-content: center; height: 72px; }
.vs .cell { position: relative; flex: 1 1 0; max-width: 150px; display: flex; align-items: center; justify-content: center; background: rgba(10,4,8,.82); border: 1px solid var(--line); color: rgba(245,237,230,.45);
  -webkit-clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); transition: background .16s, color .16s, opacity .2s; }
.vs .cell small { position: absolute; left: 9px; top: 6px; font-size: 12px; font-weight: 700; color: var(--dim); }
.vs .cell.her small { left: auto; right: 9px; color: var(--pink); }
.vs .cell .ic { display: none; width: 32px; height: 32px; margin-right: 6px; }
.vs .cell .ic svg { display: block; width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.vs .cell b { font-family: var(--disp); font-weight: 400; font-size: 22px; letter-spacing: .04em; }
.vs .cell.on { color: var(--paper); border-color: rgba(245,237,230,.5); }
.vs .cell.on .ic { display: block; }
.vs .cell.her.on { color: var(--pink); border-color: var(--pink); }
.vs .cell.slam { animation: slam .2s cubic-bezier(.2,.9,.3,1.2); }
@keyframes slam { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.vs .dots { display: none; }
.vs.chant .cell.her .dots { display: flex; }
.vs .dots i { width: 9px; height: 9px; margin: 0 5px; background: rgba(255,61,127,.25); -webkit-transform: rotate(45deg); transform: rotate(45deg); transition: background .08s, transform .12s; }
.vs .cell[data-b="1"] .dots i:nth-child(-n+1), .vs .cell[data-b="2"] .dots i:nth-child(-n+2), .vs .cell[data-b="3"] .dots i:nth-child(-n+3) { background: var(--pink); -webkit-transform: rotate(45deg) scale(1.3); transform: rotate(45deg) scale(1.3); }
.vs .mid { flex: 0 0 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--disp); line-height: 1; }
.vs .mid i { font-family: var(--num); font-style: italic; font-size: 22px; font-weight: 700; color: var(--dim); letter-spacing: .06em; }
.vs .mid em { display: none; font-style: normal; font-size: 30px; white-space: nowrap; text-shadow: 2px 2px 0 var(--ink); }
.vs .mid small { display: none; margin-top: 5px; font-size: 15px; color: var(--ink); background: var(--yellow); padding: 2px 7px; font-family: var(--disp); white-space: nowrap; }
.vs.done .mid i { display: none; }
.vs.done .mid em { display: block; }
.vs.done .mid small:not(:empty) { display: block; }
.vs .mid.pop { animation: slam .22s cubic-bezier(.2,.9,.3,1.2); }
.vs.r-me .mid em { color: var(--yellow); }
.vs.r-her .mid em { color: var(--pink); }
.vs.r-tie .mid em { color: var(--paper); }
.vs.r-me .cell.me { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.vs.r-me .cell.me small { color: rgba(10,2,7,.6); }
.vs.r-me .cell.her, .vs.r-her .cell.me { opacity: .5; }
.vs.r-her .cell.her { background: var(--pink); color: var(--ink); }
.vs.r-her .cell.her small { color: rgba(10,2,7,.6); }
.btn.hand.sel { background: var(--pink); }
.duel-bottom .rule { font-size: 13px; color: var(--dim); font-weight: 700; margin-bottom: 12px; }
.duel-bottom .rule b { color: var(--yellow); }
.hands { display: flex; justify-content: center; }
.btn.hand { flex: 1 1 0; max-width: 150px; height: 64px; margin: 0 5px; font-size: 22px; font-style: italic; background: var(--paper); color: var(--ink);
  -webkit-clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }

/* ---------- 舞台上每场戏共用的顶栏、说明条、菜单列（不是弹窗，没有遮罩） ---------- */
#bar { position: fixed; left: 0; top: 0; width: 100%; padding: calc(10px + var(--safe-t)) 12px 26px 12px; display: flex; align-items: center; z-index: 8;      /* 压在菜单、排行、任务这些整页的层上面，返回键才点得到 */
  background: linear-gradient(rgba(10, 4, 8, .92), rgba(10, 4, 8, .6) 60%, rgba(10, 4, 8, 0)); pointer-events: none; }
#bar > * { pointer-events: auto; }
#bar.in { animation: barIn .3s both; }
@keyframes barIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
#bar .bt { margin-left: 12px; min-width: 0; }
#bar .bt b { display: block; font-size: 22px; font-weight: 900; font-style: italic; line-height: 1.1; text-shadow: 3px 3px 0 var(--pink); white-space: nowrap; }
#bar .bt span { display: block; font-size: 12px; font-weight: 700; color: var(--dim); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel { position: fixed; left: 0; bottom: 0; width: 100%; max-height: 50%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 34px 16px calc(18px + var(--safe-b)); z-index: 5;
  background: linear-gradient(rgba(10, 4, 8, 0), rgba(10, 4, 8, .86) 34px, rgba(10, 4, 8, .95)); }
#panel.in { animation: panelIn .28s both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.lead .k { font-size: 12px; font-weight: 700; color: var(--pink); letter-spacing: .08em; }
.lead .n { font-size: 28px; font-weight: 900; font-style: italic; margin-top: 2px; line-height: 1.15; text-shadow: 3px 3px 0 var(--pink); }
.lead .s { font-size: 13.5px; line-height: 1.65; color: var(--dim); margin-top: 8px; }
#panel .row { display: flex; flex-wrap: wrap; margin-top: 12px; }
#panel .row .btn { margin: 0 8px 8px 0; }
.btn.act { background: var(--pink); color: var(--ink); height: 46px; padding: 0 20px; font-size: 16px; font-style: italic; line-height: 46px;
  -webkit-clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); }
#panel .btn.ghost { height: 46px; line-height: 44px; }
.filebtn { position: relative; overflow: hidden; cursor: pointer; }
.filebtn input { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rules { margin: 8px 0 0; padding-left: 18px; }
.rules li { font-size: 13px; line-height: 1.6; color: var(--dim); }
.check div { font-size: 13.5px; margin-top: 6px; font-weight: 700; }
.check .ok { color: var(--cyan); }
.check .bad { color: var(--yellow); }
.k2 { font-size: 12px; font-weight: 700; color: var(--dim); margin-top: 12px; }
.gain { margin-top: 8px; font-size: 14px; font-weight: 900; color: var(--pink); font-style: italic; }
.foot { margin-top: 2px; font-size: 12px; color: var(--dim); line-height: 1.6; }
#menu { position: fixed; left: 0; top: 0; height: 100%; width: 74%; padding: 0 0 0 22px; display: flex; flex-direction: column; justify-content: center; z-index: 6; overflow-y: auto; }
#menu .mi { display: block; text-align: left; padding: 11px 0; animation: miIn .34s both; }
@keyframes miIn { from { opacity: 0; transform: translateX(-26px) skewX(-8deg); } to { opacity: 1; transform: none; } }
#menu .mi .n { display: block; font-size: 32px; font-weight: 900; font-style: italic; line-height: 1.1; text-shadow: 4px 4px 0 var(--pink); }
#menu .mi .s { display: block; font-size: 12px; font-weight: 700; color: var(--dim); margin-top: 5px; }
#menu .mi:active .n { color: var(--yellow); }
#menu .mi:last-child .n { font-size: 20px; color: var(--dim); text-shadow: none; }
.help { animation: miIn .34s both; padding-right: 8px; }
.help h4 { margin: 14px 0 5px; font-size: 18px; font-weight: 900; color: var(--pink); font-style: italic; }
.help p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.7; color: var(--paper); text-shadow: 0 0 8px var(--ink); }
.help b { color: var(--yellow); }
.rar-row { display: flex; flex-wrap: wrap; margin: 8px 0 2px; }
.rar-row span { font-size: 12px; font-weight: 900; padding: 5px 9px; margin: 0 6px 6px 0; color: var(--ink); background: #9A8F96; font-style: italic; }
.rar-row span:nth-child(2) { background: var(--paper); }
.rar-row span:nth-child(3) { background: var(--pink); }
.rar-row span:nth-child(4) { background: var(--yellow); }
.rar-row span:nth-child(5) { background: var(--cyan); }

/* ---------- 导览：一圈光，光圈以外点不动 ---------- */
#tour { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 29; pointer-events: none; }
#tour .tb { position: absolute; background: rgba(10, 4, 8, .76); pointer-events: auto; }
#tour .tr { position: absolute; border: 2px solid var(--pink); box-shadow: 0 0 24px rgba(255, 61, 127, .7), inset 0 0 18px rgba(255, 61, 127, .25); pointer-events: auto; animation: ring 1.3s infinite; }
#tour.act .tr { pointer-events: none; border-color: var(--yellow); box-shadow: 0 0 24px rgba(252, 238, 10, .7), inset 0 0 18px rgba(252, 238, 10, .2); }
@keyframes ring { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
#tour .tbub { position: absolute; background: var(--paper); color: var(--ink); padding: 12px 14px 12px 16px; pointer-events: auto; border-left: 5px solid var(--pink);
  -webkit-clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
#tour .tbub.in { animation: tipIn .22s both; }
#tour .tno { font-family: var(--num); font-style: italic; font-weight: 900; font-size: 13px; color: rgba(10, 4, 8, .5); letter-spacing: .06em; }
#tour .ttxt { font-size: 16px; font-weight: 700; line-height: 1.55; margin-top: 2px; }
#tour .ttxt b { color: #D4145A; font-weight: 900; }
#tour .trow { margin-top: 10px; display: flex; align-items: center; }
#tour .tnext { height: 40px; line-height: 40px; padding: 0 18px; font-size: 15px; margin-right: 12px; }
#tour .tskip { font-size: 13px; font-weight: 700; color: rgba(10, 4, 8, .55); padding: 10px 4px; }

#toast { position: fixed; left: 0; width: 100%; top: calc(104px + var(--safe-t)); padding: 0 14px; z-index: 40; text-align: center; pointer-events: none; animation: tipIn .18s both; }
#toast span { display: inline-block; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 900; padding: 10px 16px; line-height: 1.5; }
#nogl { position: fixed; left: 0; top: 0; width: 100%; height: 100%; background: var(--ink); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 30px; text-align: center; }
#nogl h2 { font-size: 24px; font-style: italic; color: var(--pink); margin: 0 0 12px; }
#nogl p { font-size: 14px; line-height: 1.8; color: var(--dim); margin: 0; }
#boot { position: fixed; left: 0; top: 0; width: 100%; height: 100%; display: none; align-items: center; justify-content: center; flex-direction: column; background: var(--ink); z-index: 30; }
body.booting #boot { display: flex; }
#gate { position: fixed; left: 0; top: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; z-index: 30; cursor: pointer; }
#gate .bolt { width: 64px; height: 64px; background: var(--pink); -webkit-clip-path: polygon(61% 5%, 21% 55%, 46% 55%, 34% 95%, 80% 39%, 54% 39%, 69% 5%); clip-path: polygon(61% 5%, 21% 55%, 46% 55%, 34% 95%, 80% 39%, 54% 39%, 69% 5%); animation: pulse 1.2s infinite; }
#gate p { font-size: 26px; font-weight: 900; font-style: italic; letter-spacing: .12em; margin: 22px 0 0; text-shadow: 3px 3px 0 var(--pink); }
#gate small { font-size: 13px; color: var(--dim); font-weight: 700; margin-top: 12px; letter-spacing: .06em; }
#boot p { font-size: 13px; letter-spacing: .3em; color: var(--dim); font-weight: 700; margin-top: 18px; }
#boot .bolt { width: 46px; height: 46px; background: var(--pink); -webkit-clip-path: polygon(61% 5%, 21% 55%, 46% 55%, 34% 95%, 80% 39%, 54% 39%, 69% 5%); clip-path: polygon(61% 5%, 21% 55%, 46% 55%, 34% 95%, 80% 39%, 54% 39%, 69% 5%); animation: pulse 1s infinite; }

/* ---------- 电脑和横屏：拼图在左，标题和按钮在右 ---------- */
@media (max-height: 660px) {
  .life .num b { font-size: 32px; }
  #cap { font-size: 16px; }
  #hint { bottom: calc(100px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) { .btn.main.pulse, #hint.on { animation: none; } }

/* ---------- 标题字：得意黑（开源字体，见 THIRD_PARTY.txt）。它本身是斜的，不再另加斜体和加粗 ---------- */
.btn, .life .num b, .life .num span, .life .lab, .lead .n, .lead .k, #bar .bt b, #menu .mi .n, #cap.big, .duel-top .score, .duel-bottom .sub, .hud-title, .hud-title em,
#gate p, #tip .n, .help h4, .gain, #tour .tno, .rar-row span, .btn.side small, #rail i, #toast span, .k2 { font-family: var(--disp); font-style: normal; font-weight: 400; letter-spacing: .03em; }
.btn.main { font-size: 26px; }
.btn.main b { font-family: var(--disp); font-size: 30px; font-style: normal; font-weight: 400; }
.btn.ghost { font-size: 17px; }
.btn.ghost.sm { font-size: 16px; }
.btn.side span { font-size: 19px; }
.btn.side small { font-size: 12.5px; }
.btn.act { font-size: 19px; }
.life .lab { font-size: 14px; letter-spacing: .1em; }
.life .num b { font-size: 48px; }
.life .num span { font-size: 18px; }
.lead .n { font-size: 34px; }
.lead .k { font-size: 14px; }
#bar .bt b { font-size: 27px; }
#menu .mi .n { font-size: 40px; }
#menu .mi:last-child .n { font-size: 24px; }
#cap.big { font-size: 33px; }
#gate p { font-size: 32px; }
#tip .n { font-size: 26px; }
.help h4 { font-size: 21px; }
.gain { font-size: 16px; }
.duel-top .score { font-size: 34px; }
#toast span { font-size: 16px; }
/* 读数和按钮淡入淡出，不硬切 */
#hud { transition: opacity .28s; }
#hud.off { opacity: 0; }
#hud.off, #hud.off * { pointer-events: none !important; }
@media (hover: hover) {
  .btn:hover { filter: brightness(1.16); }
  #menu .mi:hover .n { color: var(--yellow); }
}
/* 猜拳的三只手 */
.btn.hand { height: 88px; padding: 6px 0 0; font-size: 22px; }
.btn.hand svg { display: block; width: 36px; height: 36px; margin: 0 auto 2px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.btn.hand:active { transform: translateY(3px) scale(.95); }
/* 图鉴右侧：按天跳转 */
#rail { position: fixed; right: 3px; top: calc(74px + var(--safe-t)); bottom: calc(18px + var(--safe-b)); width: 26px; z-index: 6; display: flex; flex-direction: column; justify-content: space-between; touch-action: none; cursor: pointer; animation: barIn .3s both; }
#rail i { display: block; font-size: 12px; line-height: 1; padding: 3px 0; text-align: center; color: var(--dim); }
#rail i.own { color: var(--paper); }
#rail i.on { color: var(--ink); background: var(--pink); }
/* 铸造走到第几步 */
.steps { display: flex; margin-bottom: 10px; }
.steps i { display: block; width: 30px; height: 4px; background: var(--line); margin-right: 6px; }
.steps i.on { background: var(--pink); }
.rules li b { color: var(--paper); font-weight: 900; }
.cprow { display: flex; align-items: center; margin-top: 8px; padding: 6px 6px 6px 10px; background: rgba(245,237,230,.06); border: 1px solid var(--line); }
.cprow .k { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--dim); margin-right: 10px; }
.cprow b { flex: 1 1 auto; min-width: 0; font-family: var(--num); font-size: 16px; font-weight: 700; color: var(--yellow); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-user-select: text; user-select: text; }
.cprow .btn { flex: 0 0 auto; height: 32px; line-height: 30px; padding: 0 12px; font-size: 14px; margin-left: 8px; }

/* ---------- 拍下来的那张图 ---------- */
#photo { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 28; background: rgba(10, 4, 8, .84); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(16px + var(--safe-t)) 18px calc(18px + var(--safe-b)); }
#photo img { display: block; max-width: 86%; max-height: 66%; border: 6px solid var(--paper); box-shadow: 10px 10px 0 var(--pink); transform: rotate(-2deg); animation: photoIn .36s both; -webkit-user-select: auto; user-select: auto; -webkit-touch-callout: default; }
@keyframes photoIn { from { opacity: 0; transform: rotate(6deg) scale(1.25); } to { opacity: 1; transform: rotate(-2deg) scale(1); } }
#photo .ptip { margin-top: 22px; font-size: 13px; color: var(--dim); font-weight: 700; text-align: center; }
#photo .prow { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; }
#photo .prow .btn { margin: 0 6px 8px; height: 46px; line-height: 44px; }
#acts .btn.ghost { min-width: 96px; height: 58px; font-size: 19px; }

/* 右上角：图鉴和菜单 */
.hud-tr { display: flex; flex: 0 0 auto; }
.hud-tr .btn { margin-left: 8px; }
/* ---------- 消消乐：底部的步数和进度 ---------- */
#mstat { position: fixed; left: 0; width: 100%; bottom: calc(96px + var(--safe-b)); text-align: center; font-family: var(--disp); font-size: 20px; color: var(--paper); letter-spacing: .04em; pointer-events: none; z-index: 4; text-shadow: 0 0 10px var(--ink), 2px 2px 0 var(--ink); }
#mstat b { font-weight: 400; font-size: 34px; color: var(--pink); margin: 0 4px; display: inline-block; }
#mstat b.low { color: var(--yellow); }
#mstat b.bump { animation: bump .3s; }
#mstat i { font-style: normal; color: var(--dim); margin: 0 10px; }
#mstat small { display: block; margin-top: 6px; font-family: var(--cjk); font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--dim); }
#mstat small em { font-style: normal; }
#mstat.end { bottom: calc(104px + var(--safe-b)); }
#mstat.end small { font-size: 14px; color: var(--paper); }
#acts.three .btn { min-width: 0; padding: 0 16px; margin: 0 4px; }
#acts.three .btn.ghost { min-width: 0; }

/* ---------- 首页：大厅的版式（参考二游的大厅：人物居中占满，顶上是读数牌，两侧是入口牌，底下是导航栏，中间最大的是主按钮） ----------
   这一段放在最后，盖住前面首页的旧规则。牌子都是同一种：半透明深底、细线框、切一个角、一行很小的英文加一行中文 */
.hud-top { padding: calc(10px + var(--safe-t)) 10px 20px 10px; align-items: flex-start; }
.life { position: relative; padding: 7px 18px 9px 11px; background: rgba(10, 4, 8, .6); border: 1px solid var(--line); border-left: 3px solid var(--pink);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); }
.life .lab { font-size: 11px; letter-spacing: .06em; }
.life .lab i { font-family: var(--num); font-style: normal; font-size: 9px; letter-spacing: .22em; margin-left: 8px; color: rgba(245,237,230,.45); }
.life .num b { font-size: 34px; text-shadow: 2px 2px 0 var(--pink); }
.life .num span { font-size: 14px; margin-left: 6px; }
.life .track { width: 150px; margin-top: 6px; }
#rankChip.rk { margin-top: 0; height: 36px; line-height: 34px; padding: 0 10px 0 12px; font-size: 14px;
  -webkit-clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }
#cnt { position: absolute; left: 10px; top: calc(96px + var(--safe-t)); width: auto; margin-top: 0; }
.hud-left, .hud-right { position: absolute; top: calc(146px + var(--safe-t)); transition: opacity .2s; }
.hud-left { left: 10px; } .hud-right { right: 10px; }
#hud.quiet .hud-left, #hud.quiet .hud-right { opacity: 0; pointer-events: none; }
.tile { display: block; width: 76px; margin-bottom: 8px; padding: 8px 9px 9px; text-align: left; color: var(--paper);
  background: linear-gradient(135deg, rgba(245,237,230,.2), rgba(10,4,8,.72) 58%); border: 1px solid var(--line);
  -webkit-clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: transform .08s, filter .12s; }
.tile:active { transform: translateY(2px) scale(.98); filter: brightness(1.3); }
.tile i { display: block; font-family: var(--num); font-style: normal; font-size: 9px; letter-spacing: .22em; color: rgba(245,237,230,.5); }
.tile span { display: block; margin-top: 6px; font-family: var(--disp); font-size: 19px; line-height: 1; letter-spacing: .04em; }
.tile small { display: block; margin-top: 6px; font-size: 10px; font-weight: 700; color: var(--pink); white-space: nowrap; }
.hud-right .tile { text-align: right; -webkit-clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px); clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
  background: linear-gradient(225deg, rgba(245,237,230,.2), rgba(10,4,8,.72) 58%); }
.hud-title { bottom: calc(92px + var(--safe-b)); left: 12px; font-size: 32px; }
.hud-title i { font-size: 8px; margin-bottom: 6px; }
.hud-bottom { padding: 24px 8px calc(8px + var(--safe-b)); align-items: flex-end; }
.nv { flex: 1 1 0; height: 50px; text-align: center; color: var(--dim); background: rgba(10, 4, 8, .62); border-top: 1px solid var(--line); transition: filter .12s; }
.nv:active { filter: brightness(1.5); }
.nv i { display: block; font-family: var(--num); font-style: normal; font-size: 9px; letter-spacing: .2em; opacity: .6; }
.nv span { display: block; margin-top: 6px; font-family: var(--disp); font-size: 16px; line-height: 1; letter-spacing: .06em; }
.nv.on { color: var(--paper); border-top: 2px solid var(--pink); }
.hud-bottom .main { flex: 0 0 136px; max-width: none; margin: 0 6px; height: 66px; padding: 0 4px; font-size: 18px; }
.hud-bottom .main b { font-size: 21px; margin-left: 6px; }

/* ---------- 导航栏和几个大页面跟上大厅的版式 ---------- */
#nav { position: fixed; left: 0; bottom: 0; width: 100%; z-index: 7; transition: opacity .2s, transform .2s; }
#nav.off { opacity: 0; pointer-events: none !important; -webkit-transform: translateY(14px); transform: translateY(14px); }
#nav.off > * { pointer-events: none; }
/* 页面顶上的那一条：返回是一块切角的牌，标题小一号，下面压一道粉线 */
#bar .bt b { font-size: 22px; text-shadow: none; font-style: normal; letter-spacing: .06em; }
#bar .bt b:after { content: ''; display: block; width: 28px; height: 3px; margin-top: 5px; background: var(--pink); -webkit-transform: skewX(-24deg); transform: skewX(-24deg); }
#bar .bt span { margin-top: 5px; }
/* 菜单：一摞牌子，和大厅两侧的入口牌是同一种 */
#menu { width: 66%; padding: calc(70px + var(--safe-t)) 0 calc(96px + var(--safe-b)) 12px; justify-content: flex-start; counter-reset: mi; }
#menu .mi { position: relative; padding: 10px 12px 11px 44px; margin-bottom: 8px; background: linear-gradient(135deg, rgba(245,237,230,.16), rgba(10,4,8,.72) 55%); border: 1px solid var(--line); border-left: 3px solid var(--pink);
  -webkit-clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); counter-increment: mi; }
#menu .mi:before { content: '0' counter(mi); position: absolute; left: 11px; top: 12px; font-family: var(--num); font-size: 15px; font-style: italic; color: rgba(245,237,230,.45); }
#menu .mi .n { font-size: 21px; font-style: normal; text-shadow: none; letter-spacing: .04em; }
#menu .mi .s { margin-top: 5px; font-size: 11px; }
#menu .mi:active { filter: brightness(1.4); }
#menu .mi:last-child { background: none; border-color: transparent; padding-left: 12px; }
#menu .mi:last-child:before { content: ''; }
#menu .mi:last-child .n { font-size: 16px; color: var(--dim); }
#menu .help { padding-right: 10px; }
/* 排行、图鉴：给底下的导航栏让出位置 */
#rank { bottom: calc(88px + var(--safe-b)); }
#rail { bottom: calc(92px + var(--safe-b)); }

/* ---------- 猜拳、消消乐、铸造：跟上大厅的版式 ---------- */
/* 猜拳顶上和别的页面一样：左边返回，旁边是标题，比分是右边的一块牌 */
.duel-top { justify-content: flex-start; padding: calc(10px + var(--safe-t)) 10px 0 12px; }
.duel-top .bt { margin-left: 12px; min-width: 0; }
.duel-top .bt b { display: block; font-family: var(--disp); font-weight: 400; font-size: 22px; line-height: 1.1; letter-spacing: .06em; white-space: nowrap; }
.duel-top .bt b:after { content: ''; display: block; width: 28px; height: 3px; margin-top: 5px; background: var(--pink); -webkit-transform: skewX(-24deg); transform: skewX(-24deg); }
.duel-top .bt span { display: block; margin-top: 5px; font-size: 12px; font-weight: 700; color: var(--dim); white-space: nowrap; }
.duel-top .score { margin-left: auto; padding: 5px 10px 6px 12px; font-size: 26px; white-space: nowrap; background: rgba(10, 4, 8, .6); border: 1px solid var(--line); border-right: 3px solid var(--pink);
  -webkit-clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }
.duel-top .score i { font-size: 11px; margin: 0 5px; }
.duel-top .score em { font-size: 12px; margin-left: 6px; padding: 2px 6px; }
/* 对战条的两格是同一种牌：左边切右上角，右边切左上角 */
.vs .cell { background: linear-gradient(135deg, rgba(245,237,230,.14), rgba(10,4,8,.82) 55%);
  -webkit-clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.vs .cell.her { background: linear-gradient(225deg, rgba(245,237,230,.14), rgba(10,4,8,.82) 55%);
  -webkit-clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px); clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px); }
.vs.r-me .cell.me { background: var(--paper); }
.vs.r-her .cell.her { background: var(--pink); }
/* 消消乐底下的读数：垫一条深色的带子，上下各一道细线，字才不会和棋盘的光混在一起 */
#mstat { padding: 9px 0 10px; background: linear-gradient(90deg, rgba(10,4,8,0), rgba(10,4,8,.66) 18%, rgba(10,4,8,.66) 82%, rgba(10,4,8,0));
  border-top: 1px solid rgba(245,237,230,.12); border-bottom: 1px solid rgba(245,237,230,.12); }
/* 说明区（铸造的几步、看卡时的说明）：左上角压一道粉线，和页面标题下面那道是一套 */
#panel:before { content: ''; position: absolute; left: 16px; top: 20px; width: 28px; height: 3px; background: var(--pink); -webkit-transform: skewX(-24deg); transform: skewX(-24deg); }

/* ---------- 图标和红点：按钮一眼看得出是干什么的（图标都是线条画的，颜色跟着文字走） ---------- */
.nv svg, .tile svg, #btnDraw svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nv { height: 54px; padding-top: 6px; }
.nv svg { display: block; width: 22px; height: 22px; margin: 0 auto; }
.nv span { margin-top: 4px; font-size: 13px; }
.nv.on svg { color: var(--pink); }
.tile { position: relative; padding-top: 9px; }
.tile svg { display: block; width: 24px; height: 24px; color: var(--paper); }
.hud-right .tile svg { margin-left: auto; }
.tile span { margin-top: 7px; }
#btnDraw svg { display: inline-block; vertical-align: middle; width: 24px; height: 24px; margin: -3px 6px 0 0; stroke-width: 2; }
/* 红点：右上角一个带白边的点，轻轻跳 */
.dot:after { content: ''; position: absolute; right: 6px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: #ff2d55; box-shadow: 0 0 0 2px rgba(245,237,230,.9), 0 0 8px rgba(255,45,85,.9); animation: dotBeat 1.6s infinite; }
.hud-left .tile.dot:after { right: 16px; }
@keyframes dotBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
/* 返回的按钮前面带一个箭头 */
#barBack:before, #duelClose:before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; -webkit-transform: rotate(45deg) translateY(-1px); transform: rotate(45deg) translateY(-1px); }
/* 名次牌前面一个小奖杯的位置留给文字本身：加粗一点、带箭头，看得出能点 */
#rankChip.rk { font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .dot:after { animation: none; } }

/* ---------- 加载提示：屏幕中间一块小牌子，三道粉色的斜杠轮流亮 ---------- */
#loading { position: fixed; left: 50%; top: 44%; z-index: 9; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); padding: 10px 16px 10px 14px; white-space: nowrap; pointer-events: none;
  background: rgba(10, 4, 8, .82); border: 1px solid var(--line); border-left: 3px solid var(--pink); font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--paper); }
#loading i { display: inline-block; width: 5px; height: 14px; margin-right: 4px; vertical-align: -2px; background: var(--pink); -webkit-transform: skewX(-18deg); transform: skewX(-18deg); opacity: .25; animation: loadBar .9s infinite; }
#loading i:nth-child(2) { animation-delay: .15s; } #loading i:nth-child(3) { animation-delay: .3s; margin-right: 10px; }
@keyframes loadBar { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }
#rank .rmsg:before { content: ''; display: inline-block; width: 5px; height: 14px; margin-right: 8px; vertical-align: -2px; background: var(--pink); -webkit-transform: skewX(-18deg); transform: skewX(-18deg); animation: loadBar .9s infinite; }

/* ---------- 猜拳界面重排：这一拳的胜负放到上面（标题下面的一条），她的身上不再压东西；下面三只手是三块大按钮，图标大、粉色描边，一眼知道要点哪里 ---------- */
#duel .vs { position: fixed; left: 12px; right: 12px; top: calc(60px + var(--safe-t)); height: 52px; }
#duel .vs .cell { max-width: none; }
#duel .vs .cell b { font-size: 18px; }
#duel .vs .cell .ic, #duel .vs .cell .ic svg { width: 26px; height: 26px; }
#duel .vs .mid { flex: 0 0 92px; }
#duel .vs .mid em { font-size: 24px; }
#helpBtn[data-m="duel"] { top: calc(122px + var(--safe-t)); }
#shareBtn[data-m="duel"] { top: calc(162px + var(--safe-t)); }
.duel-bottom { padding: 0 8px calc(14px + var(--safe-b)); background: linear-gradient(rgba(10,4,8,0), rgba(10,4,8,.7) 40%, rgba(10,4,8,.9)); }
.duel-bottom .sub { margin: 26px 0 4px; }
.duel-bottom .rule { margin-bottom: 10px; }
.btn.hand { max-width: none; height: 92px; margin: 0 4px; padding: 10px 0 0; font-size: 17px; font-style: normal; color: var(--paper); background: linear-gradient(160deg, rgba(255,61,127,.28), rgba(10,4,8,.86) 60%); border: 1px solid var(--pink);
  -webkit-clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.btn.hand svg { width: 42px; height: 42px; margin: 0 auto 6px; color: var(--pink); stroke-width: 1.9; }
.btn.hand:active, .btn.hand.sel { background: var(--pink); color: var(--ink); }
.btn.hand:active svg, .btn.hand.sel svg { color: var(--ink); }

/* 「教程」「晒一下」：在图鉴、排行、消消乐、铸造这些有顶栏的页面里，放进顶栏那一行的右边并排，不再压着下面的内容 */
#helpBtn[data-m="album"], #helpBtn[data-m="rank"], #helpBtn[data-m="match"], #helpBtn[data-m="forge"], #helpBtn[data-m="mine"] { top: calc(12px + var(--safe-t)); right: 12px; }
#shareBtn[data-m="album"], #shareBtn[data-m="rank"], #shareBtn[data-m="match"], #shareBtn[data-m="forge"], #shareBtn[data-m="mine"] { top: calc(12px + var(--safe-t)); right: 76px; }

#hud.tipon .hud-title { opacity: 0; }
/* 矮屏（360×640 这一档）：说明区可以占到六成高，里面的字和间距收紧一点，主按钮不用往下划才看得到；上面的卡会跟着缩小 */
@media (max-height: 700px) {
  #panel { max-height: 62%; padding-top: 26px; }
  #panel:before { top: 14px; }
  #panel .lead .n { font-size: 26px; }
  #panel .rules li { font-size: 13px; line-height: 1.45; }
  #panel .row { margin-top: 8px; }
  #panel .foot { margin-top: 6px; font-size: 11.5px; }
  #panel .btn { height: 42px; line-height: 40px; }
  #panel .btn.act { line-height: 42px; }
}

/* ---------- 菜单、排行、任务：都是一整页（拼图退到后面），不再是「拼图侧过身、字挤在左半边」 ---------- */
#menu svg, #tasks svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#menu { left: 0; top: calc(60px + var(--safe-t)); bottom: 0; width: 100%; height: auto; padding: 6px 12px calc(96px + var(--safe-b)); justify-content: flex-start; counter-reset: none; }
.mhead { display: flex; align-items: center; flex: 0 0 auto; padding: 12px 14px 12px 12px; background: linear-gradient(135deg, rgba(245,237,230,.16), rgba(10,4,8,.76) 60%); border: 1px solid var(--line); border-left: 3px solid var(--pink);
  -webkit-clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); animation: miIn .3s both; }
.mhead .av { flex: 0 0 54px; width: 54px; height: 54px; margin-right: 12px; display: flex; align-items: center; justify-content: center; color: var(--paper); background: rgba(245,237,230,.08); border: 1px solid var(--line); }
.mhead .av svg { width: 30px; height: 30px; }
.mwho { flex: 1 1 auto; min-width: 0; }
.mwho b { display: block; font-family: var(--disp); font-weight: 400; font-size: 22px; line-height: 1.1; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mwho span { display: block; margin-top: 7px; font-size: 12px; font-weight: 700; color: var(--dim); white-space: nowrap; }
.mpk { flex: 0 0 auto; text-align: center; padding-left: 12px; border-left: 1px solid var(--line); }
.mpk b { display: block; font-family: var(--num); font-style: italic; font-size: 28px; line-height: 1; color: var(--pink); }
.mpk span { display: block; margin-top: 5px; font-size: 11px; font-weight: 700; color: var(--dim); }
.mgrid { display: flex; flex-wrap: wrap; flex: 0 0 auto; margin: 8px -4px 0; }
.mt { position: relative; width: calc(25% - 8px); margin: 4px; height: 88px; padding: 14px 0 0; text-align: center; color: var(--paper);
  background: linear-gradient(160deg, rgba(245,237,230,.14), rgba(10,4,8,.76) 60%); border: 1px solid var(--line);
  -webkit-clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  animation: miIn .3s both; transition: transform .08s, filter .12s; }
.mt:active { transform: translateY(2px) scale(.97); filter: brightness(1.4); }
.mt svg { display: block; width: 28px; height: 28px; margin: 0 auto 9px; color: var(--pink); }
.mt span { display: block; font-family: var(--disp); font-size: 14px; line-height: 1; letter-spacing: .02em; white-space: nowrap; }
#menu .help { padding: 12px 14px; background: rgba(10,4,8,.6); border: 1px solid var(--line); margin-bottom: 10px; }
#menu .help h4:first-child { margin-top: 0; }
#menu > .btn.ghost { align-self: flex-start; }
/* 排行：整页宽。上面一排四个榜，下面是榜，自己的成绩是底下一块名牌 */
#rank { left: 12px; right: 12px; width: auto; padding: 0; top: calc(66px + var(--safe-t)); }
#rank .rtab { flex: 1 1 0; margin-right: 6px; padding: 0; text-align: center; font-size: 16px; white-space: nowrap; }
#rank .rtab:last-child { margin-right: 0; }
#rank .rlist { padding: 2px 10px 2px 4px; background: rgba(10,4,8,.55); border: 1px solid var(--line); }
#rank .rrow { height: 38px; }
#rank .rrow .nm { font-size: 15px; }
#rank .rme { margin-right: 0; }
#rank .rbtn { display: flex; justify-content: flex-end; }
/* 任务：一条一条的牌子，能领的那条描粉边 */
#tasks { position: fixed; left: 12px; right: 12px; top: calc(70px + var(--safe-t)); bottom: calc(92px + var(--safe-b)); z-index: 6; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tsec { margin: 12px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--dim); }
.tsec:first-child { margin-top: 0; }
.trow { display: flex; align-items: center; height: 58px; padding: 0 10px 0 12px; margin-bottom: 6px; background: linear-gradient(135deg, rgba(245,237,230,.12), rgba(10,4,8,.76) 55%); border: 1px solid var(--line); border-left: 3px solid rgba(245,237,230,.3); animation: miIn .3s both; }
.trow.can { border-color: var(--pink); border-left-color: var(--pink); }
.trow.got { opacity: .5; }
.trow svg { flex: 0 0 26px; width: 26px; height: 26px; margin-right: 10px; color: var(--paper); }
.trow.can svg { color: var(--pink); }
.trow .tn { flex: 1 1 auto; min-width: 0; }
.trow .tn b { display: block; font-family: var(--disp); font-weight: 400; font-size: 17px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .tn small { display: block; margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--dim); }
.trow .tn small:empty { display: none; }
.trow .tr { flex: 0 0 auto; margin: 0 10px; font-family: var(--disp); font-size: 15px; color: var(--yellow); white-space: nowrap; }
.trow .btn { flex: 0 0 auto; height: 36px; line-height: 34px; padding: 0 14px; font-size: 15px; }
.trow .btn.act { line-height: 36px; }
.trow .td { flex: 0 0 auto; padding: 0 12px; font-size: 13px; font-weight: 700; color: var(--dim); }
/* 首页左边现在有两块牌（铸造、任务） */
.hud-left .tile.dot:after { right: 6px; }

/* 测试用的全解锁开关（只在开发环境和 Artifact 预览里有）：黄色虚线框，一看就知道不是游戏本身的东西 */
.devchip { position: absolute; right: 10px; top: calc(54px + var(--safe-t)); height: 28px; padding: 0 10px; font-size: 12px; font-weight: 700; color: var(--yellow); background: rgba(10,4,8,.72); border: 1px dashed rgba(252,238,10,.65); z-index: 2; }
.devchip.on { background: var(--yellow); color: var(--ink); border-style: solid; }
#hud.quiet .devchip { opacity: 0; pointer-events: none; }
