/* ═══════════════════════════════════════════════
   裂境战纪 · 客户端外观
   深墨底 + 铜金高光。观众端与对战端共用同一套色板
   （与 src/versus/versus.css 的 --vs-* 同源），
   整个产品只有一种"游戏客户端"气质，不再有浅色/深色两张皮。

   两层级：
     --bg*     页面与舞台底色（近黑，带一点青绿，和战场画面连成一体）
     --card*   面板 / 控件 / 内嵌条目三级表面
   金色只用于"可操作的、值钱的、当前选中的"，其余一律灰阶，
   这样满屏都是金线时视线仍然知道该看哪里。
   ═══════════════════════════════════════════════ */

:root {
  --bg: #0a0e0c;
  --bg-2: #0d1311;
  --paper: #0a0e0c;          /* 页面底（沿用旧变量名，避免全文件改名） */
  --paper-2: #151d19;        /* 次级面：计量块、悬停 */
  --card: #121917;           /* 面板 */
  --card-2: #17201c;         /* 面板内嵌控件：输入框、条目 */
  --ink: #eef1ea;
  --ink-2: #c3cbc4;
  --muted: #8b958e;
  --faint: #626d67;
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .045);
  --accent: #cfa25a;         /* 主色＝铜金（与对战端一致） */
  --accent-2: #e6c88c;
  --accent-soft: rgba(207, 162, 90, .13);
  --gold: #cfa25a;
  --gold-2: #f0d6a2;
  --gold-soft: rgba(207, 162, 90, .11);
  --rift: #4f9d78;           /* 保留的青绿：只用于"在线/成功"状态 */
  --danger: #d0684f;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .28);
  --shadow-m: 0 2px 8px rgba(0, 0, 0, .45), 0 18px 44px rgba(0, 0, 0, .5);
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC", "Noto Serif SC", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow: hidden; }
#app { height: 100%; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; color: inherit; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tiny { font-size: 11px; color: var(--muted); letter-spacing: .02em; }

/* ═══════════ 大厅 ═══════════ */
.lobby {
  height: 100%;
  overflow-y: auto;
  background:
    radial-gradient(1200px 620px at 12% -12%, rgba(79, 157, 120, .10) 0%, transparent 62%),
    radial-gradient(900px 520px at 100% 0%, rgba(207, 162, 90, .08) 0%, transparent 58%),
    radial-gradient(760px 420px at 50% 118%, rgba(77, 112, 138, .10) 0%, transparent 62%),
    var(--bg);
}
.lobby-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 56px 40px 32px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: start;
}
@media (max-width: 1020px) {
  .lobby-inner { grid-template-columns: 1fr; gap: 32px; padding: 32px 20px; }
}

/* 大厅左栏＝"作战室"：把战争沙盘那张关键美术压在文字底下（88% 深色罩），
   既给了画面又不影响读参数——纯黑卡片在 1080p 上会显得像后台管理页。 */
.hero {
  position: relative;
  border-radius: 18px;
  padding: 28px 30px 26px;
  border: 1px solid rgba(255, 255, 255, .08);
  overflow: hidden;
  background: #0c1210;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url(assets/art/lobby-keyart.jpg) center 40% / cover no-repeat;
  opacity: .55;
  filter: saturate(.75) brightness(.8);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 13, 11, .70) 0%, rgba(9, 13, 11, .90) 48%, rgba(9, 13, 11, .97) 100%),
    radial-gradient(80% 60% at 100% 0%, rgba(207, 162, 90, .10), transparent 62%);
}
.hero > * { position: relative; z-index: 2; }

/* 金色浮雕字：中文标题的"游戏 logo"做法。
   宋体（明朝体）给骨架，竖向金渐变给金属感，1px 亮描边把笔画从黑底上"拎"出来。
   注意：background-clip:text 与 text-shadow 冲突（阴影会整块盖住填色），只能用 drop-shadow。 */
.logo-word {
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Noto Serif SC", var(--serif);
  background: linear-gradient(180deg, #fff8e8 0%, #f4dfb6 34%, #cfa25a 62%, #8a6224 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.1px rgba(255, 240, 210, .5);
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .9)) drop-shadow(0 0 26px rgba(207, 162, 90, .14));
  letter-spacing: .015em;
}

.hero-mark { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.mark-line { width: 34px; height: 1px; background: var(--gold); }
.mark-text { font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em; color: var(--gold); text-transform: uppercase; }

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 4.6vw, 58px);
  line-height: 1.02;
  letter-spacing: -.03em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero h1 .sub {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .34em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 8px;
}
.lede {
  margin-top: 24px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-2);
  max-width: 46ch;
}
.hero-points {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.hero-points li { list-style: none; display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: baseline; }
.hero-points b { font-size: 13px; font-weight: 600; color: var(--accent); }
.hero-points span { font-size: 12.5px; color: var(--muted); line-height: 1.7; }

.faction-strip { margin-top: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.faction-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 9px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .012));
  transition: border-color .18s, background .18s, transform .18s;
}
.faction-chip:hover {
  border-color: var(--fc, rgba(255, 255, 255, .2));
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .02));
  transform: translateY(-1px);
}
/* 纹章：38px 足够看清盾形与主符号，又不至于把两列网格撑破 */
.fc-emblem {
  width: 38px; height: 38px; flex: none; object-fit: contain;
  filter: drop-shadow(0 2px 7px rgba(0, 0, 0, .75));
}
.faction-chip b { font-size: 12.5px; font-weight: 600; }
.faction-chip span { font-size: 10.5px; color: var(--faint); display: block; margin-top: 2px; }

/* 地图预览：程序化生成的对称大陆，给一张缩略图比一行"随机种子"更有说服力 */
.map-preview {
  position: relative; margin-top: 12px;
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  background: #0b100e;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .4);
}
.map-preview img {
  display: block; width: 100%; height: 148px; object-fit: cover;
  filter: saturate(.85) brightness(.9);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .3s;
}
.map-preview:hover img { transform: scale(1.04); filter: saturate(1) brightness(1); }
.map-preview figcaption {
  position: absolute; inset: auto 0 0 0;
  display: flex; align-items: baseline; gap: 8px;
  padding: 22px 14px 11px;
  background: linear-gradient(180deg, transparent, rgba(7, 10, 8, .92));
  font-size: 11px; color: rgba(238, 241, 234, .55);
}
.map-preview figcaption b {
  font-family: var(--serif); font-size: 14px; color: var(--ink); letter-spacing: .04em;
}
.map-preview .mp-tag {
  margin-left: auto; padding: 1px 7px; border-radius: 999px;
  border: 1px solid rgba(207, 162, 90, .4); color: var(--gold-2); font-size: 9.5px;
}

/* 配置区 */
.config { display: flex; flex-direction: column; gap: 16px; }
.cfg-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-s);
}
.cfg-block.wide-block { grid-column: 1 / -1; }
.cfg-block h2 {
  font-size: 12px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.cfg-block h2::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
.field .inline { display: flex; align-items: center; gap: 8px; }
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.65; margin-top: 7px; }

/* 输入控件统一深色底。
   这里必须把「没有 type 属性的 input」也算进来：HTML 里 `<input class="p-name">`
   不写 type 时浏览器按 text 行为渲染，但属性选择器 `[type="text"]` **匹配不到**，
   于是那两个玩家名输入框一路沿用浏览器默认白底黑字，在大厅里亮得像两块灯箱。
   number 输入同样漏了——限时/人口/资源储量全是 number，切到「有限」就白一块。
   所以统一用 :not([type]) 兜住，number 单独列，并关掉 number 的原生步进器外观。 */
input:not([type]),
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="email"],
textarea {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-2);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
select {
  width: 100%;
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--card-2);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  /* 原生下拉箭头在深底上是浅灰三角，几乎看不见；用内联 SVG 画一个铜色细箭头 */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238b958e' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
select option { background: #17201c; color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus {
  border-color: rgba(207, 162, 90, .55);
  background-color: #1b2621;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select:focus { background-color: #1b2621; }
/* 数字输入：关掉浏览器原生步进器（浅色小方块在深底上像贴了两块补丁），
   需要微调的用户直接键入数值更快。 */
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { appearance: none; -webkit-appearance: none; margin: 0; }
/* 浏览器自动填充会强行刷成白底（密码管理器/隐私模式），必须用内阴影盖掉 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--card-2) inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-out 0s;
}
/* 只读（种子）保持弱化，但仍是深底 */
input[readonly] { color: var(--muted); background: rgba(255, 255, 255, .02); }
input[type="range"] { flex: 1; accent-color: var(--gold); height: 4px; }

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--card-2);
}
.segmented button {
  padding: 7px 15px;
  font-size: 12.5px;
  color: var(--muted);
  border-right: 1px solid var(--line);
  transition: all .15s;
}
.segmented button:last-child { border-right: none; }
.segmented button:hover { background: rgba(255, 255, 255, .04); color: var(--ink); }
.segmented button.on {
  background: linear-gradient(180deg, #e3c087, #c1944b);
  color: #1a1206;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.segmented button:disabled, .segmented button.disabled { color: #4d574f; cursor: not-allowed; background: rgba(255, 255, 255, .015); }
.segmented.sm button { padding: 5px 11px; font-size: 11.5px; }

.ghost {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .04);
  transition: all .15s;
  white-space: nowrap;
}
.ghost:hover { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: var(--ink); }
.ghost.on { background: var(--accent-soft); border-color: rgba(207, 162, 90, .42); color: var(--gold-2); }
.ghost.sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }
.ghost.wide { width: 100%; margin-top: 12px; }

/* 模型接入 */
.providers { display: flex; flex-direction: column; gap: 10px; }
.provider-row {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .025);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.provider-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.provider-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--line); }
.provider-dot.ok { background: #56c98d; box-shadow: 0 0 0 3px rgba(86, 201, 141, .16); }
.provider-name { font-size: 12.5px; font-weight: 600; }
.provider-note { font-size: 10.5px; color: var(--faint); }
.provider-row select { height: 30px; font-size: 11.5px; }
.provider-row input { height: 30px; font-size: 11.5px; grid-column: 1 / -1; }
.provider-row .status { font-size: 10.5px; color: var(--faint); }
.provider-tag {
  margin-left: auto;
  font-size: 10.5px;
  color: #86d3a8;
  background: rgba(79, 157, 120, .14);
  border: 1px solid rgba(79, 157, 120, .3);
  border-radius: 999px;
  padding: 1px 8px;
  flex: none;
}
.prov-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px 14px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--faint);
  background: rgba(255, 255, 255, .015);
}
.prov-empty code { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }

/* 玩家配置 */
.players-config { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .players-config { grid-template-columns: 1fr; } }
.pcfg {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, .028);
  position: relative;
  overflow: hidden;
}
.pcfg::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--pc, var(--accent));
}
.pcfg-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.pcfg-idx {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: #fff; background: var(--pc, var(--accent));
  flex: none;
}
.pcfg-top input { height: 30px; font-size: 12.5px; font-weight: 600; }
.pcfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pcfg-grid label { font-size: 10.5px; color: var(--faint); display: block; margin-bottom: 4px; }
.pcfg-grid select { height: 30px; font-size: 11.5px; }
.pcfg .model-line { margin-top: 8px; }

.start-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 4px 2px 0;
}
.start-note { font-size: 11.5px; color: var(--faint); line-height: 1.6; max-width: 34ch; }
.primary {
  position: relative;
  padding: 14px 30px;
  border-radius: 11px;
  background: linear-gradient(180deg, #e8c68d 0%, #c99b4e 55%, #b3853c 100%);
  color: #1a1206;
  text-align: left;
  transition: transform .15s, box-shadow .2s, filter .2s;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .45),
              0 0 0 1px rgba(255, 226, 176, .25);
  flex: none;
  min-width: 208px;
}
.primary:hover { transform: translateY(-1px); filter: brightness(1.07);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .5),
              0 0 0 1px rgba(255, 226, 176, .35), 0 0 26px rgba(207, 162, 90, .25); }
.primary:active { transform: translateY(0); }
.primary span { display: block; font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.primary small { display: block; font-size: 10.5px; color: rgba(26, 18, 6, .62); margin-top: 3px; letter-spacing: .04em; }

.lobby-foot {
  max-width: 1320px; margin: 0 auto; padding: 24px 40px 40px;
  display: flex; gap: 10px; align-items: center;
  font-size: 11px; color: var(--faint);
  border-top: 1px solid var(--line);
}
.lobby-foot .dot { opacity: .5; }

/* ═══════════ 观战台 ═══════════ */
.arena {
  height: 100%;
  display: grid;
  grid-template-rows: 60px minmax(0, 1fr);
  background: var(--paper);
  overflow: hidden;
}
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(13, 19, 17, .96), rgba(10, 14, 12, .88));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(207, 162, 90, .16);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .6), 0 8px 24px rgba(0, 0, 0, .35);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: url(assets/art/logo-crest.png) center/128% no-repeat,
              radial-gradient(circle at 50% 45%, rgba(207, 162, 90, .28), transparent 70%);
  position: relative;
  flex: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .7));
}
.brand b { display: block; font-size: 13px; letter-spacing: .04em; }
.brand small { display: block; font-size: 10px; color: var(--faint); font-family: var(--mono); margin-top: 1px; }

.clock { display: flex; align-items: baseline; gap: 10px; }
.clock-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
#clock { font-size: 19px; font-weight: 600; letter-spacing: .02em; }

.controls { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.main {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 316px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.rail {
  background: var(--card);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.rail-left { border-right: 1px solid var(--line); }
.rail-right { border-left: 1px solid var(--line); }

.rail-head, .feed-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
}
.rail-head h3, .feed-head h3 {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

/* 玩家卡 */
/* 4 人局要能一眼看全四张卡（约 4×120 + 间隔 ≈ 512px），
   6 人局超出就滚动；下方心智面板自己内部滚动，互不挤压。 */
/* 66% 在 900px 高的窗口里只够 3.9 张卡，第 4 张的"秘银/兵力"两行会被裁掉半截
   （实测需要 597px、只给了 554px）。改成 74% 并把心智面板的下限压到 176px：
   4 人局刚好全显示，5~6 人局仍然在卡区内部滚动。 */
.player-cards { padding: 0 12px 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 0 1 auto; max-height: 74%; }
.pcard {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px 10px;
  background: rgba(255, 255, 255, .028);
  cursor: pointer;
  transition: all .16s;
  position: relative;
  overflow: hidden;
  /* 列向 flex 里默认 flex-shrink:1 会把卡片压扁到内容装不下，
     再被 overflow:hidden 裁掉底部的"意图"一行。卡片必须保持自身高度，
     装不下就让 .player-cards 滚动，而不是压内容。 */
  flex: 0 0 auto;
}
.pcard:hover { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .055); }
.pcard.sel { border-color: rgba(207, 162, 90, .62); box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 24px rgba(207, 162, 90, .06); background: rgba(255, 255, 255, .06); }
.pcard.dead { opacity: .45; filter: grayscale(.6); }
.pcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pc); }
.pc-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
/* 英雄头像：72px 离屏绘制，30px 圆框展示。暗角底 + 队伍色描边在 sprites 里画 */
.pc-face { width: 30px; height: 30px; border-radius: 50%; flex: none; background: #151b20; }
.pc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pc); flex: none; }
.pc-name { font-size: 12.5px; font-weight: 600; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-fac { font-size: 10px; color: var(--faint); margin-left: auto; flex: none; }
.pc-status {
  width: 6px; height: 6px; border-radius: 50%; flex: none; background: #cdd2c9;
}
.pc-status.thinking { background: #e0a12c; animation: pulse 1.1s infinite; }
.pc-status.idle { background: #56a97e; }
.pc-status.error { background: var(--danger); }
.pc-status.offline { background: #8a90b8; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* 六项统计（兵力/军力值/秘银/古木/主城/英雄）走 3 列 2 行：
   秘银与古木都要显示「当前/累计」，4 列会把 18/851 挤成两行。 */
.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 6px; margin-bottom: 7px; }
.pc-stat { }
.pc-stat b { display: block; font-size: 12px; font-weight: 600; font-family: var(--mono); line-height: 1.2; }
/* 秘银/古木「当前/累计」：分母弱化一档，三列网格里也不会把数字挤成两行 */
.pc-stat b i { font-style: normal; font-size: .82em; font-weight: 500; opacity: .58; margin-left: 1px; letter-spacing: -.02em; }
.pc-stat span { display: block; font-size: 9px; color: var(--faint); margin-top: 2px; letter-spacing: .04em; }
.pc-bars { display: flex; flex-direction: column; gap: 3px; margin-bottom: 7px; }
.pc-bar { height: 3px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.pc-bar i { display: block; height: 100%; border-radius: 2px; transition: width .4s; }
/* 英雄经验条：比人口/评分两条更细一点，颜色用紫色和金（满级）区分"经验"与"资源" */
.pc-xpbar { height: 2px; }
.pc-xpbar i { background: linear-gradient(90deg, #7c5cf0, #c9a6ff); }
.pc-stat span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-thought {
  font-size: 10.5px; line-height: 1.6; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-style: italic;
  border-top: 1px dashed var(--line-2);
  padding-top: 6px;
}
.pc-dead-tag { font-size: 9.5px; color: var(--danger); letter-spacing: .1em; text-transform: uppercase; }

/* 决策心智 */
.mind {
  margin: 8px 12px 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  /* basis 用 0：心智面板只吃"卡区排完之后的剩余空间"。
     早先用 auto 时它按内容高度(约 282px)先占位，反过来把上面的
     玩家卡压到 498px，四张卡的最后一行意图就被裁掉了。 */
  flex: 1 1 0;
  min-height: 176px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mind-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 8px;
}
.mind-body { overflow-y: auto; flex: 1; min-height: 0; }
.mind-body .empty { font-size: 11.5px; color: var(--faint); line-height: 1.7; }
.thought-block {
  background: linear-gradient(180deg, rgba(207, 162, 90, .10), rgba(207, 162, 90, .045));
  border: 1px solid rgba(207, 162, 90, .2);
  border-left: 2px solid rgba(207, 162, 90, .5);
  border-radius: 9px;
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.7;
  color: #e6d3ad;
  margin-bottom: 9px;
  font-family: var(--serif);
}
.thought-block .q { font-size: 14px; opacity: .5; margin-right: 2px; }
.plan-line { font-size: 11.5px; color: var(--ink-2); margin-bottom: 10px; display: flex; gap: 6px; }
.plan-line b { color: var(--accent); font-weight: 600; flex: none; }
/* 建筑等级徽标：Lv3 用等宽数字，★ 表示已满级 */
.lv-tag {
  display: inline-block; margin: 0 1px; padding: 0 4px; border-radius: 3px;
  background: rgba(255, 209, 102, .16); color: #ffd166; font-family: var(--mono);
  font-size: 9.5px; font-weight: 700; letter-spacing: .2px;
}
.order-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.chip {
  font-size: 10px; padding: 3px 7px; border-radius: 5px;
  background: var(--accent-soft); color: var(--gold-2);
  border: 1px solid rgba(207, 162, 90, .26);
}
.chip.warn { background: rgba(224, 138, 60, .14); color: #f0b878; border-color: rgba(224, 138, 60, .3); }
.meter-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.meter { background: var(--paper-2); border-radius: 7px; padding: 6px 7px; }
.meter b { display: block; font-family: var(--mono); font-size: 11px; }
.meter span { font-size: 9px; color: var(--faint); }
.err-line { font-size: 10.5px; color: #e8907c; background: rgba(208, 104, 79, .13); border: 1px solid rgba(208, 104, 79, .24); border-radius: 6px; padding: 6px 8px; line-height: 1.5; }

/* 舞台 */
.stage { position: relative; overflow: hidden; background: #0b1310; min-width: 0; }
/* 初始光标用 default：真正的游戏光标由 src/versus/cursor.js 内联覆盖。
   这里若写 crosshair，鼠标尚未进入 canvas 时会先闪一下十字准星。 */
#game { width: 100%; height: 100%; display: block; cursor: default; }
/* 左键是框选（十字准星），右键/中键才是平移；拖拽中不换光标，
   否则每帧在 grab/grabbing 之间跳会闪。 */
#game:active { cursor: default; }
html[data-shell="mobile"] #game { cursor: auto; }
.stage-hud {
  position: absolute; inset: 0; pointer-events: none;
  padding: 14px 16px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.hud-left { display: flex; gap: 10px; flex-wrap: wrap; max-width: 70%; }
.hud-chip {
  pointer-events: none;
  background: rgba(12, 18, 15, .58);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #eef3ee;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  display: flex; align-items: center; gap: 7px;
}
.hud-chip i { width: 6px; height: 6px; border-radius: 50%; }
.hud-chip .mono { font-size: 12px; font-weight: 600; }
.hud-right { color: rgba(255, 255, 255, .45); display: flex; align-items: center; gap: 10px; }
/* 操作提示：只在宽屏出现。窄屏上这行会和 fps、趋势图挤在一起，
   而"左键框选"这种事看一次就记住了，不需要一直占位。 */
#ctrlHint { font-size: 10.5px; opacity: .82; }
@media (max-width: 1180px) { #ctrlHint { display: none; } }

.tooltip {
  /* fixed + 高层级：卡片必须永远浮在一切面板之上。
     原来写的是 absolute + z-index:5，而单位详情面板是 z-index:40，
     于是"鼠标放在背包药剂上"时卡片被面板整块盖住（用户反馈的原始截图）。
     改成 fixed 之后也不再被 .stage 的 overflow:hidden 在屏幕边缘裁掉。 */
  position: fixed;
  pointer-events: none;
  background: rgba(10, 15, 12, .88);
  color: #eaf0ea;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.6;
  max-width: 250px;
  width: max-content;
  backdrop-filter: blur(8px);
  z-index: 3000;
  transform: translate(-50%, -120%);
}
.tooltip.below { transform: translate(-50%, 8px); }
.tooltip b { display: block; font-size: 12px; margin-bottom: 2px; }
.tooltip .tt-row { color: rgba(255, 255, 255, .62); font-family: var(--mono); font-size: 10px; }
/* 建筑详情：等级徽标 / 当前收益 / 下一级收益 / 费用 */
.tooltip .tt-lv {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px;
  background: rgba(255, 209, 102, .16); color: #ffd166; font-size: 10px; font-weight: 600;
}
.tooltip .tt-eff { color: #b9e4c6; }
.tooltip .tt-next { color: #9fd0ff; }
.tooltip .tt-cost { color: #ffd166; }
.tooltip .tt-up { color: #ffb066; }
.tooltip .tt-max { color: #ffd166; }
.tooltip .tt-skill { color: #d8c8ff; }
/* 金矿工具提示：标题 + 储量条 + 对齐键值行，读起来像一张"矿脉档案"（需求 5） */
.tooltip .tt-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.tooltip .tt-head b { margin: 0; font-size: 12.5px; letter-spacing: .02em; }
.tooltip .tt-tag {
  flex: none; padding: 1px 5px; border-radius: 4px;
  background: rgba(255, 209, 102, .14); color: #ffd166;
  font-size: 9.5px; font-weight: 600; letter-spacing: .04em;
}
.tooltip .tt-kv {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  font-size: 10.5px; line-height: 1.65; white-space: nowrap;
}
.tooltip .tt-kv > span { flex: none; color: rgba(255, 255, 255, .48); }
.tooltip .tt-kv > b {
  display: inline-block; margin: 0; text-align: right;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: #eaf0ea;
}
.tooltip .tt-kv > b s { text-decoration: none; font-weight: 400; opacity: .45; }
.tooltip .tt-kv > b.ok { color: #9fe0b0; }
.tooltip .tt-kv > b.warn { color: #ffb066; }
.tooltip .tt-kv > b.bad { color: #ff8a8a; }
.tooltip .tt-foot {
  margin-top: 6px; padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-family: var(--mono); font-size: 9.5px; color: rgba(255, 255, 255, .42);
}
.tooltip .tt-bar {
  height: 5px; margin: 0 0 6px; border-radius: 3px; overflow: hidden;
  background: rgba(255,255,255,.12);
}
.tooltip .tt-bar i { display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #b8860b, #ffd166); transition: width .2s; }
.tooltip .tt-bar.dry i { background: linear-gradient(90deg, #4a4a4a, #707070); }
.tooltip .tt-warn { color: #ffb066; }
.tooltip .tt-dim { opacity: .62; }
/* 英雄面板：经验条 + 四个技能的等级胶囊 */
.tooltip { max-width: 270px; }
.tooltip .tt-xp { display: flex; align-items: center; gap: 6px; color: #c9b6ff; }
.tooltip .tt-xpbar {
  flex: 1 1 auto; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.14); overflow: hidden; min-width: 44px;
}
.tooltip .tt-xpbar i { display: block; height: 100%; background: linear-gradient(90deg,#7c5cf0,#c9a6ff); }
.tooltip .tt-xpnum { font-family: var(--mono); font-size: 10px; opacity: .75; }
.tooltip .tt-skl {
  display: inline-flex; align-items: center; gap: 3px;
  margin: 2px 4px 0 0; padding: 1px 5px; border-radius: 5px;
  background: rgba(255,255,255,.09); font-size: 10px; color: #e6dcff;
}
.tooltip .tt-skl b { font-family: var(--mono); font-size: 9.5px; color: #ffd166; }
.tooltip .tt-skl.dim { opacity: .42; }
.tooltip .tt-ult {
  font-style: normal; font-size: 9px; padding: 0 3px; border-radius: 3px;
  background: rgba(255,209,102,.22); color: #ffd166;
}

/* 小地图：悬浮在舞台右上角，三态可切（实体 / 半透明 / 隐藏）。
   为什么从右栏挪出来：右栏的小地图和"趋势/直播/军师"抢高度，缩到 160px 又在
   1080p 下看得清，放回战场右上角是玩家要求的位置，也是 war3 的习惯位置。 */
.mini-float {
  position: absolute; top: 52px; right: 14px; z-index: 26;
  width: 158px; padding: 6px 7px 7px; border-radius: 10px;
  background: rgba(10, 15, 12, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  color: #e8e4da;
  transition: opacity 0.18s ease, width 0.2s ease;
}
.mini-float[hidden] { display: none; }
.mini-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.mini-head b { font-size: 9.5px; letter-spacing: 0.16em; color: rgba(255, 255, 255, 0.55); font-weight: 600; }
.mini-mode {
  font: inherit; font-size: 9.5px; padding: 1px 6px; border-radius: 5px; cursor: pointer;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d8d8c8; line-height: 1.5;
}
.mini-mode:hover { background: rgba(255, 255, 255, 0.16); }
#minimap {
  width: 100%; height: auto; aspect-ratio: 1;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f1a16;
  display: block;
  image-rendering: auto;
}
.mini-legend { display: flex; gap: 9px; margin-top: 5px; font-size: 9px; color: rgba(255, 255, 255, 0.42); }
.mini-legend span { display: flex; align-items: center; gap: 3px; }
.mini-legend i { width: 5px; height: 5px; display: inline-block; }
.mini-legend .sq { background: #c2bdb0; }
.mini-legend .dt { background: #8fae9a; border-radius: 50%; }
.mini-legend .dm { background: var(--gold); border-radius: 50%; }
/* 半透明态：不挡战场；指针移上去自动恢复清晰，方便对着地图点 */
.mini-float[data-mode="ghost"] { opacity: 0.4; }
.mini-float[data-mode="ghost"]:hover { opacity: 0.96; }
/* 隐藏态：只留标题条，随时能点开 */
.mini-float[data-mode="hidden"] { width: 92px; background: rgba(10, 15, 12, 0.5); }
.mini-float[data-mode="hidden"] .mini-body { display: none; }

/* 直播流 */
.feed-head { border-top: 1px solid var(--line); padding-top: 12px; }
.feed { flex: 1; overflow-y: auto; padding: 0 12px 16px; display: flex; flex-direction: column; gap: 3px; }
.feed-item {
  display: grid; grid-template-columns: 44px 1fr; gap: 8px;
  padding: 5px 6px; border-radius: 6px;
  font-size: 11px; line-height: 1.55;
  animation: slideIn .25s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.feed-item:hover { background: rgba(255, 255, 255, .04); }
.feed-t { font-family: var(--mono); font-size: 9.5px; color: var(--faint); padding-top: 1px; white-space: nowrap; }
.feed-x { color: var(--ink-2); }
.feed-x b { font-weight: 600; }
.feed-item[data-k="kill"] .feed-x { color: #d38f7c; }
.feed-item[data-k="destroy"] .feed-x { color: #dda06b; }
.feed-item[data-k="hero"] .feed-x { color: #b9a2e8; }
.feed-item[data-k="ability"] .feed-x { color: #86b6d8; }
.feed-item[data-k="diplomacy"] .feed-x { color: var(--accent); font-weight: 500; }
.feed-item[data-k="say"] .feed-x { font-style: italic; color: #9fb0a4; }
.feed-item[data-k="victory"] .feed-x { color: var(--gold); font-weight: 700; }
.feed-item[data-k="eliminate"] .feed-x { color: var(--danger); font-weight: 600; }
.feed-item[data-k="sudden"] .feed-x { color: var(--danger); font-weight: 600; }

/* 胜利面板
   层级必须高于"游戏内一切浮层"：单位详情 z40、框选叠加 z5、选择栏 z86、
   军师 dock z8x。以前写 20，选中单位后进入终局，战报会被详情面板压住一半。 */
/* 结算：先铺一张"战后黎明"的关键美术，再压暗到只剩轮廓，
   让面板浮在画面之上。纯半透明黑底会让结算像一张弹窗，而不像"这一局结束了"。 */
.victory {
  position: absolute; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: rgba(6, 9, 7, .66);
  backdrop-filter: blur(3px) saturate(.85);
  animation: fadeIn .4s;
  isolation: isolate;
}
.victory::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background: url(assets/art/victory-bg.jpg) center 42% / cover no-repeat;
  opacity: .62;
  animation: vcPush 26s ease-out both;
}
@keyframes vcPush { from { transform: scale(1.08); } to { transform: scale(1); } }
.victory::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(72% 62% at 50% 44%, rgba(6, 9, 7, .18) 0%, rgba(6, 9, 7, .82) 72%, rgba(6, 9, 7, .95) 100%),
    linear-gradient(180deg, rgba(6, 9, 7, .55), transparent 30%, rgba(6, 9, 7, .6));
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.victory-card {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 27, 24, .97) 0%, rgba(13, 19, 17, .99) 60%, rgba(10, 15, 13, .99) 100%);
  border: 1px solid rgba(207, 162, 90, .2);
  border-radius: 18px;
  padding: 24px 32px 22px;
  text-align: center;
  width: min(560px, 92%);
  max-height: 92vh;
  /* 标准模态结构：头/尾固定，中间滚动。否则内容一多，"再战"按钮会被挤出屏幕 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
}
.victory-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;         /* 给滚动条留位，避免文字贴边 */
  scrollbar-width: thin;
}
/* 内容超出时底部渐隐，暗示"还能往下滚"，避免最后一行像被按钮压住 */
.victory-body::after {
  content: ''; position: sticky; bottom: 0; display: block;
  height: 20px; margin-top: -20px; pointer-events: none;
  background: linear-gradient(transparent, var(--card));
}
.victory-card > h2, .victory-card > p, .victory-card > .victory-kicker { flex: 0 0 auto; }
.victory-actions { flex: 0 0 auto; padding-top: 4px; }
.victory-kicker { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.victory-card h2 { font-family: var(--serif); font-size: 30px; margin: 6px 0 4px; letter-spacing: -.02em; }
.victory-card p { font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.victory-stats { display: flex; flex-direction: column; gap: 0; margin: 12px 0 2px; text-align: left; }
/* 用 grid 而不是 flex：现在每行有两行数据（统计 + 峰值），flex 会把它们挤成一条 */
.vs-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1px 10px; align-items: baseline;
  font-size: 11px; padding: 5px 0; border-bottom: 1px dashed var(--line-2);
}
/* 头像在行首（56px 画布按 26px 显示）。名字用 first-of-type 而不是 first-child：
   头像 canvas 插进来后 first-child 不再是名字，整行会掉进自动流里错位。 */
.vs-face {
  grid-area: 1 / 1; width: 26px; height: 26px; border-radius: 50%;
  align-self: center; background: #151b20;
}
.vs-row > span:first-of-type { grid-area: 1 / 2; }
.vs-row > b { grid-area: 1 / 3; font-family: var(--mono); }
.vs-row > .vs-nums {
  grid-column: 1 / -1;
  color: var(--muted); font-size: 10.5px; line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 冠军行高亮：观众第一眼要看到谁拿了第一 */
.vs-row.champ { background: linear-gradient(90deg, rgba(212,175,55,.10), transparent 70%); }
.vs-row.champ > span:first-of-type, .vs-row.champ > b { font-weight: 700; }
/* 名次徽章：金/银/铜/垫底，一眼读出名次 */
.rank-badge {
  display: inline-block; padding: 1px 6px; margin-right: 5px; border-radius: 3px;
  font-size: 10px; font-weight: 700; line-height: 1.4; vertical-align: 1px;
  background: rgba(255,255,255,.08); color: var(--muted); font-family: var(--sans);
}
.rank-badge.r1 { background: linear-gradient(135deg, #d4af37, #f0d878); color: #241c04; }
.rank-badge.r2 { background: linear-gradient(135deg, #9aa7b4, #cdd6df); color: #1a2027; }
.rank-badge.r3 { background: linear-gradient(135deg, #a86a3c, #d19a6b); color: #241202; }
.rank-badge.rlast { background: rgba(160,60,60,.25); color: #e08a8a; }
/* 奖项条：MVP + 超神 */
.awards-bar {
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid var(--line-2); border-left: 3px solid var(--gold); border-radius: 4px;
  background: rgba(212,175,55,.05); font-size: 11.5px;
}
.award-line.mvp { color: var(--gold); font-weight: 600; }
.award-line.godlike { color: #e79a3c; font-weight: 600; }
.award-line.dim { color: var(--muted); }
.award-line .tiny { font-weight: 400; margin-left: 6px; }

/* 战后复盘：曲线 + 关键节点 */
.recap { text-align: left; }
.recap-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); margin: 14px 0 5px;
}
.recap-head .tiny { letter-spacing: 0; text-transform: none; font-size: 10px; }
#victoryTrend { display: block; width: 100%; height: 88px; }
.recap-legend { display: flex; flex-wrap: wrap; gap: 3px 12px; margin: 6px 0 0; font-size: 10px; color: var(--muted); }
.recap-legend span { display: inline-flex; align-items: center; gap: 4px; }
.recap-legend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
/* 列表给足下沿留白：否则最后一条会被下面的按钮压掉半个字，看着像渲染坏了 */
.recap-moments { display: flex; flex-direction: column; gap: 3px; padding-bottom: 4px; }
.recap-item { display: flex; gap: 9px; font-size: 11px; line-height: 1.3; }
.recap-item.dim { color: var(--muted); }
.recap-t { flex: 0 0 38px; font-family: var(--mono); font-size: 10px; color: var(--muted); padding-top: 1px; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 4px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .28); background-clip: content-box; }

@media (max-width: 1180px) {
  .main { grid-template-columns: 264px minmax(0, 1fr); }
  .rail-right { display: none; }
}

/* 模型载入提示（三维模式首次进入时短暂出现） */
.loadhint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(12, 20, 17, 0.82);
  color: #e8f0ea;
  font-size: 12px;
  letter-spacing: 0.06em;
  pointer-events: none;
  z-index: 20;
  backdrop-filter: blur(4px);
}

/* 结算面板的尺寸/排版统一在上面「胜利面板」一节定义，这里不再重复覆盖。
   曾经这里有一份 width/flex 的旧规则把上面的 grid 布局又盖回 flex，
   导致新加的第二行数据被压成一行——同一属性只留一个来源。 */
.victory-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.victory-actions .primary, .victory-actions .ghost { flex: 1 1 0; }

/* 窄屏（平板 / 小窗）：收起侧栏，战场占满，控制条换行 */
@media (max-width: 900px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .rail-left { display: none; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .clock { display: none; }
  .controls { flex-wrap: wrap; row-gap: 6px; }
  .victory-card { padding: 26px 22px 22px; }
  .victory-actions { flex-direction: column; }
}

/* ═══════════ 势力趋势图 ═══════════ */
.trend {
  padding: 0 14px 12px;
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 12px;
}
.trend-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; gap: 8px;
}
.trend-head h3 {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.trend-tabs { display: flex; gap: 1px; background: rgba(255, 255, 255, .04); border-radius: 6px; padding: 2px; }
.trend-tabs button {
  border: 0; background: transparent; font-size: 10px; color: var(--muted);
  padding: 3px 6px; border-radius: 5px; cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.trend-tabs button:hover { color: var(--ink); }
.trend-tabs button.on { background: rgba(207, 162, 90, .16); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(207, 162, 90, .3); }
#trendChart {
  width: 100%; height: 106px; display: block;
  border-radius: 8px; background: #0c1310; border: 1px solid var(--line-2);
}
.trend-legend {
  display: flex; flex-wrap: wrap; gap: 4px 11px;
  margin-top: 7px; font-size: 10px; color: var(--muted);
}
.trend-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.trend-legend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.trend-legend b { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ═══════════ 转播字幕（下三分之一） ═══════════ */
.lower-third {
  position: absolute; left: 16px; bottom: 16px; z-index: 6;
  display: flex; align-items: flex-start; gap: 10px;
  max-width: min(600px, calc(100% - 32px));
  padding: 9px 14px 9px 10px;
  background: linear-gradient(90deg, rgba(10, 16, 13, .93), rgba(10, 16, 13, .74));
  border-left: 3px solid var(--gold);
  border-radius: 3px 10px 10px 3px;
  backdrop-filter: blur(6px);
  color: #eef3ee; font-size: 12.5px; line-height: 1.55;
  pointer-events: none;
  animation: ltIn .32s ease-out;
}
.lower-third[hidden] { display: none !important; }
.lt-tag {
  flex: 0 0 auto; margin-top: 1px;
  font-size: 9.5px; letter-spacing: .18em; color: #e0bd7a;
  border: 1px solid rgba(224, 189, 122, .45); border-radius: 4px; padding: 2px 6px;
}
.lt-text { flex: 1 1 auto; }
@keyframes ltIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

/* 直播条目可点击定位 */
.feed-item.jump { cursor: pointer; }
.feed-item.jump:hover { background: var(--accent-soft); }

/* 战局时间轴：右下角的可点击进度带，与大解说字幕（左下）错开 */
.tl {
  position: absolute; right: 16px; bottom: 14px; z-index: 5;
  width: min(44%, 520px); height: 46px;
  background: linear-gradient(180deg, rgba(10, 16, 13, .55), rgba(10, 16, 13, .78));
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  cursor: pointer;
}
.tl:hover { border-color: rgba(230, 192, 115, .4); }

/* 窄屏：时间轴拉通铺到底部，解说字幕上移一格，避免互相压住 */
@media (max-width: 980px) {
  .tl { left: 12px; right: 12px; width: auto; bottom: 8px; height: 40px; }
  .lower-third { bottom: 58px; max-width: calc(100% - 24px); left: 12px; }
}

/* 结算面板的关键节点：合并复盘与高光后的一行一条，带可选回看按钮 */
.recap-item { align-items: baseline; }
.recap-text { flex: 1 1 auto; min-width: 0; line-height: 1.45; }
.replay-kind { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.replay-kind.k-clash { background: #e05a4c; }
.replay-kind.k-hero { background: #e6c073; }
.replay-kind.k-item { background: #4aa88a; }
.replay-kind.k-elim { background: #f2f2f2; }
.replay-kind.k-sudden { background: #c9a227; }
button.xs { font-size: 10.5px; padding: 3px 10px; flex: 0 0 auto; }

/* 回看按钮：默认轻量到只剩文字，悬停才浮出边框，避免列表被按钮切割 */
.recap-item .ghost.xs {
  background: transparent; border-color: transparent; color: var(--faint);
  padding: 2px 8px; transition: color .12s, border-color .12s, background .12s;
}
.recap-item .ghost.xs:hover { color: var(--ink); border-color: var(--line-2); background: var(--paper-2); }

/* ══════════════ 收藏的地图（大厅 · 种子收藏） ══════════════ */
.seed-favs { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.seed-fav {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--paper-2);
}
/* 收藏行：种子号 + 人数（单行不换行）+ 备注输入框 + 两个动作按钮。
   以前把备注也塞进左侧摘要，一行被挤成三行、每条高度都不一样；
   备注已经有输入框在显示，摘要里再抄一遍纯属占地方。 */
.seed-fav-main { display: flex; align-items: baseline; gap: 6px; flex: 0 0 auto; }
.seed-fav-main b { font-size: 12px; letter-spacing: .5px; white-space: nowrap; }
.seed-fav-main span { font-size: 10px; color: var(--ink-3, #8a928a); white-space: nowrap; }
.seed-fav-note {
  flex: 1 1 auto; min-width: 60px; font-size: 11px; padding: 4px 7px;
  border-radius: 7px; border: 1px solid var(--line); background: transparent; color: inherit;
}
.seed-fav-note:focus { outline: none; border-color: var(--line-2); }
.seed-fav .ghost.xs { flex: 0 0 auto; white-space: nowrap; }

/* ══════════════ 单位详情面板（点选单位后显示） ══════════════
   三张**独立卡片**横排：① 属性（头像+身份+属性） ② 技能 ③ 背包·装备。
   以前是一整条 flex 行，靠 8px 间距分区，读起来是一整块 —— 用户反馈
   "不要把所有组件同时放在大容器里"。现在每张卡自带边框与内间距，
   卡片之间是**空隙**而不是同色背景，叠在战场上也能一眼分清边界。
   总高仍压在 ~92px：卡片是横向摊开的，不是往回堆。 */
.unitpanel {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: flex; align-items: stretch; justify-content: center; flex-wrap: wrap; gap: 6px;
  padding: 6px; border-radius: 12px;
  background: rgba(10, 14, 20, 0.9); border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  z-index: 40;
  /* width:max-content = "按单行排开的理想宽度"，再用 max-width 夹到可用宽度。
     只写 max-width 不行：绝对定位元素的 width:auto 是 shrink-to-fit，
     flex-wrap 会把它压成很窄的一条竖排（实测 360px 宽、262px 高）。
     max-content + max-width 的组合语义正好是"能一行就一行，装不下才换行"。 */
  width: max-content; max-width: calc(100% - 20px);
  font-size: 12px; color: #e8e4da;
  backdrop-filter: blur(6px);
}
.unitpanel[hidden] { display: none; }

/* 卡片：每块自带边框与内边距，是"独立组件"而不是"长条里的一段" */
.up-card {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 9px; border-radius: 9px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.09);
  flex: 0 0 auto;
}
.up-card[hidden] { display: none; }
/* 卡片小标题：技能 / 背包。9px 灰字横排，只做分区标注，不抢内容。
   压在内容上方而不是竖排在左侧：竖排中文在 9px 下几乎认不出字，
   而且会把卡片高度撑到内容之外。 */
.up-cap {
  font-style: normal; font-size: 9px; letter-spacing: 0.08em;
  color: #8f978f; line-height: 1; padding: 0 1px;
}

/* ① 身份段：头像 + 名字 + 血/蓝条 */
.up-left { display: flex; gap: 9px; align-items: center; flex: 0 0 auto; }
.up-portrait { position: relative; flex: 0 0 auto; }
.up-portrait span {
  display: flex; width: 46px; height: 46px; border-radius: 9px; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 700; color: rgba(255,255,255,0.94);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.22);
}
/* 等级徽章（用户需求 3）：压在头像右下角，18px 金色数字 + 深底描边。
   英雄等级是这个面板里玩家最想确认的数字，必须能"扫一眼就看到"，
   所以它不在文字流里，而是像 war3 那样贴在头像上、带自己的底色。 */
.up-level {
  /* 压在**右上角**而不是右下角：右下角正好是 buff 图标条的位置，
     两者叠在一起（截图实测）会让人以为 buff 是等级的一部分。 */
  position: absolute; right: -4px; top: -4px;
  min-width: 17px; height: 17px; padding: 0 3px;
  border-radius: 9px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono, monospace); font-size: 12px; font-weight: 800; line-height: 1;
  color: #1b1508; background: linear-gradient(180deg, #ffe08a, #e8b53e);
  border: 1px solid rgba(20,16,6,0.85);
  box-shadow: 0 1px 4px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,224,138,0.35);
}
/* 满级：换成暗红金，和"还能不能吃经验"这个状态绑定 */
.up-level.max { background: linear-gradient(180deg, #ffc46a, #d0561f); color: #1c0d04; }
.up-identity { display: flex; flex-direction: column; gap: 2px; width: 110px; }
.up-identity b { font-size: 12.5px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-identity > span { font-size: 10px; color: #a8b0a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 阵营徽标（用户需求 4）：详情身份行里的 8px 色块，颜色由内联 background 提供 */
.up-fac {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  margin-right: 4px; vertical-align: -1px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4), 0 0 4px rgba(0,0,0,0.35);
}
.up-bars { display: flex; flex-direction: column; gap: 3px; margin-top: 1px; }
.up-bar {
  position: relative; height: 7px; border-radius: 4px; overflow: hidden;
  background: rgba(255,255,255,0.1);
}
.up-bar i { display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #4aa85a, #8fe08a); transition: width .2s; }
.up-bar.up-mp i { background: linear-gradient(90deg, #4a6fc0, #8fb0ff); }
.up-bar em {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-style: normal; color: rgba(255,255,255,0.9); text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* ② 属性段：**固定宽度的 4 列网格**（英雄 13 项属性也只有 4 行）。
   踩过的坑：原来写的是 flex-wrap + max-width:250px，而没有固定宽度——
   面板是 flex 行，右侧技能栏 + 装备网格（7 列×3 行）宽度一旦变大，
   属性段就会被 flex-shrink 压到 60px 宽，每行只放得下一项。
   截图里"攻击/护甲/移速/攻速…"竖成一长条、面板被顶到 150px 高，
   根因就是这里没有固定宽度（max-width 挡不住 shrink）。
   固定 4 列 + 固定总宽之后，无论多少项都只占 3~4 行。 */
.up-stats {
  /* auto-fit + minmax(50px)：宽的时候自动排 4 列、窄的时候自动退到 3 列。
     固定总宽保证它**永远不会被 flex 压成一列**，列数则交给空间决定。 */
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px 9px; align-content: center; align-items: baseline;
  flex: 0 0 204px; width: 204px;
}
.up-stat {
  display: flex; flex-direction: row-reverse; justify-content: flex-start;
  align-items: baseline; gap: 3px; line-height: 1.22; min-width: 0;
}
.up-stat b {
  font-family: var(--mono, monospace); font-size: 11px; color: #ffd166;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.up-stat span { font-size: 9px; color: #98a098; white-space: nowrap; }
/* 长数值跨两列：3 列网格里单格只有 ~50px，"1299/1519" 会被省略号截断成"129…" */
.up-stat.wide { grid-column: span 2; }

/* ②b 状态栏：war3 式 buff/debuff 图标（增益蓝框 / 减益红框，右下角剩余秒数）。
   限宽限高：光环多的英雄 buff 可能同时挂七八个，不封顶会把面板挤爆。 */
.up-buffs {
  display: flex; flex-wrap: wrap; gap: 2px; align-content: flex-start;
  flex: 0 0 auto; max-width: 120px; max-height: 23px; overflow: hidden; margin-top: 1px;
}
.up-buff {
  position: relative; width: 19px; height: 19px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(120,180,255,0.55);
  cursor: help;
}
.up-buff.bad { border-color: rgba(255,110,90,0.6); background: rgba(255,90,70,0.08); }
.up-buff i { font-size: 11.5px; font-style: normal; line-height: 1; }
.up-buff em {
  position: absolute; right: -1px; bottom: -2px; font-style: normal;
  font-family: var(--mono, monospace); font-size: 8px; font-weight: 700;
  color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000;
}

/* 宽屏（≥1280，战区 ≥900px）：属性段可以放宽到 4 列，13 项从 5 行降到 4 行。
   单格 66px 仍然放得下 "1.00/s" 这类 6 字符复合值，不会触发截断。 */
@media (min-width: 1280px) {
  .up-stats { flex: 0 0 264px; width: 264px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ③ 技能段：必须一行排开（英雄带宝石技能会有 5 个） */
/* 技能卡（用户需求 1）：3 列 × 自动行 = 5 个技能排成 3+2 两排。
   以前是 nowrap 一长条，5 个技能摊开占掉 ~180px 宽度，右侧却空着；
   换成两排之后宽度降到 ~110px，把省下的空间让给属性和装备。
   列数固定 3 而不是 auto-fit：技能数量在 1~6 之间变化，
   auto-fit 会让"3 个技能"和"6 个技能"的面板宽度跳变，面板左右乱跳比留白更难看。 */
.up-skills {
  display: grid; grid-template-columns: repeat(3, auto);
  gap: 4px; align-items: center; flex: 0 0 auto;
}
.up-skill {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  width: 28px; padding: 2px 0 2px; border-radius: 7px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.09);
  position: relative; cursor: help;
}
.up-skill i { font-size: 13px; font-style: normal; line-height: 1.1; }
.up-skill b { font-size: 7.5px; font-weight: 600; color: #ffd166; white-space: nowrap; }
.up-skill.dim { opacity: 0.4; }
/* 冷却中：图标去色但数字要看得清，所以不减整块透明度（以前 opacity .55 会把读秒一起压暗） */
.up-skill.cd { filter: grayscale(0.75); }
/* 技能 CD 遮罩：锥形渐变从 12 点顺时针扫回，中间压剩余秒数（war3 式读秒） */
.up-skill .up-cd {
  position: absolute; inset: -1px; display: none; border-radius: 7px; pointer-events: none;
  background: conic-gradient(rgba(6, 10, 14, 0.82) calc(var(--p, 0) * 360deg), rgba(6, 10, 14, 0) 0);
}
.up-skill .up-cd em {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-style: normal; font-family: var(--mono, monospace); font-size: 13px; font-weight: 700;
  color: #fff; text-shadow: 0 1px 3px #000, 0 0 6px rgba(0, 0, 0, 0.95);
}
/* 最后一秒变暖色：读秒快好了要有"准备按键"的暗示 */
.up-skill.cd-soon .up-cd em { color: #ffe08a; }
.up-slot { cursor: help; }

/* ④ 背包·装备卡（用户需求 2）：**两块独立网格 + 中间一条分隔线**。
   旧版把 13 装备格和 6 背包格用 display:contents 汇进同一个 7 列网格，
   19 格连成一片，玩家分不清哪 13 格是身上穿的、哪 6 格是包里装的。
   现在：背包 6 格一行（虚线边=随身携带）、一条横线、装备 13 格（7+6 两行，实线边=穿戴中）。
   两个容器各自成网格，行数/列数互不影响，中间那条线是硬边界。 */
.up-card--skill, .up-card--items { flex-direction: column; align-items: stretch; gap: 4px; }
.up-slots {
  display: grid; grid-template-columns: repeat(7, 19px); grid-auto-rows: 19px;
  gap: 2px; justify-content: start;
}
.up-slots.up-bag { grid-template-columns: repeat(6, 19px); }
/* 背包格虚线：实线=穿戴中、虚线=随身携带，不靠颜色也能读出来 */
.up-bag .up-slot { border-style: dashed; }
/* 分隔线：两端渐隐的细线 + 中间"装备"字样。
   纯一条 1px 线在半透明 HUD 上很容易和格子边框混成一片，
   加一个居中的小标签才能让人一眼看出"线以下是另一类东西"。 */
.up-sep { display: flex; align-items: center; gap: 4px; padding: 1px 0; }
.up-sep s { flex: 1 1 auto; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.26)); }
.up-sep s:last-child { background: linear-gradient(90deg, rgba(255,255,255,0.26), rgba(255,255,255,0)); }
.up-sep em { font-style: normal; font-size: 8.5px; color: #9aa39a; letter-spacing: 0.08em; }
.up-slot {
  position: relative; width: 19px; height: 19px; border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.up-slot.empty { opacity: 0.32; }
.up-slot > span { font-size: 9px; color: #8a928a; }
.up-slot svg { position: absolute; inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); }
.up-slot em { display: none; }        /* 名称靠 title 提示，格子里只留图标 */
.up-slot .up-count {
  position: absolute; top: -1px; right: 0; font-size: 8px; font-weight: 700;
  color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000;
}

/* 神器格：金色内辉光 + 缓慢呼吸 + 角上一点星芒。
   与普通/史诗格的差别要在 24px 里就能认出来，所以给的是"持续在动"的光，
   而不是静态描边——静态描边在暗色 HUD 上和史诗紫几乎看不出层级差。 */
.up-slot.artifact {
  border-color: #ffcf5a !important;
  animation: artBreath 2.6s ease-in-out infinite;
}
.up-slot.artifact::after {
  content: ''; position: absolute; inset: 0; border-radius: 5px; pointer-events: none;
  background: radial-gradient(circle at 50% 55%, rgba(255,207,90,0.30), rgba(255,207,90,0) 68%);
}
@keyframes artBreath {
  0%, 100% { box-shadow: 0 0 3px rgba(255,207,90,0.42), inset 0 0 5px rgba(255,207,90,0.30); }
  50%      { box-shadow: 0 0 9px rgba(255,207,90,0.85), inset 0 0 8px rgba(255,207,90,0.55); }
}

/* 窄屏（战场区 < 900px）：属性段先让位，保证不压到右侧直播栏 */
@media (max-width: 1100px) {
  .unitpanel { gap: 8px; }
  /* 窄屏改成 3 列 + 更小的格子：固定总宽跟着列数一起缩，不会再把面板顶高 */
  /* 186px / 3 列 ≈ 每格 56px：刚好放下 "1.00/s" 这种 6 字符的复合值。
     面板总宽也压得住 720px 的战区（再宽就会换行，面板高度从 88 涨到 164）。 */
  .up-stats { flex: 0 0 186px; width: 186px; gap: 1px 7px; }
  .up-stat b { font-size: 10.5px; }
  .up-stat span { font-size: 8.5px; }
  .up-identity { width: 110px; }
  /* 装备格也必须跟着缩：漏了这一处，19px 的基础规则会被 21px 覆盖，
     面板总宽超出 4px → 触发换行 → 高度从 88 涨到 163（整块又变成挡战场）。 */
  .up-slots { grid-template-columns: repeat(7, 18px); grid-auto-rows: 18px; }
  .up-slots.up-bag { grid-template-columns: repeat(6, 18px); }
  .up-slot { width: 18px; height: 18px; }
}
/* 极窄屏兜底：允许换行，但不再放大格子。
   这里原来有一份"30px 大格子"的规则（早先给触屏做的），它把 7 列撑到 222px，
   三张卡加起来就超宽 → 换行 → 面板高度从 110 涨到 214，整块盖住下半屏。
   触屏尺寸应该由 .up-slot 的媒体查询统一决定，不能和布局规则打架。 */
@media (max-width: 860px) {
  .unitpanel { flex-wrap: wrap; max-height: 40vh; overflow: auto; }
}

/* ═══════════ 主菜单 · 模式选择（M0） ═══════════
   主机/手游主菜单的标准构图：全幅关键美术 → 上下压深 → 标题锚左下 →
   模式做成"整张卡就是一幅画"的艺术卡 → 底部四族徽记。
   美术本身是深色油画，所以只要保证文字压在"压深过的地面"上就有对比度，
   不需要给标题加色块底板（那会让画面显得像网页而不是游戏）。 */
.mode-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  overflow: auto;
  background: var(--bg);
  color: var(--ink);
}
.gate-bg {
  position: fixed;
  inset: 0;
  background: url(assets/art/menu-keyart.jpg) center 44% / cover no-repeat;
  transform: scale(1.04);
  animation: gateDrift 46s ease-in-out infinite alternate;
  will-change: transform;
}
/* 极慢的推镜：静态大图在菜单上会显得"死"，1.04→1.09 的呼吸足够让人感到画面是活的 */
@keyframes gateDrift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.09) translate3d(-1.4%, -1%, 0); }
}
.gate-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 10, 8, .92) 0%, rgba(7, 10, 8, .30) 28%, rgba(7, 10, 8, .52) 62%, rgba(7, 10, 8, .97) 100%),
    radial-gradient(125% 85% at 0% 104%, rgba(6, 9, 7, .97) 0%, rgba(6, 9, 7, .55) 46%, transparent 74%),
    radial-gradient(65% 55% at 100% 0%, rgba(207, 162, 90, .10), transparent 62%);
}
.gate-inner {
  position: relative;
  z-index: 2;
  min-height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 56px 24px;
  display: flex;
  flex-direction: column;
}

.gate-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.gate-brand { display: flex; align-items: center; gap: 12px; }
.gb-crest {
  width: 46px; height: 46px; flex: none;
  background: url(assets/art/logo-crest.png) center / contain no-repeat;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .85));
}
.gb-text b { display: block; font-family: var(--serif); font-size: 17px; letter-spacing: .14em; }
.gb-text i {
  display: block; font-style: normal; font-size: 9px; letter-spacing: .36em;
  color: var(--gold); opacity: .82; margin-top: 3px;
}
.gate-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(238, 241, 234, .48);
}
.gate-meta .gsep { width: 1px; height: 10px; background: rgba(255, 255, 255, .16); }

/* 标题区用 margin-top:auto 顶到下方，上方留给美术主体（那道裂开天空的光） */
.gate-stage { margin-top: auto; padding-top: 64px; }
.gate-hero h1 {
  font-family: var(--serif);
  font-size: clamp(52px, 7.4vw, 96px);
  line-height: .98;
  letter-spacing: -.035em;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-shadow: 0 4px 34px rgba(0, 0, 0, .9), 0 1px 0 rgba(0, 0, 0, .6);
}
.gate-hero h1 .sub {
  font-family: var(--sans);
  font-size: clamp(12px, 1.15vw, 15px);
  font-weight: 500;
  letter-spacing: .46em;
  color: var(--gold-2);
  text-transform: uppercase;
  margin-top: 12px;
  opacity: .92;
  text-shadow: none;
}
.gate-hero .hero-mark { margin-bottom: 16px; }
.gate-lede {
  margin-top: 18px;
  font-size: 13.5px;
  line-height: 1.8;
  color: rgba(238, 241, 234, .74);
  max-width: 52ch;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .95);
}

/* ── 模式艺术卡 ── */
.gate-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 34px;
  max-width: 920px;
}
.gate-card {
  position: relative;
  display: block;
  min-height: 252px;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  background: #0c1210;
  text-align: left;
  box-shadow: 0 20px 46px rgba(0, 0, 0, .55);
  transition: transform .22s cubic-bezier(.2, .7, .2, 1), border-color .22s, box-shadow .22s;
}
.gc-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(.95) brightness(1.02);
  transition: transform .7s cubic-bezier(.2, .7, .2, 1), filter .35s;
}
.gate-spectate .gc-art { background-image: url(assets/art/lobby-keyart.jpg); background-position: 50% 46%; }
.gate-versus  .gc-art { background-image: url(assets/art/card-versus.jpg);  background-position: 50% 34%; }
/* 压在美术上的渐变：上浅下深，让标题落在几乎全黑的地面上 */
.gate-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* 只压下半截：卡的上半部要能看见画，下半部要能读字 */
  background: linear-gradient(180deg, rgba(6, 9, 7, 0) 0%, rgba(6, 9, 7, .12) 34%, rgba(6, 9, 7, .72) 62%, rgba(6, 9, 7, .95) 100%);
}
.gate-card:hover {
  transform: translateY(-4px);
  border-color: rgba(207, 162, 90, .5);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .66), 0 0 0 1px rgba(207, 162, 90, .2), 0 0 44px rgba(207, 162, 90, .12);
}
.gate-card:hover .gc-art { transform: scale(1.055); filter: saturate(1.05) brightness(1.12); }
.gate-card:active { transform: translateY(-1px); }
.gate-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.gc-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(10, 15, 12, .72);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px);
  font-size: 10px;
  letter-spacing: .2em;
  color: rgba(238, 241, 234, .84);
}
.gc-tag-gold { border-color: rgba(207, 162, 90, .55); color: var(--gold-2); background: rgba(22, 15, 6, .72); }
.gc-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 58px 20px 16px;
}
.gc-body b {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: .01em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .95);
}
.gc-body p {
  font-size: 12.5px;
  line-height: 1.72;
  color: rgba(238, 241, 234, .74);
  text-shadow: 0 1px 10px rgba(0, 0, 0, .9);
}
.gc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.gc-meta { font-size: 10.5px; color: rgba(238, 241, 234, .42); }
.gc-cta { font-size: 12px; font-weight: 600; color: var(--gold-2); white-space: nowrap; }
.gate-card:hover .gc-cta { color: #fff2d6; }

/* ── 四族徽记 ── */
.gate-factions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
  max-width: 920px;
}
.gf {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .075);
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012));
  backdrop-filter: blur(8px);
  transition: border-color .18s, transform .18s, background .18s;
}
.gf:hover {
  border-color: rgba(207, 162, 90, .3);
  background: linear-gradient(180deg, rgba(207, 162, 90, .1), rgba(255, 255, 255, .015));
  transform: translateY(-1px);
}
.gf img { width: 46px; height: 46px; object-fit: contain; flex: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .8)) saturate(1.05); }
.gf b { display: block; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.gf span { display: block; font-size: 10px; color: rgba(238, 241, 234, .45); margin-top: 2px; }

.gate-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 10.5px;
  color: rgba(238, 241, 234, .34);
}
.gate-foot .dot { opacity: .5; }

/* ── 回退说明面板（对战脚本未加载时） ── */
.gate-panel {
  position: relative;
  z-index: 3;
  width: min(940px, calc(100% - 40px));
  margin: 48px auto;
  padding: 30px 34px 28px;
  background: rgba(13, 19, 17, .96);
  border: 1px solid rgba(207, 162, 90, .2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-m);
  backdrop-filter: blur(12px);
}
.gate-panel h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -.01em;
}
.gp-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid rgba(207, 162, 90, .28);
  color: var(--gold-2);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: .14em;
  font-weight: 500;
}
.gp-lede { margin-top: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.gp-list { margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.gp-list li {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.gp-list li:last-child { border-bottom: none; padding-bottom: 0; }
.gp-list b { font-weight: 600; color: var(--gold-2); }
.gp-note { margin-top: 18px; font-size: 11.5px; color: var(--faint); line-height: 1.7; }
.gp-note code { font-family: var(--mono); background: rgba(255, 255, 255, .06); padding: 1px 5px; border-radius: 4px; }
.gate-back {
  margin-bottom: 18px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .04);
  font-size: 11.5px;
  color: var(--ink-2);
}
.gate-back:hover { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); }

.lobby-menu {
  position: fixed;
  left: 24px;
  bottom: 22px;
  z-index: 6;
  background: rgba(14, 20, 17, .9);
  border-color: rgba(255, 255, 255, .14);
  color: var(--ink-2);
  backdrop-filter: blur(8px);
}
.lobby-menu:hover { background: rgba(255, 255, 255, .1); color: var(--ink); }

/* 中等屏幕：标题和卡片一起缩，卡片高度不足以放下整段说明时先缩正文 */
@media (max-width: 1080px) {
  .gate-inner { padding: 22px 32px 20px; }
  .gate-stage { padding-top: 44px; }
  .gate-card { min-height: 210px; }
  .gc-body { padding: 52px 16px 14px; }
  .gc-body b { font-size: 22px; }
  .gc-body p { font-size: 12px; }
}
@media (max-width: 820px) {
  .gate-inner { padding: 18px 18px 16px; }
  .gate-cards { grid-template-columns: 1fr; gap: 12px; margin-top: 24px; }
  .gate-card { min-height: 176px; }
  .gate-factions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gate-meta { display: none; }
  .gate-lede { font-size: 12.5px; }
  .gp-list li { grid-template-columns: 1fr; gap: 2px; }
}

/* ═══════════════════════════════════════════════
   横屏移动端壳层（对战模式地基 · v0.4）
   目标形态：手机 App / 微信小程序，横屏，16:9 起。
   规则：所有贴边控件吃 --sa-*；键盘只改 --kb 不改布局尺寸。
   ═══════════════════════════════════════════════ */
:root {
  --sa-t: env(safe-area-inset-top, 0px);
  --sa-r: env(safe-area-inset-right, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-l: env(safe-area-inset-left, 0px);
  --kb: 0px;                     /* 软键盘占用的高度，由 mobile.js 写入 */
}

html[data-shell="mobile"] { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
html[data-shell="mobile"] body { touch-action: manipulation; }
html[data-shell="mobile"] #game { touch-action: none; }
html[data-shell="mobile"] .topbar {
  padding-left: max(10px, var(--sa-l));
  padding-right: max(10px, var(--sa-r));
}
html[data-shell="mobile"] .lobby-inner {
  padding-left: max(20px, var(--sa-l));
  padding-right: max(20px, var(--sa-r));
}
html[data-shell="mobile"] .lobby-menu {
  left: max(16px, var(--sa-l));
  bottom: max(14px, var(--sa-b));
}
html[data-shell="mobile"] .mode-gate {
  padding-left: max(20px, var(--sa-l));
  padding-right: max(20px, var(--sa-r));
  padding-top: max(24px, var(--sa-t));
  padding-bottom: max(24px, var(--sa-b));
}

/* ── 竖屏门 ── */
.rotate-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: #f2f4f3;
  background:
    radial-gradient(700px 420px at 50% 0%, rgba(63, 143, 106, .22), transparent 62%),
    #0d1210;
}
.rg-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 320px; }
.rg-phone {
  width: 46px; height: 78px;
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 10px;
  position: relative;
  animation: rg-tilt 2.4s ease-in-out infinite;
}
.rg-phone::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 6px;
  width: 14px; height: 2px;
  margin-left: -7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .6);
}
@keyframes rg-tilt {
  0%, 18% { transform: rotate(0deg); }
  52%, 84% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}
.rg-inner b { font-family: var(--serif); font-size: 22px; letter-spacing: -.01em; }
.rg-inner p { font-size: 12.5px; line-height: 1.76; color: rgba(242, 244, 243, .66); }
.rg-skip {
  margin-top: 4px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  color: rgba(242, 244, 243, .78);
  font-size: 12.5px;
}
.rg-skip:active { background: rgba(255, 255, 255, .08); }

/* ── 横屏短屏（手机）压缩：844×390 / 932×430 这一档 ──
   观众端侧栏在手机上会吃掉战场宽度，收窄而不是堆叠。 */
@media (max-height: 560px) {
  .arena { grid-template-rows: 46px minmax(0, 1fr); }
  .topbar { gap: 10px; padding: 0 10px; }
  .brand small { display: none; }
  .brand b { font-size: 13px; }
  .clock { gap: 8px; }
  .clock-label { display: none; }
  .clock .mono, #clock { font-size: 15px; }
  .controls { gap: 6px; }
  .controls .ghost.sm { padding: 5px 8px; font-size: 11px; }
  .segmented.sm button { padding: 4px 7px; font-size: 11px; }
  .rail-head, .feed-head { padding: 9px 10px 7px; }
  .rail-head h3, .feed-head h3 { font-size: 11.5px; }
  .player-cards { padding: 0 8px 6px; gap: 6px; }
  .pc-name { font-size: 11.5px; }
  .mind { display: none; }          /* 手机上纵深有限，心智面板让位给战场 */
  .rail-right .feed { font-size: 11.5px; }
  .lobby-inner { padding-top: 22px; gap: 24px; }
  .hero h1 { font-size: clamp(34px, 6vw, 44px); }
  .gate-card { min-height: 0; padding: 18px 18px 16px; }
  .gate-card b { font-size: 22px; }
  .gate-card p { font-size: 12px; }
}

/* 对战面板底部动作区（M0.5 军师组件预览入口） */
.gp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.gp-actions .ghost {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--gold);
  border-radius: 9px;
  color: var(--gold);
  font-size: 12.5px;
  background: var(--gold-soft);
}
.gp-actions .ghost:hover { background: #f3e6c9; }
.gp-actions-hint {
  flex: 1 1 260px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--faint);
}

/* 手机横屏：战场满幅，但小地图不能丢（没小地图等于瞎打）。
   把右栏整体降级成右上角浮层，只留小地图本体；战况流在手机上是次要信息。 */
@media (max-height: 560px) and (max-width: 900px) {
  /* 手机横屏：战场满幅（单列），侧栏全部让位 */
  .main { grid-template-columns: minmax(0, 1fr); }
  .rail-right {
    display: block;
    position: fixed;
    right: calc(8px + var(--sa-r));
    top: calc(54px + var(--sa-t));
    width: 124px;
    height: auto;
    padding: 0;
    background: transparent;
    border: none;
    z-index: 8;
  }
  .rail-right .mini-wrap { padding: 0; }
  .rail-right .mini-legend, .rail-right .feed, .rail-right .trend { display: none; }
  .rail-right #minimap { border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .42); }
}

/* 手机横屏浮层只保留小地图：右栏其余节点（含战况直播标题）全部隐藏，
   否则标题会从浮层底部漏出来。 */
@media (max-height: 560px) and (max-width: 900px) {
  .rail-right > :not(.mini-wrap) { display: none !important; }
}

/* 932×430（iPhone 15 Pro Max 横屏）这类"宽但矮"的手机：
   宽度超过 900 不会命中单列规则，但右栏已在 1180 断点被隐藏，
   小地图会整个消失——所以这里单独补一条浮层，不改主栅格。 */
@media (max-height: 560px) and (min-width: 901px) and (max-width: 1180px) {
  .rail-right {
    display: block;
    position: fixed;
    right: calc(8px + var(--sa-r));
    top: calc(54px + var(--sa-t));
    width: 124px;
    height: auto;
    padding: 0;
    background: transparent;
    border: none;
    z-index: 8;
  }
  .rail-right .mini-wrap { padding: 0; }
  .rail-right > :not(.mini-wrap) { display: none !important; }
  .rail-right #minimap { border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .42); }
}

/* ══════════ 框选叠加层与多单位选择栏（用户需求：红警/星际式框选 + War3 式选择器）══════════
   叠加层独立于渲染器：二维走 Canvas2D、三维走 WebGL，两套绘制代码互不相干，
   所以"选框/选中圈"必须画在第三张透明画布上，否则切画质就丢反馈。 */
.sel-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 5; }

/* 左下角：压在军师 dock（56px 圆钮 + 14px 边距）之上，不抢它的位置 */
.sel-bar {
  position: absolute; z-index: 86;
  left: 12px; bottom: 78px;   /* 让开军师 dock（56px 圆钮 + 14px 边距） */
  pointer-events: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding: 7px 8px 6px; border-radius: 12px;
  background: rgba(12, 16, 14, .52);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .32);
  max-width: min(520px, calc(100% - 24px));
  font-family: var(--sans);
  animation: sel-in .16s ease-out;
}
@keyframes sel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sel-slots { display: flex; flex-wrap: wrap; gap: 5px; }
.sel-slot {
  position: relative; width: 40px; height: 40px; padding: 0; display: block;
  border-radius: 8px; cursor: pointer; overflow: hidden;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.sel-slot:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .4); }
.sel-slot.on {
  border-color: #ffd166;
  box-shadow: inset 0 0 0 1px #ffd166, 0 4px 14px rgba(255, 209, 102, .28);
}
.sel-slot canvas { display: block; pointer-events: none; }
.sel-hp {
  position: absolute; left: 3px; right: 3px; bottom: 2px; height: 3px;
  border-radius: 2px; background: rgba(0, 0, 0, .55); display: block;
}
.sel-hp b { display: block; height: 100%; border-radius: 2px; background: #5ad17f; transition: width .2s linear; }
.sel-hp b.hero { background: #ffd166; }
.sel-tag {
  position: absolute; right: 2px; top: 2px; font-style: normal; font-size: 9px; line-height: 1;
  padding: 1px 3px; border-radius: 4px; font-weight: 700;
  color: #0d1512; background: rgba(255, 209, 102, .92);
}
.sel-foot { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: #cfd8d3; }
.sel-foot b { font-size: 12px; color: #fff; }
.sel-foot em { font-style: normal; margin-left: auto; color: #8fa09a; }

/* 触屏：左下角已经被军师 dock 与虚拟摇杆占满，选择栏在上面只会挡住战场 */
html[data-shell="mobile"] .sel-bar { display: none; }

/* 行内复选框（人口上限的「无限人口」）：不能只写个裸 input，
   它必须和左侧数字框同高、同基线，否则一行里两个控件像两个世纪的产物。 */
.chk-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.chk-inline:hover { border-color: #cfc9b8; }
.chk-inline input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.chk-inline:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════════
   首页英雄名册（v5.0）
   ──────────────────────────────────────────────────────────────────
   参考 LoL 客户端与金铲铲的英雄墙：横向滚动、卡片常态"呼吸"、
   悬浮时按指针位置做 3D 倾斜 + 一道高光扫过。全部用 CSS 变量驱动，
   不在 JS 里跑 rAF（16 张卡 × 每帧 transform 会把低端机的帧率吃掉一半）。
   ══════════════════════════════════════════════════════════════════ */
.gate-roster {
  margin-top: 26px;
  width: 100%;
  max-width: 1180px;
}
.hr-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.hr-head b {
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--gold-2);
}
.hr-head span {
  font-size: 11.5px;
  color: rgba(226, 232, 226, .5);
}
.hr-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 138px;
  /* 右侧渐隐：暗示"还有更多"，比一根滚动条更能引导横向滑动 */
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 56px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 56px), transparent 100%);
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(207, 162, 90, .35) transparent;
  scroll-snap-type: x proximity;
}
.hr-rail::-webkit-scrollbar { height: 6px; }
.hr-rail::-webkit-scrollbar-thumb { background: rgba(207, 162, 90, .3); border-radius: 3px; }

/* 卡片本体：倾斜在外层，内容在里层，避免 3D 变换把文字糊掉 */
.hc {
  --ry: 0deg;
  --rx: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: block;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: linear-gradient(180deg, #121a17 0%, #0a0f0d 100%);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  transform-style: preserve-3d;
  transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0);
  transition: transform .16s ease-out, border-color .2s, box-shadow .25s;
  will-change: transform;
}
.hc:hover {
  border-color: color-mix(in srgb, var(--hc) 60%, transparent);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .55),
    0 0 0 1px color-mix(in srgb, var(--hc) 30%, transparent),
    0 0 26px color-mix(in srgb, var(--kc) 26%, transparent);
}
.hc-pic {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 10%, color-mix(in srgb, var(--hc) 22%, #0a0f0d), #0a0f0d 70%);
}
.hc-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
  /* 常态轻微放大 + 缓慢呼吸；hover 时再推近一点，读作"活过来了" */
  transform: scale(1.02);
  animation: hc-breathe 7s ease-in-out infinite;
  filter: saturate(1.02) contrast(1.03) brightness(1.14);
}
.hc:hover .hc-pic img {
  transform: scale(1.09);
  animation-play-state: paused;
  filter: saturate(1.12) contrast(1.06) brightness(1.04);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), filter .35s;
}
@keyframes hc-breathe {
  0%, 100% { transform: scale(1.02) translateY(0); }
  50% { transform: scale(1.045) translateY(-1.2%); }
}
/* 阵营色光晕：贴在立绘底部，像角色自己发的光 */
.hc-halo {
  position: absolute;
  inset: auto -10% -30% -10%;
  height: 62%;
  background: radial-gradient(60% 60% at 50% 100%, color-mix(in srgb, var(--hc) 55%, transparent), transparent 70%);
  opacity: .5;
  pointer-events: none;
  transition: opacity .3s;
}
.hc:hover .hc-halo { opacity: .85; }
/* 高光扫过：跟随指针位置的一道窄光 */
.hc-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(38% 60% at var(--mx) var(--my), rgba(255, 255, 255, .16), transparent 70%);
  opacity: 0;
  transition: opacity .25s;
  mix-blend-mode: screen;
}
.hc:hover .hc-sheen { opacity: 1; }

.hc-body {
  position: relative;
  display: block;
  padding: 8px 9px 9px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  background: linear-gradient(180deg, rgba(8, 12, 10, .2), rgba(8, 12, 10, .92));
}
.hc-fac {
  display: block;
  font-size: 9.5px;
  letter-spacing: .1em;
  color: color-mix(in srgb, var(--hc) 80%, #ffffff 20%);
  opacity: .85;
}
.hc-name {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: #f2f6f2;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hc-role {
  display: block;
  font-size: 10.5px;
  color: rgba(226, 232, 226, .45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 技能色标：四个小方块 = 这个英雄的四招分别是什么颜色 */
.hc-dots {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.hc-dots i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--sc);
  box-shadow: 0 0 6px var(--sc);
  opacity: .85;
  transition: transform .2s, opacity .2s;
}
.hc:hover .hc-dots i { transform: scaleX(1.25); opacity: 1; }

/* ── 英雄详情浮层 ── */
.hero-sheet {
  position: fixed;
  inset: 0;
  /* 必须高于 .mode-gate（120）：首页是 fixed 全屏层，浮层挂在 body 上，
     z-index 低于它就会被整页盖住 —— 表现为"点了没反应"（实测踩过）。 */
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 7, 6, .74);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}
.hero-sheet.open { opacity: 1; pointer-events: auto; }
.hs-card {
  position: relative;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  width: min(920px, 94vw);
  max-height: 88vh;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--fc) 40%, rgba(255, 255, 255, .1));
  background: linear-gradient(160deg, #131b18, #0a0f0d 60%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
  transform: translateY(10px) scale(.985);
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.hero-sheet.open .hs-card { transform: none; }
.hs-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(10, 14, 12, .7);
  color: #cfe0d6;
  cursor: pointer;
  font-size: 12px;
}
.hs-close:hover { border-color: var(--fc); color: #fff; }
.hs-art { position: relative; min-height: 320px; }
.hs-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  display: block;
}
.hs-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 9, 7, .1) 40%, rgba(10, 15, 13, .96) 100%);
}
.hs-fac {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: .14em;
  color: #0a0f0d;
  background: var(--fc);
  font-weight: 700;
}
.hs-info {
  padding: 22px 24px 20px;
  overflow-y: auto;
}
.hs-info h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: .03em;
  color: #f4f8f3;
}
.hs-prof {
  margin: 4px 0 10px;
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--gold-2);
}
.hs-desc {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.75;
  color: rgba(226, 232, 226, .72);
}
.hs-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.hs-stats span {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .035);
  font-size: 10.5px;
  color: rgba(226, 232, 226, .5);
}
.hs-stats b {
  display: block;
  font-size: 15px;
  color: #eef5ee;
  font-variant-numeric: tabular-nums;
}
.hs-skills { display: grid; gap: 8px; }
.hs-skill {
  display: grid;
  grid-template-columns: 18px 30px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-left: 2px solid var(--sc);
  background: linear-gradient(90deg, color-mix(in srgb, var(--sc) 12%, transparent), rgba(255, 255, 255, .02) 55%);
}
.hs-key {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(226, 232, 226, .4);
  text-align: center;
}
.hs-ico {
  font-size: 15px;
  line-height: 1;
  /* 技能图标是单字符（✦❄✚…），给足 30px 栏宽才不会压到技能名上 */
  display: grid;
  place-items: center;
  color: var(--sc);
  text-shadow: 0 0 10px var(--sc);
  text-align: center;
}
.hs-txt b {
  display: block;
  font-size: 12.5px;
  color: #eef5ee;
}
.hs-txt i {
  display: block;
  font-style: normal;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(226, 232, 226, .52);
}
.hs-cost {
  font-size: 10px;
  color: rgba(226, 232, 226, .42);
  white-space: nowrap;
}
.hs-cost b { color: #9fd0b4; }
.hs-note {
  margin: 14px 0 0;
  font-size: 10.5px;
  color: rgba(226, 232, 226, .38);
}
body.sheet-open { overflow: hidden; }

/* 窄屏：名册改小卡，详情改单列 */
@media (max-width: 860px) {
  .hr-rail { grid-auto-columns: 104px; }
  .hs-card { grid-template-columns: 1fr; }
  .hs-art { min-height: 190px; }
  .hs-art::after { background: linear-gradient(180deg, rgba(6, 9, 7, .05) 40%, rgba(10, 15, 13, .96) 100%); }
}
