* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0d0f14; overflow: hidden; font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif; color: #fff; user-select: none; }
#stage-wrap { position: absolute; width: 540px; height: 960px; transform-origin: 0 0; background: #000; box-shadow: 0 0 60px rgba(0,0,0,0.8); }
#game { position: absolute; left: 0; top: 0; touch-action: none; cursor: crosshair; }
.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud button { pointer-events: auto; }
.hud-btn { background: rgba(0,0,0,0.55); color: #fff; border: 2px solid rgba(255,255,255,0.35); border-radius: 10px; font-size: 16px; font-weight: bold; padding: 6px 10px; min-width: 52px; cursor: pointer; }
.hud-btn.on { border-color: #ffd86b; color: #ffd86b; }
.top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 12px; font-weight: bold; font-size: 18px; text-shadow: 0 2px 4px #000; }
.top .stage-name { flex: 1; text-align: center; font-size: 22px; color: #ffe07a; }
.xp-row { position: absolute; top: 54px; left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; }
.xp-bar { flex: 1; height: 12px; background: rgba(0,0,0,0.6); border-radius: 6px; border: 1px solid rgba(255,255,255,0.3); overflow: hidden; }
.xp-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, #4dc3ff, #9be3ff); transition: width 0.1s; }
#hud-level { font-weight: bold; font-size: 14px; color: #bfe9ff; text-shadow: 0 1px 3px #000; min-width: 46px; }
#hud-boss { position: absolute; top: 76px; left: 60px; right: 60px; display: flex; align-items: center; gap: 8px; font-weight: bold; color: #ff6b6b; text-shadow: 0 1px 3px #000; }
.boss-bar { flex: 1; height: 14px; background: rgba(0,0,0,0.7); border: 1px solid #ff6b6b; border-radius: 7px; overflow: hidden; }
.boss-bar > div { height: 100%; background: linear-gradient(90deg, #ff2d2d, #ff8a5a); transition: width 0.1s; }
.left-col { position: absolute; left: 12px; top: 110px; display: flex; flex-direction: column; gap: 8px; }
.right-col { position: absolute; right: 12px; top: 100px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.gun-box { background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.3); border-radius: 10px; padding: 6px 10px; text-align: right; font-size: 13px; }
#hud-ammo { font-size: 18px; font-weight: bold; color: #ffd86b; }
#hud-ammo.reloading { color: #ff7a5a; font-size: 14px; }
#hud-skills { display: flex; flex-direction: column; gap: 8px; }
.skill-icon { width: 54px; height: 54px; border-radius: 50%; border: 3px solid #666; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; font-size: 26px; position: relative; }
.skill-icon.empty { border-style: dashed; opacity: 0.35; }
.skill-icon b { position: absolute; right: -4px; bottom: -4px; background: #ffd86b; color: #000; border-radius: 10px; font-size: 12px; padding: 1px 6px; }
.wall-row { position: absolute; left: 12px; right: 12px; top: 820px; display: flex; align-items: center; gap: 10px; }
.wall-bar { flex: 1; height: 18px; background: rgba(0,0,0,0.7); border: 2px solid rgba(255,255,255,0.4); border-radius: 9px; overflow: hidden; }
.wall-bar > div { height: 100%; width: 100%; background: #e83a3a; transition: width 0.1s; }
#hud-wall-text { font-weight: bold; text-shadow: 0 1px 3px #000; min-width: 120px; text-align: right; }

/* ---------- 通用覆盖层 ---------- */
.overlay { position: absolute; inset: 0; background: rgba(8,10,16,0.82); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; overflow-y: auto; }
.overlay h1 { font-size: 52px; margin: 0 0 4px; color: #ffe07a; text-shadow: 0 4px 0 #a04a1a, 0 8px 20px rgba(0,0,0,0.8); letter-spacing: 4px; }
.overlay h2 { font-size: 36px; margin: 0 0 16px; color: #ffe07a; text-shadow: 0 3px 0 #a04a1a; }
.overlay h3 { font-size: 16px; margin: 14px 0 6px; color: #bbb; }
.subtitle { color: #aab; margin-bottom: 14px; }
.small { color: #889; font-size: 13px; margin-top: 10px; }
.help { color: #778; font-size: 12px; margin-top: 18px; line-height: 1.6; }
.big-btn { background: linear-gradient(180deg, #ffd86b, #f0a020); color: #3a1f00; border: none; border-radius: 14px; font-size: 22px; font-weight: bold; padding: 14px 32px; cursor: pointer; box-shadow: 0 5px 0 #9a5a10; margin-top: 12px; }
.big-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #9a5a10; }
.big-btn.grey { background: linear-gradient(180deg, #8a8f9a, #5c616b); color: #fff; box-shadow: 0 5px 0 #33363c; }
.big-btn.orange { background: linear-gradient(180deg, #ff9a4d, #e85a1a); color: #fff; box-shadow: 0 5px 0 #7a2a08; }
.big-btn:disabled { opacity: 0.4; cursor: default; }
.coins-row { font-size: 20px; margin-bottom: 12px; }
.coins-row b { color: #ffd86b; }

/* ---------- 武器选择 ---------- */
#menu-guns { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 460px; }
.gun-card { background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.15); border-radius: 14px; padding: 10px 14px; text-align: left; cursor: pointer; position: relative; }
.gun-card.selected { border-color: #ffd86b; background: rgba(255,216,107,0.12); }
.gun-name { font-size: 20px; font-weight: bold; }
.gun-lv { color: #ffd86b; font-size: 14px; margin-left: 6px; }
.gun-desc { color: #aab; font-size: 13px; margin: 2px 0 6px; }
.gun-stats { display: flex; gap: 12px; font-size: 12px; color: #cde; flex-wrap: wrap; }
.btn-up { position: absolute; right: 12px; top: 12px; background: #2f8f5a; color: #fff; border: none; border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: bold; cursor: pointer; }
.btn-up:disabled { background: #555; }

/* ---------- 三选一卡片 ---------- */
#cards-list { display: flex; gap: 10px; width: 100%; justify-content: center; }
.card { --c: #ffd86b; width: 158px; min-height: 300px; background: linear-gradient(180deg, #2a2f3a, #171a22); border: 3px solid var(--c); border-radius: 16px; padding: 14px 10px; cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: center; transition: transform 0.12s; box-shadow: 0 8px 24px rgba(0,0,0,0.6); }
.card:hover { transform: translateY(-8px) scale(1.03); }
.card-level { position: absolute; top: 8px; right: 10px; font-size: 12px; font-weight: bold; color: var(--c); }
.card-key { position: absolute; top: 6px; left: 10px; font-size: 12px; color: #667; border: 1px solid #556; border-radius: 4px; padding: 0 5px; }
.card-icon { font-size: 44px; width: 78px; height: 78px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(255,255,255,0.15), rgba(0,0,0,0.3)); border: 3px solid var(--c); margin: 12px 0 8px; }
.card-title { font-size: 19px; font-weight: bold; }
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin: 6px 0; }
.card-tags span { font-size: 11px; background: rgba(255,255,255,0.12); border-radius: 6px; padding: 1px 6px; color: #dde; }
.card-sub { color: var(--c); font-size: 13px; font-weight: bold; min-height: 18px; }
.card-body { font-size: 13px; color: #cfd6e0; line-height: 1.5; margin-top: 6px; }

/* ---------- 结算 ---------- */
#end-title.won { color: #ffe07a; } #end-title.lost { color: #ff6b6b; text-shadow: 0 3px 0 #5a1010; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 16px; margin-bottom: 6px; }
.stat-row .coins { color: #ffd86b; font-weight: bold; }
.table { width: 100%; max-width: 460px; }
.table .row { display: grid; grid-template-columns: 110px 1fr 110px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; text-align: left; }
.table .row span:last-child { text-align: right; }
.table .bar { height: 10px; background: rgba(255,255,255,0.1); border-radius: 5px; overflow: hidden; }
.table .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd86b, #ff8a3c); }
.table .bar i.red { background: linear-gradient(90deg, #ff4d4d, #a02020); }
.btn-row { display: flex; gap: 12px; }
