* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #1a1f16;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif; user-select: none; }
canvas#game { display: block; cursor: crosshair; }
.hidden { display: none !important; }

/* 登录 */
#login, #offline { position: fixed; inset: 0; display: flex; align-items: center;
  justify-content: center; background: radial-gradient(circle, #2b3a22 0%, #141a10 100%); z-index: 50; }
.login-box { background: rgba(20, 26, 16, .92); border: 1px solid #4a5d3a; border-radius: 12px;
  padding: 36px 44px; text-align: center; color: #dfe8d0; width: 440px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.login-box h1 { color: #a8d94e; margin-bottom: 6px; letter-spacing: 2px;
  text-shadow: 0 0 18px rgba(168, 217, 78, .4); }
.login-box .sub { color: #8ba06e; font-size: 13px; margin-bottom: 22px; }
.login-box input { width: 100%; padding: 12px; font-size: 16px; border-radius: 6px;
  border: 1px solid #4a5d3a; background: #0f140b; color: #eee; outline: none; margin-bottom: 14px; }
.login-box input:focus { border-color: #a8d94e; box-shadow: 0 0 10px rgba(168,217,78,.3); }
.login-box button { width: 100%; padding: 12px; font-size: 16px; font-weight: bold;
  border: none; border-radius: 6px; background: linear-gradient(180deg, #9ed34e, #6fa02e);
  color: #10150b; cursor: pointer; transition: filter .15s; }
.login-box button:hover { filter: brightness(1.15); }
#loginErr { color: #ff6b5e; font-size: 13px; min-height: 18px; margin-top: 8px; }
.help { margin-top: 16px; font-size: 12px; color: #77895f; line-height: 1.8; text-align: left; }
.help b { color: #c9e39a; }

/* HUD */
#hud { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 10; pointer-events: none; }
.hud-row { display: flex; align-items: center; gap: 14px; }
#buffs { display: flex; gap: 6px; min-height: 20px; }
.buff { font-size: 12px; padding: 1px 8px; border: 1px solid; border-radius: 10px;
  background: rgba(0,0,0,.55); }
#hpwrap { position: relative; width: 240px; height: 22px; background: rgba(0,0,0,.55);
  border: 1px solid #555; border-radius: 4px; overflow: hidden; }
#hpbar { height: 100%; width: 100%; background: linear-gradient(90deg, #57c14e, #8fe06a);
  transition: width .15s; }
#hptext { position: absolute; inset: 0; text-align: center; color: #fff; font-size: 13px;
  line-height: 22px; text-shadow: 0 1px 2px #000; }
#weaponinfo { color: #fff; font-size: 15px; font-weight: bold; text-shadow: 0 1px 3px #000;
  background: rgba(0,0,0,.45); padding: 6px 14px; border-radius: 4px; }
#stats { color: #cfd8c0; font-size: 13px; background: rgba(0,0,0,.45);
  padding: 6px 12px; border-radius: 4px; }

/* 技能栏 */
#skillbar { position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; z-index: 10; pointer-events: none; }
.ask, .psk, #weaponinfo { pointer-events: auto; cursor: help; }
.ask { position: relative; width: 46px; height: 46px; border: 2px solid #3a4436;
  border-radius: 8px; background: rgba(10, 14, 8, .75); overflow: hidden;
  display: flex; align-items: center; justify-content: center; }
.sk-key { position: absolute; top: 1px; left: 4px; font-size: 10px; color: #9fb08a; z-index: 3; }
.sk-icon { font-size: 20px; font-weight: bold; z-index: 2; text-shadow: 0 1px 3px #000; }
.sk-cd { position: absolute; left: 0; bottom: 0; width: 100%; height: 0%;
  background: rgba(0, 0, 0, .72); z-index: 2; }
.sk-cdnum { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: bold; text-shadow: 0 1px 2px #000; z-index: 3; }
.sk-n { position: absolute; right: 2px; bottom: 1px; font-size: 9px; color: #cfd8b8;
  text-shadow: 0 1px 2px #000; z-index: 3; }
#passives { display: flex; gap: 5px; margin-left: 6px; }
.psk { position: relative; width: 30px; height: 30px; border: 1.5px solid #3a4436; border-radius: 6px;
  background: rgba(10, 14, 8, .75); display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: bold; text-shadow: 0 1px 2px #000; }
.psk-n { position: absolute; right: 1px; bottom: 0; font-size: 8px; color: #cfd8b8; font-weight: normal; }
#swapper { position: fixed; left: 50%; bottom: 118px; transform: translateX(-50%);
  background: rgba(12, 16, 9, .92); border: 1px solid #4a5d3a; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; color: #dfe8d0; z-index: 25;
  box-shadow: 0 6px 20px rgba(0,0,0,.5); }

/* 物品悬浮提示 */
#tooltip { position: fixed; z-index: 30; pointer-events: none; max-width: 260px;
  background: rgba(12, 16, 9, .92); border: 1px solid #4a5d3a; border-radius: 8px;
  padding: 10px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.tt-name { font-size: 14px; font-weight: bold; margin-bottom: 4px; }
.tt-kind { font-size: 11px; color: #9fb08a; margin-bottom: 4px; }
.tt-desc { font-size: 12px; color: #dfe8d0; line-height: 1.5; }
.tt-tip { font-size: 11px; color: #77895f; margin-top: 5px; }

/* 击杀播报 */
#killfeed { position: fixed; top: 14px; right: 14px; z-index: 10; pointer-events: none;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.kf { background: rgba(0,0,0,.55); color: #eee; font-size: 13px; padding: 4px 10px;
  border-radius: 4px; animation: kffade 6s forwards; }
.kf b { color: #ffb84d; }
@keyframes kffade { 0% {opacity: 0; transform: translateX(20px);} 6% {opacity: 1; transform: none;}
  80% {opacity: 1;} 100% {opacity: 0;} }

/* 命中标记 */
#hitmarker { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: #ffde59; font-size: 30px; font-weight: bold; opacity: 0; pointer-events: none;
  z-index: 11; text-shadow: 0 0 6px #ff8a00; }
#hitmarker.show { animation: hm .25s ease-out; }
@keyframes hm { 0% {opacity: 1; transform: translate(-50%,-50%) scale(1.4);} 100% {opacity: 0; transform: translate(-50%,-50%) scale(.9);} }

/* 小地图 */
#minimap { position: fixed; right: 14px; bottom: 14px; z-index: 10;
  border: 2px solid rgba(0,0,0,.6); border-radius: 6px; opacity: .92; }

/* 重生提示 */
#respawnTip { position: fixed; left: 50%; top: 38%; transform: translateX(-50%);
  color: #ff7a6b; font-size: 26px; font-weight: bold; text-shadow: 0 2px 8px #000; z-index: 12; }

/* 聊天（左下角） */
#chat { position: fixed; left: 14px; bottom: 14px; width: 340px; z-index: 10; }
#chatlog { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column;
  gap: 3px; margin-bottom: 6px; mask-image: linear-gradient(to bottom, transparent, #000 15%); }
#chatlog div { color: #e8e8e8; font-size: 13px; text-shadow: 0 1px 2px #000;
  background: rgba(0,0,0,.35); padding: 3px 8px; border-radius: 3px;
  word-break: break-all; width: fit-content; max-width: 100%; }
#chatlog .sys { color: #9ecbff; font-style: italic; }
#chatlog b { color: #a8d94e; }
#chatinput { width: 100%; padding: 8px 10px; font-size: 14px; border-radius: 4px;
  border: 1px solid #666; background: rgba(0,0,0,.7); color: #fff; outline: none; display: none; }
#chat.open #chatinput { display: block; }
#chatlog::-webkit-scrollbar { width: 4px; }
#chatlog::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }

/* 计分板 */
#scoreboard { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(12, 16, 9, .92); border: 1px solid #4a5d3a; border-radius: 10px;
  padding: 24px 32px; z-index: 20; color: #dfe8d0; min-width: 420px; }
#scoreboard h2 { text-align: center; color: #a8d94e; margin-bottom: 14px; }
#scoreboard table { width: 100%; border-collapse: collapse; font-size: 14px; }
#scoreboard th, #scoreboard td { padding: 6px 14px; text-align: center; }
#scoreboard th { color: #8ba06e; border-bottom: 1px solid #4a5d3a; }
#scoreboard tr.me td { color: #ffde59; font-weight: bold; }
