/* 潇洒大乱斗 — HUD 样式
   🔴 移动端三套布局（GDD 06[S10] ⑤ / world-ui-visual §8.4）
   🔴 安全区适配（§8.5）：iOS 刘海屏 + home indicator
   🔴 可点击区域 ≥ 44×44（§8.6）
   🔴 不用 backdrop-filter（§5.3）：移动端性能差
*/
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);

  --glass: rgba(16, 22, 38, 0.72);
  --glass-lite: rgba(16, 22, 38, 0.42);
  --border: rgba(180, 210, 255, 0.16);
  --text: #E8F0FF;
  --text-dim: #9FB4D0;
  --accent: #7FD4F0;
  --gold: #FFD447;
  --danger: #FF6B6B;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0b1020;
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  user-select: none; -webkit-user-select: none;
}

#game {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
}

/* ============================================================
   进入页
   ============================================================ */

/*
 * 🔴 进入页容器 —— 曾出现"整个面板右移、右侧内容被裁"的严重布局 bug
 *
 * 根因（headless Chrome 360px 实测，左留白 143px / 右留白 3px）：
 *   `#gate` 同时是 `display:flex`（居中子元素）**和** `overflow-y:auto`（滚动容器）。
 *   滚动容器出现纵向滚动条时会占掉内容盒右侧 15px，
 *   flex 居中的参照宽度随之变窄、居中点左移 —— 整体偏右且右侧被裁。
 *
 * 修法（采用 flex + margin:auto 的经典方案，绕开滚动条占位）：
 *   `margin:auto` 在 flex 容器里可以让子元素**双向居中且不溢出**，
 *   与 `justify-content:center` 的区别在于：内容过宽时它会**溢出两侧**
 *   而不是单侧被裁。
 */
#gate {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex;
  overflow-y: auto;
  background: radial-gradient(ellipse at 50% 30%, #1E2A44, #0B1020 70%);
}
#gate.hidden { display: none; }

.gate-inner {
  margin: auto;                /* 🔴 双向自动外边距 = 居中且不裁 */
  width: calc(100% - 32px);    /* 左右各留 16px 视觉安全区 */
  max-width: 420px;
  box-sizing: border-box;
  min-width: 0;
  flex: 0 1 auto;              /* 允许收缩，避免内容撑破容器 */
  text-align: center;
}

/*
 *（.gate-inner 的规则已合并进上面 #gate 段落，用绝对定位居中法）
 * （另有窄屏压缩见 @media (max-width: 400px)）
 */

#gate h1 {
  margin: 0 0 6px;
  font-size: 30px; font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #FFD98A, #FFB03A, #F2545B);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gate-sub { margin: 0 0 20px; color: var(--text-dim); font-size: 13px; }

.pick {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;   /* 🔴 窄屏放不下就换行，绝不整体溢出（见下方注释） */
}
/*
 * 🔴 布局修复：按钮曾把文字挤出边框（截图里「影客」掉到按钮外、「铁砚」被压扁）
 *
 * 根因三条，缺一不可：
 *   ① min-width:0 —— flex 子项默认 min-width:auto，会被内容撑破，
 *      导致 flex:1 的等分宽度失效。这是「文字溢出按钮」的直接原因。
 *   ② flex-wrap:wrap —— 极窄屏（如 320px）三列必然放不下，允许换行而非压扁。
 *   ③ .cls b / .cls i 加 overflow-wrap —— 长文案不撑破容器。
 *
 * 不用 aspect-ratio/固定高度：中文文案长度不一，固定高度在窄屏会二次截断。
 */
.cls {
  flex: 1 1 0;
  min-width: 0;          /* ① 关键：允许收缩到内容以下，flex 等分才生效 */
  min-height: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--glass-lite);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.cls b {
  font-size: 15px;
  /* ③ 不撑破容器 */
  overflow-wrap: anywhere;
}
.cls i {
  font-size: 10px; font-style: normal; color: var(--text-dim); line-height: 1.3;
  max-width: 100%;       /* ③ 描述文字不超出按钮 */
  overflow-wrap: anywhere;
}
.cls.sel { border-color: var(--accent); background: rgba(127, 212, 240, 0.12); }

/*
 * 🔴 窄屏断点：≤400px 时三列会被挤成极窄的条（"影客"整列被裁掉）。
 *    改为**两列 + 第三个独占一行**，保证每个按钮都有可点的宽度。
 *    用 flex-basis 而非固定像素，避免与 padding/gap 叠加产生溢出。
 */
@media (max-width: 400px) {
  .pick { gap: 8px; }
  .cls { flex: 1 1 calc(50% - 4px); min-height: 84px; padding: 10px 6px; }
  /* 第三个按钮独占整行，避免变成三行把「开始」按钮挤出首屏 */
  .cls:last-child { flex-basis: 100%; }
  /*
   * 🔴 窄屏纵向压缩：进入页内容总高超过 800px 时会出现纵向滚动条，
   *    滚动条占位又会引发横向溢出（见 #gate 的说明）。
   *    这里整体收紧字号与间距，让内容在 640px 高度内放下，从根上避免滚动条。
   */
  #gate { padding-top: calc(10px + var(--sat)); padding-bottom: calc(10px + var(--sab)); }
  #gate h1 { font-size: 24px; margin-bottom: 4px; }
  .gate-sub { font-size: 12px; margin-bottom: 14px; }
  .cls { min-height: 74px; gap: 4px; }
  .cls b { font-size: 14px; }
  .nick { margin-bottom: 10px; }
  .gate-hint { margin-top: 10px; font-size: 10px; line-height: 1.6; }
}

/* 🔴 三职业形状编码（可访问性硬需求：不依赖颜色） */
.shape { width: 16px; height: 16px; display: inline-block; }
.shape-tieyan { background: #E8A33D; border-radius: 2px; }
.shape-yanxing {
  background: #F2545B;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  border-radius: 0;
}
.shape-yingke {
  background: #9B6BFF;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  border-radius: 0;
}

.nick {
  display: block; text-align: left;
  font-size: 12px; color: var(--text-dim);
  margin-bottom: 12px;
}
.nick input {
  display: block; width: 100%;
  margin-top: 4px; padding: 10px 12px;
  font: inherit; font-size: 15px;
  color: var(--text);
  background: var(--glass-lite);
  border: 1px solid var(--border);
  border-radius: 8px;
  /* 🔴 聊天无输入框，但昵称输入是允许的（进场前，不是战斗中） */
  outline: none;
}
.nick input:focus { border-color: var(--accent); }

.opts {
  display: flex; gap: 14px; justify-content: center;
  font-size: 12px; color: var(--text-dim);
  margin-bottom: 18px;
}
.opts label { display: flex; align-items: center; gap: 4px; cursor: pointer; }

.play {
  width: 100%; min-height: 52px;
  font: inherit; font-size: 17px; font-weight: 700;
  color: #0b1020;
  background: linear-gradient(90deg, #FFD98A, #FFB03A);
  border: none; border-radius: 12px;
  cursor: pointer;
}
.play:active { transform: scale(0.98); }
.play:disabled { opacity: .5; cursor: not-allowed; }

.gate-status { min-height: 18px; margin: 10px 0 0; font-size: 12px; color: var(--danger); }
.gate-hint { margin: 14px 0 0; font-size: 11px; color: var(--text-dim); line-height: 1.7; }

/* ============================================================
   HUD 根
   ============================================================ */

#hud {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 10;
}
#hud button { pointer-events: auto; }

/* ---------- 血条组（左上） ---------- */

.hud-hp {
  position: absolute;
  top: calc(12px + var(--sat)); left: calc(12px + var(--sal));
  width: 220px;
  padding: 7px 9px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.hp-bar {
  position: relative;
  height: 14px;
  background: rgba(0, 0, 0, .45);
  border-radius: 7px;
  overflow: hidden;
}
.hp-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #3FD8C0, #7FD4F0);
  transition: width .18s ease-out;
}
.hp-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.lv-text {
  margin-top: 3px;
  font-size: 11px; color: var(--text-dim);
  text-align: center;
}
/* 🔴 无敌保护期闪烁提示（GDD 06[S5] ②） */
.hud-hp.prot { animation: protBlink .5s infinite alternate; }
@keyframes protBlink {
  from { box-shadow: 0 0 0 0 rgba(127,212,240,0); }
  to   { box-shadow: 0 0 0 3px rgba(127,212,240,.55); }
}

/* ---------- 积分 ---------- */

.hud-score {
  position: absolute;
  top: calc(12px + var(--sat)); left: 50%;
  transform: translateX(-50%);
  padding: 5px 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  min-width: 92px;
}
.score-val { font-size: 19px; font-weight: 800; color: var(--gold); line-height: 1.1; }
.score-label { font-size: 9px; color: var(--text-dim); }

/* ---------- 昼夜条 ---------- */

.hud-daynight {
  position: absolute;
  top: calc(74px + var(--sat)); left: 50%;
  transform: translateX(-50%);
  width: 130px; height: 5px;
  background: rgba(0,0,0,.45);
  border-radius: 3px; overflow: hidden;
}
.day-fill { height: 100%; width: 50%; }

/* ---------- 技能栏 ---------- */

.hud-skills {
  position: absolute;
  /* 🔴 原来只写了 position:absolute 没写偏移 → 技能栏停在文档流位置，
     屏幕正中偏上飘着（用户截图里那个「Lv5」方块）。
     改为右下角、攻击按钮左侧，符合单机游戏惯例。 */
  left: calc(16px + var(--sal));
  bottom: calc(16px + var(--sab));
  display: grid;
  gap: 8px;
  /* 🔴🔴 原来是 pointer-events: none → 整个技能栏点击**直接穿透**，
     落在下面的 canvas 上 → 用户点技能格毫无反应（2026-10-08 反馈）。
     #hud 整体是 none（避免挡住游戏操作），子元素要逐个开回来。 */
  pointer-events: none;
  z-index: 21;                /* 🔴 高于攻击按钮 */
}
.skill-slot {
  position: relative;
  width: 52px; height: 52px;
  /* 🔴 技能格必须能接收点击（同上） */
  pointer-events: auto;
  cursor: pointer;
  background: var(--glass-lite);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.skill-slot.ready { border-color: rgba(127,212,240,.5); }
.skill-slot.cooling { opacity: .55; }
.skill-slot.locked { border-style: dashed; opacity: .7; }
.skill-icon { font-size: 22px; line-height: 1; }
.skill-cd {
  position: absolute; bottom: 2px; right: 4px;
  font-size: 10px; font-weight: 700; color: var(--gold);
}
/* 🔴 第 3 槽必须渲染 "Lv10" 文字（美术 §9.9：否则玩家以为是 bug） */
.skill-lock {
  font-size: 11px; font-weight: 700;
  color: var(--text-dim);
}

/* ---------- 排行榜 ---------- */

.hud-leaderboard {
  position: absolute;
  right: calc(16px + var(--sar));
  top: 50%; transform: translateY(-50%);
  width: 178px;
  padding: 7px 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
}
.lb-title { color: var(--text-dim); font-size: 10px; margin-bottom: 4px; }
.lb-rows { max-height: 190px; overflow: hidden; }
.lb-row { display: flex; align-items: center; gap: 5px; height: 20px; }
.lb-rank { width: 16px; text-align: right; color: var(--text-dim); font-size: 10px; }
.lb-shape { width: 8px; height: 8px; flex: none; }
.shape-tieyan { background: #E8A33D; border-radius: 1px; }
.shape-yanxing { background: #F2545B; clip-path: polygon(50% 0%,100% 100%,0% 100%); }
.shape-yingke { background: #9B6BFF; clip-path: polygon(50% 0%,100% 50%,50% 100%,0% 50%); }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-lv { color: var(--text-dim); font-size: 9px; }
.lb-score { color: var(--gold); font-weight: 700; width: 30px; text-align: right; }
/* 🔴 20 名外仍能看到自己（GDD 06[S9] ②） */
.lb-self {
  margin-top: 5px; padding-top: 5px;
  border-top: 1px solid var(--border);
  color: var(--accent); font-weight: 700; font-size: 11px;
}

/* ---------- 聊天 ---------- */

.hud-chat {
  position: absolute;
  left: calc(12px + var(--sal));
  bottom: calc(14px + var(--sab));
  max-width: 320px;
  transition: max-height .2s;
}
.chat-phrases {
  display: flex; flex-wrap: wrap; gap: 5px;
  pointer-events: auto;
}
.phrase {
  /* 🔴 可点击区域 ≥ 44×44 的折中：视觉小，命中区用 padding 撑到 40px 高 */
  min-height: 40px; padding: 8px 11px;
  font: inherit; font-size: 12px;
  color: var(--text);
  background: var(--glass-lite);
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
}
.phrase:active { background: rgba(127,212,240,.22); }
.chat-log {
  margin-top: 5px;
  max-height: 84px; overflow-y: auto;
  font-size: 11px; line-height: 1.5;
  pointer-events: none;
}
.chat-name { color: var(--accent); }
.chat-text { color: var(--text); }
/* 🔴 有敌人 400px 内时聊天区收起为细边（GDD 06[S11] ⑤） */
.hud-chat.collapsed .chat-log,
.hud-chat.collapsed .chat-phrases { display: none; }
.hud-chat.collapsed {
  height: 24px; overflow: hidden;
  border-top: 1px solid var(--border);
  opacity: .5;
}

/* ---------- 攻击按钮 ---------- */

.hud-atk {
  position: absolute;
  /* 🔴🔴 位置必须与 input.js 的 isAttackZone 对齐。
     原来只写 position:absolute 没写偏移 → 元素停在文档流位置
     → 屏幕正中偏上飘着一个方块，用户以为是 bug（2026-07-07 截图）。
     isAttackZone 的圆心是 (W-64, H-64-safeBottom)，半径 56；
     按钮 68×68 → 左上角 = 圆心 - 34。 */
  right: calc(30px + var(--sar));
  bottom: calc(30px + var(--sab));
  width: 68px; height: 68px;
  border-radius: 50%;
  /* 🔴 必须能接收点击（#hud 整体 pointer-events:none） */
  pointer-events: auto;
  cursor: pointer;
  background: rgba(16,22,38,.42);
  border: 2px solid rgba(180,210,255,.30);
  color: var(--text);
  font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  z-index: 20;                /* 🔴 压在技能栏之上，避免被遮挡 */
}
.hud-atk:active {
  transform: scale(.92);
  border-color: rgba(127,212,240,.6);
}

/* ---------- 击杀播报 ---------- */

.killfeed {
  position: absolute;
  top: 34%; left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  background: rgba(16,22,38,.8);
  border: 1px solid rgba(217,58,43,.5);
  border-radius: 20px;
  font-size: 13px; font-weight: 700;
  color: #FFD98A;
  opacity: 0;
  transition: opacity .25s;
  white-space: nowrap;
}

/* ---------- 提示 / 网络状态 ---------- */

.hud-hint {
  position: absolute;
  left: 50%; bottom: calc(10px + var(--sab));
  transform: translateX(-50%);
  font-size: 11px; color: var(--text-dim);
  white-space: nowrap;
}
.hud-net {
  position: absolute;
  left: calc(12px + var(--sal));
  top: calc(96px + var(--sat));
  font-size: 10px; color: var(--text-dim);
}
.hud-net.bad { color: var(--danger); }

/* 🔴 画质档位提示（自动降级时告知玩家）
   独立于 .hud-hint / 公告，实测那两条通道都会被其他提示抢走。 */
.hud-qnote {
  position: absolute;
  left: 50%;
  top: calc(14px + var(--sat));
  transform: translateX(-50%);
  max-width: min(88vw, 460px);
  white-space: normal;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: #ffd98a;
  background: rgba(10, 16, 30, 0.82);
  border: 1px solid rgba(255, 217, 138, 0.28);
  border-radius: 10px;
  padding: 8px 14px;
  backdrop-filter: blur(4px);
}

/* ============================================================
   移动端布局（GDD 06[S12] ①：竖屏 + 横屏都要能玩）
   ============================================================ */

@media (max-width: 520px) {
  .hud-hp { width: 168px; }
  .hud-score { padding: 4px 12px; }
  .score-val { font-size: 16px; }
  .hud-leaderboard {
    /* 🔴 竖屏：排行榜改半宽抽屉，避免遮挡 */
    width: 150px;
    right: calc(8px + var(--sar));
    font-size: 10px;
  }
  .lb-rows { max-height: 120px; }
  .hud-chat { max-width: calc(100vw - 24px); bottom: calc(96px + var(--sab)); }
  .phrase { min-height: 40px; font-size: 11px; padding: 8px 9px; }
  .chat-log { max-height: 50px; }
  .hud-atk {
    /* 🔴 必须加 safeBottom：否则被 iOS home indicator 压住 24px */
    right: calc(14px + var(--sar));
    bottom: calc(14px + var(--sab));
    width: 64px; height: 64px;
  }
}

/* 横屏 */
@media (orientation: landscape) and (max-height: 520px) {
  .hud-hp { width: 180px; padding: 5px 8px; }
  .hud-leaderboard {
    top: calc(12px + var(--sat));
    transform: none;
    width: 148px;
    max-height: 150px;
  }
  .lb-rows { max-height: 84px; }
  .hud-chat { bottom: calc(8px + var(--sab)); max-width: 260px; }
  .chat-log { max-height: 34px; }
  .hud-atk {
    right: calc(12px + var(--sar));
    bottom: calc(10px + var(--sab));
  }
  .hud-hint { display: none; }
}

/* 极窄屏（320px）：HUD 元素不许重叠 */
@media (max-width: 340px) {
  .hud-hp { width: 140px; }
  .hud-score { min-width: 70px; padding: 3px 9px; }
  .score-val { font-size: 14px; }
  .hud-leaderboard { width: 128px; font-size: 9px; }
}

/* 桌面 */
@media (min-width: 1024px) {
  .hud-skills {
    /* 🔴🔴 原来这里是 `left: 50%; transform: translateX(-50%)`
       → 技能栏停在**屏幕正中央**，在 1264px 宽的窗口里就是一个
       飘在中间的小方块（用户截图反馈「屏幕中间有个小块，一直不消失」）。
       桌面有键盘，技能栏移到右下更合理，也不挡视野。 */
    left: auto;
    right: calc(16px + var(--sar));
    bottom: calc(16px + var(--sab));
    transform: none;
    grid-template-columns: repeat(3, 52px);
  }
  /* 🔴 攻击按钮改为**显示**（缩成小圆钮）：
     原来 `display: none`，理由是"桌面用空格攻击"。但实测后果是
     ① 玩家看不到任何攻击入口，不知道能攻击
     ② 鼠标用户完全没有点击方式
     显示出来 = 键盘和鼠标两种方式都能用。 */
  .hud-atk {
    display: flex;
    right: calc(16px + var(--sar));
    bottom: calc(92px + var(--sab));   /* 在技能栏上方 */
    width: 58px; height: 58px;
  }
  .hud-atk .atk-key { display: none; }  /* 键位提示在底部操作条里 */
  .hud-chat { max-width: 360px; }
}

/* 移动端技能栏定位 */
@media (max-width: 1023px) and (orientation: portrait) {
  .hud-skills {
    right: calc(124px + var(--sar));
    bottom: calc(240px - var(--sab));
    grid-template-columns: repeat(2, 52px);
  }
}
@media (max-width: 1023px) and (orientation: landscape) {
  .hud-skills {
    right: calc(150px + var(--sar));
    bottom: calc(80px - var(--sab));
    grid-template-columns: repeat(3, 46px);
  }
  .skill-slot { width: 46px; height: 46px; }
}
/* ============================================================
   Boss / 神秘商人 / 商店（本批新增）
   🔴 沿用 §5.3玻璃拟态统一配方：渐变 + 半透明底色，**不用 backdrop-filter**
   🔴 可点击区域 ≥ 44×44（§8.6）
   ============================================================ */

/* ---------- 全服公告条（GDD 03 §2.1 / §4.1） ---------- */
.hud-announce {
  position: absolute;
  top: calc(64px + var(--sat));
  left: 50%;
  transform: translateX(-50%);
  max-width: 82vw;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0) 40%),
              rgba(16, 22, 38, 0.82);
  border: 1px solid var(--border);
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.35s ease-out;
  pointer-events: none;
  z-index: 20;
}
/* Boss 播报 18px + 主色（美术 §5.6「最高光时刻放大」） */
.hud-announce.boss {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  border-color: rgba(255, 212, 71, 0.4);
}

/* ---------- 金币 ---------- */
.hud-gold {
  position: absolute;
  top: calc(46px + var(--sat));
  right: calc(16px + var(--sar));
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(16, 22, 38, 0.72);
  border: 1px solid rgba(255, 212, 71, 0.22);
  border-radius: 8px;
  pointer-events: none;
  z-index: 12;
}

/* ---------- 移动端交互按钮 ✋（美术 §8.3） ---------- */
.touch-interact {
  position: absolute;
  width: 48px; height: 48px;
  margin-left: -24px;
  margin-top: -24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text);
  background: rgba(16, 22, 38, 0.44);
  border: 1.5px solid rgba(180, 210, 255, 0.30);
  z-index: 15;
  pointer-events: auto;
  user-select: none;
}
.touch-interact:active {
  border-color: rgba(127, 212, 240, 0.60);
}

/* ---------- 商店面板 ---------- */
.shop-panel {
  position: absolute;
  right: calc(16px + var(--sar));
  bottom: calc(90px + var(--sab));
  width: 320px;
  max-width: 92vw;
  max-height: 68vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0) 40%),
              rgba(16, 22, 38, 0.90);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 40;
}
.shop-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.shop-gold {
  font-size: 12px; color: var(--gold); margin-bottom: 8px;
  font-weight: 600;
}
.shop-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.shop-tab {
  min-width: 44px; min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(24, 32, 52, 0.85);
  border: 1px solid rgba(180, 210, 255, 0.18);
  border-radius: 6px;
  cursor: pointer;
}
.shop-tab.sel { color: var(--accent); border-color: var(--accent); }
.shop-list { overflow-y: auto; flex: 1 1 auto; }
.shop-sub {
  font-size: 11px; color: var(--text-dim);
  margin: 4px 0 6px;
}
.shop-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.shop-card.soldout { opacity: 0.5; }
.shop-card.owned { opacity: 0.65; }
.shop-icon {
  width: 20px; height: 20px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #0b1020;
  border-radius: 4px;
}
.shop-name { flex: 1 1 auto; font-size: 12px; }
.shop-desc { font-size: 10px; color: var(--text-dim); flex: 1 1 auto; }
.shop-price { font-size: 12px; color: var(--gold); white-space: nowrap; }
.shop-buy, .shop-try {
  min-width: 44px; min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text);
  background: rgba(127, 212, 240, 0.18);
  border: 1px solid rgba(127, 212, 240, 0.55);
  border-radius: 6px;
  cursor: pointer;
}
.shop-try {
  min-width: 40px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(180, 210, 255, 0.28);
}
.shop-hint {
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.5;
}
.shop-close {
  align-self: flex-end;
  min-width: 44px; min-height: 30px;
  margin-top: 8px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(180, 210, 255, 0.28);
  border-radius: 6px;
  cursor: pointer;
}

/* 移动端：商店全屏抽屉（美术 §8.4：竖屏右侧 280px 太宽） */
@media (max-width: 520px) {
  .shop-panel {
    right: 0; left: 0;
    width: 100%;
    max-width: none;
    bottom: calc(24px + var(--sab));
    max-height: 72vh;
  }
}

/* ============================================================
   🔴 排行榜面板（当前局 / 历史 两个 Tab）
   美术规格：world-ui-visual.md §5.5
   🔴 自己那行（20 名外）固定在底部并高亮 —— GDD 05 §3.1 强制要求
   ⚠️ 不用 backdrop-filter（移动端性能，§5.3）
   ⚠️ 不用 box-shadow —— 用内高光代替
   ============================================================ */

#board {
  position: absolute;
  right: calc(16px + var(--sar));
  top: 50%; transform: translateY(-50%);
  width: 186px;
  padding: 7px 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
  pointer-events: auto;
  z-index: 6;
}

.bd-tabs { display: flex; gap: 4px; margin-bottom: 5px; }
.bd-tab {
  flex: 1;
  min-height: 26px;                 /* 移动端可点区域 */
  padding: 5px 6px;
  font: inherit; font-size: 11px;
  color: var(--text-dim);
  background: var(--glass-lite);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.bd-tab.on {
  color: var(--text);
  border-bottom: 2px solid var(--accent);
}

.bd-rows { max-height: 208px; overflow: hidden; }

/* 行高 26px（美术 §5.5） */
.bd-row {
  display: flex; align-items: center; gap: 5px;
  height: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.bd-rank { width: 20px; text-align: right; color: var(--text-dim); font-size: 10px; }
.bd-shape { width: 8px; height: 8px; flex: none; }
.bd-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bd-lv { color: var(--text-dim); font-size: 9px; flex: none; }
.bd-score { color: var(--gold); font-weight: 700; text-align: right; flex: none; }
.bd-date { color: var(--text-dim); font-size: 9px; flex: none; width: 26px; text-align: right; }

/* 🔴 前 3 名排名数字染色（美术 §5.5） */
.bd-row.top1 .bd-rank { color: #FFD447; font-weight: 700; }
.bd-row.top2 .bd-rank { color: #C8D4E0; font-weight: 700; }
.bd-row.top3 .bd-rank { color: #D8945A; font-weight: 700; }

/* 历史榜里自己的那一行 */
.bd-row.me { background: rgba(127, 212, 240, 0.14); }

/* 🔴 自己那行：20 名外也**必须**显示（GDD 05 §3.1 强制） */
.bd-self {
  display: flex; align-items: center; gap: 5px;
  margin-top: 5px; padding-top: 5px;
  border-top: 1px solid var(--border);
  background: rgba(127, 212, 240, 0.14);
  border-left: 3px solid rgba(127, 212, 240, 0.8);
  border-radius: 4px;
  padding-left: 4px;
  height: 26px;
  color: var(--accent); font-weight: 700; font-size: 11px;
}
/* 🔴 前 20 名外：更醒目，因为那是"你追不上前面"的诚实提示 */
.bd-self.out {
  background: rgba(255, 212, 71, 0.16);
  border-left-color: rgba(255, 212, 71, 0.9);
  color: var(--gold);
}

.bd-empty {
  color: var(--text-dim); font-size: 10px;
  padding: 12px 4px; text-align: center;
}

/* ---------- 观战工具条 ---------- */

.spec-bar {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  top: calc(10px + var(--sat));
  display: flex; align-items: center; gap: 5px;
  padding: 5px 7px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  pointer-events: auto;
  z-index: 7;
}
.spec-badge {
  color: var(--accent);
  font-size: 11px; font-weight: 700;
  padding-right: 5px;
  max-width: 168px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.spec-btn {
  min-height: 32px;                  /* 移动端可点区域 */
  min-width: 44px;
  padding: 6px 10px;
  font: inherit; font-size: 12px;
  color: var(--text);
  background: rgba(127, 212, 240, 0.18);
  border: 1px solid rgba(127, 212, 240, 0.55);
  border-radius: 8px;
  cursor: pointer;
}
.spec-btn:disabled {
  color: var(--text-dim);
  background: var(--glass-lite);
  border-color: var(--border);
  cursor: default;
}
.spec-exit {
  color: #FFD9D9;
  background: rgba(217, 58, 43, 0.22);
  border-color: rgba(217, 58, 43, 0.6);
}

/* ---------- 移动端断点（对齐既有三档布局，world-ui-visual §8.4） ---------- */

@media (max-width: 520px) {
  #board { width: 138px; font-size: 10px; right: calc(8px + var(--sar)); }
  .bd-rows { max-height: 132px; }
  .bd-row { height: 22px; }
  .bd-date { display: none; }
  .spec-btn { min-height: 36px; min-width: 46px; font-size: 13px; }
  .spec-badge { max-width: 108px; font-size: 10px; }
}

@media (max-width: 360px) {
  #board { width: 120px; }
  .bd-rows { max-height: 108px; }
  .spec-bar { gap: 3px; padding: 4px; }
  .spec-badge { display: none; }   /* 极窄屏优先保按钮可点 */
}

/* ============================================================
   新手引导（B4）
   🔴 核心原则：**不遮挡游戏视野**。
      引导层整体 pointer-events:none，只有卡片和按钮可点，
      玩家随时能操作游戏 —— 边玩边学，而不是被弹窗拦住。
   🔴 不用 backdrop-filter（美术 §5.3：移动端性能差）。
   ============================================================ */

.tut {
  position: fixed; inset: 0;
  z-index: 60;                 /* 高于 HUD(50) / 观战条，低于进入页(100) */
  display: none;
  pointer-events: none;
  font-size: 14px;
}
.tut.on { display: block; }

/* 高亮脉冲圈 —— 只描边不填充，视野不受遮挡 */
.tut-ring {
  position: fixed;
  display: none;
  border: 2px solid var(--accent);
  box-shadow:
    0 0 0 2px rgba(127, 212, 240, 0.25),
    inset 0 0 12px rgba(127, 212, 240, 0.18);
  animation: tutPulse 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes tutPulse {
  0%, 100% { border-color: var(--accent); }
  50%      { border-color: rgba(255, 212, 71, 0.9); }
}

/* 🔴 卡片贴底部（移动端拇指区上方），不遮中央战场 */
.tut-card {
  position: fixed;
  left: 50%; bottom: calc(96px + var(--sab));
  transform: translateX(-50%);
  width: min(460px, calc(100% - 24px));
  padding: 14px 16px;
  background: rgba(16, 22, 38, 0.94);
  border: 1px solid rgba(180, 210, 255, 0.28);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}
.tut.pop .tut-card { animation: tutIn .28s ease-out; }
@keyframes tutIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.tut-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.tut-head b { font-size: 16px; color: var(--accent); }
.tut-head span { font-size: 11px; color: var(--text-dim); margin-left: auto; }
.tut-text { margin: 0 0 6px; font-size: 13px; line-height: 1.6; }
.tut-tip  { margin: 0 0 10px; font-size: 11px; color: var(--text-dim); }
.tut-tip:empty { display: none; }

.tut-btns { display: flex; gap: 8px; }
.tut-skip, .tut-next {
  font: inherit; font-size: 13px;
  min-height: 38px; padding: 0 14px;
  border-radius: 9px; cursor: pointer;
}
.tut-skip {
  color: var(--text-dim);
  background: transparent;
  border: 1px solid rgba(180, 210, 255, 0.2);
}
.tut-next {
  margin-left: auto;
  color: #0b1020; font-weight: 700;
  background: linear-gradient(90deg, var(--accent), #5BC8E8);
  border: none;
}

/* ---------- 进入页「玩法说明」面板 ---------- */
.gate-help {
  position: fixed; inset: 0;
  z-index: 120;                /* 高于 #gate(100) */
  padding: 24px 16px;
  overflow-y: auto;
  background: rgba(8, 12, 24, 0.96);
}
.gate-help h2 {
  margin: 0 0 16px;
  font-size: 18px; text-align: center; color: var(--accent);
}
.gate-help-list {
  max-width: 460px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 8px;
}
.gate-help-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 210, 255, 0.12);
  border-radius: 9px;
}
.gate-help-row b {
  flex: 0 0 52px;
  font-size: 13px; color: var(--gold);
}
.gate-help-row span {
  font-size: 12px; color: var(--text); line-height: 1.55;
}
.gate-help-tip {
  max-width: 460px; margin: 14px auto 0;
  font-size: 12px; line-height: 1.6; color: var(--text-dim);
}
.gate-help-close {
  display: block; margin: 18px auto 0;
  min-height: 42px; padding: 0 28px;
  font: inherit; font-size: 14px; font-weight: 700;
  color: #0b1020;
  background: linear-gradient(90deg, var(--accent), #5BC8E8);
  border: none; border-radius: 10px; cursor: pointer;
}

/* ---------- 进入页「玩法说明」按钮 ---------- */
.gate-help-btn {
  display: block;
  margin: 0 auto 14px;
  min-height: 40px; padding: 0 18px;
  font: inherit; font-size: 13px;
  color: var(--accent);
  background: transparent;
  border: 1px solid rgba(127, 212, 240, 0.42);
  border-radius: 10px; cursor: pointer;
}
.gate-help-btn:active { background: rgba(127, 212, 240, 0.12); }

@media (max-width: 400px) {
  .tut-card { bottom: calc(88px + var(--sab)); padding: 12px 13px; }
  .tut-text { font-size: 12px; }
  .tut-head b { font-size: 15px; }
  .gate-help-row b { flex-basis: 46px; }
}

/* ============================================================
   单机版专属
   ============================================================ */

.gate-save {
  display: flex; gap: 8px; justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.gate-save .gate-help-btn {
  margin: 0;
  min-height: 36px;
  padding: 0 14px;
  font-size: 12px;
}
.gate-help-btn.danger {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.4);
}
.gate-help-btn.danger:active {
  background: rgba(255, 107, 107, 0.12);
}

/* ============================================================
   装备铺（2026-10-08 断点 2）
   🔴 局外成长线的消费出口：金币攒了没地方花 = 攒币无意义。
   ============================================================ */

.gate-main-btns {
  display: flex; gap: 8px; justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.gate-main-btns .gate-help-btn {
  margin: 0;
  flex: 1 1 0;
  min-width: 110px;
  min-height: 40px;
}
.gate-wallet {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.3px;
}

.shop-mask {
  position: fixed; inset: 0;
  /* 🔴 必须高于 #gate(100)。装备铺是挂在 body 上的（不在 #gate 内），
     z-index 低一点就会被进入页整块盖住 ——
     探针实测 `style.display !== 'none'` 为 true、但截图里完全看不见。
     与既有的 .gate-help(120) 取同一层级。 */
  z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: calc(12px + var(--sat)) 12px calc(12px + var(--sab));
  background: rgba(6, 10, 20, 0.78);
}
.shop-box {
  width: min(440px, 100%);
  max-height: 100%;
  padding: 16px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--glass);
  overflow-y: auto;
}
.shop-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.shop-head h2 {
  margin: 0;
  font-size: 17px; font-weight: 800; color: var(--text);
}
.shop-wallet {
  font-size: 13px; font-weight: 800; color: var(--gold);
}

.shop-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.shop-card {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
}
/* 🔴 三态视觉：已买打勾 / 买得起亮边 / 买不起压灰 */
.shop-card.owned { border-color: rgba(124, 255, 178, 0.45); background: rgba(124, 255, 178, 0.08); }
.shop-card.poor { opacity: 0.5; }
.sc-name { font-size: 13px; font-weight: 700; color: var(--text); }
.sc-desc { margin-top: 2px; font-size: 11px; color: var(--text-dim); }
.sc-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; margin-top: 7px;
}
.sc-price { font-size: 12px; font-weight: 700; color: var(--gold); }
.sc-owned { font-size: 12px; font-weight: 700; color: #7CFFB2; }
.sc-buy {
  min-height: 30px; padding: 0 12px;
  border: none; border-radius: 8px;
  background: linear-gradient(180deg, #4FC3E8, #2E9BC4);
  color: #06121E;
  font: inherit; font-size: 12px; font-weight: 800;
  cursor: pointer;
}
.sc-buy:disabled {
  background: rgba(255, 255, 255, 0.10);
  color: var(--text-dim);
  cursor: not-allowed;
}
.shop-tip {
  margin: 0 0 10px;
  font-size: 11px; color: var(--text-dim); line-height: 1.6;
}
.shop-close { display: block; margin: 0 auto; }

/* ============================================================
   更新日志（进入页常驻）
   ============================================================ */

.changelog {
  margin: 14px 0 4px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg);
  background: rgba(12, 18, 32, 0.6);
  text-align: left;
  max-height: 260px;
  overflow-y: auto;
}

.changelog-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.changelog-caret {
  margin-left: auto;
  font-size: 12px;
  color: #5f6f8c;
  transition: transform 0.18s ease;
}

/* 🔴 默认折叠：只显示标题行，不挤压「开始」按钮 */
.changelog-body {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  max-height: 240px;
  overflow-y: auto;
}
.changelog.open .changelog-body { display: block; }
.changelog.open .changelog-caret { transform: rotate(180deg); }

.changelog-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #e8eefc);
}

.changelog-badge {
  font-size: 11px;
  font-family: ui-monospace, monospace;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(63, 216, 192, 0.16);
  color: #3fd8c0;
}

.changelog-item + .changelog-item {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.changelog-ver {
  font-size: 12px;
  font-weight: 500;
  color: #9fb4d8;
  margin-bottom: 5px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.changelog-date {
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: #5f6f8c;
  font-weight: 400;
}

.changelog ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.changelog li {
  font-size: 12px;
  line-height: 1.65;
  padding-left: 14px;
  position: relative;
  color: #8fa3c4;
}

/* 🔴 用前置圆点区分类型，比文字前缀更省空间 */
.changelog li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5f6f8c;
}

.changelog li.chg-add::before  { background: #3fd8c0; }
.changelog li.chg-opt::before  { background: #ffd447; }
.changelog li.chg-fix::before  { background: #7fd4f0; }
.changelog li.chg-del::before  { background: #ff6b6b; }

.changelog li.chg-add { color: #a8e8dc; }
.changelog li.chg-del { color: #d9a0a0; }

/* 🔴 启动失败提示：必须显眼，否则用户只看到"点了没反应" */
.gate-status.err {
  display: block;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 107, 0.5);
  border-radius: var(--border-radius-md, 8px);
  background: rgba(255, 107, 107, 0.12);
  color: #ff9b9b;
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
  word-break: break-all;
}

/* ============================================================
   操作提示（2026-07-07：用户反馈「游戏怎么攻击？」）
   ============================================================ */

/* 🔴 原来是一行 11px 灰字，太不显眼等于没有。
   改成底部居中的半透明卡片，三行字，攻击那行高亮。 */
.hud-hint {
  white-space: normal;
  text-align: center;
  background: rgba(10, 16, 30, 0.72);
  border: 1px solid rgba(180, 210, 255, 0.14);
  border-radius: 10px;
  padding: 8px 14px;
  backdrop-filter: blur(4px);
}

.hint-row {
  font-size: 12px;
  line-height: 1.7;
  color: #9fb4d8;
}

.hint-strong {
  color: #ffd98a;
  font-weight: 600;
}

.hint-extra {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  color: #ff9b9b;
}

/* 🔴 攻击按钮：原来只有个「⚔」图标，孩子认不出。
   改成「攻击」二字 + 键位提示。 */
.hud-atk {
  flex-direction: column;
  gap: 1px;
}

.atk-icon {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
}

.atk-key {
  font-size: 10px;
  opacity: 0.7;
  line-height: 1.1;
}

/* 技能槽也要标出键位 */
.skill-slot::after {
  content: attr(data-key);
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 9px;
  opacity: 0.6;
}

/* 🔴 版本徽标（2026-07-07）
   连续三轮"修复没生效"后加的 —— 进游戏页一眼确认浏览器实际加载的版本，
   避免对着旧包 / 缓存排查半天。 */
.gate-ver {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}

/* 🔴 设置面板（G 任务，2026-10-08）*/
.set-open {
  position: fixed;
  top: calc(12px + var(--sat)); right: calc(12px + var(--sar));
  z-index: 45;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.set-open:hover { color: var(--text); }

.set-veil {
  position: fixed; inset: 0; z-index: 46;
  background: rgba(4, 8, 16, 0.55);
  backdrop-filter: blur(2px);
}

.set-panel {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  z-index: 47;
  width: min(340px, calc(100vw - 32px));
  padding: 20px 20px 16px;
  background: var(--panel-bg, #131a2a);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.set-panel.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.set-title {
  font-size: 17px; font-weight: 700; color: var(--text);
  margin-bottom: 14px;
}

.set-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 13px;
}
.set-label {
  flex: 0 0 44px;
  font-size: 13px; color: var(--text-dim);
}

.set-seg { display: flex; flex: 1; gap: 4px; }
.set-seg button {
  flex: 1;
  padding: 7px 0;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}
.set-seg button.on {
  color: #0d1220;
  background: #7FD8FF;
  border-color: #7FD8FF;
  font-weight: 600;
}

#set-vol {
  flex: 1;
  height: 4px;
  accent-color: #7FD8FF;
  cursor: pointer;
}
.set-mute, .set-danger {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.set-mute.on { color: #0d1220; background: #E8A33D; border-color: #E8A33D; }

.set-danger { color: #E8836F; border-color: rgba(232, 131, 111, 0.4); }
.set-danger.armed {
  color: #fff; background: #D93A2B; border-color: #D93A2B;
  font-weight: 700;
}

.set-hint {
  font-size: 11px; color: var(--text-dim);
  line-height: 1.6;
  margin: 4px 0 12px;
  opacity: .8;
}
.set-close {
  width: 100%;
  padding: 10px 0;
  font-size: 14px; font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

/* 🔴 角色选择预览（F 任务）*/
.cls-pv {
  display: block;
  width: 96px; height: 96px;
  margin: 0 auto 6px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 45%,
    rgba(60,90,140,0.22), rgba(10,16,28,0.05));
}
.cls .shape { display: none; }

/* 🔴🔴 击杀播报（2026-10-08）——独立于 Boss 公告，不会被覆盖 */
.hud-kill {
  position: absolute;
  top: calc(30% + var(--sat));
  left: 50%;
  transform: translate(-50%, 0) scale(0.8);
  z-index: 24;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .28s cubic-bezier(.2,1.4,.4,1);
}
.hud-kill.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.hud-kill .kill-main {
  font-size: 26px;
  font-weight: 800;
  color: #FFD98A;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85), 0 0 18px rgba(255,180,60,0.45);
}
.hud-kill .kill-sub {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
  color: #FF8F6E;
  letter-spacing: 3px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* 🔴 技能冷却进度条（从下往上收缩）*/
.skill-slot {
  --cd: 0;
  position: relative;
  overflow: hidden;
}
.skill-slot::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--cd) * 100%);
  background: rgba(10, 16, 28, 0.55);
  border-top: 1px solid rgba(127, 216, 255, 0.4);
  pointer-events: none;
  transition: height .12s linear;
}

/* ============================================================
   暂停（G 任务）+ 结算面板（2026-10-08）
   🔴 这两块对应「3 分钟结束后什么都不发生」这个致命断点：
      暂停让孩子能中途停下，结算让一局有始有终。
   ============================================================ */

/* ---------- 暂停按钮（HUD 右上） ---------- */
.hud-pause {
  position: absolute;
  top: calc(12px + var(--sat)); right: calc(12px + var(--sar));
  min-width: 56px; height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--glass);
  color: var(--text);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}
.hud-pause:active { transform: scale(0.95); }

/* ---------- 通用按钮 ---------- */
.btn-primary, .btn-ghost {
  min-height: 44px;            /* 🔴 可点击区域 ≥ 44×44（美术 §8.6） */
  padding: 0 22px;
  border-radius: 10px;
  font-size: 15px; font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
}
.btn-primary {
  border: none;
  background: linear-gradient(180deg, #4FC3E8, #2E9BC4);
  color: #06121E;
  box-shadow: 0 3px 0 #1E6E8E;
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #1E6E8E; }
.btn-ghost {
  border: 1px solid var(--border);
  background: var(--glass-lite);
  color: var(--text-dim);
}
.btn-ghost:active { background: rgba(127, 212, 240, 0.18); }

/* ---------- 暂停遮罩 ---------- */
/*
 * 🔴 半透明而不是全黑：孩子要能看到自己停在哪，
 *   全黑会以为游戏崩了。
 */
.pause-mask {
  position: absolute; inset: 0;
  z-index: 40;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  background: rgba(6, 10, 20, 0.62);
  pointer-events: auto;
}
.pause-title {
  font-size: 30px; font-weight: 800;
  color: var(--text);
  letter-spacing: 6px;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.8);
}
.pause-tip {
  margin-bottom: 12px;
  font-size: 12px; color: var(--text-dim);
}

/* ---------- 结算面板 ---------- */
.result-mask {
  position: absolute; inset: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: calc(12px + var(--sat)) 12px calc(12px + var(--sab));
  background: rgba(6, 10, 20, 0.72);
  pointer-events: auto;
  overflow-y: auto;
}
.result-box {
  width: min(420px, 100%);
  max-height: 100%;
  padding: 18px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--glass);
  text-align: center;
  overflow-y: auto;
}
.result-head { margin-bottom: 14px; }
.result-title {
  display: block;
  font-size: 13px; color: var(--text-dim);
  letter-spacing: 4px;
}
.result-rank {
  margin-top: 4px;
  font-size: 28px; font-weight: 800;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}
.result-rank.top { color: var(--gold); }

/* ---- 战绩网格：3×2，孩子一眼扫完 ---- */
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.result-cell {
  padding: 8px 4px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
}
.rc-k { display: block; font-size: 10px; color: var(--text-dim); }
.rc-v {
  display: block; margin-top: 2px;
  font-size: 17px; font-weight: 800; color: var(--text);
}

/* ---- 结算榜 ---- */
.result-board {
  margin-bottom: 12px;
  padding: 8px 6px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.24);
  text-align: left;
}
.result-row {
  display: flex; align-items: center; gap: 6px;
  height: 19px;
  font-size: 12px;
}
.result-row.me {
  background: rgba(127, 212, 240, 0.16);
  border-radius: 5px;
}
.rr-rank { width: 17px; text-align: right; color: var(--text-dim); font-size: 10px; }
.rr-nick {
  flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
}
.rr-score { color: var(--gold); font-weight: 700; }

/* ---- 本局收获 ---- */
.result-gain {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: 8px;
  margin-bottom: 8px;
  font-size: 13px; font-weight: 700;
}
.gain-gold { color: var(--gold); }
.gain-xp { color: var(--accent); }
.gain-lv { color: #7CFFB2; }
.gain-best { color: #FF9F43; }
.result-total {
  margin-bottom: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-dim);
}
.rt-k { margin-right: 6px; }
.rt-v { color: var(--text); }

.result-btns {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap;
}

/* 🔴 小屏：结算面板内容很多，必须能滚动且不能被裁 */
@media (max-height: 560px) {
  .result-rank { font-size: 22px; }
  .rc-v { font-size: 15px; }
  .result-cell { padding: 6px 3px; }
}
