/* 钢铁洪流 - 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a08;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif; user-select: none; }
#app, #app canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hidden { display: none !important; }

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

#crosshair { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px;
  transform: translate(-50%, -50%); }
#crosshair svg { position: absolute; left: 0; top: 0; overflow: visible; }
#reloadText { position: absolute; width: 100%; top: 128px; text-align: center;
  color: #ffd35c; font-size: 14px; text-shadow: 0 0 4px #000; letter-spacing: 2px; }

/* 狙击模式 */
#sniperOverlay { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 31%, rgba(0,0,0,0.97) 33%); }
.scope-circle { position: absolute; left: 50%; top: 50%; width: 62vmin; height: 62vmin;
  transform: translate(-50%,-50%); border: 2px solid rgba(120,255,150,0.5); border-radius: 50%; }
.scope-h { position: absolute; left: 50%; top: 50%; width: 60vmin; height: 1px;
  transform: translate(-50%,-50%); background: rgba(120,255,150,0.65); }
.scope-v { position: absolute; left: 50%; top: 50%; width: 1px; height: 60vmin;
  transform: translate(-50%,-50%); background: rgba(120,255,150,0.65); }
#scopeZoom { position: absolute; left: 50%; top: calc(50% + 33vmin); transform: translateX(-50%);
  color: #7fff9a; font-size: 15px; }

#scoreBar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  font-size: 26px; font-weight: bold; text-shadow: 0 1px 4px #000; }
#scoreBar .ally { color: #7fff9a; }
#scoreBar .enemy { color: #ff6a5c; }
#scoreBar .vs { color: #ddd; margin: 0 14px; font-size: 16px; }

#playerPanel { position: absolute; left: 24px; bottom: 22px; }
#hpBarWrap { position: relative; width: 240px; height: 20px; background: rgba(0,0,0,0.55);
  border: 1px solid #777; border-radius: 3px; }
#hpBar { height: 100%; width: 100%; background: linear-gradient(90deg,#3fae52,#7ddf6a);
  border-radius: 2px; transition: width .25s; }
#hpText { position: absolute; right: 6px; top: 1px; color: #fff; font-size: 13px; text-shadow: 0 1px 2px #000; }
#killText { margin-top: 6px; color: #ffd35c; font-size: 14px; text-shadow: 0 1px 3px #000; }

#hitMsgBox { position: absolute; left: 50%; top: 34%; transform: translateX(-50%); text-align: center; }
.hitmsg { font-size: 26px; font-weight: bold; text-shadow: 0 2px 6px #000; margin: 4px 0;
  animation: hitfade 1.4s forwards; }
.hitmsg.pen { color: #ffd35c; }
.hitmsg.bounce { color: #9adcff; }
.hitmsg.nopen { color: #ccc; }
.hitmsg.dmg { color: #ff8a6a; }
@keyframes hitfade { 0%{opacity:0; transform:translateY(8px);} 15%{opacity:1; transform:none;}
  75%{opacity:1;} 100%{opacity:0; transform:translateY(-14px);} }

#minimap { position: absolute; right: 20px; bottom: 20px; border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px; background: rgba(20,16,10,0.6); }

#enemyBars { position: absolute; inset: 0; overflow: hidden; }
.ebar { position: absolute; width: 64px; height: 7px; background: rgba(0,0,0,0.6);
  border: 1px solid #222; transform: translate(-50%, -50%); }
.ebar > i { display: block; height: 100%; background: #e04b3a; }
.ebar > em { position: absolute; top: -15px; width: 100%; text-align: center; font-size: 11px;
  color: #ffb1a6; font-style: normal; text-shadow: 0 1px 2px #000; }

#helpHint { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.45); font-size: 12px; letter-spacing: 1px; }

/* 伤害浮字(3D 投影) */
.dmgfloat { position: absolute; transform: translate(-50%, -50%); font-size: 22px; font-weight: bold;
  text-shadow: 0 2px 5px #000; pointer-events: none; }
.dmgfloat.dmg { color: #ffd35c; }
.dmgfloat.bounce { color: #9adcff; font-size: 17px; }
.dmgfloat.nopen { color: #cfcfcf; font-size: 17px; }

/* 方向性受击指示 */
#hitdir { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px;
  transform: translate(-50%,-50%); border-radius: 50%; opacity: 0;
  border: 8px solid transparent; border-top-color: rgba(255,40,30,0.85); pointer-events: none; }
#hitdir.hiton { animation: hitdirfade 1.0s forwards; }
@keyframes hitdirfade { 0%{opacity:1;} 70%{opacity:0.8;} 100%{opacity:0;} }

/* 血条抖动 */
#hpBarWrap.shake { animation: hpshake 0.4s; }
@keyframes hpshake { 0%,100%{transform:none;} 20%{transform:translateX(-5px);} 40%{transform:translateX(4px);}
  60%{transform:translateX(-3px);} 80%{transform:translateX(2px);} }

/* 血条掉血闪烁 */
.ebar.flash i { animation: barflash 0.35s; }
@keyframes barflash { 0%{ background:#fff; } 100%{} }

/* 诊断日志 */
#diagLog { position: absolute; left: 8px; top: 8px; z-index: 98; max-width: 46%;
  color: #baf7c0; background: rgba(0,30,0,0.72); font: 13px monospace; padding: 8px;
  white-space: pre-wrap; pointer-events: none; }

/* ---------- 菜单 / 结算 ---------- */
#menu, #endScreen { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; color: #e8dfc8; }
#menu { background: radial-gradient(ellipse at 50% 30%, rgba(61,53,40,0.62) 0%, rgba(20,18,12,0.78) 75%); }
#endScreen { background: radial-gradient(ellipse at 50% 30%, rgba(61,53,40,0.55) 0%, rgba(20,18,12,0.82) 75%); }

/* 选车卡片 */
.vrow { display: flex; gap: 18px; margin-bottom: 26px; pointer-events: auto; }
.vcard { width: 200px; padding: 14px 16px; background: rgba(20,17,11,0.72); border: 1px solid #6a5c40;
  border-radius: 6px; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.vcard:hover { border-color: #c8a65c; }
.vcard.sel { border-color: #ffd35c; box-shadow: 0 0 18px rgba(255,211,92,0.35); }
.vcard h3 { color: #e3c37a; font-size: 16px; margin-bottom: 6px; }
.vcard .vdesc { color: #a89a7c; font-size: 12px; line-height: 1.5; margin-bottom: 10px; min-height: 36px; }
.vcard .bar { display: flex; align-items: center; margin: 4px 0; }
.vcard .bar label { width: 34px; font-size: 11px; color: #9a8f75; }
.vcard .bar i { flex: 1; height: 8px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; }
.vcard .bar b { display: block; height: 100%; background: linear-gradient(90deg,#a8894a,#ffd35c); }
#menu h1, #endScreen h1 { font-size: 64px; letter-spacing: 18px; color: #d8b465;
  text-shadow: 0 4px 18px rgba(216,180,101,0.35); margin-bottom: 8px; }
#menu .sub { color: #9a8f75; letter-spacing: 6px; margin-bottom: 34px; }
#menu .brief { color: #bfb49a; font-size: 15px; line-height: 2; margin-bottom: 40px; }
#startBtn { pointer-events: auto; cursor: pointer; font-size: 22px; letter-spacing: 8px;
  padding: 14px 58px 14px 66px; color: #1a150c; background: linear-gradient(180deg,#e3c37a,#b89444);
  border: none; border-radius: 4px; box-shadow: 0 4px 20px rgba(216,180,101,0.4); }
#startBtn:hover { filter: brightness(1.12); }
#endScreen .restart { margin-top: 26px; color: #9a8f75; letter-spacing: 3px; }
#endDetail { margin-top: 10px; color: #bfb49a; }
#endScreen.lose h1 { color: #c8543e; text-shadow: 0 4px 18px rgba(200,84,62,0.4); }

/* 错误框 */
#errDiv { position: absolute; left: 6px; bottom: 6px; z-index: 99; max-width: 60%;
  color: #ff8080; background: rgba(60,0,0,0.8); font: 12px monospace; padding: 6px;
  white-space: pre-wrap; pointer-events: none; }
