/* Battle Arena. The stage is the game's own world with its own palette (game palettes are allowed by the site
   conventions): deep indigo night, mint and coral accents. Everything outside the stage uses the site tokens. */
.ba-shell { padding: 12px; }
.ba-stage {
  --ba-bg: #0a0b1e; --ba-panel: rgba(16, 17, 40, .9); --ba-panel-2: rgba(32, 34, 70, .95); --ba-line: rgba(190, 200, 255, .13);
  --ba-text: #eef0ff; --ba-dim: #a3a8cf; --ba-mint: #5ff0c0; --ba-mint-2: #2fc8b0; --ba-coral: #ff7a66; --ba-gold: #ffc35a; --ba-bad: #ff6a5b;
  position: relative; width: 100%; height: clamp(520px, 74vh, 800px); border-radius: 16px; overflow: hidden; background: var(--ba-bg);
  color: var(--ba-text); font-family: Inter, system-ui, sans-serif; user-select: none; -webkit-user-select: none; isolation: isolate;
  box-shadow: 0 12px 44px rgba(10, 8, 40, .3); -webkit-tap-highlight-color: transparent;
}
.ba-stage:fullscreen, .ba-stage.pseudo-fs { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; z-index: 1000; }
html.ba-noscroll, html.ba-noscroll body { overflow: hidden; }
#ba-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.ba-stage.ba-playing #ba-canvas { cursor: none; }
.ba-stage [hidden] { display: none !important; }
.ba-stage h2, .ba-stage h3, .ba-stage b, .ba-stage strong { color: inherit; }
.ba-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.ba-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- screens ---- */
.ba-screen { position: absolute; inset: 0; z-index: 5; overflow-y: auto; overscroll-behavior: contain; padding: 22px; display: flex; flex-direction: column; align-items: center;
  background: radial-gradient(ellipse at 50% 15%, rgba(14, 12, 40, .35), rgba(6, 6, 20, .82) 75%); animation: ba-in .28s ease; user-select: text; -webkit-user-select: text; }
#ba-pause, #ba-controls { background: rgba(6, 6, 20, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes ba-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.ba-wrap { width: 100%; max-width: 900px; margin: auto 0; }
.ba-narrow { max-width: 540px; }
.ba-logo { text-align: center; margin: 4px 0 16px; }
.ba-logo h2 { margin: 0; font-size: clamp(40px, 7.5vw, 74px); line-height: .92; font-weight: 900; font-style: italic; letter-spacing: -.025em; text-transform: uppercase;
  color: #fff; text-shadow: 0 4px 0 #1b1640, 0 7px 0 rgba(0, 0, 0, .35), 0 0 30px rgba(95, 240, 192, .35); }
.ba-logo h2 span { background: linear-gradient(180deg, #d8fff1 0%, #5ff0c0 50%, #23b49c 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
  filter: drop-shadow(0 4px 0 #1b1640) drop-shadow(0 7px 0 rgba(0, 0, 0, .35)); }
.ba-logo h2.small { font-size: 44px; }
.ba-logo p { margin: 10px 0 0; color: var(--ba-dim); font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.ba-card { background: var(--ba-panel); border: 1px solid var(--ba-line); border-radius: 16px; padding: 16px; margin: 0 0 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.ba-card h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ba-dim); font-weight: 800; }
.ba-status { background: linear-gradient(135deg, rgba(95, 240, 192, .08), rgba(255, 122, 102, .06)), var(--ba-panel); }
.ba-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ba-row-fill > * { flex: 1 1 120px; }
.ba-menu-buttons { display: grid; gap: 10px; margin-top: 14px; }
.ba-menu-buttons .ba-row > .ba-btn { flex: 1 1 160px; }
.ba-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.ba-title h2 { margin: 0; font-size: 26px; font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: -.01em; }

.ba-btn { appearance: none; border: 1px solid var(--ba-line); background: var(--ba-panel-2); color: var(--ba-text); font: inherit; font-weight: 700; font-size: 15px;
  padding: 11px 16px; border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, background .15s, border-color .15s; }
.ba-btn:hover { border-color: rgba(190, 200, 255, .32); background: #2c2f60; }
.ba-btn:active { transform: translateY(1px); }
.ba-btn:focus-visible, .ba-skin:focus-visible, .ba-key:focus-visible, .ba-ico:focus-visible { outline: 2px solid var(--ba-mint); outline-offset: 2px; }
.ba-btn:disabled { opacity: .45; cursor: not-allowed; }
.ba-btn.primary { background: linear-gradient(180deg, #8dffd8, #3fd8b0); color: #062a22; border-color: transparent; box-shadow: 0 4px 0 #1b8f78, 0 10px 26px rgba(63, 216, 176, .28); }
.ba-btn.primary:hover { background: linear-gradient(180deg, #a9ffe2, #55e4be); }
.ba-btn.primary:active { box-shadow: 0 2px 0 #1b8f78; transform: translateY(2px); }
.ba-btn.big { font-size: 19px; padding: 15px 20px; border-radius: 14px; }
.ba-btn.small { font-size: 13px; padding: 7px 12px; border-radius: 9px; }
.ba-btn.danger { color: #ffc0b6; }
.ba-big-label { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.ba-big-label .sub { font-size: 12.5px; font-weight: 600; opacity: .72; margin-top: 2px; }

.ba-stage .ba-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--ba-dim); }
.ba-field-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--ba-dim); margin: 14px 0 6px; }
.ba-stage input[type="text"] { background: #0c0d24; color: var(--ba-text); border: 1px solid rgba(190, 200, 255, .2); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; width: 100%; box-sizing: border-box; min-height: 0; }
.ba-stage input[type="text"]:focus { outline: 2px solid var(--ba-mint); outline-offset: 0; border-color: transparent; }
.ba-check { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 6px 0; cursor: pointer; }
.ba-check input { width: 18px; height: 18px; accent-color: var(--ba-mint); margin: 0; }
.ba-skins { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.ba-skin { appearance: none; padding: 4px 0 0; border-radius: 12px; border: 2px solid transparent; background: radial-gradient(circle at 50% 30%, #2a2c5c, #121330); cursor: pointer; display: grid; place-items: center; overflow: hidden; }
.ba-skin canvas { width: 100%; max-width: 72px; aspect-ratio: 96 / 112; display: block; }
.ba-skin:hover { border-color: rgba(190, 200, 255, .35); }
.ba-skin[aria-pressed="true"] { border-color: var(--ba-mint); box-shadow: 0 0 0 3px rgba(95, 240, 192, .2), inset 0 0 18px rgba(95, 240, 192, .18); }
.ba-note { color: var(--ba-dim); font-size: 13.5px; line-height: 1.5; margin: 6px 0; }
.ba-warn { color: #ffe0b0; background: rgba(255, 195, 90, .1); border: 1px solid rgba(255, 195, 90, .3); border-radius: 10px; padding: 8px 12px; margin-top: 12px; }

/* controls list */
.ba-keys { display: grid; gap: 4px; }
.ba-keyrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--ba-line); font-size: 14px; }
.ba-keyrow small { grid-column: 2; text-align: right; color: var(--ba-dim); font-size: 11.5px; }
.ba-keyrow small:empty { display: none; }
.ba-key { appearance: none; min-width: 112px; font: inherit; font-weight: 800; font-size: 13px; color: var(--ba-text); background: #191a3e; border: 1px solid rgba(190, 200, 255, .25); border-bottom-width: 3px; border-radius: 9px; padding: 6px 10px; cursor: pointer; }
.ba-key:hover:not(:disabled) { border-color: var(--ba-mint); }
.ba-key:disabled { opacity: .6; cursor: default; }
.ba-key.wait { color: #062a22; background: var(--ba-mint); border-color: var(--ba-mint); animation: ba-blink .9s infinite; }
@keyframes ba-blink { 50% { opacity: .6; } }

/* ---- HUD ---- */
.ba-hud { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.ba-hud button { pointer-events: auto; }
.ba-hud-top { position: absolute; left: 12px; top: 12px; display: flex; gap: 8px; align-items: center; }
.ba-ico { appearance: none; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--ba-line); background: rgba(14, 14, 36, .7); color: var(--ba-text); display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(4px); }
.ba-ico svg { width: 18px; height: 18px; }
.ba-ico:hover { background: rgba(40, 42, 90, .85); }
.ba-pill { background: rgba(14, 14, 36, .7); border: 1px solid var(--ba-line); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 800; letter-spacing: .03em; backdrop-filter: blur(4px); }
.ba-side { position: absolute; right: 12px; top: 12px; width: 180px; display: grid; gap: 8px; justify-items: end; }
.ba-minimap { display: block; width: 100%; border-radius: 10px; background: rgba(10, 10, 30, .55); border: 1px solid var(--ba-line); backdrop-filter: blur(4px); }
.ba-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; justify-items: end; width: max-content; max-width: min(340px, 46vw); }
.ba-feed li { display: flex; gap: 6px; align-items: center; padding: 4px 9px; border-radius: 8px; background: rgba(10, 10, 30, .68); border: 1px solid var(--ba-line); font-size: 12.5px; font-weight: 700;
  white-space: nowrap; animation: ba-feed-in .2s ease; transition: opacity .6s; backdrop-filter: blur(4px); }
.ba-feed li.mine { border-color: rgba(255, 195, 90, .55); background: rgba(40, 30, 20, .72); }
.ba-feed li.out { opacity: 0; }
.ba-feed .who { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.ba-feed .who.me { text-decoration: underline; text-underline-offset: 3px; }
.ba-feed .how { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ba-dim); background: rgba(255, 255, 255, .07); padding: 1px 6px; border-radius: 5px; }
@keyframes ba-feed-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.ba-score { color: var(--ba-gold); }
.ba-announce { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -6px); font-size: 22px; font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .02em;
  color: #fff; text-shadow: 0 3px 0 #1b1640, 0 0 22px rgba(255, 195, 90, .5); opacity: 0; transition: opacity .25s, transform .25s; white-space: nowrap; pointer-events: none; }
.ba-announce.show { opacity: 1; transform: translate(-50%, 0); }
.ba-announce.big { font-size: clamp(28px, 4.6vw, 44px); color: var(--ba-gold); }
.ba-announce.small { font-size: 15px; font-style: normal; color: var(--ba-mint); top: 64%; text-transform: none; }
.ba-respawn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 2px; padding: 16px 26px; border-radius: 16px;
  background: rgba(10, 10, 30, .72); border: 1px solid rgba(255, 106, 91, .35); backdrop-filter: blur(4px); text-align: center; }
.ba-respawn span { font-size: 14px; font-weight: 700; color: #ffc0b6; }
.ba-respawn b { font-size: 46px; line-height: 1.05; font-weight: 900; font-variant-numeric: tabular-nums; }
.ba-respawn small { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ba-dim); font-weight: 800; }
.ba-board { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 32px)); max-height: calc(100% - 120px); overflow: auto; padding: 14px 16px;
  border-radius: 16px; background: rgba(10, 10, 30, .86); border: 1px solid var(--ba-line); backdrop-filter: blur(6px); }
.ba-board-foot { margin: 8px 0 0; font-size: 12px; color: var(--ba-dim); text-align: center; }
.ba-board table, .ba-results { width: 100%; border-collapse: collapse; font-size: 14px; }
.ba-board th, .ba-results th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ba-dim); font-weight: 800; padding: 4px 6px; }
.ba-board td, .ba-results td { padding: 6px; border-top: 1px solid var(--ba-line); font-variant-numeric: tabular-nums; }
.ba-board th:nth-child(n+3), .ba-board td:nth-child(n+3), .ba-results th:nth-child(n+3), .ba-results td:nth-child(n+3) { text-align: right; }
.ba-board td:first-child, .ba-results td:first-child { color: var(--ba-dim); width: 24px; }
.ba-board tr.me td, .ba-results tr.me td { background: rgba(95, 240, 192, .1); font-weight: 800; }
.ba-board .dot, .ba-results .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; box-shadow: 0 0 0 2px rgba(0, 0, 0, .3); }
.ba-board td small, .ba-results td small { color: var(--ba-dim); font-weight: 600; font-size: 11px; }
/* M5: ping column only in online matches; compact rows when a room is big */
.ba-board table:not(.net) .ping, .ba-results:not(.net) .ping { display: none; }
.ba-board td.ping, .ba-results td.ping { color: var(--ba-dim); font-size: 12px; }
.ba-board td.ping.slow, .ba-results td.ping.slow { color: #ffb86b; }
.ba-board table.many td, .ba-results.many td { padding-top: 3px; padding-bottom: 3px; font-size: 13px; }
.ba-weapon { position: absolute; right: 12px; bottom: 12px; padding: 8px 12px 9px; border-radius: 14px; background: rgba(12, 12, 32, .66); border: 1px solid var(--ba-line); backdrop-filter: blur(4px); min-width: 210px; box-sizing: border-box; }
.ba-gun-row { display: flex; align-items: center; gap: 10px; }
.ba-gun-row canvas { width: 88px; height: 27px; }
.ba-gun-name { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ba-dim); font-weight: 800; }
.ba-ammo { display: flex; align-items: baseline; gap: 5px; }
.ba-ammo b { font-size: 26px; line-height: 1.05; font-weight: 800; }
.ba-ammo span { font-size: 13px; color: var(--ba-dim); }
.ba-weapon.low .ba-ammo b { color: var(--ba-bad); }
.ba-gun-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 5px; }
.ba-slots { display: flex; gap: 4px; }
.ba-slots i { font-style: normal; font-size: 11px; font-weight: 800; width: 20px; height: 18px; display: grid; place-items: center; border-radius: 5px; border: 1px solid var(--ba-line); color: var(--ba-dim); }
.ba-slots i.on { background: rgba(95, 240, 192, .18); color: var(--ba-mint); border-color: rgba(95, 240, 192, .45); }
.ba-nades { display: flex; gap: 4px; }
.ba-nades i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid rgba(200, 230, 140, .35); box-sizing: border-box; }
.ba-nades i.on { background: #9ab86a; border-color: #c8e68c; }
.ba-hp-low .ba-bar.hp i { background: linear-gradient(90deg, #ff4f4f, #ff8a6b); }

/* match setup options */
.ba-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--ba-line); font-size: 14px; font-weight: 700; flex-wrap: wrap; }
.ba-seg { display: inline-flex; background: #0c0d24; border: 1px solid rgba(190, 200, 255, .2); border-radius: 11px; padding: 3px; gap: 2px; }
.ba-seg button { appearance: none; border: 0; background: transparent; color: var(--ba-dim); font: inherit; font-size: 13.5px; font-weight: 800; padding: 7px 13px; border-radius: 8px; cursor: pointer; min-width: 44px; }
.ba-seg button:hover { color: var(--ba-text); }
.ba-seg button[aria-checked="true"] { background: linear-gradient(180deg, #8dffd8, #3fd8b0); color: #062a22; }
.ba-seg button:focus-visible { outline: 2px solid var(--ba-mint); outline-offset: 1px; }
.ba-bars { position: absolute; left: 12px; bottom: 12px; display: grid; gap: 7px; padding: 10px 12px; border-radius: 14px; background: rgba(12, 12, 32, .66); border: 1px solid var(--ba-line); backdrop-filter: blur(4px); width: min(300px, calc(100% - 24px)); box-sizing: border-box; }
.ba-bar { display: grid; grid-template-columns: 20px minmax(0, 1fr) 34px; gap: 8px; align-items: center; }
.ba-bar b { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.ba-bar-ico { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-weight: 900; font-size: 16px; line-height: 1; }
.ba-bar-ico svg { width: 14px; height: 14px; }
.ba-bar.hp .ba-bar-ico { background: rgba(95, 240, 192, .18); color: var(--ba-mint); }
.ba-bar.fuel .ba-bar-ico { background: rgba(255, 195, 90, .18); color: var(--ba-gold); }
.ba-track { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); }
.ba-track i { display: block; height: 100%; border-radius: 6px; transition: width .08s linear; }
.ba-bar.hp i { background: linear-gradient(90deg, #2fc8b0, #8dffd8); }
.ba-bar.fuel i { background: linear-gradient(90deg, #ff8a3d, #ffd27a); }
.ba-fuel-low .ba-bar.fuel i { background: linear-gradient(90deg, #ff4f4f, #ff8a6b); animation: ba-blink .5s infinite; }
.ba-fps { position: absolute; right: 12px; bottom: 96px; white-space: pre; text-align: right; line-height: 1.5; font-size: 11.5px; padding: 5px 9px; border-radius: 8px; background: rgba(10, 10, 30, .7); color: var(--ba-mint); }
.ba-tips { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; max-width: min(600px, calc(100% - 420px));
  padding: 10px 16px; border-radius: 14px; background: rgba(12, 12, 32, .74); border: 1px solid rgba(95, 240, 192, .3); font-size: 13px; color: var(--ba-dim); transition: opacity .8s, transform .8s; backdrop-filter: blur(4px); }
.ba-tips b { width: 100%; text-align: center; color: var(--ba-mint); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.ba-tips.out { opacity: 0; transform: translate(-50%, -8px); }
.ba-stage kbd, .ba-below kbd { font-family: inherit; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 5px; border: 1px solid rgba(190, 200, 255, .3); border-bottom-width: 2px; background: #1b1c42; color: var(--ba-text); }

/* match setup (M3): mode tabs, map cards, wider panel */
.ba-mid { max-width: 680px; }
.ba-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 12px; background: var(--ba-panel); border: 1px solid var(--ba-line); border-radius: 14px; }
.ba-tab { appearance: none; flex: 1 1 0; border: 0; background: transparent; color: var(--ba-dim); font: inherit; font-size: 14px; font-weight: 800; padding: 10px 8px; border-radius: 10px; cursor: pointer; min-width: 0; }
.ba-tab:hover { color: var(--ba-text); }
.ba-tab[aria-selected="true"] { background: linear-gradient(180deg, #8dffd8, #3fd8b0); color: #062a22; }
.ba-tab:focus-visible { outline: 2px solid var(--ba-mint); outline-offset: 1px; }
.ba-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.ba-map { appearance: none; text-align: left; font: inherit; color: var(--ba-text); background: #0c0d24; border: 2px solid rgba(190, 200, 255, .14); border-radius: 12px; padding: 6px 6px 9px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ba-map canvas { width: 100%; aspect-ratio: 2 / 1; border-radius: 7px; display: block; }
.ba-map b { font-size: 13.5px; font-weight: 800; padding: 0 3px; }
.ba-map small { font-size: 11.5px; line-height: 1.35; color: var(--ba-dim); padding: 0 3px; }
.ba-map:hover { border-color: rgba(95, 240, 192, .4); }
.ba-map[aria-checked="true"] { border-color: var(--ba-mint); box-shadow: 0 0 0 3px rgba(95, 240, 192, .18); }
.ba-map:focus-visible { outline: 2px solid var(--ba-mint); outline-offset: 2px; }
[data-scope="tdm"][data-key="team"] button[data-v="1"][aria-checked="true"] { background: linear-gradient(180deg, #ffa494, #ff6a55); color: #3a0a04; }
[data-scope="tdm"][data-key="team"] button[data-v="2"][aria-checked="true"] { background: linear-gradient(180deg, #a6d2ff, #4a9df0); color: #04203a; }
.ba-range { display: flex; align-items: center; gap: 12px; font-size: 14px; padding: 6px 0; }
.ba-range input[type="range"] { flex: 1 1 auto; accent-color: var(--ba-mint); min-width: 0; }
.ba-range output { min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ba-dim); font-weight: 700; }
.ba-range select { margin-left: auto; background: #0c0d24; color: var(--ba-text); border: 1px solid rgba(190, 200, 255, .2); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 14px; }
.ba-board tr.team td, .ba-results tr.team td { font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; padding-top: 10px; border-top: 2px solid var(--ba-line); }
.ba-score b { font-weight: 900; }

/* sound button: speaker with waves, or crossed out when muted */
.ba-mute .off { display: none; }
.ba-mute.off .on { display: none; }
.ba-mute.off .off { display: inline; }
.ba-mute.off { color: var(--ba-bad); }

/* start countdown */
.ba-count { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: clamp(64px, 12vw, 120px); font-weight: 900; font-style: italic; color: #fff;
  text-shadow: 0 5px 0 #1b1640, 0 0 40px rgba(95, 240, 192, .55); pointer-events: none; }
.ba-count.pop { animation: ba-pop .9s ease-out both; }
@keyframes ba-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.92); } }

/* touch controls: floating sticks + buttons (only in touch mode, only while playing) */
.ba-touch { position: absolute; left: 0; right: 0; top: 56px; bottom: 0; z-index: 2; touch-action: none; outline: none; }
.ba-tstick { position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 2px solid rgba(220, 230, 255, .35); background: rgba(12, 12, 32, .25); pointer-events: none; }
.ba-tstick::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; border: 1px dashed rgba(220, 230, 255, .25); }
.ba-tstick.aim { border-color: rgba(255, 140, 120, .45); }
.ba-tstick.aim.fire { border-color: rgba(255, 106, 91, .9); background: rgba(255, 70, 60, .16); }
.ba-tstick i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(238, 240, 255, .55); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.ba-tstick.aim i { background: rgba(255, 170, 150, .65); }
.ba-tbtns { position: absolute; right: 10px; bottom: 96px; display: grid; grid-template-columns: repeat(2, 54px); gap: 8px; }
.ba-tbtn { appearance: none; width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgba(220, 230, 255, .3); background: rgba(12, 12, 32, .5); color: var(--ba-text); font: inherit; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; padding: 0; touch-action: none; }
.ba-tbtn.jump { grid-column: 2; width: 62px; height: 62px; margin: -4px; border-color: rgba(95, 240, 192, .55); }
.ba-tbtn.on { background: rgba(95, 240, 192, .35); border-color: var(--ba-mint); }
.ba-touch-only { display: none; }
.ba-touchmode .ba-touch-only { display: inline; }
.ba-touchmode .ba-keys-only { display: none; }
/* in touch mode the thumbs own the bottom corners: health/fuel go to the top left, the weapon panel to the bottom middle */
.ba-touchmode .ba-bars { top: 58px; bottom: auto; width: 200px; padding: 6px 9px; gap: 5px; }
.ba-touchmode .ba-weapon { right: auto; left: 50%; transform: translateX(-50%); bottom: 8px; min-width: 0; padding: 5px 10px; }
.ba-touchmode .ba-gun-row canvas { display: none; }
.ba-touchmode .ba-ammo b { font-size: 19px; }
.ba-touchmode.ba-playing #ba-canvas { cursor: default; }

/* below the stage: site tokens */
.ba-below { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; padding: 10px 4px 2px; font-size: 13px; color: var(--muted); }
.ba-below kbd { background: var(--surface-2, var(--surface)); color: var(--text); border-color: var(--border); }

@media (max-width: 760px) {
  .ba-stage { height: clamp(460px, 72vh, 640px); }
  .ba-screen { padding: 14px; }
  .ba-skins { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ba-side { width: 120px; }
  .ba-feed { max-width: 60vw; }
  .ba-feed li { font-size: 11px; padding: 3px 7px; }
  .ba-weapon { min-width: 0; padding: 6px 9px; }
  .ba-gun-row canvas { display: none; }
  .ba-ammo b { font-size: 20px; }
  .ba-bars { width: min(230px, calc(100% - 180px)); }
  .ba-tips { display: none !important; }
  .ba-hud-top .ba-pill:first-of-type { display: none; }
}
/* short screens (phones in landscape): the stage fits below the site header */
@media (max-height: 560px) {
  .ba-stage { height: calc(100vh - 76px); height: calc(100dvh - 76px); min-height: 280px; }
  .ba-tips { display: none !important; }
  .ba-side { width: 110px; }
  .ba-feed li:nth-last-child(n+4) { display: none; }   /* newest three only */
  .ba-weapon { min-width: 0; padding: 5px 9px 6px; }
  .ba-gun-row canvas { display: none; }
  .ba-ammo b { font-size: 19px; }
  .ba-gun-name { font-size: 10px; }
  .ba-gun-foot { margin-top: 3px; }
  .ba-respawn { padding: 10px 18px; }
  .ba-respawn b { font-size: 34px; }
  .ba-announce { top: 26%; font-size: 18px; }
  .ba-announce.big { font-size: 28px; }
  .ba-bars { width: 220px; padding: 7px 10px; gap: 5px; }
}
@media (max-width: 560px) {
  .ba-maps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ba-map small { display: none; }
  .ba-tab { font-size: 12.5px; padding: 9px 4px; }
  .ba-opt { gap: 8px; }
  .ba-seg button { padding: 7px 10px; min-width: 38px; }
}
@media (max-height: 560px) {
  .ba-tbtns { bottom: 70px; grid-template-columns: repeat(2, 48px); gap: 6px; }
  .ba-tbtn { width: 48px; height: 48px; font-size: 9.5px; }
  .ba-tbtn.jump { width: 56px; height: 56px; }
  .ba-touchmode .ba-bars { top: 54px; width: 170px; }
}
@media (prefers-reduced-motion: reduce) { .ba-count.pop { animation: none; } .ba-screen { animation: none; } .ba-key.wait, .ba-fuel-low .ba-bar.fuel i { animation: none; } .ba-feed li { animation: none; } }

/* ---- online (M4): create / join, lobby, chat, connection banner ---- */
.ba-online-btn { background: linear-gradient(135deg, rgba(95, 240, 192, .14), rgba(90, 170, 245, .14)), var(--ba-panel-2); }
.ba-err { color: #ffb4a8; background: rgba(255, 106, 91, .12); border: 1px solid rgba(255, 106, 91, .35); border-radius: 10px; padding: 8px 11px; font-size: 13.5px; margin: 10px 0 0; }
.ba-sub { margin-top: 18px !important; }
.ba-center { text-align: center; }
.ba-stage textarea, .ba-chat input { width: 100%; box-sizing: border-box; background: #0c0d24; color: var(--ba-text); border: 1px solid rgba(190, 200, 255, .22); border-radius: 10px;
  padding: 9px 11px; font: 13px/1.4 'JetBrains Mono', ui-monospace, monospace; resize: vertical; margin: 6px 0 10px; }
.ba-stage textarea:focus, .ba-chat input:focus { outline: 2px solid var(--ba-mint); outline-offset: 1px; border-color: transparent; }
.ba-stage textarea[readonly] { color: var(--ba-mint); }
.ba-qr { display: flex; justify-content: center; margin: 10px 0; }
.ba-qr:empty { display: none; }
.ba-qr canvas, .ba-qr img, .ba-qr svg { max-width: 190px; height: auto; background: #fff; border-radius: 10px; padding: 8px; }
#ba-lobby .ba-wrap { max-width: 960px; }
#ba-lobby .ba-title .ba-pill { margin-right: auto; }
.ba-lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.ba-players { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.ba-player { display: flex; align-items: center; gap: 10px; background: #0c0d24; border: 1px solid var(--ba-line); border-radius: 12px; padding: 6px 10px; min-width: 0; }
.ba-player canvas { width: 44px; height: 52px; flex: none; }
.ba-pl-text { flex: 1 1 auto; min-width: 0; }
.ba-player .nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ba-player .meta { font-size: 12.5px; color: var(--ba-dim); }
.ba-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ba-mint); flex: none; box-shadow: 0 0 8px rgba(95, 240, 192, .6); }
.ba-dot[data-s="connecting"], .ba-dot[data-s="reconnecting"] { background: var(--ba-gold); box-shadow: none; }
.ba-dot[data-s="disconnected"], .ba-dot[data-s="failed"] { background: var(--ba-bad); box-shadow: none; }
.ba-badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: rgba(190, 200, 255, .1); color: var(--ba-dim); }
.ba-badge.host { background: rgba(255, 195, 90, .16); color: var(--ba-gold); }
.ba-badge.ready { background: rgba(95, 240, 192, .16); color: var(--ba-mint); }
.ba-invite { border-top: 1px solid var(--ba-line); margin-top: 10px; padding-top: 8px; }
#ba-lobby h3 small { text-transform: none; letter-spacing: 0; font-weight: 600; }
#ba-net-maps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#ba-net-maps .ba-map b { font-size: 13px; }
.ba-map:disabled, .ba-seg button:disabled { cursor: default; }
.ba-seg button:disabled:not([aria-checked="true"]) { opacity: .45; }
.ba-map:disabled:not([aria-checked="true"]) { opacity: .55; }
.ba-chat-log { height: 130px; overflow-y: auto; background: #0c0d24; border: 1px solid var(--ba-line); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ba-chat-log .m b { color: var(--ba-gold); margin-right: 4px; }
.ba-chat-log .m.me b { color: var(--ba-mint); }
.ba-chat-log .sys { color: var(--ba-dim); font-style: italic; }
.ba-chat form { flex-wrap: nowrap; margin-top: 8px; }
.ba-chat input { margin: 0; flex: 1 1 auto; min-width: 0; font-family: inherit; font-size: 16px; padding: 7px 11px; }
.ba-lobby-go { position: sticky; bottom: -22px; z-index: 2; margin: 4px -22px -22px; padding: 12px 22px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px;
  background: #090a1c; border-top: 1px solid var(--ba-line); box-shadow: 0 -10px 24px rgba(0, 0, 0, .35); }
.ba-lobby-go .ba-btn:disabled { opacity: 1; filter: saturate(.25) brightness(.55); }
.ba-lobby-go .ba-note { margin: 0 auto 0 0; flex: 1 1 200px; }
.ba-net-banner { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); z-index: 4; background: rgba(120, 30, 30, .9); color: #ffe1dc; border-radius: 999px;
  padding: 7px 16px; font-size: 13px; font-weight: 800; pointer-events: none; }
#ba-pause-sub { margin-top: 10px; }
.ba-online #ba-pause-sub { display: block !important; }
.ba-online #ba-restart { display: none; }
@media (max-width: 760px) {
  .ba-lobby-grid { grid-template-columns: minmax(0, 1fr); }
  #ba-lobby .ba-title h2 { font-size: 20px; }
  #ba-lobby .ba-title .ba-pill { font-size: 11.5px; padding: 6px 10px; white-space: nowrap; }
  .ba-lobby-go { margin: 4px -14px -14px; padding: 10px 14px 14px; bottom: -14px; }
}

/* ---- M6: in-match chat (online), network stats line ---- */
.ba-online-only, .ba-online-tip { display: none; }
.ba-online .ba-ico.ba-online-only { display: grid; }
.ba-online:not(.ba-touchmode) .ba-online-tip { display: inline; }
.ba-mchat { position: absolute; left: 12px; bottom: 100px; width: min(380px, calc(100% - 24px)); display: grid; gap: 6px; pointer-events: none; }
.ba-mchat-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.ba-mchat-log li { justify-self: start; max-width: 100%; box-sizing: border-box; padding: 4px 9px; border-radius: 8px; background: rgba(10, 10, 30, .7); border: 1px solid var(--ba-line);
  font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; transition: opacity .6s; backdrop-filter: blur(4px); animation: ba-feed-in .2s ease; }
.ba-mchat-log li b { margin-right: 6px; }
.ba-mchat-log li.sys { color: var(--ba-dim); font-style: italic; }
.ba-mchat-log li.out { opacity: 0; }
.ba-mchat.open .ba-mchat-log li.out { opacity: .9; }
.ba-mchat-form { pointer-events: auto; }
.ba-mchat-form input { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--ba-mint); background: rgba(10, 10, 30, .9); color: var(--ba-text); outline: none; }
.ba-mchat-form input:focus-visible { box-shadow: 0 0 0 2px rgba(95, 240, 192, .35); }
.ba-touchmode .ba-mchat { top: 116px; bottom: auto; }
@media (max-height: 560px) {
  .ba-mchat { bottom: 84px; width: min(320px, calc(100% - 24px)); }
  .ba-mchat-log li:nth-last-child(n+4) { display: none; }
  .ba-touchmode .ba-mchat { top: 104px; }
}
@media (prefers-reduced-motion: reduce) { .ba-mchat-log li { animation: none; } }
