/* 钢铁洪流 - 全局样式 */
* { 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; }
#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; }

/* ---------- 菜单 / 结算 ---------- */
#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%, #3d3528 0%, #14120c 70%); }
#endScreen { background: radial-gradient(ellipse at 50% 30%, rgba(61,53,40,0.55) 0%, rgba(20,18,12,0.82) 75%); }
#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; }
