/* ═══════════════════════════════════════════════
   对战 · 局内态样式（载入 / 倒计时 / 对手席 / 暂停 / 结算名次）

   与 versus.css 分开的原因：versus.css 是大厅与平台壳（登录、排行、房间），
   这个文件只在"进了战场之后"生效。局内 UI 改动最频繁，混在一起容易改坏大厅。

   设计口径（对齐 MULTIPLAYER.md §8.7/§8.8）：
   · 横屏手机为基准，触控 ≥44pt，只用 transform/opacity 做动效；
   · 对局中任何浮层都不能遮住战场中心（载入/暂停是例外，那两处本来就该挡住）。
   ═══════════════════════════════════════════════ */

/* ═══════════ 对手席（HUD 中段） ═══════════
   war3 / 金铲铲的对局里，玩家随时要知道"还剩几家、谁快死了"。
   只显示自己的资源会让人打到一半还不知道自己排第几。 */
.vs-hud-foes { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.vs-hud-foes .vs-foe { flex: 0 0 auto; }
/* 统计项绝不换行：HUD 挤压时应该截断对手席，而不是把「存活 4」竖着摞成两行 */
.vs-hud-stats span { white-space: nowrap; }
.vs-hud-stats .rs-g { color: #ffd166; }
.vs-hud-stats .rs-w { color: #a8d08d; }
.vs-hud-stats .rs-p { color: #9fc9e8; }
/* 操控模式开关：这是"整局怎么玩"的总开关，必须比旁边的暂停/认输更显眼。
   AI 军师态用描边（次要），纯手动态用实心金（当前状态值得一眼看到）。 */
.vs-hud-actions [data-k="control"] {
  border: 1px solid rgba(207, 162, 90, .55);
  color: var(--vs-gold-2, #f0d6a2);
  background: rgba(207, 162, 90, .12);
  font-weight: 600;
  letter-spacing: .02em;
}
.vs-hud-actions [data-k="control"]:hover { background: rgba(207, 162, 90, .22); }
.vs-hud-actions [data-k="control"][data-mode="manual"] {
  background: linear-gradient(180deg, #e8c68d, #c99b4e);
  color: #1a1206;
  border-color: rgba(255, 226, 176, .5);
  box-shadow: 0 0 0 1px rgba(207, 162, 90, .25), 0 4px 14px rgba(0, 0, 0, .35);
}
.vs-foe {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px 3px 3px; border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--vs-line-2);
  font-size: 10.5px; color: var(--vs-ink-2); line-height: 1;
  transition: opacity .18s ease, filter .18s ease, border-color .18s ease;
}
.vs-foe i {
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--fc) 26%, transparent);
  color: var(--fc); font-style: normal; font-size: 9px; font-weight: 700;
}
.vs-foe b { font-weight: 600; max-width: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-foe.me { border-color: color-mix(in srgb, var(--fc) 55%, transparent); color: var(--vs-ink); }
.vs-foe.dead { filter: grayscale(1); opacity: .42; }
.vs-foe.dead::after { content: "✕"; font-size: 9px; color: var(--vs-red); }
.vs-foe.offline { border-style: dashed; opacity: .6; }
.vs-foe.out { opacity: .3; text-decoration: line-through; }

/* ═══════════ 读取界面（载入阶段） ═══════════
   对标英雄联盟读条页：每个人一张立绘卡 + 自己的进度条。
   排版口径（为什么是这些数）：
     · 卡片 3:4 —— 和英雄原画同比例，脸与肩甲都在框内，裁切不会切到下巴；
     · 一行最多 4 张 —— 本作最大就是 4 人混战，不需要滚动；
     · 进度条压在卡片底部 —— 视线不用离开"这个人"就知道他装到哪了；
     · 单人卡宽 clamp(148px, 17vw, 208px)：1080p 下约 190px，四个人刚好铺满，
       720p 下退到 150px 也不会溢出。 */
.vs-load {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center; padding: 24px;
  color: var(--vs-ink);
  background:
    radial-gradient(1100px 620px at 50% 24%, rgba(79, 157, 120, .16) 0%, transparent 62%),
    radial-gradient(800px 500px at 50% 110%, rgba(207, 162, 90, .12) 0%, transparent 60%),
    #06090a;
  animation: vsFadeIn .22s ease both;
  overflow: hidden;
}
.vs-load::before {
  /* 极细的斜向纹理：纯色大背景在 OLED 上会显得"没加载完" */
  content: ""; position: absolute; inset: -20%;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.022) 0 1px, transparent 1px 7px);
  pointer-events: none;
}
.vs-load.out { animation: vsFadeOut .42s ease both; pointer-events: none; }
@keyframes vsFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes vsFadeOut { from { opacity: 1; } to { opacity: 0; } }

.vs-load-wrap {
  position: relative; width: min(1080px, 100%);
  display: grid; grid-template-rows: auto 1fr auto; gap: 18px;
}
.vs-load-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.vs-load-kicker {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 10.5px; letter-spacing: .18em; color: var(--vs-gold);
  border: 1px solid color-mix(in srgb, var(--vs-gold) 34%, transparent);
  background: color-mix(in srgb, var(--vs-gold) 8%, transparent);
}
.vs-load-title { margin: 10px 0 4px; font-size: 26px; font-weight: 600; letter-spacing: .02em; color: var(--vs-ink); }
.vs-load-sub { margin: 0; font-size: 12px; color: var(--vs-muted); }
.vs-load-sub b { color: var(--vs-ink-2); }
.vs-load-room { text-align: right; font-size: 10px; color: var(--vs-faint); line-height: 1.6; }
.vs-load-room b { display: block; font-size: 11.5px; color: var(--vs-ink-2); letter-spacing: .06em; }

/* ── 卡片 ── */
.vs-load-cards {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(8px, 1.4vw, 16px); flex-wrap: nowrap;
}
.vs-lc {
  position: relative; flex: 0 1 208px; min-width: 0;
  width: clamp(148px, 17vw, 208px);
  aspect-ratio: 3 / 4;
  border-radius: 12px; overflow: hidden;
  background: #12181a;
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
  transition: border-color .25s ease, transform .25s ease;
}
.vs-lc.me { border-color: color-mix(in srgb, var(--vs-gold) 62%, transparent); }
.vs-lc.me::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--vs-gold) 40%, transparent),
              inset 0 -40px 60px rgba(0, 0, 0, .5);
}
.vs-lc-art, .vs-lc-art canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.vs-lc-art canvas { object-fit: cover; }
.vs-lc-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 9, 10, .18) 0%, rgba(6, 9, 10, 0) 26%,
      rgba(6, 9, 10, .72) 66%, rgba(6, 9, 10, .96) 100%);
}
/* 阵营色只做一道底部光，不做整块染色：会让立绘的肤色/金属色失真 */
.vs-lc::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: linear-gradient(0deg, color-mix(in srgb, var(--fc) 26%, transparent), transparent 70%);
  pointer-events: none; mix-blend-mode: screen;
}
.vs-lc-seat {
  position: absolute; left: 8px; top: 8px;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; color: #dbe6ef;
  background: rgba(6, 9, 10, .62); border: 1px solid rgba(255, 255, 255, .12);
}
.vs-lc-you {
  position: absolute; right: 8px; top: 8px;
  padding: 1px 7px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; color: #1a1206;
  background: linear-gradient(180deg, #e8c68d, #c99b4e);
}
.vs-lc-dot {
  position: absolute; right: 9px; top: 9px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--vs-faint); opacity: .45;
  transition: background .2s ease, opacity .2s ease, box-shadow .2s ease;
}
.vs-lc.me .vs-lc-dot { top: 34px; }
.vs-lc-dot.on { background: var(--vs-green); opacity: 1; box-shadow: 0 0 10px var(--vs-green); }

.vs-lc-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 11px 11px; }
.vs-lc-name {
  display: block; font-size: 13px; font-weight: 600; color: #f2f6fa;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}
.vs-lc-hero {
  display: block; margin-top: 1px;
  font-size: 10.5px; color: color-mix(in srgb, var(--fc) 78%, #ffffff);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vs-lc-meta { display: block; margin-top: 2px; font-size: 9.5px; color: #93a0ac; }
.vs-lc-bar {
  margin-top: 7px; height: 3px; border-radius: 3px; overflow: hidden;
  background: rgba(255, 255, 255, .12);
}
.vs-lc-bar i {
  display: block; height: 100%; width: 3%; border-radius: 3px;
  background: linear-gradient(90deg, var(--vs-green), var(--vs-gold));
  transition: width .3s cubic-bezier(.22, .9, .24, 1);
}
.vs-lc-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 3px; }
.vs-lc-stage {
  font-size: 9px; color: #8b98a4; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 78%;
}
.vs-lc-num { font-family: var(--mono); font-size: 9.5px; color: #b9c6d2; }

/* ── 底部：提示 + 总线进度 ── */
.vs-load-foot { display: grid; gap: 7px; }
.vs-load-tip {
  font-size: 11.5px; color: #8fa0ad; text-align: center; min-height: 17px;
  animation: vsTipIn .5s ease both;
}
@keyframes vsTipIn { from { opacity: .2; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.vs-load-bar { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.vs-load-bar i {
  display: block; height: 100%; width: 4%; border-radius: 3px;
  background: linear-gradient(90deg, var(--vs-green), var(--vs-gold));
  transition: width .35s cubic-bezier(.22, .9, .24, 1);
}
.vs-load-line { display: flex; justify-content: space-between; align-items: baseline; }
.vs-load-status { font-size: 11px; color: var(--vs-ink-2); }
.vs-load-total { font-size: 11px; color: var(--vs-gold-2); }

/* 倒计时：压在卡片上方，超大字号 + 呼吸光，不能只靠一个数字 */
.vs-load-cd {
  position: fixed; left: 50%; top: 46%; transform: translate(-50%, -50%) scale(.9);
  font-family: var(--mono); font-size: 128px; line-height: 1; font-weight: 700;
  color: #fff2d2; opacity: 0; pointer-events: none;
  text-shadow: 0 0 60px rgba(207, 162, 90, .55), 0 0 18px rgba(0, 0, 0, .8);
  transition: opacity .18s ease, transform .28s cubic-bezier(.2, 1.5, .4, 1);
}
.vs-load-cd.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ═══════════ 暂停 / 同步遮罩 ═══════════ */
.vs-veil {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  color: var(--vs-ink);
  background: rgba(6, 9, 8, .58);
  backdrop-filter: blur(3px);
  animation: vsFadeIn .16s ease both;
}
.vs-veil-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 30px; border-radius: 14px;
  background: rgba(16, 22, 20, .92); border: 1px solid var(--vs-line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.vs-veil-box b { font-size: 14px; font-weight: 600; color: var(--vs-ink); }
.vs-veil-sub { font-size: 10.5px; color: var(--vs-faint); }
.vs-veil-ring {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .14);
  border-top-color: var(--vs-gold);
  animation: vsSpin .9s linear infinite;
}
@keyframes vsSpin { to { transform: rotate(360deg); } }

/* ═══════════ 结算名次 ═══════════ */
.vs-result-rank { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 6px 0 2px; }
.vs-rank-num {
  font-family: var(--mono); font-size: 52px; line-height: 1; font-weight: 700;
  color: var(--vs-gold-2); text-shadow: 0 0 26px color-mix(in srgb, var(--vs-gold) 45%, transparent);
}
.vs-rank-of { font-size: 14px; color: var(--vs-faint); }
.vs-result-host.in .vs-rank-num { animation: vsRankPop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes vsRankPop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 窄屏：对手席退化成图标条，别把 HUD 撑爆 */
@media (max-width: 900px) {
  .vs-hud-foes .vs-foe b { display: none; }
  .vs-hud-foes .vs-foe { padding: 3px; }
  .vs-hud-stats { gap: 8px; padding: 0 8px; }
}
@media (max-width: 900px) {
  /* 窄屏放不下四张 3:4 立绘：换成 2×2，卡片矮一点但仍然看清脸 */
  .vs-load-cards { flex-wrap: wrap; }
  .vs-lc { width: clamp(120px, 30vw, 168px); flex: 0 0 auto; }
  .vs-load-title { font-size: 21px; }
  .vs-load-cd { font-size: 88px; }
}
@media (max-width: 620px) {
  .vs-load { padding: 14px; }
  .vs-load-title { font-size: 19px; }
  .vs-rank-num { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .vs-load, .vs-load.out, .vs-veil, .vs-result-host.in .vs-rank-num { animation: none; }
  .vs-veil-ring { animation: none; }
}

/* 掉线托管：席位仍在打，只是没人下军师令 —— 用一个后缀说明，别让对手以为是 bug */
.vs-foe.bot::after { content: "托管"; font-size: 8px; color: var(--vs-muted); margin-left: 2px; }
.vs-foe.dead.bot::after { content: "✕"; }

/* 倒计时大数字：最后 3 秒的存在感，别让玩家盯着一条进度条干等 */
.vs-count-big {
  margin-top: 10px;
  height: 54px;
  font-family: var(--mono);
  font-size: 44px;
  line-height: 54px;
  font-weight: 700;
  color: var(--vs-gold-2);
  text-shadow: 0 0 24px color-mix(in srgb, var(--vs-gold) 40%, transparent);
}

/* ═══════════ 回放控制条 ═══════════
   只在 replayMode 出现：播放/暂停 + 可拖拽进度条 + 倍速。
   压在屏幕底部居中，避开顶部 HUD 与左下军师区；不遮战场中心。 */
.vs-replay {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 70;                       /* 低于暂停遮罩(80)与载入层(90)：定位中要能被盖住 */
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(12, 17, 15, .88);
  border: 1px solid var(--vs-line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px);
  color: var(--vs-ink);
  max-width: min(92vw, 640px);
}
.vs-replay-time {
  font-size: 11px;
  color: var(--vs-ink-2);
  white-space: nowrap;
  min-width: 88px;
  text-align: center;
}
.vs-replay-bar {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  width: 240px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .14);
  outline: none;
  cursor: pointer;
}
.vs-replay-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--vs-gold-2);
  border: 2px solid rgba(0, 0, 0, .5);
  box-shadow: 0 0 8px color-mix(in srgb, var(--vs-gold) 55%, transparent);
}
.vs-replay-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--vs-gold-2);
  border: 2px solid rgba(0, 0, 0, .5);
}
.vs-replay-bar:disabled { opacity: .35; cursor: default; }
.vs-replay-speeds { display: inline-flex; gap: 4px; }
.vs-replay-speeds .vs-btn.on {
  color: var(--vs-gold-2);
  border-color: color-mix(in srgb, var(--vs-gold) 55%, transparent);
}
/* 回放条占住底部 14px 起的一带：toast 上移，别糊在进度条上 */
body.vs-replay-open .vs-toasts { bottom: 86px; }
@media (max-width: 620px) {
  .vs-replay { width: calc(100vw - 24px); flex-wrap: wrap; }
  .vs-replay-bar { width: 100%; flex-basis: 100%; order: 3; }
  /* 窄屏 HUD 本来沉底，回放时再让开控制条 */
  body.vs-replay-open .vs-hud { bottom: 92px; }
}
