/* ==========================================================
 * 《决战哈姆》PVE 复刻 — UI 样式
 * 明亮卡通 + 圆角描边 + 金色点缀
 * ========================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gold: #ffcc44;
  --gold-d: #c8901e;
  --ink: #1d2433;
  --ink-soft: rgba(24, 30, 44, 0.72);
  --cyan: #4fd4e8;
  --hp: #3ddc84;
  --hp-d: #1f9c57;
  --shield: #8fe6ff;
  --danger: #ff4d6a;
  --purple: #b060ff;
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0b0f16;
  font-family: var(--font);
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

#app { position: relative; width: 100vw; height: 100vh; }
#game-canvas { display: block; width: 100%; height: 100%; }

.hidden { display: none !important; }

/* ==================== 伤害数字 ==================== */
#dmg-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}
.dmg-num {
  position: absolute; top: 0; left: 0;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  text-shadow:
    -2px 0 0 #2a1a00, 2px 0 0 #2a1a00, 0 -2px 0 #2a1a00, 0 2px 0 #2a1a00,
    0 3px 6px rgba(0, 0, 0, 0.55);
  will-change: transform, opacity;
}
.dmg-num.k-normal { color: #fff4d6; }
.dmg-num.k-head { color: #ffe27a; font-size: 26px; }
.dmg-num.k-crit { color: #ffd34d; font-size: 32px; }
.dmg-num.k-fate { color: #ff8adf; font-size: 34px; }
.dmg-num.k-burn { color: #ff8a3c; font-size: 25px; }
.dmg-num.k-heal { color: #5bf08c; font-size: 22px; }
.dmg-num.k-shield { color: var(--shield); font-size: 20px; }
.dmg-num.k-hurt { color: #ff6b81; font-size: 24px; }

/* ==================== 受伤红晕 ==================== */
#hurt-vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 18;
  opacity: 0;
  background: radial-gradient(ellipse at center,
    rgba(255, 0, 40, 0) 42%, rgba(255, 0, 40, 0.42) 100%);
  transition: opacity 0.14s ease-out;
}
#hurt-vignette.on { opacity: 1; }

/* ==================== HUD 通用 ==================== */
#hud {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 25;
  font-size: 14px;
}
#hud .clickable { pointer-events: auto; cursor: pointer; }

/* ---------- 左上 ---------- */
.hud-tl { position: absolute; top: 14px; left: 16px; }
.tl-btns { display: flex; gap: 10px; align-items: center; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(20, 26, 38, 0.62);
  border: 2px solid rgba(255, 255, 255, 0.55);
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto; cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}
.icon-btn:hover { transform: scale(1.08); background: rgba(40, 52, 74, 0.8); }

.ic-pause { display: flex; gap: 4px; }
.ic-pause i {
  display: block; width: 4px; height: 15px;
  background: #fff; border-radius: 1px;
}
.ic-bag {
  width: 19px; height: 17px;
  border: 2px solid #fff; border-radius: 3px;
  position: relative;
}
.ic-bag::before {
  content: ""; position: absolute;
  top: -6px; left: 4px;
  width: 9px; height: 5px;
  border: 2px solid #fff; border-bottom: none;
  border-radius: 3px 3px 0 0;
}
.key-tag {
  position: absolute; right: -5px; bottom: -6px;
  min-width: 16px; height: 15px;
  padding: 0 3px;
  background: rgba(12, 16, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 3px;
  font-size: 10px; line-height: 13px;
  text-align: center;
  font-weight: 700;
}

/* 参考图：每项一条独立的深色半透明横条（右端渐隐），白字白数，第二条标签偏紫 */
.stat-panel {
  margin-top: 12px;
  width: 250px;
  display: flex; flex-direction: column; gap: 5px;
}
.stat-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  height: 26px; padding: 0 12px 0 6px;
  background: linear-gradient(90deg, rgba(20, 24, 34, 0.72) 0%, rgba(20, 24, 34, 0.62) 75%, rgba(20, 24, 34, 0.3) 100%);
}
.stat-label { font-size: 14px; color: #f4f6fa; letter-spacing: 1px; }
.stat-val {
  font-size: 15px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.stat-row.sub .stat-label { color: #b9a2ff; }
.stat-row.sub .stat-val { color: #d9ccff; }

/* ---------- 顶部中间 ---------- */
.hud-top {
  position: absolute; top: 8px; left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
/* 参考图：波次与倒计时各自压在一块深色半透明底板上，数字白色 */
.wave-line {
  display: inline-block;
  padding: 3px 22px;
  font-size: 15px; font-weight: 700;
  color: #f4f7ff;
  letter-spacing: 1.5px;
  background: linear-gradient(90deg, rgba(20, 24, 34, 0) 0%, rgba(20, 24, 34, 0.66) 16%, rgba(20, 24, 34, 0.66) 84%, rgba(20, 24, 34, 0) 100%);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.wave-line span { color: #fff; font-size: 16px; }
.timer-line {
  margin: 5px auto 0;
  width: max-content;
  padding: 2px 16px 2px 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 22px; font-weight: 700;
  letter-spacing: 1px;
  background: rgba(20, 24, 34, 0.62);
  border-radius: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.timer-icon {
  width: 15px; height: 15px;
  border: 2px solid #fff; border-radius: 50%;
  position: relative;
}
.timer-icon::after {
  content: ""; position: absolute;
  top: 1px; left: 5px;
  width: 2px; height: 6px;
  background: #fff;
}
.timer-line.urgent { color: #ff5c72; }
.timer-line.urgent .timer-icon { border-color: #ff5c72; }
.timer-line.urgent .timer-icon::after { background: #ff5c72; }

/* ---------- BOSS 血条 ---------- */
.boss-bar {
  position: absolute; top: 62px; left: 50%;
  transform: translateX(-50%);
  width: min(620px, 68vw);
  display: flex; align-items: center; gap: 10px;
}
.boss-emblem {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe6a0, #d8a83c 60%, #8c5f10);
  border: 2px solid #fff6d8;
  box-shadow: 0 0 12px rgba(255, 170, 40, 0.7);
  position: relative;
}
.boss-emblem::after {
  content: ""; position: absolute; inset: 9px;
  background: #2a1a34;
  clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
}
.boss-body { flex: 1; min-width: 0; }
.boss-name {
  font-size: 13px; font-weight: 800;
  color: #ffdcf0;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  margin-bottom: 3px;
}
.boss-track {
  position: relative;
  height: 15px;
  background: rgba(10, 8, 16, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 9px;
  overflow: hidden;
}
.boss-fill {
  position: absolute; inset: 0;
  width: 100%;
  background: repeating-linear-gradient(115deg,
    #ff5578 0 9px, #e8375e 9px 18px);
  transition: width 0.18s ease-out;
}
.boss-shield-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 0;
  background: linear-gradient(180deg, #bff0ff, #56b8ff);
  opacity: 0.92;
  transition: width 0.12s linear;
}

/* ---------- 任务横幅 ---------- */
/* 参考图：矩形粉红横带，两端像素方格渐隐，左端压一枚白底红边的交叉双剑爆炸星 */
.banner {
  position: absolute; top: 112px; left: 50%;
  transform: translateX(-50%);
  width: min(600px, 70vw);
  height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 1px 3px rgba(110, 16, 36, 0.55);
  animation: bannerIn 0.4s ease-out;
}
/* 底带放在伪元素上单独加遮罩，避免把左端图标一起渐隐掉 */
.banner::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, transparent 0 8%, #ec5468 15% 85%, transparent 92% 100%),
    repeating-conic-gradient(#ec5468 0 25%, transparent 0 50%) 0 0 / 16px 16px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 87%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 87%, transparent 100%);
  opacity: 0.94;
}
@keyframes bannerIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-14px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* 描边用多重 drop-shadow 画在未裁剪的外层上（clip-path 会裁掉自身的滤镜效果） */
.banner-icon {
  position: absolute; left: 13%; top: 50%;
  width: 58px; height: 58px;
  transform: translate(-50%, -50%) rotate(-14deg);
  filter: drop-shadow(1.5px 0 0 #d63a54) drop-shadow(-1.5px 0 0 #d63a54)
    drop-shadow(0 1.5px 0 #d63a54) drop-shadow(0 -1.5px 0 #d63a54)
    drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}
.banner-icon::before {
  content: ""; position: absolute; inset: 0;
  background: #fff;
  clip-path: polygon(50% 0, 59.8% 13.3%, 75% 6.7%, 76.9% 23.1%, 93.3% 25%, 86.7% 40.2%, 100% 50%, 86.7% 59.8%, 93.3% 75%, 76.9% 76.9%, 75% 93.3%, 59.8% 86.7%, 50% 100%, 40.2% 86.7%, 25% 93.3%, 23.1% 76.9%, 6.7% 75%, 13.3% 59.8%, 0 50%, 13.3% 40.2%, 6.7% 25%, 23.1% 23.1%, 25% 6.7%, 40.2% 13.3%);
}
/* 交叉双剑：两道对角红条 */
.banner-icon::after {
  content: ""; position: absolute; inset: 24%;
  background:
    linear-gradient(45deg, transparent 42%, #e0405a 42% 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, #e0405a 42% 58%, transparent 58%);
}

/* ---------- 准备倒计时 ---------- */
.countdown {
  position: absolute; top: 128px; left: 50%;
  transform: translateX(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(228, 42, 62, 0.9);
  border: 3px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.countdown.pulse { animation: cdPulse 0.5s ease-out; }
@keyframes cdPulse {
  0% { transform: translateX(-50%) scale(1.3); }
  100% { transform: translateX(-50%) scale(1); }
}

/* ---------- 奖励关进度 ---------- */
.bonus-bar {
  position: absolute; top: 96px; left: 50%;
  transform: translateX(-50%);
  width: min(300px, 44vw);
  text-align: center;
}
.bonus-marks { display: flex; justify-content: center; gap: 22px; margin-bottom: 3px; }
.bonus-mark {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: rgba(30, 24, 10, 0.7);
  border: 2px solid #8c7a44;
  position: relative;
}
.bonus-mark.on {
  background: radial-gradient(circle at 40% 35%, #fff0b8, #e8b02c);
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255, 200, 60, 0.8);
}
.bonus-mark::after {
  content: ""; position: absolute; inset: 6px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}
.bonus-track {
  height: 13px;
  background: rgba(10, 12, 18, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  overflow: hidden;
}
.bonus-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #ffd85c, #ffa62b);
  transition: width 0.2s ease-out;
}
.bonus-time {
  margin-top: 2px;
  font-size: 15px; font-weight: 800;
  color: #ffe9a8;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

/* ---------- 右上：延迟 + 武器槽 ---------- */
.hud-tr {
  position: absolute; top: 12px; right: 16px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 7px;
}
.ping {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  color: #b8f0c8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.ping-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #4ae08a;
  box-shadow: 0 0 6px #4ae08a;
}

.wslot {
  position: relative;
  width: 112px; height: 52px;
  background: rgba(18, 24, 36, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 7px;
  pointer-events: auto; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.wslot.active {
  background: rgba(38, 150, 110, 0.55);
  border-color: #6ef0b0;
  box-shadow: 0 0 12px rgba(80, 240, 170, 0.45);
}
.wslot.empty { opacity: 0.4; }
.wslot-key {
  position: absolute; top: -8px; left: -8px;
  width: 19px; height: 18px;
  background: rgba(12, 16, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 4px;
  font-size: 11px; line-height: 17px; text-align: center;
  font-weight: 800;
}
.wslot-ammo {
  position: absolute; left: 7px; bottom: 4px;
  font-size: 16px; font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}
.wslot-icon {
  position: absolute; right: 4px; top: 3px;
  width: 78px; height: 36px;
}

/* ---------- 准星 ---------- */
.crosshair {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 46px; height: 46px;
}
.ch-dot {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 3px; height: 3px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
}
.ch-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
  transition: all 0.08s linear;
}
.ch-l, .ch-r { width: 8px; height: 2px; top: 50%; margin-top: -1px; }
.ch-t, .ch-b { width: 2px; height: 8px; left: 50%; margin-left: -1px; }
.ch-l { left: 2px; } .ch-r { right: 2px; }
.ch-t { top: 2px; } .ch-b { bottom: 2px; }
.crosshair.spread .ch-l { left: -4px; }
.crosshair.spread .ch-r { right: -4px; }
.crosshair.spread .ch-t { top: -4px; }
.crosshair.spread .ch-b { bottom: -4px; }

.ch-ammo {
  position: absolute; top: 26px; left: 50%;
  transform: translateX(-50%);
  font-size: 13px; font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}
.hitmark {
  position: absolute; inset: -10px;
  opacity: 0;
  pointer-events: none;
}
/* 命中标记：四段斜线，中间留空，不遮挡准星 */
.hitmark::before, .hitmark::after {
  content: ""; position: absolute;
  top: 50%; left: 50%;
  width: 30px; height: 3px;
  background: linear-gradient(90deg, #fff 0 34%, transparent 34% 66%, #fff 66% 100%);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9));
}
.hitmark::before { transform: translate(-50%, -50%) rotate(45deg); }
.hitmark::after { transform: translate(-50%, -50%) rotate(-45deg); }
.hitmark.on { animation: hitPop 0.2s cubic-bezier(.2,.9,.3,1); }
.hitmark.crit::before, .hitmark.crit::after {
  background: linear-gradient(90deg, var(--gold) 0 36%, transparent 36% 64%, var(--gold) 64% 100%);
  height: 4px; width: 36px;
}
.hitmark.kill::before, .hitmark.kill::after {
  background: linear-gradient(90deg, #ff3a4a 0 38%, transparent 38% 62%, #ff3a4a 62% 100%);
  height: 5px; width: 44px;
}
.hitmark.kill.on { animation: hitKill 0.34s cubic-bezier(.2,.9,.3,1); }
@keyframes hitPop {
  0% { opacity: 1; transform: scale(1.5); }
  35% { opacity: 1; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.1); }
}
@keyframes hitKill {
  0% { opacity: 1; transform: scale(1.9) rotate(8deg); }
  30% { opacity: 1; transform: scale(1.0) rotate(0deg); }
  100% { opacity: 0; transform: scale(1.2); }
}
/* 开火时准星随后坐力扩散（--kick 由 JS 写入 0~1） */
.crosshair .ch-l { transform: translateX(calc(var(--kick, 0) * -9px)); }
.crosshair .ch-r { transform: translateX(calc(var(--kick, 0) * 9px)); }
.crosshair .ch-t { transform: translateY(calc(var(--kick, 0) * -9px)); }
.crosshair .ch-b { transform: translateY(calc(var(--kick, 0) * 9px)); }

/* ---------- 哈姆头顶窄血条 ---------- */
.enemy-hp-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.enemy-hp {
  position: absolute; top: 0; left: 0;
  width: 62px; height: 7px;
  padding: 1px;
  background: rgba(14, 16, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  will-change: transform;
}
.enemy-hp i {
  position: absolute; left: 1px; top: 1px; bottom: 1px;
  display: block; border-radius: 1px;
}
.enemy-hp .lag { background: #fff3d8; }
.enemy-hp .fill {
  background: linear-gradient(180deg, #ff8a8a 0%, #ff3b4a 55%, #d0182c 100%);
}
.enemy-hp.t-gold .fill { background: linear-gradient(180deg, #ffe58a 0%, #ffbf1a 55%, #e08a00 100%); }

/* ---------- 屏幕边缘敌人指示 ---------- */
#edge-layer { position: absolute; inset: 0; pointer-events: none; }
.edge-arrow {
  position: absolute;
  width: 0; height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 15px solid rgba(255, 70, 70, 0.85);
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.6));
  will-change: transform;
}

/* ---------- 底部血条 ---------- */
.hud-bottom {
  position: absolute; bottom: 22px; left: 50%;
  transform: translateX(-50%);
  width: min(430px, 48vw);
}
.bar {
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(10, 14, 22, 0.66);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}
/* 参考图：上方能量条细长、两端切成尖角；下方血条为纯绿胶囊 */
.energy-bar {
  height: 12px; margin: 0 6px 5px;
  border-radius: 0;
  background: rgba(40, 46, 58, 0.72);
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 50%, calc(100% - 7px) 100%, 7px 100%, 0 50%);
}
.hp-bar {
  height: 20px;
  border: 1.5px solid rgba(16, 58, 38, 0.9);
  border-radius: 10px;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.6), 0 3px 10px rgba(0, 0, 0, 0.35);
}
.bar-fill {
  position: absolute; inset: 0;
  width: 100%;
  transition: width 0.16s ease-out;
}
.energy-bar .bar-fill {
  background: linear-gradient(90deg, #35d8f0, #7ef0ff);
}
.energy-glow {
  position: absolute; inset: 0;
  opacity: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.85), rgba(255,255,255,0));
}
.energy-bar.full .energy-glow { animation: energySweep 1.1s linear infinite; opacity: 1; }
@keyframes energySweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
.hp-bar .bar-fill {
  background: linear-gradient(180deg, #74eaa6 0%, #3fc77f 45%, #2ba868 100%);
}
.shield-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 0;
  background: linear-gradient(180deg, #d8f6ff, #62c8ff);
  opacity: 0.95;
  transition: width 0.16s ease-out;
}
.bar-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  letter-spacing: 1px;
  text-shadow: -1px 0 0 #123, 1px 0 0 #123, 0 -1px 0 #123, 0 1px 0 #123;
}

/* ---------- 右下按钮 ---------- */
.hud-br {
  position: absolute; bottom: 24px; right: 26px;
  display: flex; align-items: flex-end; gap: 14px;
}
.round-btn {
  position: relative;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: rgba(20, 26, 38, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.6);
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
}
.round-btn:hover { transform: scale(1.07); }
.round-btn.disabled { opacity: 0.38; cursor: default; }
.item-btn { border-color: var(--gold); box-shadow: 0 0 10px rgba(255, 200, 70, 0.4); }
.item-btn canvas { width: 40px; height: 40px; }
.badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 19px; height: 19px;
  background: var(--danger);
  border: 2px solid #fff;
  border-radius: 10px;
  font-size: 11px; line-height: 15px; text-align: center;
  font-weight: 900;
  padding: 0 3px;
}
.skill-btn { width: 66px; height: 66px; }
.skill-ring {
  position: absolute; inset: -4px;
  border-radius: 50%;
  background: conic-gradient(var(--cyan) 0deg, rgba(255,255,255,0.14) 0deg);
  mask: radial-gradient(circle, transparent 60%, #000 62%);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%);
}
.skill-btn.ready {
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(80, 220, 250, 0.75);
  animation: skillReady 1.1s ease-in-out infinite;
}
@keyframes skillReady {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.skill-btn.active { border-color: #fff; background: rgba(60, 190, 220, 0.55); }
.ri-bolt {
  width: 20px; height: 30px;
  background: #fff;
  clip-path: polygon(58% 0, 20% 52%, 46% 52%, 34% 100%, 82% 42%, 52% 42%);
}
.jump-btn { width: 52px; height: 52px; }
.ri-jump {
  width: 22px; height: 24px;
  background: #fff;
  clip-path: polygon(50% 0, 74% 26%, 58% 26%, 58% 62%, 78% 62%, 50% 100%, 22% 62%, 42% 62%, 42% 26%, 26% 26%);
  transform: scaleY(-1);
}

/* ---------- 复归面板 ---------- */
.revive-panel {
  position: absolute; top: 44%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 18px 40px;
  background: rgba(12, 8, 14, 0.7);
  border: 2px solid rgba(255, 90, 110, 0.8);
  border-radius: 14px;
}
.rv-title {
  font-size: 30px; font-weight: 900;
  color: #ff5c72;
  letter-spacing: 4px;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
}
.rv-timer { margin-top: 8px; font-size: 15px; color: #ffd8dd; }
.rv-timer span { font-size: 20px; font-weight: 900; color: #fff; }
.rv-left { margin-top: 4px; font-size: 12px; color: #b8c4d4; }

/* ---------- 状态图标行 ---------- */
.status-row {
  position: absolute; bottom: 58px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px;
}
.status-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  background: rgba(14, 20, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  font-size: 11px; font-weight: 700;
}
.status-chip.skill { border-color: var(--cyan); color: #bff2fb; }
.status-chip.stim { border-color: var(--gold); color: #ffeaad; }
.status-chip.bleed { border-color: var(--danger); color: #ffc0cb; }
.status-chip.comeback { border-color: #7ef0a0; color: #cdffdd; }

/* ---------- toast ---------- */
#toast-layer {
  position: absolute; top: 172px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.toast {
  padding: 5px 16px;
  background: rgba(14, 20, 32, 0.8);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  font-size: 13px; font-weight: 700;
  color: #fff6de;
  white-space: nowrap;
  animation: toastIn 0.22s ease-out;
}
.toast.fade { opacity: 0; transition: opacity 0.35s, transform 0.35s; transform: translateY(-8px); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

/* ==================== 全屏界面 ==================== */
.screen {
  position: absolute; inset: 0;
  z-index: 40;
  display: none;
  align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(10, 18, 30, 0.94), rgba(22, 14, 30, 0.94));
}
.screen.show { display: flex; }
.screen.dim { background: rgba(8, 12, 20, 0.72); backdrop-filter: blur(3px); }

.big-btn {
  padding: 12px 38px;
  font-family: var(--font);
  font-size: 17px; font-weight: 900;
  letter-spacing: 3px;
  color: #33240a;
  background: linear-gradient(180deg, #ffe08a, #f0b53c 60%, #d99a24);
  border: 2px solid #fff3cf;
  border-radius: 26px;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.42);
  transition: transform 0.12s, filter 0.12s;
}
.big-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.big-btn:active { transform: translateY(1px); }
.ghost-btn {
  padding: 9px 26px;
  font-family: var(--font);
  font-size: 14px; font-weight: 700;
  letter-spacing: 2px;
  color: #dbe6f4;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.12s;
}
.ghost-btn:hover { background: rgba(255, 255, 255, 0.18); }
kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--font);
  font-size: 11px; font-weight: 700;
  text-align: center;
}

/* ---------- 大厅（开始界面） ---------- */
/* background-position 的 60% 须与 lobby.js 中 BG.posY 一致（3D 地面按它对齐画里的地面） */
.screen.lobby {
  background: #7cc4f2 url("../img/startup_bg.png") center 60% / cover no-repeat;
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
.screen.lobby.show { display: block; }
.lobby-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
.lobby-canvas.grab { cursor: grabbing; }
.lobby-logo {
  position: absolute; top: 2.2vh; right: 1.8vw;
  width: clamp(260px, 25vw, 480px); height: auto;
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(60, 20, 70, 0.3));
}
.lobby-btn {
  position: relative;
  padding: 0; margin: 0;
  background: none; border: 0; border-radius: 18px;
  line-height: 0;
  cursor: pointer;
  filter: drop-shadow(0 6px 10px rgba(80, 20, 60, 0.35));
  transition: transform 0.14s ease, filter 0.14s ease;
}
.lobby-btn img { display: block; width: 100%; height: auto; pointer-events: none; }
.lobby-btn:hover { transform: translateY(-3px) scale(1.03); filter: drop-shadow(0 9px 14px rgba(80, 20, 60, 0.4)) brightness(1.05); }
.lobby-btn:active { transform: translateY(1px) scale(0.97); }
.lobby-btn:focus-visible { outline: 3px solid #fff; outline-offset: 4px; box-shadow: 0 0 0 7px rgba(90, 50, 34, 0.55); }
.lobby-btn:disabled { cursor: progress; filter: grayscale(0.35) brightness(0.92); }
.lobby-actions {
  position: absolute; right: 1.6vw; bottom: 2.4vh;
  display: flex; align-items: flex-end; gap: 0.8vw;
}
.btn-rank, .btn-settings, .btn-switch { width: clamp(96px, 8.4vw, 170px); }
.btn-switch { position: absolute; left: 1.4vw; bottom: 2.4vh; }
.btn-start { width: clamp(150px, 13.5vw, 270px); animation: lobbyPulse 2.4s ease-in-out infinite; }
.btn-start:hover, .btn-start:active, .btn-start:disabled { animation: none; }
@keyframes lobbyPulse { 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) {
  .btn-start { animation: none; }
  .lobby-btn, .char-panel { transition: none; }
}
/* 左侧「切换上阵形象」面板（奶油底 + 棕描边 + 粉色内框，与按钮底板同一套配色） */
.char-panel {
  position: absolute; left: 1.4vw; top: 50%;
  transform: translateY(-54%);
  width: min(clamp(250px, 21vw, 400px), 40vh);
  padding: 30px 14px 12px;
  background: rgba(255, 248, 234, 0.95);
  border: 3px solid #6b3b2a;
  border-radius: 22px;
  box-shadow: inset 0 0 0 4px #ffc4dc, 0 10px 24px rgba(80, 20, 60, 0.3);
  transition: transform 0.28s ease, opacity 0.28s ease, visibility 0s linear 0s;
}
.char-panel.closed {
  transform: translate(-115%, -54%);
  opacity: 0; visibility: hidden;
  transition: transform 0.28s ease, opacity 0.28s ease, visibility 0s linear 0.28s;
}
.cp-head {
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, -52%);
  margin: 0; padding: 6px 22px;
  white-space: nowrap;
  font-size: clamp(15px, 1.15vw, 21px); font-weight: 900; letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(180deg, #ff9cc8, #f06aa8);
  border: 3px solid #6b3b2a; border-radius: 16px;
  text-shadow: 0 2px 0 #a03a6a, 0 0 3px #a03a6a;
}
.char-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.char-card {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 0; overflow: hidden;
  border: 3px solid #e8cfae; border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, var(--cc, #cfe4ff) 78%);
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.char-card:hover { transform: translateY(-2px); border-color: #f2b640; }
.char-card:focus-visible { outline: 3px solid #3d7be0; outline-offset: 2px; }
.char-card.on { border-color: #f2b640; box-shadow: 0 0 0 3px #ffe08a, 0 4px 12px rgba(242, 182, 64, 0.55); }
.cc-thumb { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cc-ph {
  position: absolute; left: 50%; top: 14%;
  width: 46%; aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50% 50% 42% 42%;
  background: rgba(255, 255, 255, 0.6);
  animation: ccPh 1.2s ease-in-out infinite;
}
.char-card.loaded .cc-ph { display: none; }
@keyframes ccPh { 50% { opacity: 0.4; } }
.cc-name {
  position: absolute; left: 6px; right: 6px; bottom: 6px;
  padding: 3px 4px;
  font-size: clamp(12px, 0.85vw, 15px); font-weight: 900; line-height: 1.3;
  color: #5a3322;
  background: rgba(255, 250, 240, 0.92);
  border-radius: 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cc-check {
  position: absolute; top: 6px; right: 6px;
  display: none;
  width: 22px; height: 22px;
  font-size: 13px; font-weight: 900; line-height: 18px; color: #fff;
  background: #f2a830; border: 2px solid #fff; border-radius: 50%;
}
.char-card.on .cc-check { display: block; }
.cp-tip { margin: 10px 0 0; font-size: 12px; color: #9a7a60; text-align: center; }
.lobby-status {
  position: absolute; left: 50%; bottom: 3vh;
  transform: translateX(-50%);
  padding: 7px 18px;
  font-size: 14px; font-weight: 800; color: #5a3322;
  background: rgba(255, 248, 234, 0.94);
  border: 2px solid #6b3b2a; border-radius: 18px;
  pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
}
.lobby-status.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .cc-ph { animation: none; } }
/* 大厅弹窗（排行榜 / 设置）：放在 #screen-start 内，自测页注入 DOM 时一并带上 */
.lobby-modal {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: rgba(60, 24, 70, 0.38);
  backdrop-filter: blur(2px);
}
.lm-card {
  position: relative;
  width: min(460px, 92vw); max-height: 86vh; overflow: auto;
  padding: 18px 22px;
  background: #fff8ea;
  border: 3px solid #6b3b2a; border-radius: 22px;
  box-shadow: inset 0 0 0 4px #ffc4dc, 0 16px 40px rgba(60, 20, 60, 0.35);
  color: #5a3322;
  text-align: left;
}
.lm-card.wide { width: min(640px, 94vw); }
.lm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.lm-head h2 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: 3px; color: #e0548e; text-shadow: 0 2px 0 #fff; }
.lm-close {
  width: 34px; height: 34px; padding: 0;
  font-family: var(--font); font-size: 22px; font-weight: 900; line-height: 28px; color: #6b3b2a;
  background: #ffe3ef; border: 2px solid #6b3b2a; border-radius: 50%;
  cursor: pointer;
}
.lm-close:hover { background: #ffc4dc; }
.lm-close:focus-visible, .lm-btn:focus-visible, .set-row input:focus-visible { outline: 3px solid #3d7be0; outline-offset: 2px; }
.lm-sub { margin: 0 0 10px; font-size: 12px; color: #9a7a60; }
.lm-sec { margin: 14px 0 6px; font-size: 13px; font-weight: 900; letter-spacing: 2px; color: #e0548e; }
.lm-foot { margin-top: 12px; text-align: right; }
.lm-btn {
  padding: 6px 16px;
  font-family: var(--font); font-size: 13px; font-weight: 800; color: #6b3b2a;
  background: #fff; border: 2px solid #d9b996; border-radius: 16px;
  cursor: pointer;
}
.lm-btn:hover { border-color: #6b3b2a; }
.lm-btn.armed { color: #fff; background: #e0548e; border-color: #a03a6a; }
.lm-btn:disabled { opacity: 0.5; cursor: default; }
.set-row {
  display: grid; grid-template-columns: 90px 1fr 52px; align-items: center; gap: 12px;
  padding: 8px 0;
  font-size: 14px; font-weight: 800;
}
.set-row.name { grid-template-columns: 90px 1fr auto; gap: 10px; }
.set-row input[type="range"] { width: 100%; accent-color: #f06aa8; }
.set-row input[type="text"] { padding: 6px 10px; font-family: var(--font); font-size: 13px; color: #5a3322; background: #fff; border: 2px solid #d9b996; border-radius: 10px; min-width: 0; }
.set-row input[type="text"]:focus { outline: none; border-color: #f06aa8; }
.set-row .lm-btn { padding: 5px 14px; font-size: 12px; }
.set-row output { text-align: right; font-variant-numeric: tabular-nums; color: #a0522d; }
.set-tip { margin: 10px 0 0; font-size: 12px; color: #9a7a60; }
/* 设置弹窗里的玩法 / 操作说明（沿用原开始界面的结构，换成奶油配色） */
.lm-card .brief { display: flex; flex-direction: column; gap: 6px; }
.lm-card .brief-row { display: flex; gap: 12px; align-items: baseline; font-size: 13px; line-height: 1.5; color: #6b4a36; }
.lm-card .brief-row b { flex: none; width: 52px; text-align: right; font-size: 12px; color: #e0548e; }
.lm-card .ctrl-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding: 12px 14px;
  background: #fff; border: 2px solid #f0dcc2; border-radius: 12px;
}
.lm-card .ctrl-col { text-align: left; }
.lm-card .ctrl-title { margin-bottom: 6px; font-size: 12px; font-weight: 900; letter-spacing: 2px; color: #3d7be0; }
.lm-card .ctrl-item { margin-bottom: 4px; font-size: 12px; color: #6b4a36; }
.lm-card kbd { color: #5a3322; background: #fff3e0; border-color: #d9b996; }
/* 排行榜 */
.rank-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.rank-row {
  display: grid; grid-template-columns: 28px 40px 1fr auto auto; align-items: center; gap: 10px;
  padding: 6px 10px;
  background: #fff; border: 2px solid #f0dcc2; border-radius: 12px;
}
.rank-row.top1 { border-color: #f2b640; background: #fff6d8; }
.rank-row.top2 { border-color: #c4ccd8; }
.rank-row.top3 { border-color: #e0a878; }
.rk-no { font-size: 18px; font-weight: 900; text-align: center; color: #a0522d; }
.rk-av {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--cc, #cfe4ff) center 12% / 150% auto no-repeat;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(80, 30, 20, 0.25);
}
.rk-main { display: flex; flex-direction: column; min-width: 0; }
.rk-name { font-size: 14px; color: #5a3322; }
.rk-meta { font-size: 11px; color: #9a7a60; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-wave { padding: 2px 8px; font-size: 12px; font-weight: 800; color: #6b4a36; background: #ffe3ef; border-radius: 10px; white-space: nowrap; }
.rk-wave.win { color: #fff; background: #3fb46a; }
.rk-score { min-width: 64px; text-align: right; font-size: 17px; font-weight: 900; color: #e0952a; font-variant-numeric: tabular-nums; }
.rank-empty { padding: 26px 0; text-align: center; font-size: 13px; color: #9a7a60; }

/* ---------- 增益选取 ---------- */
.buff-wrap {
  width: min(880px, 94vw);
  text-align: center;
}
.buff-head { margin-bottom: 18px; }
.buff-title {
  font-size: 30px; font-weight: 900;
  letter-spacing: 8px;
  color: #fff3d4;
  text-shadow: 0 3px 12px rgba(255, 170, 40, 0.5);
}
.buff-sub { margin-top: 5px; font-size: 13px; color: #a8c0d8; }
.picks {
  display: inline-block;
  min-width: 22px;
  color: #2a1c00;
  background: var(--gold);
  border-radius: 11px;
  font-weight: 900;
  padding: 0 7px;
}
.buff-cards {
  display: flex; gap: 16px; justify-content: center;
  flex-wrap: wrap;
}
.buff-card {
  position: relative;
  width: 232px; min-height: 216px;
  padding: 18px 16px 16px;
  background: linear-gradient(170deg, rgba(38, 48, 70, 0.95), rgba(22, 28, 44, 0.95));
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.buff-card:hover {
  transform: translateY(-7px);
  border-color: var(--gold);
  box-shadow: 0 12px 30px rgba(255, 180, 40, 0.3);
}
.buff-card .idx {
  position: absolute; top: -10px; left: -10px;
  width: 26px; height: 26px;
  background: var(--gold); color: #2a1c00;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 13px; font-weight: 900;
  line-height: 23px; text-align: center;
}
.buff-card .cat {
  display: inline-block;
  padding: 2px 9px;
  font-size: 10px; font-weight: 700;
  border-radius: 9px;
  margin-bottom: 9px;
}
.cat-sustain { background: rgba(80, 230, 140, 0.22); color: #8ef0b4; border: 1px solid #4ecb86; }
.cat-dmg { background: rgba(255, 90, 90, 0.2); color: #ffa8a8; border: 1px solid #e05555; }
.cat-stat { background: rgba(110, 180, 255, 0.2); color: #a8d4ff; border: 1px solid #5a9fe0; }
.cat-extra { background: rgba(200, 120, 255, 0.2); color: #dcb0ff; border: 1px solid #a865e0; }
.cat-func { background: rgba(255, 200, 70, 0.2); color: #ffe098; border: 1px solid #d8a83c; }
.buff-card .bname {
  font-size: 19px; font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.buff-card .lv { display: flex; gap: 4px; margin-bottom: 10px; }
.lv-pip {
  width: 26px; height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
}
.lv-pip.on { background: linear-gradient(90deg, #ffd85c, #ff9d2b); }
.buff-card .bdesc {
  font-size: 12px; line-height: 1.65;
  color: #c8d6e8;
}
.buff-card .upgrade-tag {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 800;
  color: #ffe8a0;
  background: rgba(200, 140, 20, 0.35);
  border: 1px solid #d8a83c;
  border-radius: 8px;
  padding: 1px 7px;
}
.buff-foot {
  margin-top: 20px;
  display: flex; align-items: center; justify-content: center; gap: 22px;
}
.buff-foot .hint { font-size: 12px; color: #8fa0b8; }

/* ---------- 暂停 ---------- */
.pause-card {
  width: min(420px, 90vw);
  padding: 28px 34px;
  background: rgba(20, 26, 40, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 16px;
  text-align: center;
}
.pause-title {
  font-size: 28px; font-weight: 900;
  letter-spacing: 8px;
  color: #fff;
  margin-bottom: 18px;
}
.pause-stats {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 18px;
}
.pause-stats > div {
  display: flex; justify-content: space-between;
  padding: 7px 14px;
  background: rgba(8, 12, 20, 0.5);
  border-radius: 7px;
  font-size: 13px;
}
.pause-stats span { color: #9fb4cc; }
.pause-stats b { color: var(--gold); font-size: 15px; }
.vol-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
  font-size: 13px; color: #b8c8dc;
}
.vol-row input { flex: 1; accent-color: var(--gold); }
.pause-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* ---------- 增益一览 ---------- */
.bag-card {
  width: min(640px, 92vw);
  max-height: 80vh;
  padding: 24px 28px;
  background: rgba(20, 26, 40, 0.92);
  border: 2px solid rgba(255, 204, 68, 0.4);
  border-radius: 16px;
  display: flex; flex-direction: column;
  align-items: center;
}
.bag-title {
  font-size: 22px; font-weight: 900;
  letter-spacing: 6px;
  margin-bottom: 16px;
  color: #fff3d4;
}
.bag-list {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 18px;
  padding-right: 4px;
}
.bag-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 13px;
  background: rgba(8, 14, 24, 0.6);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
}
.bag-item .bi-name {
  flex: none; width: 96px;
  font-size: 14px; font-weight: 800;
  color: #fff;
}
.bag-item .bi-lv {
  flex: none;
  font-size: 11px; font-weight: 800;
  color: #2a1c00;
  background: var(--gold);
  border-radius: 8px;
  padding: 1px 7px;
}
.bag-item .bi-desc { flex: 1; font-size: 12px; color: #b8c8dc; line-height: 1.5; }
.bag-empty { padding: 30px; color: #8fa0b8; font-size: 13px; }

/* ---------- 结算 ---------- */
.result-wrap { width: min(560px, 92vw); text-align: center; }
.result-title {
  font-size: 44px; font-weight: 900;
  letter-spacing: 10px;
  background: linear-gradient(180deg, #fff8e0, #ffcc44 55%, #e09a22);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55));
}
.result-title.fail {
  background: linear-gradient(180deg, #ffd8dd, #ff5c72 55%, #c02a42);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.result-wave { margin-top: 4px; font-size: 13px; color: #a8c0d8; }
.result-wave span { color: var(--gold); font-weight: 900; font-size: 16px; }
.result-card {
  margin: 22px 0 16px;
  padding: 18px 22px;
  background: rgba(255, 252, 244, 0.95);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.rc-score {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 2px dashed rgba(40, 50, 70, 0.2);
}
.rc-label { font-size: 13px; color: #6a7688; letter-spacing: 2px; }
.rc-val { font-size: 30px; font-weight: 900; color: #e0952a; }
.rc-player {
  display: flex; align-items: center; gap: 12px;
  padding-top: 12px;
}
.rc-avatar {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 34%, #f6e8dc, #c8b4a4);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}
.rc-avatar::before {
  content: ""; position: absolute;
  top: 2px; left: 6px; right: 6px; height: 17px;
  background: #e8e6ee;
  border-radius: 10px 10px 4px 4px;
}
/* 有大厅缩略图时用它当头像（background-image 由 ui.js 内联设置） */
.rc-avatar.has-img { background: #fff3e0 center 10% / 150% auto no-repeat; }
.rc-avatar.has-img::before { display: none; }
.rc-name { flex: 1; text-align: left; font-size: 16px; font-weight: 800; color: #2a3446; }
.rc-lv {
  flex: none;
  min-width: 34px; height: 24px;
  background: #3d4b64; color: #fff;
  border-radius: 12px;
  font-size: 13px; font-weight: 900;
  line-height: 24px;
}
.result-stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}
.result-stats > div {
  display: flex; justify-content: space-between;
  padding: 8px 14px;
  background: rgba(10, 16, 26, 0.55);
  border-radius: 7px;
  font-size: 13px;
}
.result-stats span { color: #9fb4cc; }
.result-stats b { color: #fff; }
.result-btns { display: flex; justify-content: center; align-items: center; gap: 14px; }

/* ---------- 加载 ---------- */
/* 初始化加载页样式见 loading.css；自测页只引本文件，仍需能隐藏它 */
.loading.hide { display: none; }

/* ---------- 窄屏适配 ---------- */
@media (max-width: 860px) {
  .buff-card { width: 200px; min-height: 196px; }
  .lm-card .ctrl-grid { grid-template-columns: 1fr; }
  .hud-bottom { width: 62vw; }
  .stat-panel { min-width: 150px; }
}
