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

/* ============ 通用覆盖层 ============ */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10,20,30,.82), rgba(4,8,12,.95));
}
.panel {
  text-align: center; color: #e8eef2; padding: 40px 56px;
  background: rgba(14, 22, 30, .88); border: 1px solid rgba(255,196,64,.35);
  border-radius: 6px; box-shadow: 0 0 60px rgba(0,0,0,.6);
  max-width: 640px;
}
.panel.small { padding: 30px 60px; }
.logo { font-size: 56px; letter-spacing: 14px; color: #ffc440; text-shadow: 0 3px 18px rgba(255,160,0,.5); margin-bottom: 6px; }
.tagline { font-size: 14px; color: #9fb4c4; letter-spacing: 3px; margin-bottom: 8px; }
.desc { font-size: 15px; color: #cfe0ec; margin-bottom: 22px; }
.controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px; margin-bottom: 26px; font-size: 13px; color: #a8bccb; text-align: left; }
.controls span { display: inline-block; min-width: 74px; color: #ffc440; font-weight: bold; }
.big-btn {
  font-size: 20px; padding: 12px 52px; cursor: pointer; letter-spacing: 6px;
  color: #14202a; background: linear-gradient(180deg, #ffd25e, #f0a91d);
  border: none; border-radius: 4px; font-weight: bold;
}
.big-btn:hover { filter: brightness(1.12); }
.hint { margin-top: 14px; font-size: 12px; color: #6e8496; }

/* ============ HUD 基础 ============ */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; color: #fff; }
#hud b, #hud em, #hud span { font-style: normal; }

/* 准星 */
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.ch { position: absolute; background: rgba(255,255,255,.92); box-shadow: 0 0 2px rgba(0,0,0,.9); }
.ch.top, .ch.bottom { width: 2px; height: 9px; left: -1px; }
.ch.left, .ch.right { width: 9px; height: 2px; top: -1px; }
.ch.dot { width: 2px; height: 2px; left: -1px; top: -1px; border-radius: 50%; }
#crosshair .top { bottom: var(--gap, 6px); }
#crosshair .bottom { top: var(--gap, 6px); }
#crosshair .left { right: var(--gap, 6px); }
#crosshair .right { left: var(--gap, 6px); }
body.scoped #crosshair { display: none; }

/* 命中反馈 */
#hitmarker { position: absolute; left: 50%; top: 50%; opacity: 0; transition: opacity .25s; }
#hitmarker i { position: absolute; width: 10px; height: 2px; background: #fff; }
#hitmarker i:nth-child(1) { transform: translate(-14px,-10px) rotate(45deg); }
#hitmarker i:nth-child(2) { transform: translate(4px,-10px) rotate(-45deg); }
#hitmarker i:nth-child(3) { transform: translate(-14px,8px) rotate(-45deg); }
#hitmarker i:nth-child(4) { transform: translate(4px,8px) rotate(45deg); }
#hitmarker.show { opacity: 1; transition: none; }
#hitmarker.head i { background: #ff5540; }

/* 狙击镜 */
#scope-overlay { position: absolute; inset: 0; display: none; }
body.scoped #scope-overlay { display: block; }
.scope-circle { position: absolute; left: 50%; top: 50%; width: min(86vh, 86vw); height: min(86vh, 86vw); transform: translate(-50%,-50%); border-radius: 50%; box-shadow: 0 0 0 3000px rgba(0,0,0,.97), inset 0 0 40px rgba(0,0,0,.9); }
.scope-line { position: absolute; background: rgba(0,0,0,.85); }
.scope-line.h { left: 0; right: 0; top: 50%; height: 1.5px; }
.scope-line.v { top: 0; bottom: 0; left: 50%; width: 1.5px; }

/* 受击反馈 */
#damage-vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 42%, rgba(200,0,0,.55) 100%); transition: opacity .5s; }
#damage-vignette.show { opacity: 1; transition: none; }
#damage-direction { position: absolute; left: 50%; top: 50%; width: 210px; height: 210px; margin: -105px 0 0 -105px; opacity: 0; transition: opacity .8s; }
#damage-direction::before {
  content: ""; position: absolute; left: 50%; top: 4px; width: 66px; height: 16px; margin-left: -33px;
  background: radial-gradient(ellipse at bottom, rgba(255,40,40,.95), transparent 70%);
  border-radius: 50%; transform-origin: 50% 101px; transform: rotate(var(--dir, 0deg));
}
#damage-direction.show { opacity: 1; transition: none; }

/* 顶部 */
#top-bar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; font-size: 14px; }
#top-bar > div { background: rgba(8,14,20,.62); border: 1px solid rgba(255,255,255,.14); padding: 6px 16px; border-radius: 3px; letter-spacing: 1px; }
#top-bar b { color: #ffc440; font-size: 17px; }
#zone-box { min-width: 168px; text-align: center; }
#zone-status { color: #8fd0ff; margin-right: 8px; }
#zone-timer { color: #fff; }
#zone-box.warn #zone-status { color: #ff5d4a; }

/* 淘汰播报 */
#killfeed { position: absolute; top: 64px; right: 16px; width: 300px; text-align: right; font-size: 13px; }
.kf { background: rgba(8,14,20,.6); margin-bottom: 5px; padding: 4px 10px; border-radius: 3px; animation: kfin .2s ease-out; }
.kf .killer { color: #ffc440; }
.kf .victim { color: #ff8a7a; }
.kf .me { color: #7dff9a; }
@keyframes kfin { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 小地图 */
#minimap-box { position: absolute; top: 14px; right: 16px; width: 184px; height: 184px; border: 2px solid rgba(255,255,255,.35); border-radius: 3px; overflow: hidden; background: #16241a; }
#minimap { width: 100%; height: 100%; }
#compass { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-size: 11px; color: #fff; text-shadow: 0 0 3px #000; }

/* 提示与伤害数字 */
#toasts { position: absolute; left: 50%; bottom: 170px; transform: translateX(-50%); text-align: center; }
.toast { font-size: 15px; color: #ffe6a3; text-shadow: 0 1px 3px #000; margin-top: 4px; animation: toastIn .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
#pickup-hint { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); font-size: 15px; color: #fff; background: rgba(8,14,20,.65); padding: 5px 16px; border: 1px solid rgba(255,214,90,.6); border-radius: 3px; letter-spacing: 1px; }
#pickup-hint::first-letter { color: #ffc440; }
#dmg-numbers { position: absolute; left: 50%; top: 44%; width: 0; height: 0; }
.dmg-num { position: absolute; font-size: 17px; font-weight: bold; color: #fff; text-shadow: 0 1px 3px #000; animation: dmgFloat .8s ease-out forwards; }
.dmg-num.head { color: #ff5d4a; font-size: 21px; }
@keyframes dmgFloat { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-46px); } }

/* 底部左侧状态 */
#status-box { position: absolute; left: 24px; bottom: 24px; width: 300px; }
.bar { position: relative; height: 20px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.25); margin-top: 6px; border-radius: 2px; overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transition: width .18s; display: block; }
.hp-bar i { background: linear-gradient(180deg,#9df07a,#4cbb3c); }
.hp-bar.low i { background: linear-gradient(180deg,#ff9b6a,#e8452c); }
.hp-bar b { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 13px; text-shadow: 0 1px 2px #000; }
.armor-bar { height: 14px; }
.armor-bar i { background: linear-gradient(180deg,#7fc4ff,#3d8fd6); }
.armor-bar label { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; text-shadow: 0 1px 2px #000; }
#heal-progress { position: relative; height: 16px; margin-top: 6px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.25); border-radius: 2px; overflow: hidden; }
#heal-progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(120,220,140,.75); }
#heal-progress label { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; }

/* 底部右侧武器 */
#weapon-box { position: absolute; right: 24px; bottom: 24px; text-align: right; }

/* 投掷物栏 */
#throw-box { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 8px; }
.throw-item {
  position: relative; display: flex; align-items: center; gap: 5px;
  padding: 4px 8px; font-size: 12px; color: #9fb4c4;
  background: rgba(8,14,20,.6); border: 1px solid rgba(255,255,255,.18);
  border-radius: 3px; user-select: none; transition: all .12s;
}
.throw-item .tkey { font-size: 10px; opacity: .7; border: 1px solid rgba(255,255,255,.3); border-radius: 2px; padding: 0 3px; }
.throw-item b { font-size: 13px; color: #e8eef2; min-width: 10px; text-align: left; }
.throw-item.active { color: #ffc440; border-color: #ffc440; background: rgba(60,45,10,.6); }
.throw-item.active b { color: #ffc440; }
.throw-item.empty { opacity: .35; filter: grayscale(1); }
/* 投掷物小图标 */
.ti-nade, .ti-smoke, .ti-fire { display: inline-block; width: 10px; height: 12px; border-radius: 4px 4px 5px 5px; }
.ti-nade  { background: #4d5f42; box-shadow: 0 -3px 0 -1px #a8a8a0; }
.ti-smoke { background: #6f7f62; box-shadow: 0 -3px 0 -1px #b04030; border-radius: 2px; }
.ti-fire  { background: linear-gradient(#ff9a3a, #8a4a1a); border-radius: 3px 3px 6px 6px; }
/* 蓄力条 */
#throw-power {
  width: 100%; height: 6px; margin-bottom: 8px;
  background: rgba(8,14,20,.65); border: 1px solid rgba(255,255,255,.2);
  border-radius: 3px; overflow: hidden;
}
#throw-power i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #7ee06a, #ffd240 60%, #ff5a3a);
  transition: width .04s linear;
}
.slot { display: inline-block; margin-left: 8px; padding: 5px 12px; font-size: 13px; color: #9fb4c4; background: rgba(8,14,20,.6); border: 1px solid rgba(255,255,255,.18); border-radius: 3px; vertical-align: bottom; }
.slot.active { color: #ffc440; border-color: #ffc440; background: rgba(60,45,10,.6); }
#ammo-line { margin-top: 8px; font-size: 15px; }
#mag-count { font-size: 34px; font-weight: bold; text-shadow: 0 2px 4px #000; }
#ammo-line span, #ammo-line em { font-size: 20px; color: #9fb4c4; margin: 0 4px; }
.wname { display: block; font-size: 13px; color: #ffc440; letter-spacing: 1px; margin-top: 2px; }
#ammo-line.reloading #mag-count { color: #ff9b6a; }

/* ===== 降级视角模式：隐藏系统光标，游戏准心即光标 ===== */
body.fallback-look, body.fallback-look * { cursor: none !important; }
