/* 三两镖局 · 样式：墨底、纸牌、朱砂、金线；等宽小字、发丝线、角括号 */
:root {
	--ink: #0b0a08; --ink-1: #100e0b; --ink-2: #16130f; --ink-3: #1f1b16; --ink-4: #2b261f;
	--paper: #f2ebde; --paper-2: #e7ddc9; --paper-3: #d6c7aa; --on-paper: #1a1612; --on-paper-2: #6a5e50;
	--verm: #e2462b; --verm-2: #b3311a; --verm-3: #ff7a5c; --gold: #d9b36c; --gold-2: #9c7a3c;
	--steel: #93b6c6; --plum: #c983b0; --ash: #a39b8c;
	--fg: #f2ebde; --fg-2: rgba(242, 235, 222, .74); --fg-3: rgba(242, 235, 222, .52); --fg-4: rgba(242, 235, 222, .32);
	--line: rgba(242, 235, 222, .12); --line-2: rgba(242, 235, 222, .24); --line-3: rgba(242, 235, 222, .42);
	--serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
	--sans: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
	--mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	--hud-h: 46px; --tray-h: 46px; --cw: 140px;
	--sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
	--sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
	--noise: 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='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .24 0 0 0 0 .16 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
	--grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .95 0 0 0 0 .92 0 0 0 0 .87 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
	color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); overflow: hidden; }
body { color: var(--fg); font: 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: none; }
.kbd :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nojs { position: fixed; inset: auto 0 40% 0; text-align: center; font-family: var(--serif); }
.lab { font: 400 11px/1.4 var(--mono); letter-spacing: .08em; color: var(--fg-3); }
.kw { font-weight: 700; color: inherit; border-bottom: 1px dotted currentColor; }
.gold { color: var(--gold); }

/* 角括号：八段渐变画出四个角（--bk 颜色，--bs 长度，--bt 粗细） */
.brk, .btn, .pane, .ovl__panel, .ware-r, .tile, .rw, .opt, .end, .foe.aimed::before, .card__in::before {
	--bk: var(--line-3); --bs: 9px; --bt: 1px;
	background-image:
		linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
		linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
		linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
		linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk));
	background-repeat: no-repeat;
	background-size: var(--bs) var(--bt), var(--bt) var(--bs), var(--bs) var(--bt), var(--bt) var(--bs), var(--bs) var(--bt), var(--bt) var(--bs), var(--bs) var(--bt), var(--bt) var(--bs);
	background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%;
}

/* ———————— 外框 ———————— */
.app { position: fixed; inset: 0; overflow: hidden; background-color: var(--ink); isolation: isolate; }
.app::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: var(--grain), radial-gradient(120% 80% at 50% 25%, #1a1611 0%, rgba(11, 10, 8, 0) 62%), radial-gradient(90% 60% at 50% 110%, #140f0b 0%, rgba(11, 10, 8, 0) 70%); }
.stage { position: absolute; inset: 0; }
.app:not([data-screen="title"]):not([data-screen="school"]) .stage { top: calc(var(--hud-h) + var(--sat)); }
.scr { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ink-4) transparent; }
.app:not(.ready) .stage { opacity: 0; }

/* ———————— 按钮 ———————— */
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; padding: 8px 22px;
	border: 1px solid var(--line-2); background-color: rgba(11, 10, 8, .55); color: var(--fg); font: 600 15px/1.2 var(--sans); letter-spacing: .14em;
	transition: border-color .15s, background-color .15s, color .15s, transform .15s; }
.btn small { font: 400 11px/1.2 var(--mono); letter-spacing: .06em; color: inherit; opacity: .78; }
.btn:hover:not(:disabled) { border-color: var(--line-3); background-color: rgba(242, 235, 222, .06); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; }
.btn--v { --bk: rgba(255, 240, 220, .7); background-color: var(--verm); border-color: var(--verm); color: #fff7ea; }
.btn--v:hover:not(:disabled) { background-color: #ef5233; border-color: #ef5233; }
.btn--g { --bk: transparent; border-color: transparent; background-color: transparent; color: var(--fg-2); }
.btn--g:hover:not(:disabled) { color: var(--fg); border-color: var(--line); }
.btn--warn { color: var(--verm-3); }
.snd svg { width: 20px; height: 20px; fill: currentColor; }
.snd svg .w, .snd svg .x { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.snd[aria-pressed="true"] svg .x, .snd[aria-pressed="false"] svg .w { display: none; }

/* ———————— 印章 ———————— */
.seal { display: block; width: 28px; height: 28px; }
.seal rect { fill: var(--verm); }
.seal text { fill: #fff3e4; font-family: var(--serif); font-weight: 900; }
.seal--relic rect { fill: var(--ink-4); stroke: var(--gold); stroke-width: 1.4; }
.seal--relic text { fill: var(--gold); }

/* ———————— 顶栏 ———————— */
.hud { position: absolute; top: 0; left: 0; right: 0; z-index: 40; height: calc(var(--hud-h) + var(--sat)); display: flex; align-items: center; gap: clamp(8px, 1.6vw, 18px);
	padding: var(--sat) calc(10px + var(--sar)) 0 calc(12px + var(--sal)); border-bottom: 1px solid var(--line); background: rgba(11, 10, 8, .9); }
.hud__brand { display: flex; align-items: center; gap: 8px; font: 700 14px var(--serif); letter-spacing: .14em; white-space: nowrap; }
.hud__brand i { display: grid; place-items: center; width: 24px; height: 24px; background: var(--verm); color: #fff3e4; font: 900 14px/1 var(--serif); font-style: normal; letter-spacing: 0; }
.hud__i { display: flex; flex: 0 0 auto; align-items: baseline; gap: 3px; font: 600 14px/1 var(--mono); white-space: nowrap; cursor: default; }
.hud__i small { font-size: 11px; color: var(--fg-3); font-weight: 400; }
.hud__hp { position: relative; padding: 6px 8px 7px; min-width: 104px; border: 1px solid var(--line-2); }
.hud__hp i { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; transform-origin: left; transform: scaleX(var(--v, 1)); background: var(--verm); transition: transform .4s; }
.hud__hp b { color: var(--fg); }
.hud__hp.low b { color: var(--verm-3); }
.hud__gold b { color: var(--gold); }
.hud__step { font-family: var(--serif); font-weight: 700; letter-spacing: .08em; gap: 6px; }
.hud__step small { font-family: var(--mono); }
.hud__relics { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.hud__relics::-webkit-scrollbar { display: none; }
.relic { flex: 0 0 auto; display: block; width: 28px; height: 28px; transition: transform .2s; }
.relic .seal { width: 28px; height: 28px; }
.relic.bump { animation: bump .5s; }
.hud__btns { display: flex; gap: 4px; margin-left: auto; }
.hud__b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 9px; border: 1px solid var(--line); font: 12px var(--mono); color: var(--fg-2); }
.hud__b:hover { color: var(--fg); border-color: var(--line-2); }
.hud__b i { font-style: normal; color: var(--fg); }
.hud__rb b, .hud__b .nb { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--gold); color: var(--gold); font: 900 11px/1 var(--serif); }
.hud__rb, .hud__b .nb { display: none; }
.narrow .hud__b .nb { display: grid; }
.narrow .hud__rb { display: inline-flex; padding: 0 7px; gap: 5px; }
.narrow #hudDeckBtn { padding: 0 7px; gap: 5px; }
.hud__b .nb { border-color: var(--line-3); color: var(--fg-2); }
.narrow .hud__relics { display: none; }
.rlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rlist li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rlist .seal { width: 34px; height: 34px; }
.rlist b { font: 700 15px var(--serif); color: var(--gold); letter-spacing: .06em; }
.rlist p { margin: 2px 0 0; font-size: 13.5px; color: var(--fg-2); }
.rlist p.q { font-family: var(--serif); color: var(--fg-3); }
.hud__b svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#hudSnd svg path:first-child { fill: currentColor; stroke: none; }

/* ———————— 标题 ———————— */
.scr-title { overflow: hidden; }
.ttl__bg { position: absolute; inset: 0; }
.ttl__bg svg { width: 100%; height: 100%; display: block; }
.ttl { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 3vw;
	padding: calc(22px + var(--sat)) calc(clamp(20px, 5vw, 80px) + var(--sar)) calc(30px + var(--sab)) calc(clamp(20px, 6vw, 110px) + var(--sal)); }
.ttl__mark { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ttl__main { grid-column: 1; grid-row: 2; align-self: center; display: flex; align-items: flex-end; gap: clamp(22px, 3.4vw, 52px); }
.ttl__h { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 0; }
.ttl__h span { writing-mode: vertical-rl; font: 900 clamp(66px, 15.5vh, 142px)/1 var(--serif); letter-spacing: .12em; color: var(--paper); text-shadow: 0 6px 30px rgba(0, 0, 0, .6); }
.seal--t { width: clamp(42px, 6.4vh, 58px); height: clamp(42px, 6.4vh, 58px); }
.ttl__side { display: flex; flex-direction: column; gap: 22px; padding-bottom: 6px; }
.ttl__sub { font: 500 clamp(17px, 2.4vh, 21px)/1.85 var(--serif); color: var(--fg-2); letter-spacing: .08em; }
.ttl__btns { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: min(260px, 100%); }
.ttl__route { grid-column: 2; grid-row: 2; position: relative; min-height: 0; align-self: stretch; }
.ttl__route > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grat path { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.grat text { font: 10px var(--mono); fill: var(--fg-4); }
.canal { fill: none; stroke: var(--gold); stroke-width: 2; opacity: .85; }
.road { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-dasharray: 3 6; opacity: .8; }
.rlab { font: 11px var(--mono); fill: var(--gold); opacity: .7; letter-spacing: .06em; }
.rpt circle { fill: var(--gold); }
.rpt.end circle { fill: var(--verm); }
.rpt .halo { fill: none; stroke: var(--verm); stroke-width: 1; opacity: .6; }
.rpt text { fill: var(--fg); font: 600 17px var(--serif); letter-spacing: .12em; }
.rpt text.m { font: 10px var(--mono); fill: var(--fg-3); letter-spacing: .02em; font-weight: 400; }
.scr-title > .snd { position: absolute; left: calc(14px + var(--sal)); bottom: calc(14px + var(--sab)); display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; color: var(--fg-2); font: 12px var(--mono); border: 1px solid var(--line); background: rgba(11, 10, 8, .6); }
.narrow .ttl { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(120px, 30vh) auto; align-content: space-evenly; padding: calc(14px + var(--sat)) 18px calc(64px + var(--sab)); row-gap: 8px; overflow: auto; }
.narrow .ttl__route { grid-column: 1; grid-row: 2; }
.narrow .ttl__main { grid-column: 1; grid-row: 3; flex-direction: column; align-items: center; text-align: center; gap: 16px; align-self: start; }
.narrow .ttl__h { flex-direction: row; gap: 12px; }
.narrow .ttl__h span { writing-mode: horizontal-tb; font-size: clamp(44px, 13.5vw, 62px); letter-spacing: .08em; }
.narrow .ttl__side { align-items: center; gap: 16px; }
.narrow .ttl__btns { width: min(300px, 100%); }
.narrow .rpt text { font-size: 22px; }
.narrow .rpt text.m { font-size: 14px; }
.narrow .grat text, .narrow .rlab { font-size: 14px; }
.short .ttl__h span { font-size: clamp(50px, 14vh, 120px); }
.short .ttl__side { gap: 14px; }
.tiny .ttl { padding-top: 14px; padding-bottom: 14px; }
.tiny .ttl__h { gap: 8px; }
.tiny .ttl__h span { font-size: clamp(40px, 12.5vh, 60px); }
.tiny .seal--t { width: 34px; height: 34px; }
.tiny .ttl__side { gap: 10px; }
.tiny .ttl__btns .btn { min-height: 38px; padding: 6px 18px; }
.tiny .ttl__sub { font-size: 16px; line-height: 1.7; }
.tiny .ttl__rec { display: none; }
.portrait .ttl { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(160px, 34vh) auto; align-content: space-evenly; row-gap: 10px; padding-bottom: calc(70px + var(--sab)); }
.portrait .ttl__route { grid-column: 1; grid-row: 2; }
.portrait .ttl__main { grid-column: 1; grid-row: 3; flex-direction: column; align-items: center; text-align: center; align-self: start; }
.portrait .ttl__h { flex-direction: row; gap: 14px; }
.portrait .ttl__h span { writing-mode: horizontal-tb; font-size: clamp(56px, 9vw, 88px); }
.portrait .ttl__side { align-items: center; }

/* ———————— 选门派 ———————— */
.scr-school { padding: calc(18px + var(--sat)) 16px calc(70px + var(--sab)); }
.sch__h { text-align: center; margin: 8px auto 18px; }
.sch__h h2 { font: 900 clamp(26px, 4vw, 38px)/1.3 var(--serif); letter-spacing: .1em; }
.sch__row { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); justify-content: center; gap: clamp(14px, 3vw, 36px); }
.sch { position: relative; display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 20px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(31, 27, 22, .7), rgba(16, 14, 11, .7)); transition: border-color .2s; }
.sch:hover { border-color: var(--line-2); }
.sch__fig { color: var(--paper); align-self: end; }
.sch__fig .fig { width: 100%; height: auto; }
.sch__n { font: 900 34px/1.2 var(--serif); letter-spacing: .12em; margin: 2px 0 6px; }
.sch__m { font: 16px/1.7 var(--serif); color: var(--gold); margin-bottom: 8px; }
.sch__b { font-size: 14px; color: var(--fg-2); }
.sch__x { font-size: 13px; color: var(--fg-2); margin: 8px 0; padding: 8px 10px; border-left: 2px solid var(--verm); background: rgba(226, 70, 43, .06); }
.sch__deck { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 10px 0; }
.sch__deck li { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 2px; border: 1px solid var(--line); font-size: 12px; color: var(--fg-2); }
.sch__deck b { display: grid; place-items: center; width: 20px; height: 20px; background: var(--paper); color: var(--on-paper); font: 700 12px var(--serif); }
.sch__deck em { font: 11px var(--mono); font-style: normal; color: var(--fg-3); }
.sch__r { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--fg-2); margin: 6px 0 14px; }
.sch__r span b { display: block; color: var(--gold); font-family: var(--serif); }
.sch__go { width: 100%; }
.sch__back { position: absolute; left: calc(12px + var(--sal)); top: calc(10px + var(--sat)); }
.narrow .sch__row { grid-template-columns: minmax(0, 1fr); }
.narrow .sch { grid-template-columns: 76px 1fr; padding: 14px; gap: 12px; }
.narrow .sch__n { font-size: 28px; }

/* ———————— 过场 ———————— */
.scr-scene { display: grid; grid-template-rows: minmax(140px, 46%) auto; cursor: pointer; }
.scn__art { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.scn__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 10, 8, 0) 50%, rgba(11, 10, 8, .9)); }
.scn__art > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scn { width: 100%; height: 100%; display: block; color: var(--paper); overflow: visible; }
.scn .figN { color: rgba(242, 235, 222, .8); }
.scn .ground { stroke: var(--line-2); stroke-width: 1; }
.scn__p .p { fill: rgba(242, 235, 222, .74); }
.scn__p .ps { stroke: rgba(242, 235, 222, .7); stroke-width: 4; fill: none; }
.scn__p .acc { fill: var(--verm); }
.scn__p .acc2 { fill: var(--verm); opacity: .85; }
.scn__p .win { fill: var(--gold); opacity: .55; }
.scn .moon { fill: rgba(242, 235, 222, .5); }
.scn__p .hole2 { fill: var(--ink); }
.scn__p .hole2s { stroke: var(--ink); stroke-width: 2; fill: none; }
.scn__p .ink path { stroke: var(--on-paper); stroke-width: 3; opacity: .55; }
.scn__p .pt { font: 900 14px var(--serif); fill: var(--on-paper); text-anchor: middle; }
.scn__p .pt.v { font-size: 15px; }
.scn__p .pt.fl { fill: #fff3e4; }
.scn__p .pt.sg { fill: var(--gold); font-size: 15px; }
.scn__p .pt.half { clip-path: inset(0 0 52% 0); }
.scn__p .wave { stroke: rgba(242, 235, 222, .32); stroke-width: 1.5; fill: none; }
.scn__p .rain { stroke: rgba(242, 235, 222, .35); stroke-width: 1; }
.scn__p .steam { stroke: rgba(242, 235, 222, .5); stroke-width: 1.6; fill: none; }
.scn__txt { max-width: 720px; width: 100%; margin: 0 auto; padding: clamp(14px, 3vh, 30px) 20px calc(80px + var(--sab)); }
.scn__at { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.scn__at span:first-child { color: var(--gold); font-family: var(--serif); font-size: 14px; letter-spacing: .14em; }
.scn__lines p { font: 500 clamp(17px, 2.3vh, 20px)/1.95 var(--serif); color: var(--fg); margin: 0 0 .5em; animation: lineIn .5s ease-out both; }
.scn__lines p:not(:last-child) { color: var(--fg-2); }
.scn__btns { display: flex; gap: 10px; margin-top: 18px; scroll-margin-bottom: 70px; }
.narrow .scr-scene { grid-template-rows: minmax(120px, 30%) auto; }
.narrow .scn__lines p { font-size: 17px; line-height: 1.85; }

/* ———————— 地图 ———————— */
.scr-map { overflow: hidden; }
.map__bg { position: absolute; inset: 0; opacity: .8; }
.map__bg svg { width: 100%; height: 100%; display: block; }
.map { position: relative; width: min(600px, 100%); height: 100%; margin: 0 auto; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 12px calc(16px + var(--sar)) calc(14px + var(--sab)) calc(16px + var(--sal)); }
.map__h .lab { display: flex; justify-content: space-between; gap: 10px; }
.map__h h2 { font: 900 clamp(22px, 3.6vh, 30px)/1.3 var(--serif); letter-spacing: .12em; margin: 2px 0 4px; }
.map__h h2 i { font-style: normal; color: var(--gold); font-weight: 400; margin: 0 .3em; letter-spacing: -.1em; }
.prog { list-style: none; display: flex; padding: 0; margin: 4px 0 0; gap: 0; }
.prog li { flex: 1; position: relative; font: 12px var(--serif); color: var(--fg-4); padding-top: 9px; }
.prog li::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 1px; background: var(--line-2); }
.prog li::after { content: ""; position: absolute; left: 0; top: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); border: 1px solid var(--line-3); }
.prog li:last-child { flex: 0 0 auto; }
.prog li:last-child::before { display: none; }
.prog li.done { color: var(--fg-3); }
.prog li.done::before { background: var(--gold); }
.prog li.done::after { background: var(--gold); border-color: var(--gold); }
.prog li.now { color: var(--fg); }
.prog li.now::after { background: var(--verm); border-color: var(--verm); }
.prog b { font-weight: 500; }
.map__board { position: relative; margin: 14px 4px 8px; min-height: 150px; --bs: 14px; container-type: size; }
.map__lines { position: absolute; inset: 22px; width: calc(100% - 44px); height: calc(100% - 44px); overflow: visible; }
.map__lines path { stroke: var(--line-2); stroke-width: 1.4; stroke-dasharray: 2 6; fill: none; vector-effect: non-scaling-stroke; }
.map__lines path.live { stroke: var(--fg-2); stroke-dasharray: 4 5; }
.map__lines path.walked { stroke: var(--gold); stroke-dasharray: none; stroke-width: 2; }
.map__nodes { position: absolute; inset: 22px; }
.mn { position: absolute; transform: translate(-50%, -50%); width: clamp(30px, 10.5cqh, 44px); height: clamp(30px, 10.5cqh, 44px); border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--ink-2); color: var(--fg-3); font: 700 clamp(14px, 4.4cqh, 18px)/1 var(--serif); transition: transform .15s, background-color .15s; }
.mn b { font-weight: 700; }
.mn.open { color: var(--paper); border-color: var(--gold); background: var(--ink-3); cursor: pointer; animation: ring 1.8s ease-out infinite; }
.mn.open:hover, .mn.open:focus-visible { transform: translate(-50%, -50%) scale(1.12); background: var(--ink-4); }
.mn.off { opacity: .55; cursor: default; }
.mn.done { background: var(--ink-3); color: var(--fg-4); border-color: var(--gold-2); }
.mn.here { background: var(--verm); border-color: var(--verm); color: #fff3e4; box-shadow: 0 0 0 4px rgba(226, 70, 43, .2); }
.mn.t-elite:not(.here):not(.done) b, .legend .t-elite b { color: var(--verm-3); }
.mn.t-rest:not(.here):not(.done) b, .legend .t-rest b { color: var(--steel); }
.mn.t-shop:not(.here):not(.done) b, .legend .t-shop b, .mn.t-event:not(.here):not(.done) b, .legend .t-event b { color: var(--gold); }
.mn.t-boss { width: clamp(38px, 13.5cqh, 58px); height: clamp(38px, 13.5cqh, 58px); font-size: clamp(18px, 5.6cqh, 24px); border-color: var(--verm); color: var(--verm-3); }
.mn.t-boss.open { color: #fff3e4; background: var(--verm-2); }
.map__to, .map__from { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.map__to { top: -8px; background: var(--ink); padding: 0 8px; }
.map__from { bottom: -8px; background: var(--ink); padding: 0 8px; }
.map__hint { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; font-size: 13px; color: var(--fg-2); padding-top: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--fg-3); }
.legend i { font-style: normal; display: inline-flex; align-items: center; gap: 4px; }
.legend b { font: 700 13px var(--serif); color: var(--fg); }

/* ———————— 战斗 ———————— */
.scr-combat { overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr) calc(var(--cw) * 1.4 + 14px) calc(var(--tray-h) + var(--sab)); }
.field { position: relative; display: grid; grid-template-columns: minmax(130px, 24%) minmax(0, 1fr); align-items: end; gap: 12px; padding: 30px clamp(14px, 4vw, 64px) 6px; container-type: size; min-height: 0; }
.field__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.field__bg svg { width: 100%; height: 100%; display: block; }
.field__bg .ground { stroke: var(--line-2); stroke-width: 1; }
.field__bg .wv path { stroke: rgba(242, 235, 222, .07); stroke-width: 1.2; fill: none; }
.field__bg .wall { fill: rgba(242, 235, 222, .045); }
.me { position: relative; z-index: 2; grid-column: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.me__fig { height: clamp(70px, calc(100cqh - 120px), 300px); aspect-ratio: 120 / 160; color: var(--paper); }
.me__info { display: flex; flex-direction: column; align-items: center; gap: 4px; width: clamp(120px, 16vw, 180px); }
.fig { display: block; width: 100%; height: 100%; overflow: visible; }
.fig__b { fill: currentColor; stroke: currentColor; }
.fig__b > path[stroke-width] { fill: none; }
.fig__a { fill: var(--verm); stroke: var(--verm); }
.fig__b .ac { stroke: var(--verm); fill: none; }
.fig__b .hole { fill: var(--ink); stroke: var(--ink); }
.ttl__route .figN { color: rgba(242, 235, 222, .85); }
.me__fig .fig, .foe__fig .fig { transform-origin: 50% 96%; animation: breathe 3.6s ease-in-out infinite; }
.foe:nth-child(2) .foe__fig .fig { animation-delay: -1.2s; }
.foe:nth-child(3) .foe__fig .fig { animation-delay: -2.1s; }
.foes { position: relative; z-index: 2; grid-column: 2; display: flex; justify-content: center; align-items: flex-end; gap: clamp(6px, 2.4vw, 34px); min-width: 0; }
.foe { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 0 1 auto; min-width: 0; padding: 4px; cursor: default; outline-offset: 4px; transition: opacity .6s .25s; }
.foe__fig { height: clamp(64px, calc(100cqh - 112px), 300px); aspect-ratio: 120 / 160; max-width: 100%; color: #e8dcc6; transition: filter .2s; }
.foe.elite .foe__fig { color: #f0dcc0; filter: drop-shadow(0 0 14px rgba(226, 70, 43, .22)); }
.foe.boss .foe__fig { height: clamp(70px, calc(100cqh - 100px), 350px); }
.foe.dog .foe__fig { aspect-ratio: 120 / 104; height: clamp(44px, calc((100cqh - 112px) * .65), 195px); }
.narrow .foe.dog .foe__fig { height: clamp(40px, calc((100cqh - 190px) * .65), 136px); }
.narrow .foe.boss .foe__fig { height: clamp(60px, calc(100cqh - 170px), 250px); }
.foe__n { font: 700 14px/1.2 var(--serif); letter-spacing: .1em; white-space: nowrap; color: var(--fg); }
.foe.elite .foe__n { color: var(--verm-3); }
.foe .bar { width: clamp(84px, 12vw, 150px); }
.foe .chips { min-height: 20px; justify-content: center; }
.foe.aimable { cursor: crosshair; }
.foe.aimed::before { content: ""; position: absolute; inset: -2px; pointer-events: none; --bk: var(--verm); --bs: 14px; --bt: 2px; }
.foe.aimed .foe__fig { filter: drop-shadow(0 0 10px rgba(226, 70, 43, .55)); }
.foe.dead { opacity: 0; pointer-events: none; }
.foe.dying .foe__fig { animation: die .7s ease-in forwards; }
.foe.hit .foe__fig, .me.hit .me__fig { animation: hitf .3s ease-out; }
.foe.tink .foe__fig, .me.tink .me__fig { animation: tink .25s ease-out; }
.foe.lunge .foe__fig { animation: lunge .38s ease-out; }
.foe.flex .foe__fig { animation: flex .38s ease-out; }
.foe__say { position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translate(-50%, 6px); max-width: 220px; width: max-content; padding: 5px 9px; background: var(--paper); color: var(--on-paper); font: 600 13px/1.4 var(--serif); opacity: 0; pointer-events: none; z-index: 6; transition: opacity .2s, transform .2s; }
.foe__say::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--paper); transform: translateX(-50%) rotate(45deg); }
.foe__say.on { opacity: 1; transform: translate(-50%, 0); }
.foe__it { min-height: 26px; display: flex; justify-content: center; }
.its { display: flex; gap: 4px; justify-content: center; cursor: help; }
.it { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px 0 3px; border: 1px solid var(--line-2); background: rgba(11, 10, 8, .78); font: 700 13px/1 var(--mono); color: var(--fg); }
.it b { display: grid; place-items: center; width: 18px; height: 18px; font: 900 12px/1 var(--serif); color: #fff3e4; background: var(--ash); }
.it em { font-style: normal; }
.it:only-child:not(.it--atk) { padding-right: 3px; }
.it--atk { border-color: rgba(226, 70, 43, .6); color: var(--verm-3); }
.it--atk b { background: var(--verm); }
.it--def b { background: #5f7f8e; }
.it--buf b { background: var(--gold-2); }
.it--dbf b { background: #8b4e74; }
.it--tired b { background: #4a443b; }
.bar { position: relative; height: 16px; border: 1px solid var(--line-2); background: rgba(11, 10, 8, .72); }
.bar__hp { position: absolute; left: 2px; right: 2px; top: 2px; bottom: 2px; transform-origin: left; transform: scaleX(var(--v, 1)); background: linear-gradient(90deg, var(--verm-2), var(--verm)); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.bar.blocked .bar__hp { background: linear-gradient(90deg, #47616d, var(--steel)); }
.bar__t { position: relative; display: block; text-align: center; font: 700 11px/14px var(--mono); color: #fff7ea; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
.bar__blk { position: absolute; left: -13px; top: 50%; transform: translateY(-50%); width: 24px; height: 26px; display: grid; place-items: center; background: var(--steel); color: var(--ink); font: 800 11px/1 var(--mono); clip-path: polygon(50% 0, 100% 16%, 100% 62%, 50% 100%, 0 62%, 0 16%); }
.bar--p { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 3px; min-height: 0; }
.chip { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 5px 0 2px; border: 1px solid var(--line-2); background: rgba(11, 10, 8, .8); font: 600 11px/1 var(--mono); cursor: help; }
.chip b { display: grid; place-items: center; width: 16px; height: 16px; font: 900 11px/1 var(--serif); color: var(--ink); background: var(--paper); }
.chip em { font-style: normal; }
.chip.c-verm b { background: var(--verm); color: #fff3e4; }
.chip.c-gold b { background: var(--gold); }
.chip.c-plum b { background: var(--plum); }
.chip.c-ash b { background: var(--ash); }
.chip.c-steel b { background: var(--steel); }
.chip.bad { border-color: rgba(201, 131, 176, .45); }
.combo { display: flex; align-items: center; gap: 4px; min-height: 18px; cursor: help; }
.combo .lab { margin-right: 2px; }
.combo i { width: 8px; height: 8px; transform: rotate(45deg); border: 1px solid var(--line-3); }
.combo i.on { background: var(--paper); border-color: var(--paper); box-shadow: 0 0 6px rgba(242, 235, 222, .5); }
.combo i.d { border-radius: 50%; transform: none; }
.combo i.d.on { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 6px rgba(217, 179, 108, .6); }
.combo em { font: 700 12px var(--mono); font-style: normal; color: var(--fg-2); margin-left: 3px; }
.combo.bump { animation: bump .4s; }
.endturn { position: absolute; z-index: 5; right: clamp(14px, 3vw, 48px); bottom: 10px; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; background: var(--verm); color: #fff7ea; font: 700 15px var(--sans); letter-spacing: .14em; box-shadow: 0 8px 22px -10px rgba(226, 70, 43, .8); transition: filter .15s, opacity .2s, transform .15s; }
.endturn kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid rgba(255, 247, 234, .5); letter-spacing: 0; }
.endturn:hover:not(:disabled) { filter: brightness(1.1); }
.endturn:disabled { opacity: .35; filter: grayscale(.6); }
.endturn.nudge { animation: nudge 1.6s ease-in-out infinite; }
.banner { position: absolute; left: 50%; top: 38%; z-index: 30; transform: translate(-50%, -50%); text-align: center; pointer-events: none; opacity: 0; white-space: nowrap; }
.banner b { display: block; font: 900 clamp(30px, 6cqh, 58px)/1.1 var(--serif); letter-spacing: .32em; padding-left: .32em; color: var(--paper); text-shadow: 0 4px 24px rgba(0, 0, 0, .8); }
.banner b::after { content: ""; display: block; height: 5px; margin: 8px auto 0; width: 70%; background: var(--verm); clip-path: polygon(0 40%, 8% 0, 100% 30%, 96% 100%, 4% 80%); }
.banner .lab { color: var(--fg-2); }
.banner.on { animation: ban 1.2s ease-out; }
.toast { position: absolute; left: 50%; top: 6px; z-index: 31; transform: translate(-50%, -6px); max-width: min(90%, 520px); padding: 6px 12px; background: rgba(27, 24, 20, .95); border: 1px solid var(--line-2); font-size: 13px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.field.shake { animation: shake .32s linear; }
.field.shake2 { animation: shake2 .36s linear; }
.field.drop::after { content: ""; position: absolute; inset: 8px; border: 1px dashed rgba(226, 70, 43, .5); pointer-events: none; }

/* —— 手牌与卡牌 —— */
.handzone { position: relative; z-index: 20; min-height: 0; }
.hand { position: absolute; inset: 0; }
.card { --x: 0px; --y: 0px; --r: 0deg; --s: 1; position: absolute; left: 0; top: 8px; width: var(--cw); height: calc(var(--cw) * 1.4); transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(var(--s)); transform-origin: 50% 85%;
	transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .25s, filter .2s; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; outline: none; }
.card__in { position: absolute; inset: 0; overflow: hidden; border-radius: calc(var(--cw) * .045); background: var(--noise), linear-gradient(170deg, #f6f0e4 0%, var(--paper) 45%, var(--paper-2) 100%); color: var(--on-paper);
	box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(26, 22, 18, .22); }
.card__in::before { content: ""; position: absolute; inset: calc(var(--cw) * .03); pointer-events: none; --bk: rgba(26, 22, 18, .42); --bs: calc(var(--cw) * .07); }
.card.r-uncommon .card__in { box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(26, 22, 18, .2), inset 0 0 0 calc(var(--cw) * .018) rgba(156, 122, 60, .55); }
.card.r-rare .card__in { box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(26, 22, 18, .2), inset 0 0 0 calc(var(--cw) * .022) rgba(226, 70, 43, .6); }
.card.r-curse .card__in, .card.r-status .card__in { background: var(--noise), linear-gradient(170deg, #3a332a, #221e18); color: var(--fg); }
.card.r-curse .card__in::before, .card.r-status .card__in::before { --bk: rgba(242, 235, 222, .3); }
.card__cost { position: absolute; z-index: 2; left: calc(var(--cw) * .05); top: calc(var(--cw) * .05); width: calc(var(--cw) * .21); height: calc(var(--cw) * .21); border-radius: 50%; display: grid; place-items: center;
	background: var(--on-paper); color: var(--paper); font: 800 calc(var(--cw) * .13)/1 var(--mono); box-shadow: 0 0 0 calc(var(--cw) * .012) var(--paper), 0 0 0 calc(var(--cw) * .024) rgba(26, 22, 18, .5); }
.card__cost:empty { display: none; }
.card__kind { position: absolute; z-index: 2; right: calc(var(--cw) * .07); top: calc(var(--cw) * .075); font: 500 max(8px, calc(var(--cw) * .066))/1 var(--mono); letter-spacing: .04em; color: var(--on-paper-2); }
.r-curse .card__kind, .r-status .card__kind { color: var(--fg-3); }
.card__art { position: absolute; left: calc(var(--cw) * .07); right: calc(var(--cw) * .07); top: calc(var(--cw) * .2); height: calc(var(--cw) * .55); border-bottom: 1px solid rgba(26, 22, 18, .16); }
.cart { width: 100%; height: 100%; display: block; overflow: visible; }
.cart__sw { fill: #5c7684; opacity: .85; }
.k-atk .cart__sw { fill: var(--verm); opacity: .88; }
.k-xin .cart__sw { fill: var(--gold); opacity: .9; }
.r-curse .cart__sw, .r-status .cart__sw { fill: #6b5f52; }
.cart__gap path { stroke: var(--paper); }
.r-curse .cart__gap path, .r-status .cart__gap path { stroke: #2c2620; }
.cart__g { font: 900 44px var(--serif); fill: var(--on-paper); }
.r-curse .cart__g, .r-status .cart__g { fill: var(--paper); }
.cart__sun { fill: none; stroke: var(--verm); stroke-width: 1.4; }
.card__name { position: absolute; left: 0; right: 0; top: calc(var(--cw) * .78); text-align: center; font: 800 max(11px, calc(var(--cw) * .115))/1.2 var(--serif); letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 calc(var(--cw) * .06); }
.card.up .card__name { color: var(--verm-2); }
.card__name sup { font: 700 .8em var(--mono); vertical-align: .25em; margin-left: 1px; }
.card__txt { position: absolute; left: calc(var(--cw) * .07); right: calc(var(--cw) * .07); top: calc(var(--cw) * .94); bottom: calc(var(--cw) * .09); display: block; text-align: center; word-break: break-all; line-break: strict;
	font: 500 max(8.5px, calc(var(--cw) * .079))/1.45 var(--sans); color: #2c251e; overflow: hidden; }
.r-curse .card__txt, .r-status .card__txt { color: var(--fg-2); }
.card.tx-m .card__txt { font-size: max(8px, calc(var(--cw) * .072)); }
.card.tx-l .card__txt { font-size: max(7.5px, calc(var(--cw) * .066)); line-height: 1.38; }
.card__txt em { font: 800 1.12em/1 var(--mono); font-style: normal; color: var(--on-paper); }
.card__txt em.up { color: #2e7d4f; }
.card__txt em.dn { color: var(--verm-2); }
.card__txt .kw { border-bottom-color: rgba(26, 22, 18, .35); }
.card__mark { position: absolute; right: calc(var(--cw) * .055); bottom: calc(var(--cw) * .05); width: calc(var(--cw) * .12); height: calc(var(--cw) * .12); display: grid; place-items: center; background: var(--verm); color: #fff3e4; font: 900 calc(var(--cw) * .075)/1 var(--serif); font-style: normal; opacity: .9; }
.card.ok .card__in { box-shadow: 0 0 0 2px rgba(217, 179, 108, .95), 0 0 18px -2px rgba(217, 179, 108, .45), 0 12px 26px -12px rgba(0, 0, 0, .9); }
.card.no .card__in { filter: saturate(.55) brightness(.78); }
.card.sel .card__in { box-shadow: 0 0 0 2px var(--verm), 0 0 26px -2px rgba(226, 70, 43, .6), 0 16px 30px -12px rgba(0, 0, 0, .9); }
.kbd .card:focus-visible .card__in { box-shadow: 0 0 0 3px var(--gold), 0 12px 26px -12px rgba(0, 0, 0, .9); }
.card.dragging { transition: transform .05s linear, opacity .2s; z-index: 90 !important; }
.card.armed .card__in { box-shadow: 0 0 0 3px var(--verm), 0 0 30px rgba(226, 70, 43, .7); }
.card.enter { opacity: 0; }
.card.played { opacity: 0; transition: transform .32s cubic-bezier(.5, 0, .7, .4), opacity .22s .1s; pointer-events: none; }
.card.gone { opacity: 0; transition: transform .36s ease-in, opacity .3s .06s; pointer-events: none; }
.card.deny { animation: deny .3s; }
.inspect { position: absolute; z-index: 75; bottom: calc(var(--tray-h) + var(--sab) + 18px); left: 0; width: 236px; padding: 10px 12px; background: rgba(22, 19, 15, .97); border: 1px solid var(--line-2); font-size: 13px; line-height: 1.6; color: var(--fg-2); pointer-events: none; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .9); }
.insp__h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.insp__h b { font: 800 16px var(--serif); color: var(--fg); letter-spacing: .06em; }
.insp__t { color: var(--fg); margin-bottom: 6px; }
.inspect:not(.full) .insp__h, .inspect:not(.full) .insp__t { display: none; }
.insp__t em { font: 800 1.05em var(--mono); font-style: normal; color: var(--gold); }
.insp__t em.up { color: #8fd3a5; }
.insp__t em.dn { color: var(--verm-3); }
.inspect p { margin: 0 0 4px; }
.inspect p .kw { color: var(--gold); border: 0; margin-right: 6px; }
.insp__q { font-family: var(--serif); color: var(--fg-3); }
.insp__go { color: var(--verm-3); font-weight: 700; }
.aim { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; opacity: 0; overflow: visible; }
.aim.on { opacity: 1; }
.aim path { fill: none; stroke: var(--verm); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 9 7; opacity: .85; }
.aim circle { fill: var(--verm); }
.aim.lock path { stroke-dasharray: none; opacity: 1; }
.tray { position: relative; z-index: 25; display: flex; align-items: center; gap: 8px; padding: 0 calc(12px + var(--sar)) var(--sab) calc(12px + var(--sal)); border-top: 1px solid var(--line); background: rgba(11, 10, 8, .92); }
.standalone .tray { padding-right: calc(186px + var(--sar)); }
.orb { position: relative; flex: 0 0 auto; width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center; align-content: center; border: 1px solid var(--gold);
	background: radial-gradient(circle at 50% 38%, #4a3b20 0%, #1c170f 70%); box-shadow: 0 0 0 4px rgba(11, 10, 8, .9), 0 0 22px -4px rgba(217, 179, 108, .5); cursor: help; }
.orb b { font: 800 24px/1 var(--mono); color: var(--gold); }
.orb small { font: 9px/1 var(--mono); color: var(--fg-3); letter-spacing: .1em; margin-top: 2px; }
.orb.zero b { color: var(--fg-4); }
.orb.zero { box-shadow: 0 0 0 4px rgba(11, 10, 8, .9); border-color: var(--gold-2); }
.orb.bump, .pile.bump { animation: bump .5s; }
.pile { display: inline-flex; align-items: baseline; gap: 5px; height: 30px; padding: 0 9px; border: 1px solid var(--line); font: 11px var(--mono); color: var(--fg-3); }
.pile b { font: 700 13px var(--mono); color: var(--fg); }
.pile:hover { border-color: var(--line-2); color: var(--fg-2); }
.tray__turn { margin-left: 4px; white-space: nowrap; }
.tray__hint { flex: 1; min-width: 0; font-size: 12px; color: var(--fg-3); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.fnum { position: absolute; transform: translate(-50%, -50%); font: 800 24px/1 var(--mono); white-space: nowrap; animation: fup 1.15s ease-out forwards; text-shadow: 0 2px 0 rgba(0, 0, 0, .7), 0 0 12px rgba(0, 0, 0, .6); }
.fnum.dmg { color: #fff1e2; font-size: 28px; }
.fnum.hurt { color: var(--verm-3); font-size: 28px; }
.fnum.blk { color: var(--steel); font-size: 15px; }
.fnum.heal { color: #9ad6ab; }
.fnum.poison { color: var(--plum); }
.fnum.gold { color: var(--gold); font-size: 17px; }
.fnum.buf { color: var(--gold); font: 700 14px var(--sans); }
.fnum.debuf { color: var(--plum); font: 700 14px var(--sans); }
.fnum.note { color: var(--fg-2); font: 700 13px var(--sans); }

/* 窄屏（手机竖屏） */
.narrow { --hud-h: 44px; --tray-h: 42px; }
.narrow .hud__brand span, .narrow #hudDeckBtn span { display: none; }
.narrow .hud { gap: 8px; }
.narrow .hud__hp { min-width: 0; padding: 6px 6px 7px; }
.narrow .hud__step small { display: none; }
.narrow .scr-combat { grid-template-rows: minmax(0, 1fr) calc(var(--cw) * 1.4 + 10px) calc(var(--tray-h) + var(--sab)); }
.narrow .field { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; padding: 32px 8px 6px; gap: 6px; }
.narrow .foes { grid-column: 1; grid-row: 1; gap: 2px; }
.narrow .foe__fig { height: clamp(56px, calc(100cqh - 190px), 210px); }
.narrow .foe .bar { width: min(28vw, 120px); }
.narrow .foe__n { font-size: 13px; letter-spacing: .04em; }
.narrow .it { height: 22px; font-size: 12px; }
.narrow .me { grid-column: 1; grid-row: 2; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; padding-right: 128px; }
.narrow .me__fig { height: 62px; flex: 0 0 auto; }
.narrow .me__info { width: auto; flex: 1; align-items: stretch; max-width: 240px; }
.narrow .me__info .bar { width: 100%; }
.narrow .endturn { right: 8px; bottom: 8px; height: 46px; padding: 0 14px; }
.narrow .endturn kbd { display: none; }
.narrow .inspect { left: 8px !important; right: 8px; top: 6px; bottom: auto !important; width: auto; font-size: 14px; }
.narrow .toast { top: auto; bottom: 10px; }
.narrow .tray__hint { display: none; }
.narrow .tray__turn { margin-left: auto; }
.standalone .narrow .tray { padding-right: calc(176px + var(--sar)); }
.standalone .narrow { --tray-h: 54px; }
.standalone .ovl { padding-bottom: calc(62px + var(--sab)); }
.standalone .narrow .map { padding-bottom: calc(62px + var(--sab)); }
.standalone .narrow .tray__turn { display: none; }
.narrow .orb { width: 50px; height: 50px; margin-top: -22px; }
.narrow .pile { padding: 0 7px; }
.narrow .banner b { letter-spacing: .2em; padding-left: .2em; }
.short .field { padding-top: 26px; }
.short .scr-title .ttl__mark { margin-bottom: 8px; }
.tiny .foe .chips, .tiny .me .chips { min-height: 0; }
.tiny .foe__n { font-size: 12px; }
.tiny .field { padding-top: 22px; }

/* ———————— 面板：战利品、客栈、市集、结局 ———————— */
.pane { position: relative; width: min(820px, calc(100% - 24px)); margin: clamp(10px, 3vh, 36px) auto calc(70px + var(--sab)); padding: clamp(16px, 3vw, 30px); border: 1px solid var(--line); background-color: rgba(22, 19, 15, .9); }
.pane__h { margin-bottom: 14px; }
.pane__h h2 { font: 900 clamp(24px, 3.4vw, 34px)/1.25 var(--serif); letter-spacing: .1em; margin: 4px 0 4px; }
.pane__note { font-size: 14px; color: var(--fg-2); }
.pane__btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.rws { display: grid; gap: 8px; }
.rw { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-2); text-align: left; background-color: rgba(11, 10, 8, .4); transition: border-color .15s, opacity .2s; }
button.rw:hover:not(:disabled) { border-color: var(--gold); }
.rw.taken { opacity: .45; }
.rw span { display: flex; flex-direction: column; min-width: 0; }
.rw b { font: 700 16px var(--serif); letter-spacing: .06em; }
.rw small { font-size: 13px; color: var(--fg-2); }
.rw__ic { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; font: 900 18px var(--serif); font-style: normal; border: 1px solid var(--line-2); }
.rw__ic.gold { color: var(--ink); background: var(--gold); border-color: var(--gold); }
.rw__ic .seal { width: 34px; height: 34px; }
.rw__ic.card-ic { background: var(--paper); color: var(--on-paper); }
.pick { display: flex; justify-content: center; gap: clamp(8px, 2.4vw, 26px); flex-wrap: wrap; margin: 18px 0 4px; }
.pick__c { --cw: clamp(104px, 21vw, 168px); }
.pick .card, .grid .card, .ware .card, .pk__prev .card { position: relative; left: auto; top: auto; transform: none; transition: transform .18s; }
.pick .card:hover, .pick .card:focus-visible, .ware .card[data-buy]:hover, .ware .card[data-buy]:focus-visible, .grid .card.pickable:hover, .grid .card.pickable:focus-visible { transform: translateY(-6px); }
.pick .card { cursor: pointer; }
.grid { --cw: clamp(96px, 15vw, 132px); display: grid; grid-template-columns: repeat(auto-fill, var(--cw)); gap: 14px 12px; justify-content: center; }
.grid .card { cursor: default; }
.grid .card.pickable { cursor: pointer; }
.grid .card.unpickable { opacity: .35; }
.grid .card.chosen .card__in { box-shadow: 0 0 0 3px var(--verm), 0 0 24px rgba(226, 70, 43, .5); }
.card--mini { --cw: 92px; }
.pane--rest { overflow: hidden; }
.rest__art { height: 150px; margin: calc(clamp(16px, 3vw, 30px) * -1) calc(clamp(16px, 3vw, 30px) * -1) 14px; border-bottom: 1px solid var(--line); opacity: .9; }
.rest__opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; border: 1px solid var(--line-2); background-color: rgba(11, 10, 8, .45); transition: border-color .15s, background-color .15s; }
.tile:hover:not(:disabled) { border-color: var(--gold); background-color: rgba(217, 179, 108, .06); }
.tile:disabled { opacity: .4; }
.tile b { font: 900 26px var(--serif); letter-spacing: .14em; }
.tile span { font-size: 15px; color: var(--fg); }
.tile small { font: 12px var(--mono); color: var(--fg-3); }
.shop { width: min(980px, calc(100% - 24px)); margin: clamp(10px, 3vh, 30px) auto calc(80px + var(--sab)); }
.shop__sec { margin-bottom: 16px; }
.shop__sec h3 { padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.shop__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wares { --cw: clamp(100px, 13vw, 140px); display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.ware { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ware .card[data-buy] { cursor: pointer; }
.ware.sold .card { opacity: .25; }
.ware.poor .card { filter: saturate(.6) brightness(.8); }
.price { font: 700 13px var(--mono); color: var(--gold); font-style: normal; }
.price i { font-style: normal; margin-left: 6px; padding: 1px 4px; background: var(--verm); color: #fff3e4; font-size: 11px; }
.ware.sold .price { color: var(--fg-4); }
.wares-r { display: grid; gap: 8px; }
.ware-r { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-2); background-color: rgba(11, 10, 8, .45); text-align: left; transition: border-color .15s; }
.ware-r:hover:not(:disabled) { border-color: var(--gold); }
.ware-r:disabled { opacity: .45; }
.ware-r .seal { width: 34px; height: 34px; }
.ware-r span { display: flex; flex-direction: column; min-width: 0; }
.ware-r b { font: 700 15px var(--serif); letter-spacing: .06em; }
.ware-r small { font-size: 12.5px; color: var(--fg-2); line-height: 1.5; }
.ware-r .ic { display: grid; place-items: center; width: 34px; height: 34px; background: var(--paper); color: var(--on-paper); font: 900 17px var(--serif); font-style: normal; }
.end { position: relative; width: min(640px, calc(100% - 24px)); margin: clamp(14px, 5vh, 50px) auto calc(80px + var(--sab)); padding: clamp(20px, 4vw, 40px); text-align: center; border: 1px solid var(--line); background-color: rgba(22, 19, 15, .9); }
.end__seal .seal { width: 76px; height: 76px; margin: 0 auto 12px; }
.seal--lose rect { fill: #4a443b; }
.end h2 { font: 900 clamp(30px, 5vw, 46px)/1.25 var(--serif); letter-spacing: .14em; margin: 6px 0 8px; }
.end__q { font: 17px/1.8 var(--serif); color: var(--fg-2); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 20px 0 14px; background: var(--line); border: 1px solid var(--line); }
.stats div { background: var(--ink-2); padding: 10px 6px; }
.stats dt { font: 11px var(--mono); color: var(--fg-3); letter-spacing: .08em; }
.stats dd { margin: 2px 0 0; font: 800 24px/1.2 var(--mono); color: var(--fg); }
.stats dd small { font-size: 12px; color: var(--fg-3); margin-left: 2px; }
.stats dd.sm { font-size: 17px; }
.end__rec { margin-top: 6px; }
.end .pane__btns { justify-content: center; }

/* ———————— 奇遇 ———————— */
.ev { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(16px, 3vw, 40px); width: min(1080px, calc(100% - 24px)); margin: clamp(12px, 4vh, 44px) auto calc(80px + var(--sab)); align-items: start; }
.ev__art { position: relative; aspect-ratio: 400 / 260; border: 1px solid var(--line); overflow: hidden; --bs: 14px; }
.ev__txt h2 { font: 900 clamp(26px, 3.6vw, 38px)/1.25 var(--serif); letter-spacing: .12em; margin: 4px 0 12px; }
.ev__txt > p:not(.lab) { font: 17px/1.9 var(--serif); color: var(--fg); margin-bottom: .5em; }
.opts { display: grid; gap: 8px; margin-top: 16px; }
.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 11px 14px; border: 1px solid var(--line-2); background-color: rgba(11, 10, 8, .45); text-align: left; transition: border-color .15s, background-color .15s; }
.opt:hover:not(:disabled) { border-color: var(--gold); background-color: rgba(217, 179, 108, .06); }
.opt:disabled { opacity: .4; }
.opt b { font: 700 16px var(--serif); letter-spacing: .06em; }
.opt small { font: 12px/1.5 var(--mono); color: var(--gold); letter-spacing: .02em; }
.ev__res { margin-top: 16px; padding: 14px 16px; border-left: 2px solid var(--verm); background: rgba(226, 70, 43, .06); animation: lineIn .4s ease-out; }
.ev__res p { font: 16px/1.85 var(--serif); margin-bottom: 8px; }
.gains { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 12px; }
.gains li { font: 12px var(--mono); padding: 2px 8px; border: 1px solid var(--gold-2); color: var(--gold); }
.gains li.neg { border-color: rgba(226, 70, 43, .5); color: var(--verm-3); }
.narrow .ev { grid-template-columns: minmax(0, 1fr); }
.narrow .ev__art { aspect-ratio: 400 / 200; }
.narrow .shop__row, .narrow .rest__opts { grid-template-columns: minmax(0, 1fr); }
.narrow .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ———————— 浮层 ———————— */
.ovl { position: absolute; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: calc(12px + var(--sat)) 12px calc(12px + var(--sab)); background: rgba(6, 5, 4, .78); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.ovl__panel { position: relative; width: min(980px, 100%); max-height: 100%; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line-2); background-color: var(--ink-2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9); animation: popIn .22s ease-out; }
.ovl--small { width: min(440px, 100%); }
.ovl__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.ovl__h h2 { font: 900 20px var(--serif); letter-spacing: .1em; }
.ovl__x { font: 12px var(--mono); color: var(--fg-2); padding: 6px 10px; border: 1px solid var(--line); }
.ovl__x:hover { color: var(--fg); border-color: var(--line-2); }
.ovl__b { padding: 16px; overflow: auto; overscroll-behavior: contain; min-height: 0; flex: 1 1 auto; }
.ovl__h, .ovl__f { flex: 0 0 auto; }
.ovl__f { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.ovl__note { font-size: 14px; color: var(--fg-2); margin-bottom: 12px; }
.pk__prev { display: flex; align-items: center; gap: 10px; min-height: 20px; font-size: 14px; }
.pk__prev .card { --cw: 108px; }
.pk__btns { display: flex; gap: 8px; margin-left: auto; }
.menu { display: grid; gap: 8px; }
.menu .snd { flex-direction: row; gap: 8px; }
.how p { font-size: 14.5px; line-height: 1.8; color: var(--fg-2); margin-bottom: 10px; }
.how b { color: var(--fg); font-family: var(--serif); }
.how b.v { color: var(--verm-3); }
.how .lab { margin: 14px 0 6px; }
.how ul { margin: 0; padding-left: 1.2em; font-size: 14px; line-height: 1.8; color: var(--fg-2); }
.how__kw { list-style: none; padding: 0 !important; }
.how__kw li { padding: 3px 0; border-bottom: 1px solid var(--line); }
.how__kw .kw { color: var(--gold); border: 0; margin-right: 10px; }
.stats--rec { margin: 0 0 14px; }
.empty { text-align: center; color: var(--fg-3); padding: 20px; }
.tip { position: absolute; left: 0; top: 0; z-index: 120; max-width: 270px; padding: 9px 11px; background: #1d1915; border: 1px solid var(--line-2); box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .9); font-size: 13px; line-height: 1.6; color: var(--fg-2); pointer-events: none; }
.tip b { display: block; font: 800 14px var(--serif); color: var(--gold); letter-spacing: .06em; margin-bottom: 2px; }
.tip span { display: block; }
.tip span.q { color: var(--fg-3); font-family: var(--serif); margin-top: 4px; }
.tip .kw { color: var(--fg); border: 0; }
.gtoast { position: absolute; left: 50%; top: calc(var(--hud-h) + var(--sat) + 10px); z-index: 110; transform: translate(-50%, -8px); padding: 8px 14px; background: var(--paper); color: var(--on-paper); font: 600 14px var(--serif); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 24px); }
.gtoast.on { opacity: 1; transform: translate(-50%, 0); }

/* ———————— 动画 ———————— */
@keyframes breathe { 50% { transform: scaleY(1.018) translateY(-.5%); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(217, 179, 108, .45); } 100% { box-shadow: 0 0 0 12px rgba(217, 179, 108, 0); } }
@keyframes bump { 30% { transform: scale(1.18); } }
@keyframes nudge { 50% { box-shadow: 0 0 0 6px rgba(226, 70, 43, .25), 0 8px 22px -10px rgba(226, 70, 43, .8); } }
@keyframes lineIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes fup { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 14% { opacity: 1; transform: translate(-50%, -70%) scale(1.18); } 30% { transform: translate(-50%, -80%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -210%); } }
@keyframes ffade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hitf { 0% { filter: brightness(2.6); transform: translateX(0); } 30% { transform: translateX(7px); } 100% { filter: none; transform: none; } }
@keyframes tink { 40% { filter: drop-shadow(0 0 10px rgba(147, 182, 198, .9)); } }
@keyframes lunge { 40% { transform: translateX(-26px) scale(1.04); } }
@keyframes flex { 40% { transform: translateY(-6px) scale(1.04); } }
@keyframes die { to { opacity: 0; transform: translateY(14px) scale(.92); filter: blur(2px); } }
@keyframes shake { 20% { transform: translate(-5px, 2px); } 40% { transform: translate(5px, -2px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, -1px); } }
@keyframes shake2 { 15% { transform: translate(-8px, 3px); } 35% { transform: translate(8px, -3px); } 55% { transform: translate(-6px, 2px); } 75% { transform: translate(4px, -1px); } }
@keyframes ban { 0% { opacity: 0; transform: translate(-50%, -42%) scale(1.06); } 18%, 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -54%); } }
@keyframes deny { 25% { translate: -6px 0; } 50% { translate: 6px 0; } 75% { translate: -3px 0; } }
.is-paused *, .is-paused *::before, .is-paused *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; }
	.me__fig .fig, .foe__fig .fig, .mn.open, .endturn.nudge { animation: none !important; }
	.fnum { animation: ffade 1.15s ease-out forwards !important; }
	.banner.on { animation: ffade 1.2s ease-out; transform: translate(-50%, -50%); }
	.card { transition: opacity .15s, filter .15s; }
	.scn__lines p, .ev__res, .ovl__panel { animation: none; }
	.foe.lunge .foe__fig, .foe.flex .foe__fig, .foe.hit .foe__fig, .me.hit .me__fig { animation: none; }
}
@media (hover: none) { .btn:hover:not(:disabled) { background-color: rgba(11, 10, 8, .55); } .btn--v:hover:not(:disabled) { background-color: var(--verm); } }

/* ———————— 一步步看 ———————— */
/* 启动钮只在标题页显示（底部正中）；上路以后从「暂歇」里一步步看，不压住手牌和顶栏 */
html.jh-run:not(.hwt-on) .hwt[data-hwt] .hwt-launch { display: none !important; }
/* 手机矮屏（比如嵌在展馆页里）：标题页收紧一点，「出镖」三个钮不再伸到底下「声音」和启动钮那一条里 */
.narrow.short:not(.tiny) .ttl { grid-template-rows: auto minmax(90px, 22vh) auto; }
.narrow.short:not(.tiny) .ttl__main { gap: 10px; }
.narrow.short:not(.tiny) .ttl__h span { font-size: clamp(40px, 11.5vw, 54px); }
.narrow.short:not(.tiny) .ttl__side { gap: 10px; }
.narrow.short:not(.tiny) .ttl__sub { font-size: 16px; line-height: 1.7; }
.narrow.short:not(.tiny) .ttl__btns .btn { min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
/* 更矮的窗口：底下照样给「声音」和启动钮留一条；手机上把小地图收起来（路线在副标题里也写着） */
.tiny .ttl { padding-bottom: calc(60px + var(--sab)); }
.narrow.tiny .ttl { grid-template-rows: auto 0 auto; }
.narrow.tiny .ttl__route { display: none; }
.narrow.tiny .ttl { padding-top: 10px; }
.narrow.tiny .ttl__main, .narrow.tiny .ttl__btns { gap: 8px; }
/* 手机上小地图里的经纬度小字缩小一号、整张图往左挪一点，扬州那一行不伸出屏幕右边 */
.narrow .rpt text.m { font-size: 11px; }
.narrow .ttl__route > svg { width: calc(100% - 28px); }
/* 走的时候：整个游戏往上收，让出卡片的高度；标题页放不下时可以上下滚 */
html.hwt-on .app { bottom: var(--hwt-h, 200px); }
html.hwt-on .scr-title, html.hwt-on .scr-map { overflow: auto; }
html.hwt-on .ttl { position: relative; inset: auto; min-height: 100%; }
html.hwt-on .wk-pill { visibility: hidden; }
