* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #06080f;
  color: #eef2ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  cursor: crosshair;
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.topbar {
  position: absolute;
  top: 14px; left: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

.tag {
  border: 1px solid rgba(238, 242, 255, 0.3);
  border-radius: 4px;
  padding: 3px 8px;
  letter-spacing: 2px;
  background: rgba(6, 8, 15, 0.4);
}

.kills {
  color: #ffd166;
  letter-spacing: 1px;
  background: rgba(6, 8, 15, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
}

.bottom {
  position: absolute;
  left: 0; right: 0; bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 22px;
}

.vitals { display: flex; align-items: center; gap: 10px; }

.bar {
  width: 150px; height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #3ee08f, #6ee7ff);
  transition: width .15s linear, background .2s;
}

.bar i.low { background: linear-gradient(90deg, #ff6b6b, #ff9f43); }

.hp {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ammo {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  letter-spacing: 1px;
}

.ammo #ammoMag { font-size: 26px; font-weight: 800; }
.ammo .slash { opacity: .45; margin: 0 3px; }
.ammo #ammoRes { opacity: .65; }
.ammo .weapon {
  display: block;
  font-size: 11px;
  opacity: .55;
  letter-spacing: 2px;
  text-align: right;
}

/* ---------- 准星 ---------- */
.crosshair {
  position: fixed;
  left: 50%; top: 50%;
  width: 0; height: 0;
  z-index: 7;
  pointer-events: none;
  opacity: .9;
}

.crosshair i {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
}

.ch-top, .ch-bottom { width: 2px; height: 8px; left: -1px; }
.ch-left, .ch-right { width: 8px; height: 2px; top: -1px; }
.ch-top { top: -13px; }
.ch-bottom { top: 5px; }
.ch-left { left: -13px; }
.ch-right { left: 5px; }

.hitmark {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.8);
  font-size: 18px;
  color: #ff8a8a;
  opacity: 0;
  z-index: 8;
  pointer-events: none;
  transition: opacity .12s;
}

.hitmark.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- 小地图 ---------- */
#minimap {
  position: fixed;
  top: 58px; right: 14px;
  width: 148px; height: 148px;
  border-radius: 50%;
  border: 1px solid rgba(238, 242, 255, 0.22);
  background: rgba(6, 8, 15, 0.42);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  z-index: 6;
  pointer-events: none;
}

.sound {
  position: fixed;
  top: 12px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(238, 242, 255, 0.25);
  background: rgba(6, 8, 15, 0.55);
  color: #eef2ff;
  font-size: 14px;
  cursor: pointer;
  z-index: 9;
}

.sound[aria-pressed="false"] { opacity: .4; }

/* ---------- 触屏按钮 ---------- */
.touch-btn {
  position: fixed;
  display: none;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(6, 8, 15, 0.45);
  color: #eef2ff;
  font-size: 13px;
  z-index: 9;
  touch-action: none;
}

.touch-btn.fire {
  right: 22px; bottom: 90px;
  width: 74px; height: 74px;
  border-color: rgba(255, 106, 106, 0.5);
  background: rgba(120, 24, 24, 0.45);
  font-size: 15px;
  font-weight: 700;
}

.touch-btn.reload {
  right: 106px; bottom: 44px;
  width: 54px; height: 54px;
  font-size: 12px;
}

body.touch .touch-btn { display: block; }

/* ---------- 摇杆 ---------- */
.stick {
  position: fixed;
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
  display: none;
  z-index: 4;
}

.stick::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

.stick.on { display: block; }

/* ---------- 浮层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 6, 12, 0.86);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.overlay.hidden { display: none; }

.card {
  width: min(94vw, 560px);
  max-height: 92vh;
  overflow: auto;
  padding: 30px 26px 24px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(24, 32, 58, 0.98), rgba(10, 14, 26, 0.98));
  border: 1px solid rgba(110, 231, 255, 0.22);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.card .icon {
  font-size: 34px;
  color: #6ee7ff;
  margin-bottom: 6px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: 1px;
}

.card .line {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.9;
  color: rgba(238, 242, 255, 0.66);
}

.maps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.map-card {
  padding: 0 0 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #eef2ff;
  cursor: pointer;
  overflow: hidden;
  text-align: center;
  font-size: 12px;
}

.map-card b { display: block; margin-top: 8px; font-size: 13px; }
.map-card small { display: block; margin-top: 2px; opacity: .5; font-size: 11px; }

.map-card.sel {
  border-color: rgba(110, 231, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(110, 231, 255, 0.45), 0 10px 26px rgba(0, 0, 0, 0.4);
}

.map-card .thumb {
  display: block;
  height: 58px;
}

.thumb.yard { background: linear-gradient(180deg, #4a8fd8 0%, #b9dcf2 55%, #8d9098 56%, #6e7078 100%); }
.thumb.warehouse { background: linear-gradient(180deg, #2a3145 0%, #4a5470 60%, #3a3f4e 61%, #24272f 100%); }
.thumb.parking {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 2px, transparent 2px 24px),
    linear-gradient(180deg, #23262a 0%, #3b3f45 62%, #4a4d52 63%, #303338 100%);
}
.thumb.mall {
  background:
    linear-gradient(180deg, #fff6d8 0 12%, transparent 12%),
    linear-gradient(180deg, #d9d6cf 0%, #b9c6cc 55%, #cfccc3 56%, #a9a69e 100%);
}
.thumb.pool {
  background:
    linear-gradient(180deg, #7fc8e6 0%, #b9e3f4 42%, #e9f2f3 43% 58%, #3fa2c6 59%, #2f83ad 100%);
}
.thumb.warehouse { background: linear-gradient(180deg, #2a3145 0%, #4a5470 60%, #3a3f4e 61%, #24272f 100%); }

button.primary {
  padding: 13px 44px;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 255, 0.5);
  background: linear-gradient(180deg, #6ee7ff, #3fa9d8);
  color: #06202c;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
  cursor: pointer;
}

button.primary:active { transform: scale(0.98); }

.keys {
  margin: 16px 0 0;
  font-size: 11px;
  color: rgba(238, 242, 255, 0.4);
  line-height: 1.8;
}

@media (max-width: 700px) {
  #minimap { width: 104px; height: 104px; top: 54px; right: 10px; }
  .bottom { bottom: 12px; padding: 0 14px; }
  .bar { width: 96px; }
  .hp { font-size: 17px; }
  .ammo #ammoMag { font-size: 21px; }
  .maps { grid-template-columns: 1fr; }
  .map-card { display: grid; grid-template-columns: 62px 1fr; text-align: left; padding: 0; }
  .map-card .thumb { height: 56px; }
  .map-card b, .map-card small { grid-column: 2; }
  .map-card b { align-self: end; }
}
