/* 猎械纪元 —— 全屏战斗壳 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #05070d; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #e7ecf5;
  -webkit-user-select: none; user-select: none;
}
#stage { position: fixed; inset: 0; }
#game { display: block; width: 100%; height: 100%; cursor: crosshair; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud.hidden { display: none; }
#hud-left { position: absolute; left: 20px; top: 18px; display: flex; flex-direction: column; gap: 8px; }
#hpbar {
  width: 260px; height: 16px; border: 1px solid rgba(148,163,192,.5);
  border-radius: 8px; background: rgba(10,16,31,.75); overflow: hidden;
}
#hpfill { width: 100%; height: 100%; background: linear-gradient(90deg,#34d399,#22d3ee); transition: width .12s; }
#ammo { font-family: Consolas, monospace; font-size: 15px; color: #e7ecf5; text-shadow: 0 1px 2px #000; }
#hud-right { position: absolute; right: 20px; top: 18px; text-align: right; display: flex; flex-direction: column; gap: 6px; }
#gun-name { font-size: 14px; color: #94a3c0; text-shadow: 0 1px 2px #000; }
#fps { font-family: Consolas, monospace; font-size: 11px; color: #5c6b8c; }

#toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(245,158,11,.92); color: #0b1120; font-size: 13px;
  padding: 7px 16px; border-radius: 8px; z-index: 20;
/* 掉落卡 */
#lootcard {
  position: fixed; inset: 0; z-index: 30; background: rgba(5,7,13,.55);
  display: flex; align-items: center; justify-content: center;
#toast.hidden { display: none; }

/* 背包 */
#inventory { position: fixed; inset: 0; z-index: 25; background: rgba(5,7,13,.6); display: flex; align-items: center; justify-content: center; }
#inventory.hidden { display: none; }
#inv-panel {
  width: 640px; max-width: 94vw; max-height: 86vh; overflow-y: auto;
  background: #0d1526; border: 1px solid rgba(148,163,192,.3); border-radius: 16px; padding: 18px 20px;
}
#inv-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#inv-title { font-size: 16px; font-weight: 700; letter-spacing: .1em; }
#inv-close { background: none; border: 1px solid rgba(148,163,192,.4); color: #94a3c0; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; }
#inv-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-bottom: 14px; }
.inv-slot {
  aspect-ratio: 1; border-radius: 10px; border: 2px solid rgba(148,163,192,.25);
  background: rgba(255,255,255,.04); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #cbd5e1; transition: transform .1s;
}
.inv-slot:hover { transform: scale(1.08); }
.inv-slot.equipped { box-shadow: 0 0 0 2px #22d3ee; }
.inv-slot.empty { cursor: default; opacity: .25; }
#inv-detail { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
#inv-d-name { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
#inv-d-stats { font-family: Consolas, monospace; font-size: 12px; color: #e7ecf5; line-height: 1.7; }
#inv-d-affixes { font-size: 12.5px; line-height: 1.8; color: #94a3c0; }
#inv-d-actions { margin-top: 10px; }
#inv-equip { padding: 8px 22px; border: 0; border-radius: 10px; background: #22d3ee; color: #06121f; font-weight: 700; cursor: pointer; }
#inv-settings { display: flex; gap: 22px; font-size: 12.5px; color: #94a3c0; }
#inv-settings label { display: flex; align-items: center; gap: 8px; }
#inv-settings input[type=range] { width: 130px; }
.delta-up { color: #34d399; }
.delta-down { color: #f87171; }
#lootcard.hidden { display: none; }
#lootcard-box {
  width: 460px; max-width: 92vw; background: #0d1526; border: 2px solid #60a5fa;
  border-radius: 18px; padding: 26px 28px; text-align: center;
  box-shadow: 0 0 60px rgba(34,211,238,.18), 0 30px 80px rgba(0,0,0,.7);
}
#loot-rarity { font-size: 12px; letter-spacing: .3em; margin-bottom: 4px; }
#loot-name { margin: 0 0 6px; font-size: 26px; }
#loot-maker { font-size: 13px; color: #94a3c0; margin-bottom: 14px; }
#loot-stats {
  font-family: Consolas, monospace; font-size: 13px; color: #e7ecf5;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; line-height: 1.7;
}
#loot-affixes { font-size: 13.5px; line-height: 1.9; min-height: 24px; margin-bottom: 16px; }
#loot-take {
  width: 100%; padding: 11px 0; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(90deg, #22d3ee, #60a5fa); color: #06121f;
  font-size: 15px; font-weight: 700; letter-spacing: .15em;
}
#loot-take:hover { filter: brightness(1.12); }
#toast.hidden { display: none; }

/* Boss 血条 */
#bossbar {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  width: 520px; max-width: 80vw; pointer-events: none; z-index: 11;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
#bossbar.hidden { display: none; }
#bossname { font-size: 13px; letter-spacing: .2em; color: #f59e0b; text-shadow: 0 1px 3px #000; }
#bossfill-wrap { width: 100%; height: 12px; border: 1px solid rgba(245,158,11,.6); border-radius: 6px; background: rgba(10,16,31,.8); overflow: hidden; }
#bossfill { width: 100%; height: 100%; background: linear-gradient(90deg, #f87171, #f59e0b); transition: width .15s; }

/* 胜负遮罩 */
#overlay {
  position: fixed; inset: 0; z-index: 30; background: rgba(5,7,13,.72);
  display: flex; align-items: center; justify-content: center; pointer-events: auto;
}
#overlay.hidden { display: none; }
#overlay-box { text-align: center; }
#overlay-title { font-size: 52px; margin: 0 0 10px; letter-spacing: .08em; }
#overlay-sub { font-size: 15px; color: #94a3c0; margin: 0; }
