/* 弹仓 2048 · AMMO 2048 — 正式版样式。门户把本文件内联进 Shadow DOM，所有选择器都挂在 .g-ammo 之下。 */
body { margin: 0; background: #fff9ed; }
.g-ammo { container: ammo / inline-size; --ink: #272219; --paper: #fff9ed; --card: #fffdf6; --muted: #857866; --yellow: #f8d84a; --red: #d54830; position: relative; box-sizing: border-box; max-width: 1100px; margin: 0 auto; padding: 14px; color: var(--ink); background: var(--paper); font-family: 'Avenir Next', 'PingFang SC', 'Hiragino Sans', 'Microsoft YaHei', sans-serif; font-synthesis: none; -webkit-tap-highlight-color: transparent; }
.g-ammo:focus { outline: none; }
.g-ammo *, .g-ammo *::before, .g-ammo *::after { box-sizing: border-box; }
.g-ammo button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.g-ammo button:disabled { cursor: default; opacity: .4; }
.g-ammo button:focus-visible, .g-ammo summary:focus-visible { outline: 3px solid #337a9f; outline-offset: 3px; }

/* ---------- layout: phone = stacked, host ≥ 900px = battlefield left, panel right ---------- */
.am-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@container ammo (min-width: 900px) { .am-layout { grid-template-columns: minmax(0, 1.4fr) minmax(290px, .6fr); gap: 24px; } }
.am-stage { position: relative; overflow: hidden; padding: 14px; background: #e6ece4; border: 1px solid #d4dbd0; border-radius: 22px; }
.am-side { min-width: 0; }

/* ---------- panel kit (stats, panels, buttons, feedback, result) ---------- */
.am-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.am-stat { min-width: 0; padding: 9px 12px; border: 2px solid var(--ink); box-shadow: 3px 3px var(--ink); background: var(--card); }
.am-stat small { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-stat b { display: block; font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.am-panel { padding: 16px; border: 2px solid var(--ink); box-shadow: 5px 5px var(--ink); background: var(--card); }
.am-panel + .am-panel, .am-result + .am-panel { margin-top: 16px; }
.am-panel h2 { margin: 0 0 10px; font-size: 16px; font-weight: 850; }
.am-btn { min-height: 44px; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 0; box-shadow: 3px 3px var(--ink); background: var(--yellow); color: var(--ink); font-weight: 800; transition: transform .12s, box-shadow .12s; }
.am-btn.accent { background: var(--red); color: var(--paper); }
.am-btn.secondary { background: var(--card); }
.am-btn.wide { width: 100%; }
.am-btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px var(--ink); }
.am-btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px var(--ink); }
.am-row { display: flex; gap: 8px; margin-top: 10px; }
.am-row .am-btn { flex: 1; min-width: 0; padding-inline: 6px; }
.am-feedback { min-height: 65px; margin: 0 0 12px; padding: 11px 13px; border: 1.5px solid var(--ink); background: #fff1b9; font-size: 13px; line-height: 1.6; white-space: pre-line; }
.am-feedback.good { background: #e3f0d2; }
.am-feedback.bad { background: #f9d6cc; color: #8e2f1f; }
.am-result:empty { display: none; }
.am-result { margin: 16px 0 0; padding: 16px 18px; border: 2px solid var(--ink); box-shadow: 5px 5px var(--red); background: var(--yellow); }
.am-result h2 { margin: 0 0 8px; font-size: 22px; }
.am-result p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; }
.am-result .am-best { font-weight: 800; }
.am-result .am-btn { background: var(--ink); color: var(--yellow); }
.badge { display: inline-flex; padding: 3px 8px; font-size: 10px; font-weight: 700; background: #e9eedf; color: #486444; }
.am-settings { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.am-toggle { min-height: 36px; padding: 6px 12px; border: 1.5px solid var(--ink); background: var(--card); font-size: 12px; font-weight: 700; }
.am-toggle[aria-pressed="true"] { background: var(--yellow); }
.am-help { margin-top: 12px; font-size: 12px; line-height: 1.7; color: #5c5244; }
.am-help summary { cursor: pointer; font-weight: 800; color: var(--ink); }
.am-help ol { margin: 8px 0 0; padding-left: 18px; }
.am-help li + li { margin-top: 4px; }

/* ---------- celebration confetti (inside the stage) ---------- */
.am-confetti { position: absolute; inset: 0; z-index: 45; pointer-events: none; overflow: hidden; }
.am-confetti i { position: absolute; top: 18%; width: 8px; height: 13px; animation: am-fall 1.1s ease-in forwards; }
@keyframes am-fall { to { transform: translate(var(--dx), 420px) rotate(340deg); opacity: 0; } }

/* ---------- battlefield & chamber skin (from the lab, scoped) ---------- */
.g-ammo .am-fx-canvas, .g-ammo .am-fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
.g-ammo .am-fx-layer { overflow: visible; }
.g-ammo .am-fx-layer > * { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform, opacity; }
.g-ammo .am-chain-status { min-height: 42px; margin: 10px 0; padding: 10px 14px; border-radius: 10px; background: #253b35; color: #ffe09a; font-size: 14px; font-weight: 850; }
.g-ammo .am-bullet:hover { filter: brightness(1.08); }
.g-ammo .am-bullet:focus-visible, .g-ammo .am-lane:focus-visible { outline: 3px solid #709bbe; outline-offset: 3px; }
.g-ammo .am-root[aria-busy="true"] .am-lane { cursor: wait; }
.g-ammo .am-lanes { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 10px; border-radius: 16px; background: linear-gradient(180deg, #2b393d 0%, #1f2a2d 100%); border: 2px solid #1b2426; }
.g-ammo .am-lane { display: flex; flex-direction: column; gap: 5px; padding: 6px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(255, 255, 255, 0.12); cursor: pointer; transition: border-color .13s, background .13s; position: relative; min-width: 0; }
.g-ammo .am-lane:hover, .g-ammo .am-lane.active { border-color: #f3c859; background: rgba(243, 200, 89, 0.12); }
.g-ammo .am-lane.zero-ready { border-color: #67d59b; background: rgba(103, 213, 155, 0.14); }
.g-ammo .am-cell { height: 44px; border-radius: 9px; display: flex; align-items: center; justify-content: center; position: relative; border: 1px dashed rgba(255, 255, 255, 0.1); color: #fffdf7; font-weight: 850; }
.g-ammo .am-cell.frontline { border-bottom: 2px solid rgba(235, 108, 84, 0.65); }
.g-ammo .am-monster { width: 100%; height: 100%; border-radius: 8px; background: linear-gradient(180deg, #d96b52, #a8422f); border: 2px solid #591c12; display: flex; align-items: center; justify-content: center; gap: 4px; position: relative; box-shadow: 0 2px 0 #591c12; }
.g-ammo .am-monster.elite { background: linear-gradient(180deg, #b858b0, #7c2d78); border-color: #421240; box-shadow: 0 2px 0 #421240; }
.g-ammo .am-monster svg { width: 22px; height: 22px; flex-shrink: 0; }
.g-ammo .am-monster.target { animation: am-target 0.9s ease-in-out infinite; }
@keyframes am-target { 50% { box-shadow: 0 0 0 3px #f3c859, 0 2px 0 #591c12; } }
.g-ammo .am-monster.target.zero { animation-name: am-target-zero; }
@keyframes am-target-zero { 50% { box-shadow: 0 0 0 3px #67d59b, 0 0 14px #67d59b; } }
.g-ammo .am-hp { font-size: 16px; font-weight: 900; letter-spacing: -.02em; }
.g-ammo .am-after { font-size: 10px; background: rgba(0,0,0,.35); padding: 1px 4px; border-radius: 4px; }
.g-ammo .am-shot-tag { margin-top: 4px; padding: 5px 4px; border-radius: 8px; text-align: center; font-size: 11px; font-weight: 800; background: rgba(255, 255, 255, 0.12); color: #dfe7e5; }
.g-ammo .am-shot-tag.zero { background: #58c98e; color: #0e2b1d; }
.g-ammo .am-shot-tag.pierce { background: #67b7dc; color: #0e2736; }
.g-ammo .am-shot-tag.danger { background: #d9524a; color: #fff; }
.g-ammo .am-chamber-box { position: relative; margin-top: 12px; padding: 12px; border-radius: 16px; background: #fffdf7; border: 2px solid #252d30; box-shadow: 0 4px 0 #252d30; }
.g-ammo .am-chamber-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; margin-bottom: 9px; gap: 8px; flex-wrap: wrap; }
.g-ammo .am-chamber-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; position: relative; }
.g-ammo .am-bullet { min-height: 56px; min-width: 0; border-radius: 12px; border: 2px solid #3c3224; background: linear-gradient(180deg, #fae19c, #e6b853); color: #2f210c; font: inherit; font-weight: 900; font-size: 19px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: translate .14s, box-shadow .14s, border-color .14s; box-shadow: 0 3px 0 #3c3224; position: relative; touch-action: none; user-select: none; -webkit-user-select: none; }
.g-ammo .am-bullet small { font-size: 10px; font-weight: 700; opacity: .78; margin-bottom: 2px; white-space: nowrap; }
.g-ammo .am-bullet[data-tier="2"] { background: linear-gradient(180deg, #f5b371, #db7635); color: #fffdf8; }
.g-ammo .am-bullet[data-tier="3"] { background: linear-gradient(180deg, #86b9e8, #467eb8); color: #fffdf8; }
.g-ammo .am-bullet[data-tier="4"] { background: linear-gradient(180deg, #ffe678, #df9b1a); color: #2a1903; box-shadow: 0 3px 0 #593b04, 0 0 14px rgba(255, 217, 74, 0.75); }
.g-ammo .am-bullet.selected { translate: 0 -7px; border-color: #db6446; outline: 3px solid #db6446; outline-offset: 1px; }
.g-ammo .am-bullet.lean-r { translate: 4px 0; box-shadow: 0 3px 0 #3c3224, inset 0 0 0 2px #4aa375; }
.g-ammo .am-bullet.lean-l { translate: -4px 0; box-shadow: 0 3px 0 #3c3224, inset 0 0 0 2px #4aa375; }
.g-ammo .am-bullet.dragging { opacity: .35; }
.g-ammo .am-bullet.zero-hit::after { content: attr(data-zero); position: absolute; left: 50%; bottom: -9px; translate: -50% 0; padding: 0 5px; border-radius: 6px; background: #58c98e; color: #0e2b1d; font-size: 9px; font-weight: 900; line-height: 15px; white-space: nowrap; pointer-events: none; }
.g-ammo [data-fx="comic"] .am-bullet.zero-hit { box-shadow: 3px 3px #4f8a2e; }
.g-ammo [data-fx="comic"] .am-bullet.zero-hit::after { background: #8cba67; color: #272219; border: 1.5px solid #272219; border-radius: 0; }
.g-ammo .am-after-bar { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: #eef3ec; font-size: 12px; font-weight: 750; color: #2f4a3c; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-ammo .am-chain-line { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.g-ammo .am-chain-line i { font-style: normal; padding: 1px 6px; border-radius: 6px; background: #fff; border: 1px solid #c9d5c6; font-variant-numeric: tabular-nums; }
.g-ammo .am-chain-line i.hot { background: #ffe09a; border-color: #d69a2c; }
.g-ammo .am-chain-line b { color: #b75635; }
.g-ammo .am-chain-hud { position: absolute; right: 10px; top: -16px; z-index: 31; padding: 3px 10px; border-radius: 999px; background: #252d30; color: #ffe09a; font-weight: 950; font-size: 15px; letter-spacing: .02em; pointer-events: none; opacity: 0; white-space: nowrap; box-shadow: 0 3px 0 #0005; }
.g-ammo .am-aim { position: absolute; inset: 0; pointer-events: none; z-index: 8; overflow: visible; }
.g-ammo .am-aim path { fill: none; stroke: #f3c859; stroke-width: 2.5; stroke-dasharray: 7 7; animation: am-dash .5s linear infinite; }
.g-ammo .am-aim.zero path { stroke: #67d59b; }
.g-ammo .am-aim.danger path { stroke: #e0574b; }
.g-ammo .am-aim circle { fill: none; stroke: #f3c859; stroke-width: 2.5; }
.g-ammo .am-aim.zero circle { stroke: #67d59b; }
@keyframes am-dash { to { stroke-dashoffset: -14; } }
.g-ammo .am-drag-ghost { position: absolute; z-index: 1000; pointer-events: none; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 12px; display: grid; place-items: center; font-weight: 950; font-size: 18px; background: #ffe299; color: #2f210c; border: 2px solid #3c3224; box-shadow: 0 10px 20px #0004; }

/* ---------- FX words & projectiles (shared) ---------- */
.g-ammo .am-word { font-weight: 950; font-size: 17px; white-space: nowrap; color: #fff8df; text-shadow: 0 2px 0 #342b20, 1px 0 #342b20, -1px 0 #342b20, 0 -1px #342b20; }
.g-ammo .am-word.big { font-size: 24px; }
.g-ammo .am-word.huge { font-size: 34px; }
.g-ammo .am-word.pts { font-size: 13px; color: #ffe09a; }
.g-ammo .am-word.pts.mid { font-size: 16px; }
.g-ammo .am-word.pts.big { font-size: 20px; }
.g-ammo .am-shot { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 50% 50% 30% 30%; background: #ffe299; color: #36270c; font-weight: 950; font-size: 13px; box-shadow: 0 0 14px #f3c859; }

/* ---------- A · 金属撞膛 (default brass) ---------- */
.g-ammo [data-fx="metal"] .am-chain-hud { background: #2c2318; color: #ffd36b; border: 2px solid #ffd36b; }
.g-ammo [data-fx="metal"] .am-shot { width: 14px; min-width: 0; height: 30px; padding: 0; border-radius: 7px 7px 3px 3px; background: linear-gradient(90deg, #a8742c, #ffe7a2 45%, #c58b32); color: transparent; box-shadow: 0 0 10px #ffcf6b; font-size: 0; }

/* ---------- B · 电磁聚变 ---------- */
.g-ammo [data-fx="plasma"] .am-lanes { background: radial-gradient(120% 90% at 50% 100%, #1d3448 0%, #0d1520 70%); border-color: #0a1018; }
.g-ammo [data-fx="plasma"] .am-lane { border-color: rgba(120, 220, 255, .14); background: rgba(80, 180, 255, .04); }
.g-ammo [data-fx="plasma"] .am-lane:hover, .g-ammo [data-fx="plasma"] .am-lane.active { border-color: #6fe3ff; background: rgba(111, 227, 255, .1); }
.g-ammo [data-fx="plasma"] .am-monster { background: linear-gradient(180deg, #2c1e3e, #1b1228); border-color: #ff5d8f; box-shadow: 0 0 10px #ff5d8f88, inset 0 0 10px #ff5d8f44; color: #ffd6e4; }
.g-ammo [data-fx="plasma"] .am-monster.elite { border-color: #c77dff; box-shadow: 0 0 12px #c77dffaa, inset 0 0 10px #c77dff55; }
.g-ammo [data-fx="plasma"] .am-chamber-box { background: #101b26; border-color: #6fe3ff; box-shadow: 0 0 0 1px #0b121a, 0 0 18px #6fe3ff44; color: #cdeffc; }
.g-ammo [data-fx="plasma"] .am-chamber-head span { color: #8fb7c8 !important; }
.g-ammo [data-fx="plasma"] .am-after-bar { background: #172838; color: #bfe9f7; }
.g-ammo [data-fx="plasma"] .am-chain-line i { background: #0f1c28; border-color: #2c4a5e; }
.g-ammo [data-fx="plasma"] .am-chain-line i.hot { background: #1c4255; border-color: #6fe3ff; }
.g-ammo [data-fx="plasma"] .am-chain-line b { color: #6fe3ff; }
.g-ammo [data-fx="plasma"] .am-bullet { background: radial-gradient(circle at 50% 35%, #1e3a4d, #0d1823 75%); border: 2px solid #6fe3ff; color: #e3fbff; box-shadow: 0 0 10px #6fe3ff66, inset 0 0 12px #6fe3ff33; border-radius: 14px; text-shadow: 0 0 8px #6fe3ff; }
.g-ammo [data-fx="plasma"] .am-bullet[data-tier="2"] { border-color: #4dffc3; box-shadow: 0 0 12px #4dffc388, inset 0 0 12px #4dffc344; text-shadow: 0 0 8px #4dffc3; }
.g-ammo [data-fx="plasma"] .am-bullet[data-tier="3"] { border-color: #c77dff; box-shadow: 0 0 14px #c77dffaa, inset 0 0 14px #c77dff55; text-shadow: 0 0 8px #c77dff; }
.g-ammo [data-fx="plasma"] .am-bullet[data-tier="4"] { border-color: #fff4b8; background: radial-gradient(circle at 50% 35%, #5a4a1e, #1d1608 80%); box-shadow: 0 0 18px #ffe36e, inset 0 0 14px #ffe36e66; text-shadow: 0 0 10px #ffe36e; }
.g-ammo [data-fx="plasma"] .am-bullet.selected { outline-color: #ff5d8f; border-color: #ff5d8f; }
.g-ammo [data-fx="plasma"] .am-chain-hud { background: #0b1520; color: #6fe3ff; border: 1.5px solid #6fe3ff; box-shadow: 0 0 14px #6fe3ff88; }
.g-ammo [data-fx="plasma"] .am-word { color: #e8fcff; text-shadow: 0 0 6px #6fe3ff, 0 0 14px #6fe3ff, 0 0 2px #023; }
.g-ammo [data-fx="plasma"] .am-word.pts { color: #b6f6ff; }
.g-ammo [data-fx="plasma"] .am-shot { width: 22px; min-width: 0; height: 22px; padding: 0; border-radius: 50%; background: radial-gradient(circle, #fff 0 25%, #8ff0ff 45%, #2aa7d8 75%, transparent 76%); box-shadow: 0 0 16px #6fe3ff, 0 0 30px #6fe3ff88; color: transparent; font-size: 0; }

/* ---------- C · 软糖融合 ---------- */
.g-ammo [data-fx="jelly"] .am-lanes { background: linear-gradient(180deg, #ffe9ef 0%, #ffd9e4 100%); border-color: #f2b6c7; }
.g-ammo [data-fx="jelly"] .am-lane { background: rgba(255,255,255,.45); border-color: rgba(220,140,165,.3); border-radius: 18px; }
.g-ammo [data-fx="jelly"] .am-lane:hover, .g-ammo [data-fx="jelly"] .am-lane.active { border-color: #ff8fb1; background: rgba(255,255,255,.7); }
.g-ammo [data-fx="jelly"] .am-cell { border-color: rgba(200,120,150,.22); border-radius: 14px; }
.g-ammo [data-fx="jelly"] .am-shot-tag { background: #fff; color: #9b5870; }
.g-ammo [data-fx="jelly"] .am-monster { border-radius: 16px 16px 12px 12px; background: radial-gradient(circle at 35% 25%, #ffd2c4 0 12%, #ff9b84 13% 100%); border: 2px solid #e0705a; box-shadow: 0 4px 0 #e0705a55; color: #5a2218; }
.g-ammo [data-fx="jelly"] .am-monster.elite { background: radial-gradient(circle at 35% 25%, #f2d6ff 0 12%, #c69bff 13% 100%); border-color: #9a6ad8; box-shadow: 0 4px 0 #9a6ad855; color: #3a1a5c; }
.g-ammo [data-fx="jelly"] .am-chamber-box { border-color: #e48aa6; box-shadow: 0 4px 0 #e48aa6; border-radius: 22px; background: #fff8fa; }
.g-ammo [data-fx="jelly"] .am-bullet { border-radius: 22px; border: 2px solid #ef9fb6; background: radial-gradient(circle at 32% 24%, #fff 0 9%, transparent 10%), linear-gradient(180deg, #ffe3ec, #ffb7cc); color: #7a2944; box-shadow: 0 4px 0 #ef9fb6; }
.g-ammo [data-fx="jelly"] .am-bullet[data-tier="2"] { border-color: #8fd8b5; background: radial-gradient(circle at 32% 24%, #fff 0 9%, transparent 10%), linear-gradient(180deg, #ddfbe9, #9fe6c3); color: #1f5a3f; box-shadow: 0 4px 0 #8fd8b5; }
.g-ammo [data-fx="jelly"] .am-bullet[data-tier="3"] { border-color: #9fb8ff; background: radial-gradient(circle at 32% 24%, #fff 0 9%, transparent 10%), linear-gradient(180deg, #e3eaff, #a9bfff); color: #23367a; box-shadow: 0 4px 0 #9fb8ff; }
.g-ammo [data-fx="jelly"] .am-bullet[data-tier="4"] { border-color: #f5c84e; background: radial-gradient(circle at 32% 24%, #fff 0 9%, transparent 10%), linear-gradient(180deg, #fff6c9, #ffd65e); color: #6b4a00; box-shadow: 0 4px 0 #f5c84e, 0 0 14px #ffd65e; }
.g-ammo [data-fx="jelly"] .am-bullet.selected { outline-color: #ff6f98; border-color: #ff6f98; }
.g-ammo [data-fx="jelly"] .am-chain-hud { background: #ff6f98; color: #fff; border-radius: 999px; box-shadow: 0 3px 0 #d9547a; }
.g-ammo [data-fx="jelly"] .am-word { color: #c2185b; text-shadow: 0 2px 0 #fff, 2px 0 #fff, -2px 0 #fff, 0 -2px #fff, 0 4px 0 #f7a8c0; }
.g-ammo [data-fx="jelly"] .am-word.pts { color: #2e8b62; }
.g-ammo [data-fx="jelly"] .am-shot { width: 26px; min-width: 0; height: 26px; padding: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 14%, #ffb7cc 16% 100%); border: 2px solid #ef9fb6; box-shadow: none; color: transparent; font-size: 0; }

/* ---------- D · 漫画拟声（主站配色：米白 / 墨线 / 黄 / 红 / 粉 / 蓝，方角硬投影） ---------- */
.g-ammo .am-root[data-fx="comic"] { background: #fff1b9; border: 2px solid #272219; border-radius: 0; box-shadow: 6px 6px #272219; }
.g-ammo [data-fx="comic"] .am-lanes { background-color: #fff9ed; background-image: radial-gradient(#e9dcbf 1.3px, transparent 1.5px); background-size: 9px 9px; border: 2px solid #272219; border-radius: 0; box-shadow: 4px 4px #272219; }
.g-ammo [data-fx="comic"] .am-lane { background: #fffdf6; border: 2px solid #272219; border-radius: 0; }
.g-ammo [data-fx="comic"] .am-lane:hover, .g-ammo [data-fx="comic"] .am-lane.active { background: #ffe88d; border-color: #272219; }
.g-ammo [data-fx="comic"] .am-lane.zero-ready { background: #e3f0d2; }
.g-ammo [data-fx="comic"] .am-lane.zero-ready.active { background: #cfe6b4; }
.g-ammo [data-fx="comic"] .am-cell { border: 1.5px dashed #27221922; border-radius: 0; color: #272219; }
.g-ammo [data-fx="comic"] .am-cell.frontline { border-bottom: 3px solid #d54830; }
.g-ammo [data-fx="comic"] .am-shot-tag { background: #272219; color: #fff9ed; border-radius: 0; }
.g-ammo [data-fx="comic"] .am-shot-tag.zero { background: #8cba67; color: #272219; outline: 2px solid #272219; outline-offset: -2px; }
.g-ammo [data-fx="comic"] .am-shot-tag.pierce { background: #97bbf1; color: #272219; outline: 2px solid #272219; outline-offset: -2px; }
.g-ammo [data-fx="comic"] .am-shot-tag.danger { background: #d54830; color: #fff9ed; }
.g-ammo [data-fx="comic"] .am-monster { border-radius: 0; background: #d54830; border: 2px solid #272219; box-shadow: 3px 3px #272219; color: #fff9ed; }
.g-ammo [data-fx="comic"] .am-monster.elite { background: #3679e7; box-shadow: 3px 3px #272219; }
.g-ammo [data-fx="comic"] .am-monster svg path:first-child { fill: #fff9ed; }
.g-ammo [data-fx="comic"] .am-monster svg circle { fill: #272219; }
.g-ammo [data-fx="comic"] .am-monster svg path + path { stroke: #272219; }
.g-ammo [data-fx="comic"] .am-after { background: #272219; color: #f8d84a; border-radius: 0; }
.g-ammo [data-fx="comic"] .am-monster.target { animation-name: am-target-ink; }
.g-ammo [data-fx="comic"] .am-monster.target.zero { animation-name: am-target-ink-zero; }
@keyframes am-target-ink { 50% { box-shadow: 3px 3px #272219, 0 0 0 4px #f8d84a; } }
@keyframes am-target-ink-zero { 50% { box-shadow: 3px 3px #272219, 0 0 0 4px #8cba67; } }
.g-ammo [data-fx="comic"] .am-chain-status { background: #272219; color: #f8d84a; border-radius: 0; }
.g-ammo [data-fx="comic"] .am-chamber-box { background: #fff9ed; border: 2px solid #272219; box-shadow: 5px 5px #272219; border-radius: 0; }
.g-ammo [data-fx="comic"] .am-after-bar { background: #fff1b9; border: 1.5px solid #272219; border-radius: 0; color: #272219; }
.g-ammo [data-fx="comic"] .am-after-bar .badge { background: #272219; color: #f8d84a; border-radius: 0; }
.g-ammo [data-fx="comic"] .am-chain-line i { background: #fffdf6; border: 1.5px solid #272219; border-radius: 0; }
.g-ammo [data-fx="comic"] .am-chain-line i.hot { background: #f8d84a; }
.g-ammo [data-fx="comic"] .am-chain-line b { color: #d54830; }
.g-ammo [data-fx="comic"] .am-bullet { border-radius: 0; border: 2px solid #272219; background: #fffdf6; color: #272219; box-shadow: 3px 3px #272219; }
.g-ammo [data-fx="comic"] .am-bullet[data-v="4"], .g-ammo [data-fx="comic"] .am-bullet[data-v="8"] { background: #ffe88d; }
.g-ammo [data-fx="comic"] .am-bullet[data-v="16"] { background: #f8d84a; }
.g-ammo [data-fx="comic"] .am-bullet[data-v="32"] { background: #f3a6bf; color: #272219; }
.g-ammo [data-fx="comic"] .am-bullet[data-v="64"] { background: #d54830; color: #fff9ed; }
.g-ammo [data-fx="comic"] .am-bullet[data-v="128"] { background: #3679e7; color: #fff9ed; }
.g-ammo [data-fx="comic"] .am-bullet[data-v="256"] { background: #8cba67; color: #272219; }
.g-ammo [data-fx="comic"] .am-bullet[data-tier="4"] { background: radial-gradient(#f8d84a55 1.3px, transparent 1.6px) 0 0/6px 6px, #272219; color: #f8d84a; box-shadow: 3px 3px #d54830; }
.g-ammo [data-fx="comic"] .am-bullet.selected { outline: 3px solid #d54830; outline-offset: 2px; border-color: #272219; }
.g-ammo [data-fx="comic"] .am-bullet.lean-l, .g-ammo [data-fx="comic"] .am-bullet.lean-r { box-shadow: 3px 3px #272219, inset 0 0 0 2px #272219; }
.g-ammo [data-fx="comic"] .am-chain-hud { background: #f8d84a; color: #272219; border: 2px solid #272219; border-radius: 0; box-shadow: 3px 3px #272219; }
.g-ammo [data-fx="comic"] .am-word { color: #f8d84a; font-style: italic; letter-spacing: -.02em; -webkit-text-stroke: 1.5px #272219; paint-order: stroke fill; text-shadow: 3px 3px 0 #272219; font-size: 22px; }
.g-ammo [data-fx="comic"] .am-word.big { font-size: 30px; color: #fff9ed; }
.g-ammo [data-fx="comic"] .am-word.huge { font-size: 44px; color: #d54830; }
.g-ammo [data-fx="comic"] .am-word.pts { font-size: 15px; color: #fff9ed; }
.g-ammo [data-fx="comic"] .am-word.pts.mid { font-size: 18px; color: #f8d84a; }
.g-ammo [data-fx="comic"] .am-word.pts.big { font-size: 22px; color: #f3a6bf; }
.g-ammo [data-fx="comic"] .am-shot { width: 16px; min-width: 0; height: 34px; padding: 0; border-radius: 0; background: #f8d84a; border: 2px solid #272219; box-shadow: none; color: transparent; font-size: 0; }
.g-ammo [data-fx="comic"] .am-aim path { stroke: #272219; }
.g-ammo [data-fx="comic"] .am-aim circle { stroke: #272219; fill: #f8d84a; }
.g-ammo [data-fx="comic"] .am-aim.zero path, .g-ammo [data-fx="comic"] .am-aim.zero circle { stroke: #4f8a2e; }
.g-ammo [data-fx="comic"] .am-aim.danger path, .g-ammo [data-fx="comic"] .am-aim.danger circle { stroke: #d54830; }
.g-ammo [data-fx="comic"] .am-drag-ghost { border-radius: 0; background: #f8d84a; border-color: #272219; box-shadow: 4px 4px #272219; }

/* ---------- E · 像素街机 ---------- */
.g-ammo [data-fx="arcade"] { --px: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.g-ammo [data-fx="arcade"] .am-lanes { background: #0b0b1a; border: 3px solid #000; border-radius: 0; box-shadow: inset 0 0 0 2px #3a3aa8; background-image: linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg, #ffffff08 1px, transparent 1px); background-size: 8px 8px; }
.g-ammo [data-fx="arcade"] .am-lane { border-radius: 0; border: 2px solid #3a3aa8; background: #10102a; }
.g-ammo [data-fx="arcade"] .am-lane:hover, .g-ammo [data-fx="arcade"] .am-lane.active { border-color: #fcfc54; background: #1a1a40; }
.g-ammo [data-fx="arcade"] .am-lane.zero-ready { border-color: #54fc54; }
.g-ammo [data-fx="arcade"] .am-cell { border-radius: 0; border: 1px dotted #ffffff1c; }
.g-ammo [data-fx="arcade"] .am-shot-tag { border-radius: 0; font-family: var(--px); background: #23235a; color: #fcfcfc; }
.g-ammo [data-fx="arcade"] .am-shot-tag.zero { background: #54fc54; color: #000; }
.g-ammo [data-fx="arcade"] .am-shot-tag.pierce { background: #54fcfc; color: #000; }
.g-ammo [data-fx="arcade"] .am-monster { border-radius: 0; background: #fc5454; border: 0; box-shadow: inset -4px -4px 0 #a80000, inset 4px 4px 0 #fca8a8; color: #000; font-family: var(--px); }
.g-ammo [data-fx="arcade"] .am-monster.elite { background: #fc54fc; box-shadow: inset -4px -4px 0 #a800a8, inset 4px 4px 0 #fcb8fc; }
.g-ammo [data-fx="arcade"] .am-chamber-box { border-radius: 0; border: 3px solid #000; box-shadow: 4px 4px 0 #000; background: #fcfce8; font-family: var(--px); }
.g-ammo [data-fx="arcade"] .am-after-bar { border-radius: 0; }
.g-ammo [data-fx="arcade"] .am-bullet { border-radius: 0; border: 0; font-family: var(--px); background: #fcfc54; color: #000; box-shadow: inset -4px -4px 0 #a8a800, inset 4px 4px 0 #ffffc0, 0 3px 0 #000; }
.g-ammo [data-fx="arcade"] .am-bullet[data-tier="2"] { background: #fca854; box-shadow: inset -4px -4px 0 #a85400, inset 4px 4px 0 #ffe0b0, 0 3px 0 #000; color: #000; }
.g-ammo [data-fx="arcade"] .am-bullet[data-tier="3"] { background: #54a8fc; box-shadow: inset -4px -4px 0 #0054a8, inset 4px 4px 0 #c0e0ff, 0 3px 0 #000; color: #000; }
.g-ammo [data-fx="arcade"] .am-bullet[data-tier="4"] { background: #54fc54; box-shadow: inset -4px -4px 0 #00a800, inset 4px 4px 0 #d0ffd0, 0 3px 0 #000, 0 0 0 2px #fcfc54; color: #000; }
.g-ammo [data-fx="arcade"] .am-bullet.selected { outline: 3px dashed #fc5454; outline-offset: 2px; }
.g-ammo [data-fx="arcade"] .am-chain-hud { border-radius: 0; background: #000; color: #fcfc54; font-family: var(--px); border: 2px solid #fcfc54; }
.g-ammo [data-fx="arcade"] .am-word { font-family: var(--px); color: #fcfc54; text-shadow: 2px 2px 0 #000, -2px 0 #000, 0 -2px #000, 2px 0 #000; letter-spacing: .04em; }
.g-ammo [data-fx="arcade"] .am-word.pts { color: #54fcfc; }
.g-ammo [data-fx="arcade"] .am-shot { width: 12px; min-width: 0; height: 20px; padding: 0; border-radius: 0; background: #fcfcfc; box-shadow: 0 0 0 2px #fcfc54; color: transparent; font-size: 0; }

/* ---------- weapons, boss, intro (all styles; comic overrides below) ---------- */
.g-ammo .am-monster.boss { background: linear-gradient(180deg, #4b4f57, #23262b); border-color: #111; color: #ffd84a; }
.g-ammo .am-monster.boss-l { border-right-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.g-ammo .am-monster.boss-r { border-left-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.g-ammo .am-monster.boss-l::after { content: ''; position: absolute; top: -2px; bottom: -2px; right: -22px; width: 22px; background: inherit; border: inherit; border-width: 2px 0; z-index: 1; }
.g-ammo .am-crown { font-size: 11px; font-weight: 950; letter-spacing: .04em; padding: 0 3px; border-radius: 3px; background: #ffd84a; color: #23262b; }
.g-ammo .am-monster.boss-r .am-crown, .g-ammo .am-monster.boss-r .am-hp { visibility: hidden; }
.g-ammo .am-aim path.beam { stroke-width: 6; stroke-dasharray: none; opacity: .35; animation: none; }
.g-ammo .am-bullet[data-weapon="shotgun"] small::before { content: '⋰ '; }
.g-ammo .am-bullet[data-weapon="laser"] small::before { content: '┃ '; }
.g-ammo .am-bullet[data-weapon="rocket"] small::before { content: '✹ '; }
.g-ammo .am-bullet[data-weapon="rail"] small::before { content: '☰ '; }
.g-ammo .am-arsenal h2 small { font-weight: 600; font-size: 11px; color: var(--muted, #727b70); margin-left: 6px; }
.g-ammo .am-weapon { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; padding: 7px 0; border-top: 1px dashed #d8d8cc; }
.g-ammo .am-weapon:first-of-type { border-top: 0; }
.g-ammo .am-weapon b { font-size: 14px; }
.g-ammo .am-weapon .am-range { font-size: 11px; color: var(--muted, #727b70); font-variant-numeric: tabular-nums; }
.g-ammo .am-weapon p { grid-column: 1 / -1; margin: 2px 0 0 !important; font-size: 12px !important; line-height: 1.55 !important; }
.g-ammo .am-weapon.locked { opacity: .45; }
.g-ammo .am-weapon.have b { background: #f8d84a; padding: 0 4px; }
.g-ammo .am-intro { position: absolute; z-index: 40; left: 50%; top: 38%; translate: -50% -50%; width: min(320px, 86%); padding: 16px 18px; background: #fff9ed; border: 2px solid #272219; box-shadow: 6px 6px #272219; animation: am-intro-in .28s cubic-bezier(.2,1.4,.4,1); }
.g-ammo .am-intro-kicker { margin: 0 0 4px; font-size: 11px; font-weight: 900; letter-spacing: .15em; color: #d54830; }
.g-ammo .am-intro h3 { margin: 0 0 6px; font-size: 24px; font-weight: 900; }
.g-ammo .am-intro h3 small { font-size: 13px; color: #7a6a52; margin-left: 4px; }
.g-ammo .am-intro p { margin: 0 0 12px; font-size: 13px; line-height: 1.65; color: #4b4232; }
.g-ammo .am-intro .am-btn { width: 100%; }
@keyframes am-intro-in { from { opacity: 0; scale: .7; rotate: -4deg; } }
.g-ammo [data-fx="comic"] .am-monster.boss { background: radial-gradient(#f8d84a33 1.2px, transparent 1.5px) 0 0/6px 6px, #272219; color: #f8d84a; border: 2px solid #272219; box-shadow: 3px 3px #d54830; }
.g-ammo [data-fx="comic"] .am-monster.boss-l { border-right-width: 0; }
.g-ammo [data-fx="comic"] .am-monster.boss-r { border-left-width: 0; }
.g-ammo [data-fx="comic"] .am-crown { border-radius: 0; background: #f8d84a; color: #272219; }

/* ---------- HUD, ghost row, reserve chips ---------- */
.g-ammo .am-hud { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-width: 0; }
.g-ammo .am-chapter { flex-shrink: 0; font-size: 12px; font-weight: 900; padding: 4px 9px; background: #272219; color: #f8d84a; }
.g-ammo .am-boss-chip { flex: 1; min-width: 0; font-size: 12px; font-weight: 800; padding: 3px 9px; border: 1.5px solid #272219; background: #fffdf6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-ammo .am-boss-chip.boss { background: #d54830; color: #fff9ed; }
.g-ammo .am-advance { flex-shrink: 0; display: flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; }
.g-ammo .am-advance i { width: 10px; height: 10px; border: 1.5px solid #272219; background: #fffdf6; }
.g-ammo .am-advance i.on { background: #272219; }
.g-ammo .am-advance.warn i.on { background: #d54830; animation: am-warn .7s ease-in-out infinite; }
@keyframes am-warn { 50% { transform: scale(1.3); } }
.g-ammo .am-ghostcell { height: 22px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #9a8a6c; border: 1.5px dashed #27221933; white-space: nowrap; overflow: hidden; }
.g-ammo .am-ghostcell:empty { border-color: transparent; }
.g-ammo .am-ghostcell.boss { color: #d54830; border-color: #d54830; background: repeating-linear-gradient(45deg, transparent 0 5px, #d5483018 5px 10px); }
.g-ammo .am-reserve { display: inline-flex; align-items: center; gap: 4px; color: var(--muted, #727b70); }
.g-ammo .am-reserve i { font-style: normal; min-width: 26px; text-align: center; padding: 1px 4px; font-size: 11px; font-weight: 900; color: #272219; background: #ffe88d; border: 1.5px solid #272219; }
.g-ammo .am-reserve i[data-tier="2"] { background: #f3a6bf; }
.g-ammo .am-reserve i[data-tier="3"] { background: #97bbf1; }
.g-ammo .am-reserve i[data-tier="4"] { background: #272219; color: #f8d84a; }
.g-ammo .am-chamber-head small { font-weight: 600; color: var(--muted, #727b70); margin-left: 4px; }

@container ammo (max-width: 720px) {
  .g-ammo .am-lanes { gap: 6px; padding: 7px; }
  .g-ammo .am-lane { padding: 4px; }
  .g-ammo .am-monster { flex-wrap: wrap; gap: 1px; align-content: center; }
  .g-ammo .am-monster svg { width: 15px; height: 15px; }
  .g-ammo .am-monster .am-after { flex-basis: 100%; text-align: center; }
  .g-ammo .am-shot-tag { font-size: 10px; padding: 5px 0; }
  .g-ammo .am-chamber-row { gap: 5px; }
  .g-ammo .am-bullet { padding: 3px 0; min-height: 48px; font-size: 16px; }
  .g-ammo .am-hp { font-size: 14px; }
  .g-ammo .am-hud { gap: 6px; margin-bottom: 8px; }
  .g-ammo .am-chapter { font-size: 11px; padding: 3px 6px; }
  .g-ammo .am-boss-chip { font-size: 11px; padding: 2px 6px; }
  .g-ammo .am-advance { font-size: 0; }
  .g-ammo .am-ghostcell { height: 18px; font-size: 9px; }
  .g-ammo .am-cell { height: 40px; }
  .g-ammo .am-chain-status { min-height: 0; margin: 8px 0; padding: 7px 10px; font-size: 12px; }
  .g-ammo .am-chamber-box { padding: 9px; }
  .g-ammo .am-chamber-head { margin-bottom: 7px; }
  .g-ammo .am-chamber-head small { display: none; }
}

/* ---------- narrow hosts ---------- */
@container ammo (max-width: 720px) {
  .g-ammo .am-stage.am-root { padding: 8px; box-shadow: 4px 4px #272219; }
  .am-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
  .am-stat { padding: 6px 7px; box-shadow: 2px 2px #272219; }
  .am-stat b { font-size: 16px; }
  .am-stat small { font-size: 9px; }
  .am-panel { padding: 13px; }
}
@container ammo (max-width: 480px) { .g-ammo { padding: 8px; } .g-ammo .am-bullet small { font-size: 9px; letter-spacing: -.02em; } }
@container ammo (max-width: 360px) {
  .g-ammo .am-bullet small { font-size: 8.5px; }
  .g-ammo .am-bullet { font-size: 14px; }
  .g-ammo .am-lanes { gap: 4px; padding: 5px; }
  .g-ammo .am-lane { padding: 3px; }
  .g-ammo .am-shot-tag { font-size: 9px; }
  .am-btn { padding-inline: 4px; font-size: 13px; }
}
.am-bullet small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.am-shot-tag { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- reduced motion (in-game switch or system setting) ---------- */
.g-ammo.still *, .g-ammo.still *::before, .g-ammo.still *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .g-ammo *, .g-ammo *::before, .g-ammo *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* endless mode: the chapter chip turns red */
.g-ammo .am-chapter.endless { background: #d54830; color: #fff9ed; }
