/* 小字下限（2026-09-13 界面评审）：HUD 按舞台宽度的 1% 缩放，窗口一小，.5em~.62em 的字只剩 6~8px，中文读不清。最小的几处加 max(…, Npx) */
/* 旅伴守卫战 v2
   色板：夜蓝紫地 #0b0c12 / 面板 #14131f / WoW 金 #ffd100（只给最关键的字）/ 羊皮纸 #ece3cf / 暗月紫 #8a5cc2
   字体：标题宋体（接近 WoW 石刻字气质）、正文系统黑体、数字等宽 */
:root {
  --ground: #0b0c12; --panel: rgba(18, 16, 28, 0.88); --panel-solid: #14131f; --line: #2d2742;
  --gold: #ffd100; --text: #ece3cf; --muted: #8f8ba3; --moon: #8a5cc2;
  --hp: #4fd35a; --danger: #e0413b;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ground); color: var(--text); font-family: var(--sans); }
body { display: grid; place-items: center; overflow: hidden; }
#app { width: 100vw; height: 100vh; display: grid; place-items: center; }
#stage {
  position: relative; width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9;
  container-type: inline-size; overflow: hidden; background: #000;
}
#canvas-host, #canvas-host canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
kbd {
  font-family: var(--sans); font-size: .78em; font-weight: 700; color: var(--gold);
  border: 1px solid rgba(255, 209, 0, .45); border-bottom-width: 2px; border-radius: 4px; padding: .05em .45em;
  background: rgba(0, 0, 0, .35); white-space: nowrap;
}
button { font: inherit; cursor: pointer; }
button:focus-visible, .spec:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ================= HUD（尺寸全用 cqw，随舞台等比缩放） ================= */
#hud { position: absolute; inset: 0; pointer-events: none; font-size: 1cqw; }
#hud[hidden] { display: none; }
.frame { display: flex; gap: .7em; align-items: flex-start; }
.frame .portrait {
  flex: none; width: 3.6em; height: 4.8em; border-radius: .3em; background: center bottom / contain no-repeat;
  border: 1px solid color-mix(in srgb, var(--cc) 60%, transparent); box-shadow: 0 .2em .8em rgba(0,0,0,.5);
  image-rendering: pixelated;
}
.frame .name { font-weight: 800; color: var(--cc); font-size: 1.15em; text-shadow: 0 1px 2px #000; }
.hp, .mana { position: relative; height: 1.15em; background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.12); border-radius: .2em; overflow: hidden; margin-top: .25em; }
.hp i, .mana i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#5fe36a, #2f9b3a); transition: width .12s linear; }
.mana i { background: linear-gradient(#4f9dff, #2459b8); }
.hp b, .mana b { position: relative; display: block; text-align: center; font-size: max(.8em, 10px); line-height: 1.45; font-weight: 700; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.res { display: flex; gap: .25em; margin-top: .3em; min-height: .9em; }
.res .mana, .res .meter { flex: 1; height: .9em; margin-top: 0; }
.res .mana b, .res .meter b { font-size: max(.7em, 9px); line-height: 1.3; }
/* 0~100 的资源画成条（怒气、能量、集中值……），点数少的才画圆点 */
.meter { position: relative; height: 1.15em; background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.12); border-radius: .2em; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#9aa4b2, #5b6472); transition: width .12s linear; }
.meter b { position: relative; display: block; text-align: center; font-weight: 700; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.res[data-kind="mana"] .meter i        { background: linear-gradient(#4f9dff, #2459b8); }
.res[data-kind="rage"] .meter i        { background: linear-gradient(#ff6a5a, #a01b12); }
.res[data-kind="fury"] .meter i        { background: linear-gradient(#c86bff, #6a1fa8); }
.res[data-kind="energy"] .meter i      { background: linear-gradient(#ffe680, #c8a01e); }
.res[data-kind="focus"] .meter i       { background: linear-gradient(#ffb864, #a85e12); }
.res[data-kind="astral_power"] .meter i{ background: linear-gradient(#9fd8ff, #2f6fb8); }
.res[data-kind="insanity"] .meter i    { background: linear-gradient(#c8a8ff, #5a2a9a); }
.res[data-kind="ele_maelstrom"] .meter i { background: linear-gradient(#7fe8ff, #1c7aa8); }
.pip { width: .95em; height: .95em; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); }
.res[data-kind="shards"] .pip.on { background: radial-gradient(circle at 35% 35%, #e0b3ff, #8b3dd6 60%, #4a1675); border-color: #d9a6ff; box-shadow: 0 0 .5em #a45cff; }
.res[data-kind="maelstrom"] .pip { width: .7em; height: .7em; }
.res[data-kind="maelstrom"] .pip.on { background: radial-gradient(circle at 35% 35%, #dff6ff, #3aa6e8 60%, #144e7a); border-color: #9fe3ff; box-shadow: 0 0 .4em #62d0ff; }

#pf { position: absolute; left: 1.4em; top: 1.2em; width: 23em; }
#pf .body { flex: 1; }
#pf .mastery { font-size: .72em; color: var(--muted); margin-top: .3em; }
#pf .buffs { position: absolute; left: 4.9em; top: 7.2em; display: flex; flex-wrap: wrap; gap: .35em; width: 26em; }
.buff { display: inline-flex; align-items: center; gap: .25em; font-size: .85em; background: var(--panel); border: 1px solid var(--line); border-radius: .3em; padding: .1em .45em .1em .3em; }
.buff small { font-size: .82em; color: var(--text); font-variant-numeric: tabular-nums; }

/* 队伍框：人多时自动变紧凑，并且**不许长到伤害面板上**（8 个旅伴时最后一个会被压掉半截） */
#party { position: absolute; right: 1.4em; top: 1.2em; display: flex; flex-direction: column; gap: .7em; width: 17em;
         max-height: calc(100% - 12.5em); overflow-y: auto; scrollbar-width: thin; }
.mate { background: var(--panel); border: 1px solid var(--line); border-radius: .5em; padding: .5em .6em; }
.mate .portrait { width: 2.4em; height: 3.2em; }
.mate .body { flex: 1; min-width: 0; }
.mate .name { font-size: .95em; }
.mate .cast { font-size: .75em; color: var(--muted); height: 1.2em; margin-top: .25em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mate.dead { opacity: .55; filter: grayscale(.8); }

.topbar { position: absolute; left: 50%; top: 1em; transform: translateX(-50%); text-align: center; }
#loot { font-size: .85em; color: var(--text); text-shadow: 0 1px 3px #000; font-variant-numeric: tabular-nums; margin-top: .2em; }
/* 难度选择：WoW 的难度阶梯，一排按钮 */
#diffs { display: flex; gap: .5em; margin: 0 0 1.1em; flex-wrap: wrap; }
#diffs button { flex: 1 1 0; min-width: 9em; text-align: left; padding: .55em .8em; border-radius: .45em; border: 1px solid var(--line); background: #15131f; color: var(--text); }
#diffs button b { display: block; font-size: 1em; }
#diffs button small { display: block; font-size: .72em; color: var(--muted); line-height: 1.35; margin-top: .15em; }
#diffs button .best { color: #9fe3a0; }
#diffs button.on { border-color: var(--dc); background: color-mix(in srgb, var(--dc) 16%, #15131f); box-shadow: 0 0 0 1px var(--dc) inset; }
#diffs button.on b { color: var(--dc); }
#phase .aff { display: inline-flex; gap: .35em; margin-left: .6em; vertical-align: middle; }
#phase .aff i { font-style: normal; color: #ffb58a; background: rgba(255,90,40,.12); border: 1px solid rgba(255,120,60,.35); border-radius: .3em; padding: 0 .35em; pointer-events: auto; cursor: help; }
.shop-head .go small.dn { display: block; font-size: .7em; font-weight: 500; opacity: .8; }
/* 鼠标提示：WoW 风格的深色框 */
#tip { position: fixed; z-index: 50; max-width: 26em; pointer-events: none; font-size: 13px; line-height: 1.5;
       background: rgba(10, 9, 18, .96); border: 1px solid #5a4d80; border-radius: 6px; padding: .6em .8em; color: var(--text);
       box-shadow: 0 6px 24px rgba(0,0,0,.6); }
#tip h5 { margin: 0 0 .3em; font-size: 1.1em; }
#tip h5 small { margin-left: .6em; font-size: .75em; color: var(--muted); font-weight: 500; }
#tip p { margin: .2em 0; color: #d8cfbd; }
#tip p.note { color: var(--muted); font-size: .9em; margin-top: .5em; }
#tip dl { display: grid; grid-template-columns: auto 1fr; gap: .2em .7em; margin: .5em 0 0; }
#tip dt { color: var(--muted); }
#tip dd { margin: 0; }
#hud .slot { pointer-events: auto; }
/* 手动技能按了放不出来：闪红 + 原因 */
.slot.deny { animation: deny .45s; }
.slot.deny::after { content: attr(data-why); position: absolute; left: 50%; bottom: 105%; transform: translateX(-50%); white-space: nowrap;
                    font-size: .7em; color: #ff8a7a; text-shadow: 0 1px 2px #000; animation: denyTxt .9s forwards; }
@keyframes deny { 0%, 60% { box-shadow: 0 0 0 .15em #ff4a3a inset; } 100% { box-shadow: none; } }
@keyframes denyTxt { 0% { opacity: 1; } 100% { opacity: 0; } }
.slot { overflow: visible; }
/* 选项开关（Q/E/R 自动释放） */
.toggle { font: inherit; font-size: .85em; padding: .3em .8em; border-radius: 1em; border: 1px solid var(--line); background: #1a1626; color: var(--muted); cursor: pointer; }
.toggle.on { color: #9fe3a0; border-color: #4a8a4c; background: #16241a; }
#pause .opt { margin-top: 1em; }
.autopill { align-self: stretch; display: flex; align-items: center; gap: .3em; padding: 0 .7em; border-radius: .35em; font-size: .8em; font-weight: 800;
            border: 1px solid var(--line); background: #17141f; color: var(--muted); }
.autopill.on { color: #9fe3a0; border-color: #4a8a4c; background: #16241a; }
/* 手动技能被设成自动时，格子角上标"自动" */
.slot.auto::before { content: '自动'; position: absolute; right: .2em; top: .1em; font-size: max(.6em, 9px); color: #9fe3a0; z-index: 2; }
/* 第一次上场的按键说明 */
#keyhint { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); pointer-events: auto; cursor: pointer;
           background: rgba(12, 10, 20, .93); border: 1px solid #5a4d80; border-radius: .7em; padding: 1em 1.4em; min-width: 26em; box-shadow: 0 1em 3em rgba(0,0,0,.6); }
#keyhint h4 { margin: 0 0 .6em; font-size: 1.15em; color: var(--gold); }
#keyhint dl { display: grid; grid-template-columns: auto 1fr; gap: .35em .9em; margin: 0; }
#keyhint dt kbd { min-width: 2.6em; text-align: center; }
#keyhint dd { margin: 0; }
#keyhint dd small { color: var(--muted); margin-left: .5em; }
#keyhint p { margin: .8em 0 0; font-size: .85em; color: var(--muted); }
#timer { font-family: var(--serif); font-size: 2.1em; font-weight: 700; color: var(--text); text-shadow: 0 2px 6px #000; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
#phase { font-size: .85em; color: var(--muted); margin-top: .1em; }
#bossbar { margin-top: .6em; width: 34em; }
#bossbar[hidden] { display: none; }
#bossbar .bn { font-family: var(--serif); color: #ff9a6a; font-weight: 700; letter-spacing: .1em; }
#bossbar .bar { position: relative; height: 1.3em; background: rgba(0,0,0,.7); border: 1px solid #6b2a22; border-radius: .2em; overflow: hidden; margin-top: .25em; }
#bossbar .bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ff5c3a, #9b1f10); }
#bossbar .bar b { position: relative; font-size: .8em; line-height: 1.6; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
#bossbar .bcast { display: block; font-size: .8em; color: #ffb58a; height: 1.3em; margin-top: .2em; }

#announce {
  position: absolute; left: 0; right: 0; top: 62%; text-align: center; font-family: var(--serif); font-size: 2.1em; font-weight: 700;
  pointer-events: none;   /* 放在画面上方三分之一：原来压在战场正中间，"宝箱出现了！"直接盖住主角 */
  color: var(--gold); text-shadow: 0 0 .4em rgba(255, 170, 0, .5), 0 3px 8px #000; letter-spacing: .08em; opacity: 0;
}
#announce.show { animation: announce 2.6s ease both; }
@keyframes announce { 0% { opacity: 0; transform: scale(1.15); } 12% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }

/* 平A条 / 施法条贴着动作条，别浮在场地中间（原来 gap .8em，两条都藏起来时中间空一大块） */
.bottom { position: absolute; left: 50%; bottom: 1.3em; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .3em; }
#castbar { position: relative; width: 22em; height: 1.4em; background: rgba(0,0,0,.72); border: 1px solid rgba(255,209,0,.5); border-radius: .2em; overflow: hidden; }
#castbar[hidden] { display: block; visibility: hidden; }
/* 平A条（WoW 的挥砍计时器）：物理系才有。满了就是这一刀 / 这一箭出手 */
#swingbar { position: relative; width: 22em; height: .95em; margin-bottom: .25em; background: rgba(0,0,0,.72); border: 1px solid rgba(232,217,181,.45); border-radius: .2em; overflow: hidden; }
#swingbar[hidden] { display: block; visibility: hidden; }
#swingbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #8a7a55, #e8d9b5); opacity: .85; }
#swingbar.hit i { background: #fff3c4; opacity: 1; }
#swingbar.far { opacity: .45; }
#swingbar span { position: relative; display: block; text-align: center; font-size: max(.62em, 10px); line-height: 1.55; font-weight: 700; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.frame .sw { height: 2px; margin-top: 2px; background: rgba(0,0,0,.5); border-radius: 1px; overflow: hidden; }
.frame .sw i { display: block; height: 100%; width: 0; background: #e8d9b5; }
#castbar i { position: absolute; inset: 0 auto 0 0; opacity: .85; }
/* 蓄力法术的档位刻度 */
#castbar .pips { position: absolute; inset: 0; pointer-events: none; }
#castbar .pips b { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(0,0,0,.65); box-shadow: 1px 0 0 rgba(255,255,255,.25); }
#castbar span { position: relative; display: block; text-align: center; font-size: .82em; line-height: 1.7; font-weight: 700; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
#actionbar { display: flex; gap: .35em; align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: .6em; padding: .45em; }
#actionbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 .25em; }
.slot {
  position: relative; width: 4.4em; height: 3.6em; border-radius: .35em; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--sc) 40%, #1a1826), #0f0e17 75%);
  border: 1px solid color-mix(in srgb, var(--sc) 55%, transparent);
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.slot.big { width: 5.2em; height: 4.2em; }
.slot .nm { position: relative; font-size: .78em; font-weight: 700; line-height: 1.15; padding: 0 .2em; text-shadow: 0 1px 2px #000; z-index: 1; text-wrap: balance; }
.slot kbd { position: absolute; left: .25em; top: .2em; font-size: max(.6em, 10px); padding: 0 .3em; border-bottom-width: 1px; z-index: 1; color: var(--muted); border-color: rgba(255,255,255,.2); }
.slot.big kbd { color: var(--gold); border-color: rgba(255,209,0,.5); }
.slot em { position: absolute; right: .3em; bottom: .15em; font-style: normal; font-size: .72em; font-weight: 800; color: #fff; z-index: 1; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.slot .cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0,0,0,.66); }
.slot.casting { box-shadow: 0 0 0 2px var(--gold), 0 0 1em rgba(255,209,0,.45); }
.slot.dim .nm { opacity: .45; }
.slot.ready { box-shadow: 0 0 0 2px var(--gold); animation: ready 1s ease-in-out infinite alternate; }
@keyframes ready { from { box-shadow: 0 0 0 2px var(--gold), 0 0 .3em rgba(255,209,0,.3); } to { box-shadow: 0 0 0 2px var(--gold), 0 0 1.4em rgba(255,209,0,.8); } }

#summons { position: absolute; left: 1.4em; bottom: 1.4em; display: flex; flex-wrap: wrap; gap: .4em; max-width: 24em; }

#meter { position: absolute; right: 1.4em; bottom: 1.4em; width: 17em; background: var(--panel); border: 1px solid var(--line); border-radius: .5em; padding: .5em .6em .6em; }
#meter h4 { margin: 0 0 .4em; font-size: .72em; color: var(--muted); font-weight: 600; letter-spacing: .08em; }
#meter .row { position: relative; height: 1.5em; margin-top: .2em; border-radius: .2em; overflow: hidden; background: rgba(255,255,255,.04); display: flex; align-items: center; justify-content: space-between; padding: 0 .5em; }
#meter .row i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--cc) 38%, transparent); }
#meter .row span, #meter .row b { position: relative; font-size: .8em; font-variant-numeric: tabular-nums; }
#meter .row b em { font-style: normal; color: #7dff8a; font-weight: 600; }

/* ================= 菜单 / 暂停 / 结算 ================= */
.screen { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1cqw;
  background: radial-gradient(ellipse at 50% 40%, rgba(40, 22, 60, .55), rgba(5, 5, 10, .92) 70%); }
.screen[hidden] { display: none; }
.panel { width: min(92%, 82em); }
.panel.small { width: 34em; text-align: center; background: var(--panel-solid); border: 1px solid var(--line); border-radius: .8em; padding: 2em; }
.eyebrow { margin: 0; color: var(--moon); letter-spacing: .3em; font-size: 1em; font-weight: 600; }
h1 { margin: .15em 0 .2em; font-family: var(--serif); font-size: 5.2em; line-height: 1; color: var(--gold); letter-spacing: .12em; font-weight: 900;
     text-shadow: 0 .04em 0 #7a5a00, 0 .1em .4em rgba(0,0,0,.8); text-wrap: balance; }
.lede { margin: 0 0 2em; color: var(--text); font-size: 1.15em; max-width: 44em; line-height: 1.7; }
#specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2em; }
.spec {
  position: relative; display: flex; gap: 1em; text-align: left; color: var(--text); padding: 1.1em;
  background: linear-gradient(150deg, color-mix(in srgb, var(--cc) 14%, var(--panel-solid)), var(--panel-solid) 60%);
  border: 1px solid color-mix(in srgb, var(--cc) 35%, var(--line)); border-radius: .7em; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.spec:hover { transform: translateY(-.2em); border-color: var(--cc); box-shadow: 0 .6em 2em rgba(0,0,0,.5), 0 0 0 1px var(--cc); }
.spec .portrait { flex: none; width: 5em; height: 6.4em; border-radius: .3em; background: center bottom / contain no-repeat; border: 1px solid color-mix(in srgb, var(--cc) 55%, transparent); image-rendering: pixelated; }
.spec .top { display: flex; align-items: baseline; gap: .6em; }
.spec h3 { margin: 0; font-family: var(--serif); font-size: 1.5em; color: var(--cc); letter-spacing: .04em; }
.role { font-size: .75em; padding: .1em .55em; border-radius: 1em; border: 1px solid var(--line); color: var(--muted); }
.role.healer { color: #7dff8a; border-color: rgba(125,255,138,.4); }
.spec p { margin: .5em 0 .7em; font-size: .92em; line-height: 1.6; color: #d7cfbe; }
.spec dl { display: grid; grid-template-columns: auto 1fr; gap: .25em .7em; margin: 0; font-size: .85em; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; }
.spec > kbd { position: absolute; right: .8em; top: .8em; }
.keys { list-style: none; padding: 0; margin: 2em 0 0; display: flex; flex-wrap: wrap; gap: .6em 2em; color: var(--muted); font-size: .92em; }
.keys kbd { margin-right: .5em; }
#end .panel { background: var(--panel-solid); border: 1px solid var(--line); border-radius: .9em; padding: 2em 2.4em; width: min(92%, 66em); }
h2 { margin: 0; font-family: var(--serif); font-size: 3.4em; letter-spacing: .15em; }
h2.win { color: var(--gold); } h2.lose { color: #ff7a6a; }
.sub { color: var(--muted); margin: .3em 0 1.4em; font-size: 1.05em; }
.cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2em; }
.cols h4 { margin: 0 0 .6em; color: var(--muted); font-weight: 600; letter-spacing: .08em; font-size: .9em; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95em; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: .85em; padding: .3em .4em; border-bottom: 1px solid var(--line); }
.tbl td { padding: .4em; border-bottom: 1px solid rgba(255,255,255,.05); }
.tbl .team td:first-child { color: var(--cc); font-weight: 700; }
.tbl.bars td:nth-child(2) { width: 50%; }
.tbl.bars i { display: block; height: .7em; border-radius: .2em; background: linear-gradient(90deg, var(--moon), #c79bff); }
.tbl.bars td:last-child { text-align: right; color: var(--muted); }
.kills { color: var(--muted); font-size: .85em; margin: 1.2em 0 0; }
.btns { display: flex; gap: .8em; justify-content: center; margin-top: 1.6em; }
.btns button { padding: .7em 1.6em; border-radius: .4em; border: 1px solid var(--line); background: #1d1a2b; color: var(--text); font-size: 1em; }
.btns button.primary { background: linear-gradient(#ffe066, #c99a00); color: #1a1200; border-color: #ffd100; font-weight: 800; }
.btns button.primary kbd { color: #1a1200; border-color: rgba(0,0,0,.35); background: rgba(255,255,255,.3); }
#fatal { position: absolute; inset: 2em; background: #2a0b0b; color: #ffb0a8; padding: 1em; white-space: pre-wrap; border: 1px solid #a33; }
@media (prefers-reduced-motion: reduce) { #announce.show, .slot.ready { animation: none; opacity: 1; } .spec { transition: none; } }

/* ================= v2 肉鸽层：选择页 / 商店 / 队伍框 ================= */
#pf .lanes { display: flex; flex-wrap: wrap; gap: .3em; margin-top: .3em; }
#pf .lanes span { font-size: .72em; padding: .05em .5em; border-radius: 1em; border: 1px solid color-mix(in srgb, var(--cc) 50%, transparent); background: rgba(0,0,0,.45); white-space: nowrap; }
#party.dense { gap: .35em; }
/* 七个以上：再紧一档，藏掉施法行 */
#party.tight { gap: .22em; }
#party.tight .mate { padding: .18em .4em; }
#party.tight .mate .portrait { width: 1.5em; height: 2em; }
#party.tight .mate .hp { height: .8em; margin-top: .12em; }
#party.tight .mate .hp b { font-size: max(.62em, 9px); line-height: 1.3; }
#party.tight .mate .name { font-size: .72em; }
#party.tight .mate .cast { display: none; }
#party.dense .mate { padding: .3em .45em; }
#party.dense .mate .portrait { width: 1.9em; height: 2.5em; }
#party.dense .mate .res { display: none; }
#party.dense .mate .hp { height: .9em; }
#party.dense .mate .hp b { font-size: .7em; line-height: 1.3; }
.mate { border-left: .25em solid var(--qc, var(--line)); }
.mate.master { box-shadow: inset 0 0 0 1px rgba(255,128,0,.55); }
.mate.master .portrait { border-color: #ff8000; }

/* 选择页：按职业分三列 */
#specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2em; align-items: start; }
.cls { display: flex; flex-direction: column; gap: .6em; }
.cls header { display: flex; gap: .8em; align-items: center; padding-bottom: .5em; border-bottom: 1px solid color-mix(in srgb, var(--cc) 40%, var(--line)); }
.cls header .portrait { width: 3.2em; height: 4.2em; border-radius: .3em; background: center bottom / contain no-repeat; border: 1px solid color-mix(in srgb, var(--cc) 60%, transparent); image-rendering: pixelated; flex: none; }
.cls h3 { margin: 0; font-family: var(--serif); font-size: 1.5em; color: var(--cc); letter-spacing: .06em; }
.cls header p { margin: .15em 0 0; font-size: .82em; color: var(--muted); }
.cls header p b { color: #ff8000; font-weight: 700; }
.cls .spec { display: block; padding: .75em .9em; }
.cls .spec .top { display: flex; align-items: center; gap: .6em; }
.cls .spec h4 { margin: 0; font-size: 1.1em; color: var(--text); }
.cls .spec .top kbd { margin-left: auto; }
.cls .spec p { margin: .4em 0 .35em; font-size: .82em; line-height: 1.55; color: #cfc6b4; }
.cls .spec .meta { font-size: .76em; color: var(--muted); }
.cls .spec { --cc: inherit; }
#menu .panel { width: min(94%, 88em); }
#menu h1 { font-size: 4.4em; }
#menu .lede { margin-bottom: 1.4em; }

/* 商店 */
/* 两个商店叠起来比屏幕高时（宽而矮的窗口，界面按宽度缩放）：整屏滚动，面板从顶部排起 */
#shop { overflow-y: auto; align-items: start; padding: 1.2em 0; }
#shop .panel.shop { position: relative; width: min(95%, 92em); background: var(--panel-solid); border: 1px solid var(--line); border-radius: .9em; padding: 1.3em 1.6em 1.5em; }
/* 顶栏钉住：往下滚货架时，金币和「开始下一波」不能跟着滚走 */
.shop-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 1.5em;
             padding: .2em 0 .9em; border-bottom: 1px solid var(--line); background: var(--panel-solid); }
.shop-head h2 { font-size: 2.2em; letter-spacing: .1em; color: var(--gold); }
.shop-head .sub { margin: .2em 0 0; }
.shop-head .tickets { margin-left: auto; text-align: right; font-size: 1.5em; font-variant-numeric: tabular-nums; }
/* 货币图标：8-bit 像素图，由 game/currency.js 在启动时烘焙进 --cur-img */
/* 尺寸用整数倍像素（16 / 32px）：16×16 的像素图缩到 13px 这类非整数倍会丢像素、糊成一团 */
.cur { display: inline-block; width: 16px; height: 16px; margin-right: 3px; vertical-align: -3px;
       background: var(--cur-gold) center / contain no-repeat; image-rendering: pixelated; }
.cur-ticket { background-image: var(--cur-ticket); }
/* 通用像素小图标（王冠、卡片……），大小跟着字号走但按像素锐利显示 */
/* 界面里的小人也会轻轻呼吸（用户要的"动态"）；开了系统减少动态效果就停下 */
@keyframes heroBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.ctile .portrait, .spec .portrait, .offer .portrait, .cls header .portrait, .frame .portrait { animation: heroBob 1.8s ease-in-out infinite; }
.ctile:nth-child(2n) .portrait, .offer:nth-child(2n) .portrait { animation-delay: -.6s; }
.ctile:nth-child(3n) .portrait { animation-delay: -1.1s; }
.ctile.on .portrait { animation-duration: 1.1s; }
@media (prefers-reduced-motion: reduce) { .ctile .portrait, .spec .portrait, .offer .portrait, .cls header .portrait, .frame .portrait { animation: none; } }
.pxi { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; background: var(--i) center / contain no-repeat; image-rendering: pixelated; }
/* 暗月卡片的牌面：竖着的塔罗牌比例，像素放大不模糊 */
.tarot.card-art { width: 2.6em; height: 3.6em; background: center / contain no-repeat; image-rendering: pixelated;
                  filter: drop-shadow(0 0 .35em color-mix(in srgb, var(--qc) 70%, transparent)); }
.tarot.px { width: 2.7em; height: 2.7em; background: center / contain no-repeat; image-rendering: pixelated; filter: drop-shadow(0 0 .3em color-mix(in srgb, var(--qc) 60%, transparent)); }
.shop-head .tickets .cur { width: 32px; height: 32px; vertical-align: -6px; margin-right: 6px; }
.shop-head .wallet { margin-left: auto; display: flex; gap: 1.4em; align-items: flex-start; }
.shop-head .wallet .tickets { margin-left: 0; }
.shop-head .wallet .tk b { color: #ff7a7a; }
/* 暗月奖品摊：红紫色调，和金币商店区分开 */
.prizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8em; margin-bottom: 1.1em; }
.offer.prize .tarot { font-size: 2.2em; line-height: 1.3; }
.offer.prize { --qc: #ff6b6b; background: linear-gradient(170deg, #2a1420, #16131f 70%); }
.offer.prize.altar { --qc: #b44cff; background: linear-gradient(170deg, #241236, #16131f 70%); border-style: dashed; }
.offer.prize button { border-color: rgba(255,107,107,.55); color: #ff9a9a; background: #2a1218; }
.offer.prize.altar button { border-color: rgba(180,76,255,.6); color: #d6a4ff; background: #1f1230; }
/* 天赋三选一：**盖在商店上面的独立面板**。一局只有四次、而且是唯一改变主角的东西 ——
   原来只是商店最上面的一条，是整页最小的一块，权重完全不对（评审提的） */
.talents { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center;
           gap: 1em; background: rgba(8,7,12,.86); backdrop-filter: blur(3px); border-radius: .6em; }
.talents[hidden] { display: none; }
.talents h3 { margin: 0; font-size: 1.5em; color: var(--gold); letter-spacing: .06em; }
.talents h3 small { display: block; margin-top: .3em; font-size: max(.5em, 12px); color: var(--muted); font-weight: 500; letter-spacing: 0; }
.talent-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1em; width: min(60em, 88%); }
.talent { min-height: 9em; }
.talent { position: relative; display: flex; flex-direction: column; gap: .3em; text-align: left; padding: .8em .9em 1em; border-radius: .5em;
          border: 1px solid #6a5a2a; background: linear-gradient(170deg, #2a2412, #16131f 70%); color: var(--text); cursor: pointer; }
.talent:hover { border-color: var(--gold); background: linear-gradient(170deg, #3a3218, #16131f 70%); }
.talent .q { font-size: .72em; font-weight: 800; color: var(--gold); letter-spacing: .1em; }
.talent h4 { margin: 0; font-size: 1.25em; color: var(--gold); }
.talent h4 small { margin-left: .5em; font-size: .72em; color: var(--muted); font-weight: 500; }
.talent .desc { margin: 0; font-size: .92em; color: #d8cfbd; line-height: 1.5; }
.talent .hint { margin: 0; font-size: .75em; color: var(--muted); }
.talent .kbd { position: absolute; right: .6em; bottom: .5em; }
.prize-foot { display: flex; align-items: center; gap: 1em; margin: -.3em 0 1.1em; }
.status { display: flex; flex-wrap: wrap; gap: .4em; margin: .2em 0 .9em; }
.status span { font-size: .78em; padding: .15em .6em; border-radius: 1em; border: 1px solid var(--line); color: #d6c9ff; background: #1a1626; }
.shop-head .tickets b { color: var(--gold); font-size: 1.3em; }
.shop-head .tickets small { display: block; font-size: max(.5em, 11px); color: var(--muted); }
.shop-head .go { padding: .8em 1.4em; border-radius: .45em; border: 1px solid #ffd100; background: linear-gradient(#ffe066, #c99a00); color: #1a1200; font-weight: 800; font-size: 1em; }
.shop-head .go kbd { color: #1a1200; border-color: rgba(0,0,0,.35); background: rgba(255,255,255,.3); }
.shop-body { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1.6em; margin-top: 1em; }
.shop-body h3 { margin: .2em 0 .6em; font-size: .9em; color: var(--muted); font-weight: 600; letter-spacing: .12em; }
.shop-body h3 small { font-weight: 400; letter-spacing: 0; margin-left: .6em; opacity: .8; }
.offers { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: .8em; }
.offer {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35em;
  padding: 1em .7em .8em; border-radius: .6em; background: linear-gradient(170deg, color-mix(in srgb, var(--qc) 12%, #1a1826), #121019 70%);
  border: 1px solid color-mix(in srgb, var(--qc) 50%, var(--line)); min-height: 17em;
}
.offer .q { position: absolute; left: .6em; top: .5em; font-size: .72em; font-weight: 800; color: var(--qc); letter-spacing: .1em; }
.offer .portrait { width: 4.2em; height: 5.4em; border-radius: .3em; background: center bottom / contain no-repeat; border: 1px solid color-mix(in srgb, var(--qc) 60%, transparent); image-rendering: pixelated; box-shadow: 0 0 1em color-mix(in srgb, var(--qc) 40%, transparent); }
.offer .tarot { font-size: 3em; line-height: 1.5; filter: drop-shadow(0 0 .3em color-mix(in srgb, var(--qc) 60%, transparent)); }
.offer h4 { margin: .1em 0 0; font-size: 1.05em; color: var(--cc, var(--qc)); }
.offer h4 small { display: block; font-size: .7em; color: var(--muted); font-weight: 500; }
.offer .chips { display: flex; gap: .3em; }
.offer .chips span { font-size: .72em; padding: .05em .5em; border-radius: 1em; border: 1px solid var(--line); color: var(--muted); }
.offer .hint, .offer .desc { margin: 0; font-size: .78em; color: #cfc6b4; line-height: 1.45; }
.offer .desc { color: var(--text); font-size: .85em; }
.offer button { margin-top: auto; width: 100%; padding: .5em; border-radius: .35em; border: 1px solid rgba(255,209,0,.5); background: #231f10; color: var(--gold); font-weight: 800; font-size: .95em; }
.offer button:hover:not(:disabled) { background: #3a3110; }
.offer button:disabled { opacity: .45; cursor: default; }
.offer .why { font-size: .7em; color: #ff8a7a; }
.offer.sold { opacity: .4; }
.offer.empty { justify-content: center; color: var(--muted); }
.market-foot { display: flex; align-items: center; gap: 1em; margin: .8em 0 1.1em; }
.refresh { padding: .45em 1em; border-radius: .35em; border: 1px solid var(--line); background: #1d1a2b; color: var(--text); }
.refresh:disabled { opacity: .45; }
.market-foot .note { font-size: .78em; color: var(--muted); }
.owned { display: flex; flex-wrap: wrap; gap: .4em; }
.owned span { font-size: .82em; padding: .25em .6em; border-radius: .35em; border: 1px solid color-mix(in srgb, var(--qc) 45%, var(--line)); background: #16141f; }
.owned small { margin-left: .5em; color: var(--muted); font-size: .9em; }
.owned em { color: var(--muted); font-size: .85em; }
.roster ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3em; }
.roster li { display: flex; align-items: center; gap: .5em; padding: .4em .6em; border-radius: .35em; background: #16141f; border-left: .25em solid var(--qc, var(--gold)); color: var(--cc); font-size: .92em; }
.roster li.me { border-left-color: var(--gold); }
.roster li b { font-weight: 800; }
.roster .qdot { display: none; }
.roster .tag { margin-left: auto; font-size: .75em; color: var(--muted); }
.roster .tag.master { color: #ff8000; }
.acts { display: flex; flex-direction: column; gap: .4em; margin: .7em 0 1em; }
.merge { text-align: left; padding: .55em .8em; border-radius: .4em; border: 1px solid #ff8000; background: linear-gradient(90deg, rgba(255,128,0,.22), rgba(255,128,0,.05)); color: var(--text); font-size: .95em; }
.merge b { color: #ff9a3c; }
.merge small { display: block; font-size: .78em; color: var(--muted); margin-top: .15em; }
.merge:disabled { opacity: .5; cursor: default; }
.bonds { display: flex; flex-direction: column; gap: .3em; }
.bond { display: grid; grid-template-columns: 5.2em auto 1fr; align-items: center; gap: .6em; font-size: .85em; color: var(--muted); }
.bond.zero { opacity: .45; }
.bond.active { color: var(--text); }
.bond .bn { font-weight: 700; }
.bond.active .bn { color: var(--gold); }
.bond .pips { display: flex; gap: .15em; }
.bond .pips i { width: .6em; height: .8em; border-radius: .12em; background: rgba(255,255,255,.08); }
.bond .pips i.mark { box-shadow: inset 0 -2px 0 rgba(255,209,0,.6); }
.bond .pips i.on { background: #c9a14a; }
.bond.active .pips i.on { background: var(--gold); }
.bond .be { font-size: .92em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 选择页：两步选（职业 → 专精） */
/* 13 个职业排成 7 + 6 两行；窄屏退回自动换行 */
#classes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6em; margin-bottom: 1.2em; }
@media (max-width: 760px) { #classes { grid-template-columns: repeat(auto-fill, minmax(7em, 1fr)); } }
.ctile { display: flex; flex-direction: column; align-items: center; gap: .3em; padding: .7em .4em .6em; border-radius: .6em;
  background: #15131f; border: 1px solid var(--line); color: var(--text); transition: border-color .12s, transform .12s; }
.ctile:hover { transform: translateY(-.15em); border-color: color-mix(in srgb, var(--cc) 60%, var(--line)); }
.ctile.on { border-color: var(--cc); background: linear-gradient(170deg, color-mix(in srgb, var(--cc) 20%, #15131f), #15131f 70%); box-shadow: 0 0 0 1px var(--cc); }
.ctile .portrait { width: 3em; height: 4em; border-radius: .3em; background: center bottom / contain no-repeat; border: 1px solid color-mix(in srgb, var(--cc) 55%, transparent); image-rendering: pixelated; }
.ctile b { font-family: var(--serif); font-size: 1.05em; color: var(--cc); }
.ctile small { font-size: .72em; color: var(--muted); }
#specs { display: block; }
#specs header { display: flex; align-items: baseline; gap: 1em; margin-bottom: .7em; }
#specs header h3 { margin: 0; font-family: var(--serif); font-size: 1.6em; color: var(--cc); letter-spacing: .08em; }
#specs header p { margin: 0; color: var(--muted); font-size: .9em; }
#specs header p b { color: #ff8000; }
.spec-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(16em, 1fr)); gap: .9em; }
.spec-row .spec { display: block; text-align: left; padding: .85em 1em; }
.spec-row .spec .top { display: flex; align-items: center; gap: .6em; }
.spec-row .spec .top .portrait { flex: none; width: 2.6em; height: 3em; background: center bottom / contain no-repeat; image-rendering: pixelated; }
.spec-row .spec h4 { margin: 0; font-size: 1.15em; color: var(--text); }
.spec-row .spec .top kbd { margin-left: auto; }
.spec-row .spec p { margin: .45em 0 .4em; font-size: .85em; line-height: 1.6; color: #cfc6b4; }
.spec-row .spec .meta { font-size: .78em; color: var(--muted); }
.role.tank { color: #7ab8ff; border-color: rgba(122,184,255,.45); }

/* 解雇按钮：藏在队伍行里，不抢眼，但队伍满了必须找得到 */
.roster li { position: relative; }
/* 一直看得见（只在 hover 才出现的话，队伍满了的人根本找不到它）——平时压暗，指上去才亮 */
.roster li .fire { margin-left: auto; display: inline-flex; align-items: center; gap: .25em; opacity: .45;
                   background: rgba(120,20,20,.3); color: #ffb0a8; border: 1px solid rgba(255,120,100,.3);
                   border-radius: .3em; font-size: .72em; padding: .1em .45em; cursor: pointer; white-space: nowrap; }
.roster li:hover .fire { opacity: 1; }
.roster li .fire:hover { background: rgba(180,30,30,.55); color: #fff; }
.roster h3 .full { margin-left: .6em; font-size: .78em; color: #ffb454; font-weight: 600; }

/* 旅伴卡上的数值：买谁不能靠职业名瞎猜 */
.offer .stats { margin: .25em 0 0; font-size: .76em; color: var(--muted); font-variant-numeric: tabular-nums; }
.offer .stats b { color: #e8e2d0; font-weight: 700; }
.offer .stats .dup { color: #ffb454; }

/* 首领机制预告：橙色一条，和普通说明区分开 */
.bosstip { margin: .35em 0 0; font-size: .82em; color: #ffcf8a; background: rgba(255,140,40,.08);
           border-left: 3px solid #ff8c28; border-radius: 0 .3em .3em 0; padding: .25em .6em; }
.bosstip b { color: #ff9a3c; margin-right: .5em; }

/* 结算页的一行总结 */
#end .runstats { margin: .2em 0 1.1em; font-size: .92em; color: #c9c2b4; }
#end .runstats b { color: var(--gold); font-variant-numeric: tabular-nums; }
#end .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(17em, 1fr)); gap: 1.4em; }
#end .bars td i { background: linear-gradient(90deg, #6dff9a, #2ac86a); }
#end section:nth-child(2) .bars td i { background: linear-gradient(90deg, #ffb454, #c96a00); }

/* 排行榜（只有无尽 / 史诗钥石会出现） */
.board { margin-top: 1.4em; border-top: 1px solid var(--line); padding-top: 1em; }
.board[hidden] { display: none; }
.board .bhead { display: flex; align-items: baseline; gap: .8em; }
.board .bhead h4 { margin: 0 0 .5em; color: var(--gold); }
.board .bhead .rank { font-size: .85em; color: #9fe3ff; }
.board .bhead .rank b { color: var(--gold); font-size: 1.2em; }
.board form { display: flex; gap: .6em; align-items: center; margin: 0 0 .8em; font-size: .9em; }
.board form[hidden] { display: none; }
.board input { background: #12101a; border: 1px solid var(--line); border-radius: .3em; color: var(--text); padding: .35em .6em; font: inherit; width: 9em; }
.board button { padding: .4em 1em; border-radius: .35em; border: 1px solid #ffd100; background: linear-gradient(#ffe066, #c99a00); color: #1a1200; font-weight: 700; cursor: pointer; }
.board tbody tr.me { background: rgba(255,209,0,.12); }
.board td.empty { color: var(--muted); text-align: center; padding: .8em; }

/* 奖券为 0 时把奖品摊折叠成一行灰条：新玩家第一眼不该是一整排买不起的东西 */
.prizes.locked { display: block; }
.prizes.locked .offer { display: none; }
.prizes.locked::before { content: attr(data-locked); display: block; font-size: .85em; color: var(--muted);
                         border: 1px dashed var(--line); border-radius: .4em; padding: .5em .8em; }

/* 菜单：把"点专精卡就开局"写出来 */
#specs header .gohint { display: inline-block; margin-top: .3em; font-size: .8em; color: var(--gold); }
.spec .go { display: block; margin-top: .5em; font-size: .8em; color: var(--gold); opacity: .55; }
.spec:hover .go { opacity: 1; }
/* 暂停页速查 */
#pausesheet dl { display: grid; grid-template-columns: auto 1fr; gap: .25em .9em; margin: .8em 0 0; font-size: .85em; text-align: left; }
#pausesheet dt { color: var(--muted); white-space: nowrap; }
#pausesheet dd { margin: 0; color: #d8cfbd; }
#pausesheet b { color: var(--gold); }

/* 按键说明底部的"开打"提示：说明弹着时游戏是暂停的，要让人知道怎么继续 */
#keyhint .go { margin: .8em 0 0; text-align: center; color: var(--gold); font-weight: 700; animation: hintpulse 1.2s ease-in-out infinite; }
@keyframes hintpulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { #keyhint .go { animation: none; } }

/* 阵容缺口：坦克 / 治疗各要 2 个，缺的标橙 */
.roster .rolebar { display: flex; flex-wrap: wrap; gap: .35em; margin: .1em 0 .4em; }
.roster .rolebar span { font-size: .78em; padding: .1em .55em; border-radius: 1em; border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.roster .rolebar span.ok { color: #9fe3a0; border-color: rgba(120,220,130,.35); }
.roster .rolebar span.lack { color: #ffb454; border-color: rgba(255,160,60,.6); background: rgba(255,140,40,.1); font-weight: 700; }
.roster .lacktip { margin: 0 0 .6em; font-size: .78em; color: #ffcf8a; }
.offer .chips .fill { color: #1a1200; background: #ffb454; border-color: #ffb454; font-weight: 800; }

/* 低血红边：--k 0~1（血越少越大），--speed 脉动周期 */
#lowhp { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 1;
         background: radial-gradient(ellipse at center, transparent 55%, rgba(200, 0, 0, calc(.25 + .45 * var(--k, 0))) 100%); }
#lowhp.on { animation: lowhp var(--speed, 1s) ease-in-out infinite; }
@keyframes lowhp { 0%, 100% { opacity: calc(.55 + .45 * var(--k, 0)); } 50% { opacity: calc(.25 + .3 * var(--k, 0)); } }
@media (prefers-reduced-motion: reduce) { #lowhp.on { animation: none; opacity: calc(.4 + .5 * var(--k, 0)); } }
/* 结算页：死前 5 秒的伤害构成 */
#end .recap { margin: -.6em 0 1.1em; font-size: .88em; color: #ffb3a6; }
#end .recap b { color: #ff8a7a; }

/* 一波结束后的针对性建议（伤害垫底 / 一个技能没按）*/
.coach { margin: .35em 0 0; font-size: .82em; color: #bfe8ff; background: rgba(90,170,255,.08);
         border-left: 3px solid #5aa8ff; border-radius: 0 .3em .3em 0; padding: .25em .6em; }

/* 货架锁定 */
.offer .lock { margin-top: .3em; width: 100%; font-size: .72em; padding: .15em 0; border-radius: .3em; cursor: pointer;
               background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.offer .lock:hover { color: var(--text); border-color: var(--muted); }
.offer .lock.on { color: #1a1200; background: #9fd8ff; border: 1px solid #9fd8ff; font-weight: 800; }

/* 排行榜页（主菜单 B） */
.menubar { margin: -.4em 0 .8em; display: flex; gap: .5em; }
.menubar button { padding: .35em .9em; border-radius: .35em; border: 1px solid var(--line); background: #15131f; color: var(--gold); font: inherit; font-size: .9em; cursor: pointer; }
.menubar button:hover { border-color: var(--gold); }
#boards .btabs { display: flex; flex-wrap: wrap; gap: .4em; margin: .6em 0 0; }
#boards .btabs button { padding: .4em .8em; border-radius: .35em; border: 1px solid var(--line); background: #15131f; color: var(--text); font: inherit; font-size: .9em; cursor: pointer; text-align: left; }
#boards .btabs button small { display: block; font-size: .78em; color: var(--muted); }
#boards .btabs button.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; color: var(--gold); }
#boards .board { border-top: 0; }
#boards .mine { color: #9fe3ff; font-size: .9em; margin: .6em 0 0; }
.bhead h4 small { margin-left: .6em; font-size: .75em; color: var(--muted); font-weight: 400; }
#quit.danger { border-color: #ff6a5a; color: #ff8a7a; }
#diffs button b .rec { font-style: normal; font-size: .62em; margin-left: .5em; padding: .05em .45em; border-radius: .3em; background: #9fe3a0; color: #0e1a0e; vertical-align: .15em; }
.bond-zero { margin: .3em 0 0; font-size: .8em; color: var(--muted); }
.lacktip kbd { font-size: .85em; }
#bossbar .bcast em { font-style: normal; color: #ffe0c8; margin-left: .6em; }
#bossbar .btip { display: block; margin-top: .3em; padding: .35em .7em; font-size: max(.85em, 11px); line-height: 1.45; color: #ffe0c8; background: rgba(40,10,6,.78); border: 1px solid #6b2a22; border-radius: .3em; }
#bossbar .btip[hidden] { display: none; }
.challenge { margin: .5em 0 0; padding: .5em .8em; border: 1px solid #b44cff; border-radius: .35em; background: rgba(120,40,180,.15); font-size: .9em; line-height: 1.5; }
.challenge b { color: #d6a4ff; margin-right: .5em; }
.challenge span { display: block; color: var(--muted); }
.challenge button { margin-top: .35em; padding: .3em .9em; border-radius: .3em; border: 1px solid #b44cff; background: #2a1840; color: #e8d0ff; font: inherit; cursor: pointer; }
button.elite { align-self: center; margin-right: .6em; padding: .45em .9em; border-radius: .4em; border: 1px dashed #ff9a2a; background: #1d1614; color: #ffc68a; font: inherit; cursor: pointer; text-align: left; }
button.elite small { display: block; font-size: max(.72em, 11px); color: var(--muted); }
button.elite.on { border-style: solid; background: rgba(255,120,30,.18); box-shadow: 0 0 0 1px #ff9a2a inset; }
button.elite b, .elitetag { color: #ff9a2a; }
.offer .hint.none { color: #ff8a7a; }
#daily { color: var(--text) !important; }
#daily b { font-weight: 800; }
.spec h4 .badge { font-style: normal; font-size: .6em; margin-left: .5em; padding: .05em .4em; border-radius: .25em; border: 1px solid var(--dc); color: var(--dc); vertical-align: .2em; font-weight: 700; }
#end .meta { margin: .4em 0 0; padding: .45em .8em; border-radius: .35em; background: rgba(255,209,0,.08); border: 1px solid rgba(255,209,0,.35); font-size: .9em; line-height: 1.6; }
#end .meta[hidden] { display: none; }
.achv { list-style: none; margin: .4em 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16em, 1fr)); gap: .5em; }
.achv li { padding: .5em .7em; border-radius: .35em; border: 1px solid var(--line); background: #15131f; opacity: .55; }
.achv li.got { opacity: 1; border-color: var(--gold); background: rgba(255,209,0,.08); }
.achv li b { display: block; color: var(--gold); }
.achv li span { font-size: .85em; color: var(--muted); }
.spec .ease { margin: .15em 0 .2em; font-size: max(.78em, 11px); color: var(--muted); }
.spec .ease b { color: var(--ec); }
/* 十一格动作条（2026-09-14）：格子缩一点，一排放得下 */
#actionbar.wide .slot.big { width: 4.3em; height: 3.7em; }
#actionbar.wide .slot .nm { font-size: .72em; }
.buff.debuff { border-color: #c0392b; background: rgba(120,20,20,.55); }
.buff.team { font-size: .78em; opacity: .85; letter-spacing: .1em; }
.frame .name .st { margin-left: .35em; font-size: .85em; }
.spec .rot, #keyhint .rot { margin: .35em 0 .2em; font-size: max(.82em, 11px); line-height: 1.55; color: var(--text); }
.spec .rot b, #keyhint .rot b { color: var(--gold); margin-right: .45em; }
.spec .rot kbd, #keyhint .rot kbd { font-size: .85em; padding: 0 .3em; }

/* 正式服 / 测试服切换（主菜单右上角） */
.channel { position: absolute; top: 1em; right: 1.2em; z-index: 20; padding: .4em 1em; border-radius: .4em; border: 1px solid #b44cff; background: rgba(60,20,90,.75);
           color: #e8d0ff; font-weight: 700; text-decoration: none; letter-spacing: .08em; }
.channel:hover { background: rgba(100,40,150,.9); }
.channel.back { border-color: var(--gold); color: var(--gold); background: rgba(60,45,0,.7); }
.channel[hidden], .channelnote[hidden] { display: none; }
.channelnote { position: absolute; top: 1.15em; right: 9em; z-index: 20; margin: 0; padding: .3em .8em; border-radius: .35em; background: rgba(180,76,255,.2); border: 1px dashed #b44cff; color: #e8d0ff; font-size: .85em; }

/* 觉醒（2026-09-14）：合击格角标 + 另外两系的自动释放开关 */
.slot.combo::before { content: '合击'; position: absolute; right: .2em; top: .1em; font-size: max(.58em, 9px); font-weight: 800; color: #ff8000; z-index: 2; text-shadow: 0 1px 2px #000; }
.slot.combo[data-ult]::before { content: '三系'; }
.lanegrp { display: flex; flex-direction: column; gap: .25em; align-self: stretch; justify-content: space-between; }
.slot.lane { cursor: pointer; font: inherit; color: inherit; width: 6.2em; height: auto; flex: 1; min-height: 1.7em; display: flex; align-items: center; gap: .3em; padding: 0 .35em;
             border: 1px solid var(--sc); box-shadow: inset 0 0 0 1px var(--sc); }
.slot.lane kbd { position: static; color: var(--gold); border-color: rgba(255,209,0,.5); }
.slot.lane .nm { font-size: .7em; white-space: nowrap; padding: 0; }
.slot.lane em { position: static; margin-left: auto; font-size: .7em; color: #9fe3a0; }
.slot.lane.off { opacity: .75; box-shadow: none; border-style: dashed; }
.slot.lane.off em { color: #ff9a7a; }
.slot.lane .pips { position: absolute; left: 50%; bottom: .08em; transform: translateX(-50%); display: flex; gap: .18em; font-style: normal; }
.slot.lane .pips b { width: .3em; height: .3em; border-radius: 50%; background: rgba(255,255,255,.18); }
.slot.lane .pips b.ready { background: var(--sc); box-shadow: 0 0 .3em var(--sc); }
.slot.lane:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#actionbar.wide.lanes .slot.big { width: 3.95em; }
#actionbar.wide.lanes { gap: .3em; }
/* 只留大秘境（2026-09-14）：主菜单原来的难度选择换成一张说明卡 */
#diffs .keystone { flex: 1; padding: .55em .8em; border-radius: .45em; border: 1px solid #ff8000; background: color-mix(in srgb, #ff8000 12%, #15131f); }
#diffs .keystone b { display: block; color: #ff8000; }
#diffs .keystone small { display: block; font-size: .72em; color: var(--muted); line-height: 1.35; margin-top: .15em; }
#diffs .keystone .best { color: #9fe3a0; }

/* 大秘境词缀（2026-09-14）：层开始横幅 + 商店「接下来两层」 */
#affixbanner { position: absolute; left: 50%; top: 68%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .3em; pointer-events: none; opacity: 0; z-index: 5; }
#affixbanner.show { animation: affixin 3.2s ease both; }
#affixbanner p { margin: 0; display: flex; align-items: baseline; gap: .5em; background: rgba(20,8,6,.78); border: 1px solid rgba(255,110,60,.45); border-radius: .4em; padding: .3em .8em; white-space: nowrap; }
#affixbanner em { font-style: normal; font-size: 1.2em; }
#affixbanner b { color: #ffb070; font-size: 1.05em; }
#affixbanner sup { color: #ffd100; font-size: .65em; margin-left: .2em; }
#affixbanner span { color: #f0e6d8; font-size: .9em; }
@keyframes affixin { 0% { opacity: 0; transform: translate(-50%, -8px); } 10% { opacity: 1; transform: translate(-50%, 0); } 82% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #affixbanner.show { animation: none; opacity: 1; } }
.affprev { margin: .45em 0 0; display: flex; flex-direction: column; gap: .3em; }
.affrow { display: flex; flex-wrap: wrap; gap: .35em; align-items: stretch; font-size: .82em; }
.affrow > b { color: var(--muted); align-self: center; min-width: 4.2em; }
.affcard { display: grid; grid-template-columns: auto 1fr; column-gap: .4em; background: rgba(255,90,40,.08); border: 1px solid rgba(255,120,60,.3); border-radius: .35em; padding: .2em .5em; max-width: 21em; cursor: help; }
.affcard em { font-style: normal; grid-row: span 3; align-self: center; font-size: 1.2em; }
.affcard strong { color: #ffb070; }
.affcard small { color: #e8dccc; }
.affcard i { font-style: normal; font-size: .85em; color: var(--muted); }
.affcard i.ok { color: #9fe3a0; }
.affcard i.no { color: #ff8a7a; }

/* buff / debuff 图标块（2026-09-15）：像素图标 + 层数 + 剩余秒数 + 时间遮罩 */
#pf .buffs { display: flex; flex-direction: column; gap: .25em; }
#pf .buffs .arow { display: flex; flex-wrap: wrap; gap: .2em; }
.aic { position: relative; display: inline-block; width: 2.1em; height: 2.1em; background: var(--i) center / contain no-repeat; image-rendering: pixelated; pointer-events: auto; cursor: help; flex: none; }
.aic::after { content: ''; position: absolute; inset: 0; background: conic-gradient(rgba(0,0,0,.72) var(--p), transparent 0); border-radius: .2em; pointer-events: none; }
.aic.db::before { content: ''; position: absolute; right: 0; top: 0; border-style: solid; border-width: 0 .55em .55em 0; border-color: transparent #ff2a1a transparent transparent; z-index: 1; }
.aic b { position: absolute; right: -.15em; bottom: -.1em; font-size: .72em; font-weight: 800; color: #fff; text-shadow: 0 0 2px #000, 0 1px 2px #000; z-index: 1; font-variant-numeric: tabular-nums; }
.aic em { position: absolute; left: 50%; bottom: .05em; transform: translateX(-50%); font-style: normal; font-size: .78em; font-weight: 800; line-height: 1; padding: 0 .15em; border-radius: .15em; background: rgba(0,0,0,.72); color: #fff; font-variant-numeric: tabular-nums; }
#pf .buffs .arow { row-gap: .25em; }
.aic.sm { width: 1.35em; height: 1.35em; }
.aic.sm b { font-size: .6em; }
.aic.db { filter: drop-shadow(0 0 .12em rgba(255,60,40,.9)) drop-shadow(0 0 .12em rgba(255,60,40,.9)); }
.aic.dp { filter: drop-shadow(0 0 .2em rgba(190,110,255,.8)); }
.frame.mate .pa { display: flex; flex-wrap: wrap; gap: .15em; margin-top: .15em; min-height: 0; }
.frame.mate .pp { display: flex; gap: .25em; margin-top: .15em; }
.frame.mate .pp:empty, .frame.mate .pa:empty { display: none; }
.frame.mate .mp { position: relative; width: 1.5em; height: 1.5em; background: var(--i) center / contain no-repeat; image-rendering: pixelated; }
.frame.mate .mp i { position: absolute; left: 0; bottom: -.25em; height: .18em; background: #4fd35a; }
#bossbar .bauras { display: inline-flex; gap: .15em; margin-left: .6em; vertical-align: middle; }
/* 宠物框（2026-09-15）：头像 + 名字 + 血条 + 蓝条 / 剩余时间 */
#summons { gap: .35em; align-items: flex-end; max-width: 15.5em; }
#summons.compact .pet .pbody small { display: none; }
#summons.compact .pet .pbody { width: 3em; }
#summons .more { font-size: .8em; color: var(--gold); align-self: center; }
#summons .pet { display: flex; align-items: center; gap: .35em; background: var(--panel); border: 1px solid var(--line); border-radius: .35em; padding: .2em .4em .2em .2em; pointer-events: auto; }
#summons .pp { position: relative; width: 2.1em; height: 2.1em; background: var(--i) center / contain no-repeat; image-rendering: pixelated; flex: none; }
#summons .pp b { position: absolute; right: -.25em; bottom: -.2em; font-size: .7em; color: var(--gold); text-shadow: 0 1px 2px #000; }
#summons .pbody { display: flex; flex-direction: column; gap: .12em; width: 5.2em; }
#summons .pbody small { font-size: .68em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#summons .pb { height: .38em; background: rgba(0,0,0,.6); border-radius: .1em; overflow: hidden; }
#summons .pb i { display: block; height: 100%; }
#summons .pb.hp i { background: linear-gradient(#6ee07a, #2e9a3a); }
#summons .pb.mp i { background: linear-gradient(#6aa8ff, #2a5ac0); }
#summons .pb.lt i { background: linear-gradient(#7ae8ff, #2a9ab0); }

/* ================= 手机版（html.mobile，由 game/touch.js 判定：触屏设备，或网址 ?mobile=1） =================
   横屏、全屏铺满；战斗强制 AUTO，只剩一个浮动摇杆；HUD 去掉动作条和伤害面板；商店分两页（金币 → 奖券）。
   字号按屏幕短边算：横屏手机高 360~430px，界面字约 11px，HUD 约 9px */
html:not(.mobile) .mobile-only { display: none !important; }
.mobile body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
.mobile #app { width: 100vw; height: 100vh; height: 100dvh; }
.mobile #stage { width: 100%; height: 100%; aspect-ratio: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mobile kbd, .mobile .autoqer, .mobile #keyhint { display: none !important; }

/* 摇杆：不按时停在左下角当提示，按下就挪到手指下面 */
#joy { display: none; }
.mobile.playing #joy { display: block; }
.mobile #joy { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; pointer-events: none;
               left: calc(env(safe-area-inset-left, 0px) + 96px); top: calc(100% - 92px);
               border-radius: 50%; border: 2px solid rgba(255,255,255,.14); background: radial-gradient(circle, rgba(255,255,255,.05), rgba(255,255,255,.02) 70%); transition: opacity .2s; opacity: .7; }
.mobile #joy i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%;
                 background: rgba(255,255,255,.16); border: 2px solid rgba(255,255,255,.22); }
.mobile #joy.on { opacity: 1; border-color: rgba(255,209,0,.45); }
.mobile #joy.on i { background: rgba(255,209,0,.38); border-color: rgba(255,224,102,.8); box-shadow: 0 0 14px rgba(255,209,0,.35); }

/* 战斗 HUD */
.mobile #hud { font-size: clamp(8px, min(1.2vw, 2.6dvh), 12px); }
.mobile #actionbar, .mobile #swingbar, .mobile #meter, .mobile #pf .lanes, .mobile #pf .mastery { display: none !important; }
.mobile #pf { left: max(1em, env(safe-area-inset-left)); top: .8em; width: 19em; }
.mobile #pf .buffs { width: 22em; top: 6.4em; }
.mobile #party { right: max(1em, env(safe-area-inset-right)); top: 5em; width: 12.5em; gap: .3em; max-height: calc(100% - 13em); }
.mobile #party .mate { padding: .25em .4em; }
.mobile #party .mate .portrait { width: 1.7em; height: 2.2em; }
.mobile #party .mate .res, .mobile #party .mate .cast { display: none; }
.mobile #party .mate .hp { height: .85em; margin-top: .12em; }
.mobile #party .mate .hp b { font-size: max(.68em, 8px); line-height: 1.3; }
.mobile #party .mate .name { font-size: .8em; }
.mobile #summons { left: auto; right: max(1em, env(safe-area-inset-right)); bottom: .8em; justify-content: flex-end; }
.mobile .bottom { bottom: .8em; }
.mobile #bossbar { width: 30em; }
.mobile #bossbar .btip { font-size: .8em; padding: .25em .6em; }
.mobile #mpause { position: absolute; right: max(1em, env(safe-area-inset-right)); top: .7em; width: max(3.4em, 40px); height: max(3.4em, 40px);
                  display: flex; gap: 5px; align-items: center; justify-content: center; pointer-events: auto; padding: 0;
                  border-radius: 50%; border: 1px solid var(--line); background: var(--panel); }
.mobile #mpause i { width: 5px; height: 15px; border-radius: 1px; background: var(--text); }
.mobile #tip { font-size: 12px; max-width: min(24em, 70vw); }

/* 菜单 / 暂停 / 结算：整屏可滚，面板贴满宽度 */
.mobile .screen { font-size: clamp(10px, min(1.3vw, 2.9dvh), 13px); overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch;
                  padding: .8em max(1em, env(safe-area-inset-right)) 1.2em max(1em, env(safe-area-inset-left)); }
.mobile .screen > .panel { margin-block: auto; }
.mobile #menu .panel { width: 100%; }
.mobile #menu h1 { font-size: 3em; }
.mobile #menu .lede:not(.touchnote) { display: none; }
.mobile #menu .lede { font-size: 1em; line-height: 1.6; }
.mobile .touchnote b { color: var(--gold); }
.mobile .touchnote { margin: 0 0 .8em; padding: .5em .8em; border-radius: .4em; font-size: .95em; color: #bfe8ff; background: rgba(90,170,255,.08); border: 1px solid rgba(90,170,255,.3); }
.mobile .keys { display: none; }
.mobile .spec:hover, .mobile .ctile:hover { transform: none; }
.mobile .btns button { min-height: 42px; }
.mobile #end .panel { width: 100%; padding: 1.2em 1.4em; }
.mobile #end h2 { font-size: 2.4em; }
.mobile .panel.small { width: min(40em, 100%); }

/* 商店：两页。顶栏钉住：标题 + 步骤 + 钱包 + 翻页 / 开始按钮 */
.mobile #shop { padding: 0; }
.mobile #shop .panel.shop { width: 100%; min-height: 100%; border: 0; border-radius: 0; padding: 0 max(1em, env(safe-area-inset-right)) 1.4em max(1em, env(safe-area-inset-left)); }
.mobile .shop-head { gap: 1em; padding: .5em 0; }
.mobile .shop-head .ttl { display: flex; flex-direction: column; gap: .1em; }
.mobile .shop-head h2 { font-size: 1.55em; letter-spacing: .06em; white-space: nowrap; }
.mobile .shop-head .step { font-size: .8em; color: var(--muted); white-space: nowrap; }
.mobile .shop-head .step b { display: inline-block; min-width: 1.4em; text-align: center; border-radius: 1em; background: var(--gold); color: #1a1200; }
.mobile .shop-head .step i { font-style: normal; margin: 0 .3em; }
.mobile .shop-head .wallet { gap: 1em; align-items: center; }
.mobile .shop-head .tickets { font-size: 1.1em; white-space: nowrap; }
.mobile .shop-head .tickets small { display: none; }
.mobile .shop-head .tickets .cur { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.mobile .shop-head .go, .mobile .shop-head .next { min-height: 40px; padding: .5em 1.1em; font-size: 1em; white-space: nowrap; max-width: 24em; overflow: hidden; text-overflow: ellipsis; }
.shop-head .next { border-radius: .45em; border: 1px solid #ffd100; background: linear-gradient(#ffe066, #c99a00); color: #1a1200; font-weight: 800; }
.mobile .shop-head .go small.dn { display: none; }
.mobile .shop-head .back { min-height: 40px; padding: .4em .9em; border-radius: .45em; border: 1px solid var(--line); background: #1d1a2b; color: var(--text); white-space: nowrap; }
.mobile .shop-info { display: flex; flex-direction: column; gap: .3em; margin: .3em 0 .6em; }
.mobile .shop-info:empty { display: none !important; }
.mobile .shop-info .sub { margin: 0; font-size: .95em; }
.mobile .shop-info button.elite { align-self: stretch; margin: 0; padding: .7em 1em; font-size: 1.05em; }
.mobile .shop-body { grid-template-columns: 1.45fr 1fr; gap: 1.2em; margin-top: .4em; }
.mobile #shop.p0 .pg-prize, .mobile #shop.p1 .pg-gold, .mobile #shop.p1 .roster { display: none; }
.mobile #shop.p1 .shop-body { grid-template-columns: 1fr; }
.mobile .offers { grid-template-columns: repeat(3, 1fr); gap: .6em; }
.mobile .offer { min-height: 0; padding: 1.3em .5em .6em; }
.mobile .offer .tarot { font-size: 1.7em; line-height: 1.2; }
.mobile .offer .portrait { width: 3.4em; height: 4.4em; }
.mobile .offer button.lock { position: absolute; right: .35em; top: .3em; width: auto; min-height: 0; margin: 0; padding: .2em .6em; font-size: .78em; }
.mobile .offer button, .mobile .refresh, .mobile .merge, .mobile .talent { min-height: 38px; }
.mobile .prizes { grid-template-columns: repeat(4, 1fr); gap: .6em; }
.mobile #shop.p1 .status { margin: 0 0 .8em; }
.mobile .roster li .fire { opacity: 1; min-height: 28px; }
.mobile .talents { position: fixed; border-radius: 0; overflow-y: auto; justify-content: safe center; padding: 1em; }
.mobile .talent-row { width: min(64em, 96%); }
.mobile .talent { min-height: 0; }

/* 竖屏：盖一层"请横过来"（游戏会自动暂停） */
#rotate { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
          padding: 24px; background: #0b0c12; color: var(--gold); text-align: center; font-size: 20px; }
#rotate::before { content: ''; width: 34px; height: 56px; margin-bottom: 10px; border: 3px solid var(--gold); border-radius: 6px; animation: rotHint 1.8s ease-in-out infinite; }
#rotate small { color: var(--muted); font-size: 14px; }
@keyframes rotHint { 0%, 25% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) { .mobile #rotate { display: flex !important; } }

/* 团队冷却按钮：嗜血 G（赤橙）/ 战复 H（金绿），2026-09-15 */
.slot.raid { --sc: #ff6a2a; cursor: pointer; }
.slot.raid.rez { --sc: #7dff8a; }
.slot.raid.dim .nm { opacity: .55; }
.slot.raid.none { opacity: .38; filter: grayscale(.8); }
.slot.raid.on { box-shadow: 0 0 0 2px #ff8a3a, 0 0 1.2em rgba(255,106,42,.7); }
.slot.raid.need, .mraid.need { animation: ready 0.8s ease-in-out infinite alternate; box-shadow: 0 0 0 2px #7dff8a; }
#mraid { display: none; }
.mobile #mraid { display: flex; flex-direction: column; gap: 10px; position: absolute; right: max(1em, env(safe-area-inset-right)); bottom: 9em; pointer-events: auto; }
.mraid { position: relative; width: max(4.6em, 50px); height: max(4.6em, 50px); border-radius: 50%; overflow: hidden; padding: 0; color: #fff;
         border: 2px solid #ff6a2a; background: radial-gradient(circle at 40% 35%, #5a2412, #1a0e0a 75%); font-weight: 800; }
.mraid.rez { border-color: #7dff8a; background: radial-gradient(circle at 40% 35%, #1e4a24, #0a140c 75%); }
.mraid b { position: relative; z-index: 1; font-size: max(.9em, 11px); text-shadow: 0 1px 2px #000; }
.mraid .cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0,0,0,.66); }
.mraid em { position: absolute; left: 0; right: 0; bottom: 18%; z-index: 1; font-style: normal; font-size: max(.75em, 10px); text-shadow: 0 1px 2px #000; }
.mraid.dim b { opacity: .6; }
.mraid.none { opacity: .35; filter: grayscale(.8); }
.mraid.on { box-shadow: 0 0 14px rgba(255,106,42,.8); }

/* ================= 图鉴 · 首领出场说明 · 死亡建议（game/codex.js，2026-09-15） ================= */
#codex .panel.codex { width: min(94%, 86em); height: min(92%, 60em); box-sizing: border-box; display: flex; flex-direction: column;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: .9em; padding: 1.3em 1.8em 1.5em; }
.cx-top { display: flex; align-items: center; gap: 1.2em; }
.cx-top h2 { font-size: 2.6em; color: var(--gold); letter-spacing: .14em; }
.cx-top .sub { margin: 0; flex: 1; }
.cx-top button { padding: .55em 1.3em; border-radius: .4em; border: 1px solid #ffd100; background: linear-gradient(#ffe066, #c99a00); color: #1a1200; font: inherit; font-weight: 800; cursor: pointer; }
.cx-top button kbd { color: #1a1200; border-color: rgba(0,0,0,.35); background: rgba(255,255,255,.3); }
.cx-tabs { display: flex; flex-wrap: wrap; gap: .4em; margin: .7em 0 0; }
.cx-tabs button { padding: .4em 1em; border-radius: .35em; border: 1px solid var(--line); background: #15131f; color: var(--text); font: inherit; font-size: .95em; cursor: pointer; text-align: left; }
.cx-tabs button small { display: block; font-size: .72em; color: var(--muted); min-height: 1.2em; }
.cx-tabs button.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; color: var(--gold); }
.cx-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(18em, 26em) 1fr; gap: 1.1em; margin-top: .8em; }
.cx-list { overflow-y: auto; padding-right: .3em; }
.cx-list h4 { margin: .5em 0 .35em; color: var(--muted); font-size: .8em; font-weight: 600; letter-spacing: .14em; }
.cx-list h4:first-child { margin-top: 0; }
.cx-list ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .3em; }
.cx-list button { position: relative; width: 100%; display: flex; align-items: center; gap: .5em; padding: .3em .5em; border-radius: .35em; border: 1px solid var(--line);
  background: #17141f; color: var(--text); font: inherit; font-size: .88em; text-align: left; cursor: pointer; }
.cx-list button:hover { border-color: #6a5a9a; }
.cx-list button.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: #221c14; }
.cx-list button.locked span { color: var(--muted); letter-spacing: .1em; }
.cx-list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-list sup { position: absolute; right: .3em; top: .15em; font-size: .7em; color: #1a1200; background: var(--gold); border-radius: .6em; padding: 0 .35em; font-weight: 800; }
.cxi { flex: none; width: 2.2em; height: 2.2em; background: var(--i) center / contain no-repeat; image-rendering: pixelated; }
.cxi.locked { filter: brightness(0) drop-shadow(0 0 1px #8a7fb0); opacity: .75; }
.cx-detail { overflow-y: auto; min-height: 0; background: #100e18; border: 1px solid var(--line); border-radius: .6em; padding: 1em 1.3em 1.2em; }
.cx-head { display: flex; gap: 1em; align-items: center; }
.cx-head .cxi { width: 5.2em; height: 5.2em; border-radius: .4em; background-color: rgba(255,255,255,.03); }
.cx-head h3 { margin: 0; font-family: var(--serif); font-size: 1.7em; color: var(--gold); letter-spacing: .05em; }
.cx-head h3 small { margin-left: .6em; font-family: var(--sans); font-size: .5em; font-weight: 600; color: var(--muted); letter-spacing: .1em; vertical-align: .3em; }
.cx-blurb { margin: .25em 0 0; color: var(--text); line-height: 1.5; }
.cx-needs { margin: .45em 0 0; display: flex; flex-wrap: wrap; gap: .3em; }
.cx-needs i, #bossbrief .needs i, #pausetip .needs i { font-style: normal; font-size: .78em; padding: .05em .6em; border-radius: 1em; border: 1px solid #5a86c8; color: #bfe0ff; background: rgba(90,140,255,.12); white-space: nowrap; }
.cx-howto { margin-top: 1em; background: rgba(125,255,138,.06); border: 1px solid rgba(125,255,138,.28); border-radius: .5em; padding: .6em 1em .7em; }
.cx-howto h4, .cx-mech h4 { margin: 0 0 .35em; font-size: .82em; letter-spacing: .12em; color: #9fe3a0; }
.cx-mech h4 { color: var(--muted); margin-top: 1em; }
.cx-howto ol { margin: 0; padding-left: 1.4em; line-height: 1.75; font-size: 1.02em; }
.cx-mech dl { display: grid; grid-template-columns: max-content 1fr; gap: .4em 1em; margin: 0; font-size: .9em; }
.cx-mech dt { color: var(--muted); white-space: nowrap; }
.cx-mech dd { margin: 0; line-height: 1.5; }
.cx-mech dd b { color: #ffcf8a; margin-right: .5em; }
.cx-mech dd em { display: block; font-style: normal; color: var(--muted); font-size: .86em; }
.cx-lock { color: var(--muted); margin-top: 1.2em; line-height: 1.6; }
.mobile #codex { padding: 0; overflow: hidden; }
.mobile #codex .panel.codex { width: 100%; height: 100vh; height: 100dvh; margin: 0; border: 0; border-radius: 0; padding: .4em max(1em, env(safe-area-inset-right)) .6em max(1em, env(safe-area-inset-left)); }
.mobile .cx-top h2 { font-size: 1.6em; }
.mobile .cx-top .sub { font-size: .85em; }
.mobile .cx-top button { min-height: 36px; padding: .3em 1em; }
.mobile .cx-tabs { margin-top: .35em; }
.mobile .cx-tabs button { padding: .25em .8em; min-height: 34px; }
.mobile .cx-tabs button small { display: inline; margin-left: .5em; }
.mobile .cx-body { grid-template-columns: 15em 1fr; gap: .7em; margin-top: .5em; }
.mobile .cx-list ul { grid-template-columns: 1fr; }
.mobile .cx-list button { min-height: 32px; }
.mobile .cx-detail { padding: .6em .9em .8em; }
.mobile .cx-head .cxi { width: 3.8em; height: 3.8em; }
.mobile .cx-head h3 { font-size: 1.4em; }

/* 首领出场说明卡片：出场时展开，几秒后收进血条右边的「？ 机制」按钮 */
#bossbar { position: relative; }
#bossbar .bbrief { position: absolute; left: 100%; top: 1.35em; margin-left: .5em; pointer-events: auto; white-space: nowrap; cursor: pointer;
  font: inherit; font-size: max(.78em, 11px); padding: .15em .7em; border-radius: 1em; border: 1px solid #c8643a; background: rgba(40,12,6,.85); color: #ffcf8a; }
#bossbar .bbrief:hover, #bossbar .bbrief.on { border-color: #ffb070; background: rgba(90,30,10,.9); }
#bossbar .bbrief[hidden] { display: none; }
#bossbrief { position: relative; margin: .2em auto 0; width: 32em; text-align: left; box-sizing: border-box; pointer-events: none; z-index: 6;
  background: rgba(26,10,8,.9); border: 1px solid #9a4a2a; border-radius: .55em; padding: .55em 1em .7em; box-shadow: 0 .4em 1.4em rgba(0,0,0,.5); }
#bossbrief[hidden] { display: none; }
#bossbrief.in { animation: bbIn .35s ease-out both; }
#bossbrief.out { animation: bbOut .26s ease-in both; }
@keyframes bbIn { from { opacity: 0; transform: translateY(-.8em) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes bbOut { to { opacity: 0; transform: translate(40%, -4em) scale(.3); } }
#bossbrief h5, #pausetip h5 { margin: 0 0 .3em; font-size: 1em; font-weight: 600; color: #ffb58a; }
#bossbrief h5 b, #pausetip h5 b { font-family: var(--serif); color: #ff9a6a; letter-spacing: .08em; margin-right: .5em; }
#bossbrief h5 small, #pausetip h5 small { font-size: .78em; color: var(--muted); }
#bossbrief ol, #pausetip ol { margin: 0; padding: 0; list-style: none; counter-reset: bb; }
#bossbrief li, #pausetip li { counter-increment: bb; position: relative; padding-left: 1.9em; margin: .25em 0; line-height: 1.45; color: #fff2e6; font-size: 1.05em; text-align: left; }
#bossbrief li::before, #pausetip li::before { content: counter(bb); position: absolute; left: 0; top: .1em; width: 1.35em; height: 1.35em; border-radius: 50%;
  background: #ff8c28; color: #1a0a00; font-size: .8em; font-weight: 800; line-height: 1.35em; text-align: center; }
#bossbrief .needs, #pausetip .needs { margin: .4em 0 0; display: flex; flex-wrap: wrap; gap: .3em; }
#bossbrief .bb-close { position: absolute; right: .5em; top: .45em; pointer-events: auto; cursor: pointer; font: inherit; font-size: .78em; padding: .05em .6em;
  border-radius: 1em; border: 1px solid #6b3a2a; background: rgba(0,0,0,.35); color: #d9b8a0; }
#pausetip { text-align: left; }
#pausetip li { font-size: 1em; }
.mobile #bossbrief { width: 30em; padding: .4em .8em .5em; }
.mobile #bossbrief li { margin: .15em 0; }
.mobile #bossbar .bbrief { min-height: 26px; }
@media (prefers-reduced-motion: reduce) { #bossbrief.in, #bossbrief.out { animation: none; } }

/* 主角倒下（队友还在打）：一句简短建议 */
#downtip { position: absolute; left: 50%; top: 75%; transform: translateX(-50%); max-width: 44em; width: max-content; box-sizing: border-box; pointer-events: none; z-index: 5;
  padding: .45em 1.1em; border-radius: .45em; background: rgba(22,8,10,.88); border: 1px solid rgba(255,120,100,.5); color: #ffe6dc; font-size: 1.05em; line-height: 1.5; opacity: 0; }
#downtip[hidden] { display: none; }
#downtip b { color: #ff8a7a; margin-right: .7em; }
#downtip.show { animation: downtip 7s ease both; }
@keyframes downtip { 0% { opacity: 0; transform: translate(-50%, .6em); } 6%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.mobile #downtip { top: 70%; max-width: 70%; width: auto; }
@media (prefers-reduced-motion: reduce) { #downtip.show { animation: none; opacity: 1; } }

/* 结算页：下次试试（死亡建议） */
#end .advice { margin: -.4em 0 1.1em; padding: .55em 1em .6em; border-radius: .5em; background: rgba(125,255,138,.06); border: 1px solid rgba(125,255,138,.3); font-size: .95em; }
#end .advice[hidden] { display: none; }
#end .advice b { color: #9fe3a0; letter-spacing: .08em; }
#end .advice ul { margin: .25em 0 0; padding-left: 1.3em; line-height: 1.65; color: #e8f5e2; }
.cx-list, .cx-detail { color-scheme: dark; scrollbar-width: thin; scrollbar-color: #3a3452 transparent; }

/* ---- 能力标签（2026-09-15）：词缀需求 / 旅伴特长 / 团队能力 / 应对类暗月卡片共用一套词和颜色（shop.js 的 NEED） ---- */
.need { --nc: #cfc6b4; display: inline-block; font-style: normal; font-weight: 700; font-size: .72em; line-height: 1.45; padding: 0 .42em; border-radius: .3em; white-space: nowrap;
        color: var(--nc); border: 1px solid color-mix(in srgb, var(--nc) 55%, transparent); background: color-mix(in srgb, var(--nc) 13%, transparent); }
.need.n-kick { --nc: #ffa040; }
.need.n-dispel { --nc: #5cc8ff; }
.need.n-single { --nc: #ff6b6b; }
.need.n-aoe { --nc: #c88cff; }
.need.n-party { --nc: #ffe066; }
.need.n-lust { --nc: #ff66c4; }
.need.n-rez { --nc: #6fe8c0; }
.need.n-tank { --nc: #b8c4d8; }
.need.n-healer { --nc: #9be35a; }
.need.n-counter { --nc: #ffd100; }
.need.miss { --nc: #8a8578; border-style: dashed; }
.offer .skills { display: flex; flex-wrap: wrap; justify-content: center; gap: .2em; min-height: 1.1em; }
.roster li .skills { display: inline-flex; flex-wrap: wrap; gap: .2em; }
.roster li .skills .need { font-size: .68em; }
.roster .teamskills { display: flex; flex-wrap: wrap; align-items: center; gap: .3em; margin: 0 0 .45em; font-size: .95em; }
.roster .teamskills em { font-style: normal; font-size: .76em; color: var(--muted); margin-right: .15em; }
.roster .teamskills .need { font-size: .78em; font-variant-numeric: tabular-nums; }
.affcard i .need { font-size: .95em; margin-right: .15em; }
.affcard i .ok { color: #9fe3a0; }
.affcard i .no { color: #ff8a7a; font-weight: 800; }
.offer .counter { margin: 0; font-size: .74em; line-height: 1.4; color: #ffe9a8; }
.offer .counter .need { margin-right: .3em; font-size: .95em; }
.offer .counter.off { color: var(--muted); font-size: .7em; }
.offer.countered { border-color: #ffd100; box-shadow: 0 0 0 1px rgba(255,209,0,.55) inset, 0 0 .9em rgba(255,209,0,.22); }
.mobile .offer .skills .need { font-size: .66em; }
.mobile .offer .counter { font-size: .68em; }
.mobile .offer .counter.off { display: none; }
.cxi.q { display: grid; place-items: center; background: #0c0b12; border: 1px dashed #3a3452; border-radius: .3em; color: #5a527a; font-weight: 800; font-size: 1em; box-sizing: border-box; }
.cx-head .cxi.q b { font-size: 2.2em; }
.offers > .offer { min-width: 0; }

/* ===== 2026-09-16 评测修复（第一批）===== */
/* 带 display 的 HUD 元素会盖掉 hidden 属性（词缀横幅压在暂停 / 结算页上，三份评测里两份独立发现） */
#affixbanner[hidden], #bossbrief[hidden], #downtip[hidden], #keyhint[hidden], #mraid[hidden] { display: none !important; }
/* 全屏界面（暂停 / 图鉴 / 结算 / 商店）压在 HUD 上面：HUD 里带 z-index 的元素（嗜血 / 战复按钮字、横幅）不再透出来 */
.screen { z-index: 30; }
/* 全屏界面内容比舞台高时整屏滚动（主菜单在 16:9 下被裁掉专精卡下半截和 AUTO 开关，不能滚） */
.screen { overflow-y: auto; place-items: start center; }
.screen > .panel { margin-block: auto; }
#menu { padding-block: 1em; }
#specs header .autoqer { margin-left: auto; font-size: .95em; }
/* 手机 HUD（手机评测）：队伍框改成一行名字 + 细血条，8 人放得下；嗜血 / 战复挪到顶部暂停键左边；字不小于 11px；触控目标 ≥ 44px */
.mobile #party { top: 4.6em; width: 9.5em; gap: 3px; max-height: none; overflow: visible; }
.mobile #party .mate { display: flex; align-items: center; gap: 4px; padding: 2px 5px; border-radius: 4px; }
.mobile #party .mate .portrait { display: none; }
.mobile #party .mate .name { font-size: 11px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile #party .mate .name .st { display: none; }
.mobile #party .mate .hp { height: 4px; margin-top: 2px; }
.mobile #party .mate .hp b, .mobile #party .mate .pa, .mobile #party .mate .pp, .mobile #party .mate .sw { display: none; }
.mobile #party.dense .mate, .mobile #party.tight .mate { padding: 2px 5px; }
.mobile #mraid { flex-direction: row; top: .7em; bottom: auto; right: calc(max(1em, env(safe-area-inset-right)) + max(3.4em, 40px) + 8px); gap: 8px; }
.mobile .mraid { width: 48px; height: 48px; }
.mobile .mraid b { font-size: 12px; }
.mobile .mraid em { font-size: 10px; bottom: 12%; }
.mobile #bossbar .bcast { font-size: 11px; background: rgba(0,0,0,.55); border-radius: 4px; padding: 0 6px; }
.mobile #pf .name { font-size: 12px; }
.mobile #pf .hp b { font-size: 11px; }
.mobile .aic b { font-size: 10px; }
.mobile #announce { top: 40%; }
.mobile .menubar button, .mobile .btns button, .mobile .toggle, .mobile .cx-tabs button, .mobile .refresh, .mobile #bossbar .bbrief, .mobile #bossbrief button { min-height: 44px; }
.mobile .shop-info .affrow small, .mobile .offer .hint, .mobile .offer .chips span, .mobile .need, .mobile .roster .tag { font-size: max(.8em, 11px); }
.mobile #menu .keystone small { font-size: 11px; }

/* 桌面：伤害统计挪到动作条上方、只列前 6 名（新手评测：满编时盖住 AUTO / G / H 和第 8 个队友框） */
html:not(.mobile) #meter { bottom: 5.8em; width: 16em; }
/* 手机首领说明（暂停中）：卡片放屏幕中间、能点，下面一个大「开打」按钮 */
#bossbrief.gate { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; pointer-events: auto; z-index: 40; width: min(92vw, 30em); font-size: 14px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
#bossbrief .bb-go { display: block; width: 100%; min-height: 44px; margin-top: .6em; border-radius: .4em; border: 1px solid #ffd100; background: linear-gradient(#ffe066, #c99a00); color: #1a1200; font-weight: 800; font-size: 16px; }

.spec-row .spec p.sig { margin: .35em 0; padding: .3em .55em; border-radius: .35em; background: rgba(255,209,0,.07); border: 1px solid rgba(255,209,0,.25); color: #efe2c0; }
.spec-row .spec p.sig b { color: var(--gold); margin-right: .5em; }
