* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
body {
  font-family: 'Ubuntu', -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;  /* 字体正常粗细，不加粗 */
  color: #fff;
}
/* 全局禁止选中/拖拽：卡面与文字都是画布像素，没有任何可选中的 DOM 文本 */
*, *::before, *::after {
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-user-drag: none; -webkit-tap-highlight-color: transparent;
}

#game { display: block; position: absolute; inset: 0; }
.hidden { display: none !important; }

/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; }

/* 左下角图标列：使用 assets/ui 真实矢量化按钮贴图（层级高于窗口） */
#dockBtns {
  position: absolute; left: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px;
  pointer-events: auto; z-index: 45;
}
.dockbtn {
  padding: 0; border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: filter .1s, transform .08s;
}
.dockbtn img { width: 100%; height: 100%; display: block; pointer-events: none; }
.dockbtn:hover { filter: brightness(1.1); }
.dockbtn:active { filter: brightness(.82); transform: scale(.95); }
/* 背包按钮：原 54px × 0.85 × 1.2 */
#bagBtn { width: 55.2px; height: 55.2px; }
/* 合成按钮：与背包按钮同尺寸，排在背包正下方（列从底部锚定 -> 背包整体上移一格） */
#craftBtn { width: 55.2px; height: 55.2px; }
/* 左上角按钮组：设置（最左）+ 生物图鉴（右移一格） */
#topBtns {
  position: absolute; left: 16px; top: 12px;
  display: flex; align-items: center; gap: 3px;   /* 两个图标靠得更近 */
  pointer-events: auto; z-index: 45;
}
/* 生物图鉴按钮：原 32.4px × 1.4 = 45.36px */
#dexBtn { width: 45.36px; height: 45.36px; }
/* 设置按钮：与图鉴同级；内联 SVG 便于单独转动中间齿轮 */
#setBtn { width: 45.36px; height: 45.36px; }
.setbtn-svg { width: 100%; height: 100%; display: block; }
/* 只有中间那个白色齿轮转：外框与底板保持不动 */
#setBtn .gear { transform-box: view-box; transform-origin: 50% 50%; }
#setBtn:hover .gear { animation: gearSpin 2.6s linear infinite; }
@keyframes gearSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 底部常驻快捷栏：仅一行 = 当前装备的卡（空位为灰色半透明圆角块，无描边；层级高于窗口） */
#quickbar {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  pointer-events: auto; z-index: 45;
}
.quickrow { display: flex; gap: 8px; }
/* 状态效果条：卡槽正上方，按获得顺序从左到右排列。
   每条 = 圆角条带（略浅底色）+ 圆形图标 + 数字；宽度由 JS 按文本量出并自适应。
   无描边：原本 2px 黑边的位置改成条带自身的内边距（本体更大更宽）；
   宽度、位移、入场/退场（缩放+透明度）全部平滑过渡。 */
.status-row {
  display: flex; gap: 6px; margin-bottom: 6px;
  justify-content: center;
  position: relative;
  min-height: 22px;
}
.status-band {
  display: flex; align-items: center; gap: 4px;
  height: 22px; box-sizing: border-box;
  padding: 0 9px 0 5px;
  border-radius: 9px;
  color: #fff;
  font-family: 'Ubuntu', 'Segoe UI', sans-serif;
  font-size: 12px; font-weight: 800; line-height: 1;
  -webkit-text-stroke: 0.6px #000; paint-order: stroke fill;
  overflow: hidden; white-space: nowrap;
  flex: 0 0 auto;
  will-change: transform, opacity, width;
  transition: width .18s ease, background .18s linear,
              transform .2s cubic-bezier(.3,1.15,.5,1), opacity .18s ease;
}
/* 图标：圆形底色 + 一个符号（减号 / 骷髅 / 约等号） */
.status-ico {
  flex: 0 0 auto;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 11px; font-weight: 900;
  color: #000; -webkit-text-stroke: 0;
}
/* 数值：条带内部只显示数字/百分比，不放文字或 emoji */
.status-txt {
  font-style: normal; font-weight: 800; white-space: nowrap;
}
/* 主槽行：整体 0.9 倍（zoom 同步缩放描边/圆角/间距等所有子元素） */
#slotRow { zoom: 0.9; }
/* 副槽行：整体 0.75 倍（临时存储），位于主槽正下方 */
#subRow { zoom: 0.75; margin-top: 10px; }
/* [R] 提示：绝对定位，故不参与副槽行的居中计算；
   位于第二行第一个卡槽的【正左边】，并相对该卡槽上下居中 */
.subwrap { position: relative; }
.qkey {
  position: absolute; top: 50%; right: calc(100% + 10px); transform: translateY(-50%);
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-size: 12.5px; font-weight: 800;
  color: #fff; -webkit-text-stroke: 1.83px #000; paint-order: stroke fill;
  white-space: nowrap; line-height: 1; pointer-events: none;
}
/* 空卡槽：用 .qinner::after 画"空 eternal 卡"灰白外观；装卡后 .card 绝对铺满完全覆盖，无痕迹 */
.qslot { width: 54px; height: 54px; border-radius: 4px; position: relative; }
.qinner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.qinner::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: 4px; background: #ededed; border: 3.4px solid #c3c3c3; box-sizing: border-box;
}
.qslot .card { position: absolute; inset: 0; z-index: 1; }
/* 拾取落槽：卡牌凭空出现在槽里时"快速渐大"（无位移，只有缩放 + 淡入） */
@keyframes slot-pop {
  0%   { transform: scale(0.55); opacity: 0.15; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.slot-pop { animation: slot-pop 0.22s cubic-bezier(.3,1.4,.5,1) both; transform-origin: center; }
/* 花瓣血量"水缸"阴影已改画在卡牌 canvas 内板上（cards.js drawHpShadow，与
   reload 装填阴影同层同色、掉血从顶边下垂），DOM 层方案已删除。 */
/* 数量角标（xN / ∞）：DOM 文本，可自由溢出卡牌边界（canvas 绘制会被自身裁掉而显示不全）。
   定位用百分比 -> 随卡牌尺寸等比；倾斜 30° 与原 canvas 版观感一致，
   锚点在卡面右上角 (right:15% / top:11%)，绕该点旋转。 */
.card-count {
  position: absolute; right: 8%; top: 20%;
  transform: rotate(30deg); transform-origin: 100% 0;
  font-family: 'Ubuntu', 'Segoe UI', sans-serif;
  font-weight: 800; font-size: 10.4px; line-height: 1;
  color: #fff; -webkit-text-stroke: 0.115em #000;
  paint-order: stroke fill; white-space: nowrap;
  pointer-events: none; z-index: 3;
}
/* 主槽装填（reload）阴影：改由卡牌 canvas 内部绘制（见 cards.js 的 drawReload）——
   画在「内板之上、花瓣图形与名称之下」，所以阴影只压暗卡牌中部底板，
   外周描边、花瓣本体、名称文字全都不被遮盖。因此这里不再需要任何 DOM 覆盖层。 */
/* 副槽格子正下方的数字快捷键提示（放在 .qinner 内，随副槽缩放同步缩放） */
.qinner .qnum {
  position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-size: 15px; font-weight: 800;
  color: #fff; -webkit-text-stroke: 2.2px #000; paint-order: stroke fill;
  white-space: nowrap; line-height: 1; pointer-events: none; z-index: 2;
}
/* 卡牌：纯 canvas 绘制（外框/内板/素材/数量角标全在 JS 里画）
   CSS 只负责布局尺寸与外角裁剪，卡面本身没有任何 DOM 文字/图片节点。 */
.card {
  display: block; width: 100%; height: 100%;
  border-radius: 7%;      /* 画布外角裁剪（内框圆角由 JS 绘制） */
  pointer-events: auto; -webkit-user-drag: none;
}
.cardcell .card { border-radius: 5.88%; }   /* 背包卡外角裁剪 */

/* 悬浮框覆盖层：全屏 canvas，画卡牌数据框（在所有窗口之上） */
#uiOverlay {
  position: fixed; left: 0; top: 0; z-index: 500; pointer-events: none;
}

/* 死亡效果：全屏径向灰黑晕影（置于所有 UI 之下、pointer-events:none 不挡交互）
   + 面板从屏幕下方滑入渐显（0.35s 回弹曲线）。退出反向，播完再摘除 DOM。 */
.death-vignette {
  position: fixed; inset: 0; z-index: 10;   /* 高于 canvas(0)、低于所有 UI(45+) */
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0) 50%, rgba(16, 16, 16, 0.6) 80%, rgba(6, 6, 6, 0.92) 100%);
  opacity: 0; transition: opacity 0.45s ease;
}
.death-vignette.on { opacity: 1; }
.death-overlay {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s ease;
  pointer-events: none;            /* 容器不挡交互，仅 Continue 按钮可点（可继续操作背包/卡槽） */
}
.death-overlay.on { opacity: 1; }
.death-panel {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-weight: 800;
  text-align: center;
  transform: translateY(64px); opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22, 1.2, 0.36, 1), opacity 0.35s ease;
  pointer-events: none;
}
.death-overlay.on .death-panel { transform: translateY(0); opacity: 1; }
.death-title {
  font-size: 17px; color: #fff;
  -webkit-text-stroke: 1px #000; paint-order: stroke fill;
}
.death-cause {
  font-size: 22px; color: #fff;
  -webkit-text-stroke: 1.2px #000; paint-order: stroke fill;
}
/* Continue 按钮：略下移、更小；加粗描边且描边色 = 原主色(#1ea761)，主色(底色)改浅 */
.death-continue {
  margin-top: 20px; padding: 7px 34px;
  font-family: inherit; font-weight: 800; font-size: 14.5px;
  color: #fff; -webkit-text-stroke: 1px #000; paint-order: stroke fill;
  background: #2fc47a; border: 4px solid #1ea761; border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;            /* 死亡面板里唯一可点的元素 */
  transition: transform 0.15s ease, background 0.15s ease;
}
.death-continue:hover { background: #45d68d; transform: scale(1.06); }
.death-continue:active { transform: scale(0.96); }

/* 窗口：左下角背包窗口（宽 = 原 0.8 倍；主色 = 捕获.png 背包按钮棕，描边 = darken(0.18)） */
.window {
  position: absolute; left: 80px; bottom: 16px;
  width: 272.16px;                         /* 背包宽度 = 原 0.5 倍×1.05 = 259.2×0.5×1.05 */
  height: auto; min-height: 120px; max-height: 408px;   /* 纵向自适应：最多 1.5×宽，多了滚轮 */
  background: #5A9FDB; border: 4px solid #4981B1; border-radius: 5.4px;  /* 背包主色 #5A9FDB，边框 #4981B1 */
  display: flex; flex-direction: column; pointer-events: auto; z-index: 100;   /* 窗口置于最高图层 */
  opacity: 1; transform: translateY(0);
  transition: transform .3s ease, opacity .3s ease;   /* 打开从下方冒出 / 关闭滑回下方 0.3s */
}
/* 关闭态：完全滑回屏幕下方外并淡出（保持 flex 布局，仅覆盖全局 .hidden 的 display:none） */
.window.hidden { display: flex !important; opacity: 0; transform: translateY(100%); pointer-events: none; }
/* 关闭的窗口【连同内部所有元素】都不许再接收鼠标事件。
   仅靠父级 pointer-events:none 不够：内部卡牌 canvas 自带 pointer-events:auto（见 .card），
   会把命中测试重新打开 —— 于是窗口关掉后，鼠标扫过原位置仍会弹出格子的悬浮框。 */
.window.hidden, .window.hidden * { pointer-events: none !important; }

/* ---- 生物图鉴窗口 ----
   主色 = 图鉴按钮（btn-bee.svg）的黄 #dbd74b，描边同背包算法（darken 0.18 = #b3b03d）。
   动画与背包完全一致（.window 上的 0.3s transform/opacity），只是方向改为从左上角弹出。 */
#dex {
  left: 16px; top: 64px; bottom: auto;      /* 紧贴左上角按钮组（top 12 + 45.36 高）下方，避免盖住按钮 */
  width: 530.7px;                                 /* 上一版 408.24 × 1.3；每格约 51.9px */
  min-height: 0;
  max-height: 408px;                              /* 与背包窗口同高，行多了在框内滚动 */
  background: #dbd74b; border-color: #b3b03d;
  transform-origin: left top;
}
/* 左上角窗口一律【水平】弹入/收回（只做 X 位移，绝不斜向移动） */
#dex.window.hidden { transform: translateX(-26px); opacity: 0; }

/* ---- 设置窗口 ----
   主色 = 设置按钮（btn-gear-settings.svg）的内板灰 #aaaaaa，
   描边 #8c8c8c（正是该素材的外框色），动效与图鉴一致：从左上角按钮位置弹出。 */
#settings {
  left: 16px; top: 68px; bottom: auto;
  width: 306px; min-height: 0; max-height: 380px;
  background: #aaaaaa; border-color: #8c8c8c;
  transform-origin: left top;
}
#settings.window.hidden { transform: translateX(-18px); opacity: 0; }   /* 水平弹入 */

/* ---- 合成窗口 ----
   主色 = 合成按钮（btn-party.svg）的内板 #db9d5a，描边 = darken 0.18 = #b17f49。
   位置/动效与背包窗口一致，宽度 = 背包 1.5×（288 → 432）；
   上半是 5 个材料槽 + 合成按钮，下半是背包卡按种类分行（同种不同稀有度同一行）。 */
#craft { width: 432px; max-height: 530px; background: #db9d5a; border-color: #b17f49; }
#craft .win-body {
  display: flex; flex-direction: column; overflow: hidden;
  padding: 0 8px 8px; gap: 2px;
}
.craft-top { display: flex; align-items: stretch; gap: 4px; }
/* 舞台吃满主行剩余宽度（按钮侧栏固定宽），5 槽不再被挤；高度固定，增量全给下方列表 */
.craft-stage { position: relative; flex: 1 1 auto; min-width: 0; height: 178px; }
/* 空材料槽：正五边形五个，尺寸与下方卡片一致；点击 = 卸下全部材料 */
.craft-slot {
  position: absolute; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  border-radius: 3.2px; background: rgba(96, 96, 96, .38); cursor: pointer;
  z-index: 1;
}
.craft-stage.crafting .craft-slot { opacity: .32; }
/* 待合成卡：每帧直接写 left/top/transform，绝不能加 CSS 过渡（会拖慢聚拢张开） */
.craft-card {
  position: absolute; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  z-index: 2; cursor: pointer;
}
/* 切卡 / 加卡 / 卸下的渐大渐小：只缩放【卡面内容】，绝不动卡片本体的
   left/top/transform —— 那些每帧由合成动画写，CSS 动画会覆盖导致卡片"消失"。 */
/* 数量角标是 canvas 的兄弟节点，必须和卡面【同一时刻同一曲线】一起渐大/渐小，
   否则会出现"卡没了、xN 才突然消失"。 */
.craft-card > .card.craft-pop { animation: craft-pop .22s cubic-bezier(.3, 1.5, .5, 1); }
.craft-card > .card.craft-pop-out { animation: craft-pop-out .22s cubic-bezier(.3, 1.5, .5, 1) forwards; }
/* 角标自带 rotate(30deg)，必须用它自己的关键帧保住旋转，否则动画期间会突然摆正 */
.craft-card > .card-count.craft-pop { animation: craft-pop-count .22s cubic-bezier(.3, 1.5, .5, 1); }
.craft-card > .card-count.craft-pop-out {
  animation: craft-pop-out-count .22s cubic-bezier(.3, 1.5, .5, 1) forwards;
}
@keyframes craft-pop {
  from { transform: scale(.35); opacity: .4; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes craft-pop-out {
  from { transform: scale(1); opacity: 1; }
  to   { transform: scale(.2); opacity: 0; }
}
@keyframes craft-pop-count {
  from { transform: rotate(30deg) scale(.35); opacity: .4; }
  to   { transform: rotate(30deg) scale(1); opacity: 1; }
}
@keyframes craft-pop-out-count {
  from { transform: rotate(30deg) scale(1); opacity: 1; }
  to   { transform: rotate(30deg) scale(.2); opacity: 0; }
}
/* UI 层方形粒子画布：就在合成舞台内，不受世界坐标/相机影响。
   z-index 0 = 位于槽位(1)和卡片(2)【下方】，粒子不会盖住卡面。 */
.craft-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
/* 最终结果：中心渐大一张更大的卡面，点击即"拿下来"（收起 + 5 槽从中心张开） */
.craft-big {
  position: absolute; left: 50%; top: 50%; width: 74px; height: 74px;
  margin: -37px 0 0 -37px; z-index: 5; cursor: pointer;
}
.craft-big.grow { animation: craft-grow .42s cubic-bezier(.2, 1.5, .5, 1) both; }
.craft-big .card { width: 100%; height: 100%; pointer-events: none; }
.craft-big.hidden { display: none !important; }
@keyframes craft-grow {
  from { transform: scale(.15); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.craft-card .card { width: 100%; height: 100%; }
.craft-side {
  flex: 0 0 112px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
}
.craft-btn {
  min-width: 56px; padding: 4px 6px; border-radius: 5px; cursor: pointer;
  border: 2.4px solid #242424; background: #8a8a8a; color: #fff;
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-size: 12px; font-weight: 800;
  -webkit-text-stroke: 1.2px #1e1e1e; paint-order: stroke fill;
  transition: transform .08s;
}
.craft-btn:active { transform: scale(.95); }
/* 不足 5 张：灰色 + 略深描边，明确"不可用"，不再只是不能点 */
.craft-btn:disabled {
  cursor: default; background: #5a5a5a; border-color: #3a3a3a;
  color: #c2c2c2; -webkit-text-stroke-color: #222;
}
.craft-chance {
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-size: 10.4px; font-weight: 800;
  color: #fff; -webkit-text-stroke: 1.4px #000; paint-order: stroke fill;
  text-align: center; white-space: nowrap;
}
.craft-note {
  padding: 5px 8px 1px; text-align: center; line-height: 1.5;
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-size: 11px; font-weight: 800;
  color: #fff; -webkit-text-stroke: 1.4px #000; paint-order: stroke fill;
}
/* 下半：一种花瓣一行，行内 8 格 = 8 个可合成稀有度（common..super，eternal 不计入）；
   有货的格上色可点（装 5 张 / 补齐 / 叠加触发自动合成），空槽 = 生物图鉴同款灰槽；
   Shift+点击 = 全部库存自动多次合成。悬浮只出 tooltip。 */
.craft-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.craft-list::-webkit-scrollbar { width: 8px; }
.craft-list::-webkit-scrollbar-track { background: transparent; }
.craft-list::-webkit-scrollbar-thumb { background: rgba(226,232,236,.5); border-radius: 8px; }
.craft-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.craft-cell {
  position: relative; aspect-ratio: 1 / 1; border-radius: 3.2px;
  background: rgba(96, 96, 96, .38);
}
.craft-cell.on { background: transparent; cursor: pointer; }
.craft-cell.off { cursor: default; }
.craft-cell.off .card { filter: grayscale(.85) brightness(.82); }   /* 凑不齐 5 张：置灰不可点 */
.craft-cell .card { position: absolute; inset: 0; }
/* 分栏标签：四等分的小按钮，选中项用白底深字 */
.set-tabs { display: flex; gap: 4px; padding: 2px 12px 0; }
.set-tab {
  flex: 1 1 0; padding: 4px 0; border: none; border-radius: 3.4px; cursor: pointer;
  background: rgba(0, 0, 0, .18); color: #fff;
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-size: 11.4px; font-weight: 800; line-height: 1.2;
  -webkit-text-stroke: 1.5px #000; paint-order: stroke fill;
}
.set-tab:hover { background: rgba(0, 0, 0, .3); }
.set-tab.on { background: #fefefe; color: #3b3b3b; -webkit-text-stroke: 0; }

.set-panel { display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-size: 12px; font-weight: 800;
  color: #fff; -webkit-text-stroke: 1.6px #000; paint-order: stroke fill; cursor: pointer;
}
.set-row select {
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-size: 11.4px; font-weight: 800;
  padding: 3px 6px; border-radius: 3.4px; border: 2px solid #8c8c8c;
  background: #fefefe; color: #2b2b2b; cursor: pointer;
  /* 描边是可继承属性：父级 .set-row 的 1.6px 黑描边会继承进下拉框，
     在浅底深字上糊成一团（看起来像纯黑字），这里必须清零。 */
  -webkit-text-stroke: 0;
}
.set-row select option { -webkit-text-stroke: 0; color: #2b2b2b; }

/* 勾选框：与聊天面板【同款】——黑描边外框 + 内部填充块 + 勾选绿→深灰 / 取消红→缩没，
   动画复用同一组 keyframes（cbx-check / cbx-uncheck）。
   结构：<span class="set-check"><i class="set-box"><b class="set-fill"></b></i></span> */
.set-check { display: inline-flex; align-items: center; cursor: pointer; }
.set-check .set-box {
  position: relative; width: 15px; height: 15px; box-sizing: border-box;
  /* 未勾选 = 深色底（勾选时被浅色填充盖住） */
  display: inline-block; background: #555; border: 1px solid #000; border-radius: 2px;
  -webkit-text-stroke: 0;
}
.set-check .set-box .set-fill {
  /* 勾选稳定态 = 浅色（与未勾选的深色底正好反过来） */
  position: absolute; inset: 0; background: #ececec; border-radius: 1px;
  transform: scale(0); transform-origin: center;
}
.set-check.on .set-box .set-fill { transform: scale(1); }
.set-check .set-box .set-fill.cbx-checking   { animation: cbx-check   0.36s cubic-bezier(.4,0,.2,1) forwards; }
.set-check .set-box .set-fill.cbx-unchecking { animation: cbx-uncheck 0.36s cubic-bezier(.4,0,.2,1) forwards; }

/* 说明小字：与窗口标题一致的黑色描边（不能只有浅色字，浅底上会看不清） */
.set-note {
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-size: 10.4px; font-weight: 700; line-height: 1.35;
  color: #fff; -webkit-text-stroke: 1.4px #000; paint-order: stroke fill;
}
.set-credits {
  padding: 18px 0; text-align: center;
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-size: 13px; font-weight: 800; line-height: 1.9;
  color: #fff; -webkit-text-stroke: 1.8px #000; paint-order: stroke fill;
}

/* 图鉴内容：一行一种生物，9 格从左到右稀有度递增 */
.dex-grid { display: flex; flex-direction: column; gap: 3px; }
.dex-row { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
/* 空格子 = 灰色半透明槽；打过的那格换成空白稀有度卡面 + 生物贴图 */
.dex-cell {
  position: relative; aspect-ratio: 1 / 1;
  border-radius: 3.2px; background: rgba(96, 96, 96, .38);
}
.dex-cell.on { background: transparent; }
/* 生物贴图画布：铺满卡面内侧（图案本身在画布里再按 0.78 的留白比例缩放，
   见 ui.js _paintMobArt —— 卡面圆角描边不会被盖住，也不会溢出格子） */
.dex-mob {
  position: absolute; left: 4%; top: 4%; width: 92%; height: 92%;
  pointer-events: none; -webkit-user-drag: none;
}

/* 卡牌/卡槽：触屏上禁止滚动手势与长按菜单（否则拖动会被 pointercancel 掐断） */
.card, .cardcell, .qslot, .qinner, .flyghost {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

/* 拿起卡牌：左右小幅晃动。只作用在幽灵元素本身（内部卡面不再另加动画），
   否则父子两层旋转叠加（±9°×2）会放大成左上/右下的抖动。 */
.dragging { animation: cardWobble .6s ease-in-out infinite; opacity: 1; }  /* 不透明 */
@keyframes cardWobble {
  0%, 100% { rotate: -2.5deg; translate: -1.5px 0; }
  50%      { rotate: 2.5deg;  translate: 1.5px 0; }
}
.win-head { position: relative; padding: 12px 54px 4px; }
.win-title {
  display: block; text-align: center; font-size: 15px; font-weight: 900; color: #fff; letter-spacing: .3px;
  -webkit-text-stroke: 2.25px #000; paint-order: stroke fill;  /* 黑描边加粗 0.5 倍：1.5 -> 2.25px */
}
.win-subtitle {
  display: block; text-align: center; font-size: 10.8px; font-weight: 900; color: #e8f2fa; margin-top: 2px;
  -webkit-text-stroke: 1.8px #000; paint-order: stroke fill;    /* 黑描边加粗 0.5 倍：1.2 -> 1.8px */
}
.win-count {
  position: absolute; left: 16px; top: 15px; font-size: 12px; font-weight: 800; color: #eaf4fc;
  -webkit-text-stroke: 1.2px #000; paint-order: stroke fill;  /* 纯色黑描边 */
}
/* 关闭按钮：统一使用 btn-close.svg 真实矢量化贴图，尺寸不变（17px） */
.win-close {
  position: absolute; top: 6px; right: 8px;
  width: 17px; height: 17px; padding: 0; border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.win-close img { width: 100%; height: 100%; display: block; pointer-events: none; }
.win-close:hover { filter: brightness(1.1); }
.win-close:active { filter: brightness(.85); }
/* 自绘滚动条：仅一根半透明灰色条，不用浏览器默认样式 */
/* pan-y：窗口内容区可以用手指上下滚动；落在卡面上的手势仍然是"拖卡"（卡上是 none，
   取交集后以 none 为准，所以拖卡不会被滚动抢走）。 */
.win-body { padding: 10px 16px 16px; overflow-y: auto; flex: 1 1 auto; min-height: 0; touch-action: pan-y; }
.win-body::-webkit-scrollbar { width: 8px; }
.win-body::-webkit-scrollbar-track { background: transparent; }
.win-body::-webkit-scrollbar-thumb { background: rgba(226,232,236,.5); border-radius: 8px; }
.win-body::-webkit-scrollbar-thumb:hover { background: rgba(226,232,236,.7); }
.win-body { scrollbar-width: thin; scrollbar-color: rgba(226,232,236,.5) transparent; }

/* 画廊：按稀有度分组 */
.gallery { display: flex; flex-direction: column; gap: 12px; }
/* 背包内部卡牌 = 原 0.8 倍 */
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, 44.544px); gap: 5.76px; justify-items: center; }  /* 卡牌×1.2，居中对齐 */
.cardcell { display: flex; align-items: center; justify-content: center; }  /* 让卡牌在cell内完全居中 */
.cardcell .card { width: 44.544px; height: 44.544px; }  /* 背包卡牌 = 37.12×1.2 */
.rar-divider { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; }
.rar-line { flex: 1; height: 2.4px; border-radius: 1.5px; }   /* 分割线宽度0.6倍 = 4×0.6 */
.rar-name {
  font-size: 9.6px; font-weight: 800; padding: 1px 6.4px; border-radius: 4.8px;  /* 字体0.8倍 = 12×0.8 */
  background: transparent; white-space: nowrap;
  -webkit-text-stroke: 1.2px #000; paint-order: stroke fill;   /* 描边宽度1.2倍 = 1×1.2 */
}
/* 背包卡牌：一行最多 5 张（官方口径），间距收紧到 3px。
   用 flex-wrap + 容器最大宽度 = 5 张的宽度来"限行"，
   这样不足 5 张的那一行仍然是【整行居中】，不会像固定网格那样靠左对齐。
   原来 gap 7.2px + cell 55.68px（两侧各 5.57px 空白）在 272px 窗口里只能排 4 张。 */
.rar-grid {
  display: flex; flex-wrap: wrap; gap: 3px; justify-content: center;
  max-width: 247px; margin-left: auto; margin-right: auto;   /* 5×47 + 4×3 = 247 */
}
/* 背包窗口略加宽，5 张卡刚好放得下（内宽 248px）。 */
#inventory.window { width: 288px; }
/* cell 只要比卡牌大一点点即可：原来的 55.68 两侧各留 5.57px 空白，
   再加上 7.2px 的 grid gap，一行只能排 4 张且看着很散。 */
.cardcell { position: relative; width: 47px; height: 47px; border-radius: 10px; cursor: pointer; }

/* 拖拽幽灵 / 飞入动画 */
.flyghost {
  position: fixed; z-index: 200; pointer-events: none; width: 54px; height: 54px;
  transform: translate(-50%, -50%);
}
/* 拖拽中的卡 = 卡槽中卡牌(54px) × 1.3 × 0.6 × 1.2 = 50.54px，摇晃动画保持不变 */
#dragGhost {
  position: fixed; z-index: 200; pointer-events: none; width: 50.54px; height: 50.54px;
  transform: translate(-50%, -50%);
}
/* 小地图名：样式与副槽 [1][2] 相同（Ubuntu 800 + 黑描边），始终居中在小地图正下方 */
#mmName {
  position: fixed; left: 0; top: 0; transform: translateX(-50%);
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-size: 11.25px; font-weight: 800;
  color: #fff; -webkit-text-stroke: 1.65px #000; paint-order: stroke fill;
  white-space: nowrap; line-height: 1; pointer-events: none; z-index: 46;
}
/* 加载：纯黑底 + 内联蜘蛛动画 + 标志性 Ubuntu 白色大字（原 18px × 2） */
#loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 40px;
  background: #000; font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-weight: 700;
  font-size: 36px; color: #fff; z-index: 50; line-height: 1; text-align: center;
}
/* Worker 在 OffscreenCanvas 上直接画白蛛（透明底），不再需要 invert；
   不支持 Worker 时退回内联 SVG（此时 CSS filter 由 JS 补 invert）。 */
#loadAnim { width: 120px; height: 120px; flex: 0 0 auto; }
#loadAnim svg, #loadAnim canvas { display: block; width: 100%; height: 100%; }
#loadText { flex: 0 0 auto; }
/* 加载完成后的退场序列：蜘蛛 + 文案先渐隐 -> 播放一次映界 logo -> 停留 -> 整块蒙版渐隐。
   蒙版在 #loadAnim/#loadText 改写 opacity 时不能整块跟着变，所以只给子元素加过渡。 */
#loading.fade-out #loadAnim,
#loading.fade-out #loadText { opacity: 0; transition: opacity .45s ease; }
#loading.gone { opacity: 0; transition: opacity .45s ease; pointer-events: none; }
/* studio logo：居中、放大到 220px（"适当缩放"），原本是黑的，素材已翻成白字适配纯黑蒙版 */
#studioLogo {
  position: absolute; left: 50%; top: 50%; width: 220px; height: 220px;
  transform: translate(-50%, -50%); opacity: 0;
  transition: opacity .5s ease; pointer-events: none;
}
#studioLogo.on { opacity: 1; }
#studioLogo.hidden { display: none; }
#studioLogo svg { display: block; width: 100%; height: 100%; }
/* 加载过慢提示：定格于正上方中央的悬浮框（不随页面滚动，不阻塞交互） */
#loadWarn {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  max-width: min(520px, 86vw); padding: 10px 16px; box-sizing: border-box;
  background: rgba(20, 30, 24, 0.92); border: 2px solid #3c5a44; border-radius: 8px;
  font-size: 15px; line-height: 1.45; color: #e8f3dd; text-align: center;
  z-index: 60; pointer-events: none;
  font-family: 'Ubuntu', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
/* ================= 准备页（Connecting -> Ready） =================
   Loading 蒙版撤掉后才出现：花园瓦片平铺背景（压暗）+ 白底黑描边 Ubuntu 大字。
   连接建立后文字快速渐小，Ready 按钮（Continue 同款绿钮）快速渐大；点 Ready 才入服。 */
/* z-index 必须低于 #loading(50)：准备页会在 Loading 淡出前预挂载，
   由蒙版盖住；蒙版撤走时下面已经是准备页，不会先闪一下游戏画面。 */
#connect {
  position: fixed; inset: 0; z-index: 49;
  display: flex; align-items: center; justify-content: center;
  background: #24301f url('../assets/static/tiles/grass_c_0.svg') repeat;
  background-size: 96px 96px;
  opacity: 1; transition: opacity .45s ease;
}
#connect::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
#connect.gone { opacity: 0; pointer-events: none; }
#connectInner { position: relative; display: flex; align-items: center; justify-content: center; }
#connectText {
  font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-weight: 800; font-size: 52px;
  color: #fff; -webkit-text-stroke: 2px #000; paint-order: stroke fill;
  transform-origin: center;
  transition: transform .28s cubic-bezier(.5, 0, .9, .4), opacity .28s ease;
}
#connectText.shrink { transform: scale(.15); opacity: 0; }
#connectText.hidden, #connectBtn.hidden { display: none; }
#connectBtn {
  padding: 10px 44px; font-family: 'Ubuntu', 'Segoe UI', sans-serif; font-weight: 800;
  font-size: 20px; line-height: 1;
  color: #fff; -webkit-text-stroke: 1px #000; paint-order: stroke fill;
  background: #2fc47a; border: 4px solid #1ea761; border-radius: 8px; cursor: pointer;
  animation: connect-btn-in .28s cubic-bezier(.3, 1.5, .5, 1) both;
  transition: transform .15s ease, background .15s ease;
}
#connectBtn:hover { background: #45d68d; transform: scale(1.06); }
#connectBtn:active { transform: scale(.96); }
@keyframes connect-btn-in {
  0% { transform: scale(.15); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ================= 全局聊天（仿 notice.PNG / notice2.PNG / example1.PNG） ================= */
/* 单一容器：收起态与展开态共用同一个输入框，左右边界/圆角/白底黑边完全一致；
   展开只是在上方追加标签与历史（#chat 以 bottom 定位，自动向上生长）。 */

/* 左右边界恒定：左侧避开左下角图标列（#dockBtns 宽约 71px），右侧由 width 决定 */
#chat {
  position: absolute; left: 88px; bottom: 22px; width: 235px;
  pointer-events: auto; z-index: 46;
  font-family: 'Ubuntu', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 13px; line-height: 1.45; color: #fff;
}
/* 收起态：隐藏标签/历史/前缀；输入行变成参考图里紧凑的深绿胶囊（notice.PNG / example1.PNG），
   宽度自适应内容，不再是 340px 白框。点击或按 Enter 后还原为白底黑边输入框（notice2.PNG 底部）。 */
#chat.collapsed .chat-tabs,
#chat.collapsed .chat-log,
#chat.collapsed .chat-chan { display: none; }
#chat.collapsed { width: 235px; }   /* 与展开态同宽，点击展开时输入框不再变宽 */
#chat.collapsed .chat-inputrow {
  display: inline-flex; width: 100%;
  background: rgba(0, 0, 0, 0.35);     /* 非焦点态：半透明黑底（与悬浮信息框同级） */
  border: 2px solid transparent;       /* 预留与聚焦态相同的描边宽度(2px)：无焦点看着不再小一圈 */
  border-radius: 5px;
  padding: 2px 8px;                    /* 与聚焦态一致，保证两态内容区精确对齐 */
  box-shadow: none;
}
#chat.collapsed .chat-input {
  flex: 1; min-width: 0; color: #fff; font-size: 13px;
}
#chat.collapsed .chat-input::placeholder {
  color: #fff; opacity: 1; font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
}

/* ---- 频道标签（notice2.PNG 顶部四个） ---- */
.chat-tabs { display: flex; gap: 2px; margin-bottom: 5px; }
.chat-tab {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 5px; border: none; border-radius: 4px;
  background: rgba(170, 170, 170, 0.45); color: #fff;
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
  -webkit-text-stroke: 1.1px #000; paint-order: stroke fill;
}
.chat-tab:hover { background: rgba(195, 195, 195, 0.55); }
.chat-tab.on { background: rgba(255, 255, 255, 0.22); }
/* 通用勾选框：外框(黑描边) + 内部填充块。填充块 inset:0 落在描边内侧，缩放时不覆盖描边。
   未勾选 = 白/淡灰底；勾选稳定态 = 深灰；两段动画由 JS 加类触发（keyframes 见下）：
   勾选 = 绿块从中心放大到满 -> 平滑变深灰；取消 = 先平滑变红 -> 再缩到中心直至看不见。 */
.chat-tab .chat-box {
  position: relative;
  width: 11px; height: 11px;
  box-sizing: border-box;
  display: inline-block;
  background: #555;                    /* 未勾选：深色 */
  border: 1px solid #000;              /* 勾选框描边（填充不覆盖它） */
  border-radius: 2px;
}
.chat-tab .chat-box .chat-fill {
  position: absolute; inset: 0;
  background: #ececec;                 /* 勾选稳定态：浅色 */
  border-radius: 1px;
  transform: scale(0);
  transform-origin: center;
}
.chat-tab.on .chat-box .chat-fill { transform: scale(1); }
.chat-tab .chat-box .chat-fill.cbx-checking   { animation: cbx-check   0.36s cubic-bezier(.4,0,.2,1) forwards; }
.chat-tab .chat-box .chat-fill.cbx-unchecking { animation: cbx-uncheck 0.36s cubic-bezier(.4,0,.2,1) forwards; }
/* 红/绿过渡保持不变，只把"稳定态"翻过来：勾选 = 浅色，未勾选 = 深色 */
@keyframes cbx-check {
  0%   { transform: scale(0); background: #3ecf5b; }   /* 绿，从中心出现 */
  55%  { transform: scale(1); background: #3ecf5b; }   /* 放大到满（不覆盖描边） */
  100% { transform: scale(1); background: #ececec; }   /* 平滑变浅色 */
}
@keyframes cbx-uncheck {
  0%   { transform: scale(1); background: #ececec; }
  40%  { transform: scale(1); background: #e0483a; }   /* 先平滑变红 */
  100% { transform: scale(0); background: #e0483a; }   /* 再缩到中心直至看不见 */
}

/* ---- 历史区：中浅灰半透明底（notice2.PNG）、可滚动、保留登入以来全部消息 ---- */
.chat-log {
  background: rgba(150, 150, 150, 0.55); border-radius: 4px;
  padding: 6px 8px; margin-bottom: 5px;
  max-height: 168px; overflow-y: auto; overscroll-behavior: contain;
  font-size: 13px;
}
.chat-log::-webkit-scrollbar { width: 8px; }
.chat-log::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.35); border-radius: 4px; }
.chat-log::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
/* 指令提示：匹配的指令一条一个小半透明栏（命令格式 + 介绍） */
.chat-log .chat-hint {
  padding: 2px 6px; margin: 1px 0; border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 12px; line-height: 1.4;
}
.chat-hint-cmd { color: #ffe763; font-weight: 700; -webkit-text-stroke: 1.2px #000; paint-order: stroke fill; }
.chat-hint-desc { color: #ffffff; -webkit-text-stroke: 1.2px #000; paint-order: stroke fill; }

/* ---- 强制换行：任何长度都不许撑破左右边界 ---- */
.chat-line { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.chat-tag  { color: #ffffff; font-weight: 700; margin-right: 2px; }   /* 频道前缀：白字（notice2.PNG） */
.chat-name { color: #FFE763; font-weight: 700; margin-right: 3px; }   /* 玩家名：黄字 */
.chat-text { color: #ffffff; }
/* 文字统一黑色描边（与画面内 canvas 的 strokeText 同款：黑边、圆角连接、填充在上） */
.chat-tag, .chat-name, .chat-text, .chat-sys {
  -webkit-text-stroke: 1.8px #000;
  paint-order: stroke fill;
}
/* 系统消息：整行红字（约定：红色一律为系统） */
.chat-line.sys .chat-sys { color: #FF0000; font-weight: 700; }
/* 密语行：[@对象] 前缀用 rare 紫蓝区分 */
.chat-line.whisper .chat-tag { color: #4D52E3; }

/* ---- 输入行：白底黑字黑边。收起/展开完全同一款，左右边界与 #chat 一致 ---- */
.chat-inputrow {
  display: flex; align-items: center; gap: 6px;
  background: #ffffff; border: 2px solid #000; border-radius: 5px;
  padding: 2px 8px; width: 100%; box-sizing: border-box;
}
.chat-chan { font-size: 13px; font-weight: 700; white-space: nowrap; -webkit-text-stroke: 1px #000; paint-order: stroke fill; }
.chat-input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font: inherit; font-size: 13px; color: #000;
  -webkit-text-stroke: 0.6px #000; paint-order: stroke fill;   /* 与全局文字一致的描边（更粗实） */
}
.chat-input::placeholder { color: #333; opacity: 1; }
/* 聚焦后隐藏提示文案：与 notice2.PNG 一致，只留 [Local] 前缀与光标 */
.chat-input:focus::placeholder { opacity: 0; }

/* ---- 漂浮态：无边框、无底色，直接叠在游戏画面上（example1.PNG） ---- */
.chat-float {
  position: absolute; left: 88px; bottom: 62px;
  display: flex; flex-direction: column; gap: 2px;
  pointer-events: none; user-select: none;
  font-family: 'Ubuntu', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 13px; line-height: 1.4;
  max-width: 235px;
}
/* 漂浮态同样黑描边（不用投影，与画面内文字观感一致） */
.chat-float .chat-tag, .chat-float .chat-name, .chat-float .chat-text, .chat-float .chat-sys {
  -webkit-text-stroke: 1.8px #000;
  paint-order: stroke fill;
}
.chat-float .chat-line { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }

/* ================= 移动端触控层（ui/touch.js） ================= */
/* 只在粗指针设备创建（JS 判断）；桌面浏览器不会出现这些元素。
   只占左下这一块（摇杆活动区），不覆盖整屏 —— 免得挡住快捷栏/聊天/按钮。 */
#touchLayer {
  position: fixed; left: 0; bottom: 0;
  width: 64vw; height: 78vh; z-index: 30;
  pointer-events: auto; touch-action: none;
}
/* 触屏上禁止整页滚动/下拉刷新，避免拖摇杆时页面跟着动 */
html, body { overscroll-behavior: none; }
body.touch-ui { touch-action: none; -webkit-user-select: none; user-select: none; }
body.touch-ui canvas { touch-action: none; }
.t-stick {
  position: fixed; z-index: 30;
  width: var(--t-stick, 120px); height: var(--t-stick, 120px);
  pointer-events: none;
  transition: left .12s ease-out, top .12s ease-out;
}
.t-stick.active { transition: none; }
.t-stick-base {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(16, 28, 20, .26);
  border: 2px solid rgba(255, 255, 255, .35);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .25);
}
.t-stick-knob {
  position: absolute; left: 50%; top: 50%;
  width: var(--t-knob, 52px); height: var(--t-knob, 52px);
  margin-left: calc(var(--t-knob, 52px) / -2);
  margin-top: calc(var(--t-knob, 52px) / -2);
  border-radius: 50%;
  background: rgba(226, 244, 214, .55);
  border: 2px solid rgba(255, 255, 255, .7);
  will-change: transform;
}
.t-stick.active .t-stick-base { border-color: rgba(255, 255, 255, .6); }

/* A/B 按钮：独立挂在 body 上（不在摇杆层里），四边都显式写死，
   保证【严格贴屏幕右下角】—— 之前夹在 #touchLayer(64vw×78vh) 里，
   任何父级尺寸/变换都会把它带偏。 */
.t-btns {
  position: fixed;
  left: auto; top: auto;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 12px; align-items: flex-end; justify-content: flex-end;
  margin: 0; padding: 0;
  z-index: 31;
}
.t-btn {
  width: var(--t-btn, 68px); height: var(--t-btn, 68px);
  border-radius: 50%; padding: 0; border: 2px solid rgba(255, 255, 255, .5);
  background: rgba(18, 32, 22, .38); color: #eaf7e4;
  font-family: 'Ubuntu', sans-serif; line-height: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.t-btn b { font-size: calc(var(--t-btn, 68px) * .38); font-weight: 800; }
.t-btn i { font-size: calc(var(--t-btn, 68px) * .16); font-style: normal; opacity: .85; }
.t-btn-a { border-color: rgba(255, 214, 102, .7); }
.t-btn-b { border-color: rgba(120, 214, 255, .7); }
.t-btn.down { transform: scale(.94); background: rgba(60, 96, 68, .6); }

/* 触控设备上隐藏桌面提示类文字，并把快捷栏整体缩小，给摇杆/按钮让位 */
body.touch-ui #touchLayer { touch-action: none; }
/* 移动端：卡槽【靠左下】，避开右下角的 A/B 按钮与摇杆。
   注意 transform 必须换掉桌面端的 translateX(-50%)（居中位移），
   否则 scale 会把它覆盖掉 -> 整排右移半个宽度，看上去就是"位置不对"。
   bottom 抬起 = #dockBtns（背包按钮）的高度 + 间距，两张都露得出来。 */
body.touch-ui #quickbar {
  left: calc(8px + env(safe-area-inset-left, 0px));
  bottom: calc(16px + 62px + 8px);
  transform: scale(.82);
  transform-origin: 0% 100%;
  align-items: flex-start;
}
body.touch-ui .chat-float { max-width: 46vw; }

/* ================= F3 调试屏幕（ui/debug-screen.js） ================= */
#f3 {
  position: fixed; left: 0; top: 0; z-index: 80;
  display: flex; align-items: flex-start; gap: 26px;
  padding: 10px 14px; pointer-events: none;
  font-family: 'Consolas', 'DejaVu Sans Mono', monospace;
  font-size: 12px; line-height: 1.55; color: #eaf7e4;
  text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000;
  max-width: 100vw; overflow: hidden;
}
#f3.hidden { display: none; }
#f3 .f3-col { min-width: 208px; }
#f3 .f3-head {
  margin: 6px 0 2px; color: #9fe870; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; font-size: 11px;
}
#f3 .f3-col > .f3-head:first-child { margin-top: 0; }
#f3 .f3-row { display: flex; justify-content: space-between; gap: 14px; }
#f3 .f3-k { color: #b9d8ab; }
#f3 .f3-v { color: #fff; font-variant-numeric: tabular-nums; }
#f3 .f3-petals { display: flex; flex-direction: column; gap: 1px; }
#f3 .f3-petal { white-space: nowrap; }
#f3 .f3-petal b { display: inline-block; width: 16px; color: #7EEF6D; }
#f3 .f3-petal i { color: #ffd166; font-style: normal; }
#f3 .f3-petal em { color: #8fb3a7; font-style: normal; font-size: 11px; }
#f3 .f3-hint {
  position: fixed; left: 14px; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  color: #9fe870; font-size: 11px;
}
@media (max-width: 760px) {
  #f3 { font-size: 11px; gap: 12px; flex-wrap: wrap; }
  #f3 .f3-col { min-width: 44vw; }
}