/* Blockfield — UI w stylu Liquid Glass, przeniesionym 1:1 z CubeVerse (wiedza
   #3 TopSoft). To sprawdzony, akceptowany język wizualny — NIE zmieniać.
   Frakcje red/blue wchodzą wyłącznie jako AKCENTY, nie zmieniają szkła. */

:root {
  --red: #e0454f;
  --blue: #3f86e6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  background: #000; color: #fff;
  user-select: none;
}

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#crosshair, #hitmarker, #damage-feedback, #score-feed, #kill-feed, #scoreboard, #hint, #hud-dock, #loadout, #ammo-counter,
#health, #stamina, #respawn-wave, #vehicle-prompt, #minimap, #team-support, #conquest-hud, #comms-feed, #chat, #world-pings, #fireteam-hud { z-index: 2; }

/* Skala rozdzielczości renderowania — obok przełącznika muzyki, bo to ta sama
   półka ustawień „jak gra ma działać", a nie element odprawy przed bitwą. */
.quality-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 8px; margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.scale-options { display: flex; gap: 4px; }
.scale-options button {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 6px;
  background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.6);
  font: 800 9px/1 system-ui; letter-spacing: .6px; cursor: pointer;
  transition: background 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
}
.scale-options button:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.scale-options button.selected {
  color: #fff; border-color: rgba(157, 220, 255, 0.62); background: rgba(72, 132, 188, 0.42);
}

/* Licznik wydajności (F3). Prawy dolny róg — jedyny wolny narożnik HUD-u
   i jedyne miejsce, gdzie nie zasłania ani czatu, ani minimapy. */
#perf-hud {
  position: fixed; right: 14px; bottom: 14px; width: 264px; z-index: 30;
  padding: 9px 11px; box-sizing: border-box;
  border: 1px solid rgba(157, 220, 255, 0.30); border-radius: 10px;
  background: rgba(6, 11, 18, 0.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  font: 600 10px/1.5 ui-monospace, monospace; letter-spacing: .2px;
  color: rgba(255, 255, 255, 0.82);
}
#perf-hud[hidden] { display: none; }
.perf-row { display: flex; justify-content: space-between; gap: 10px; }
.perf-row > span { color: rgba(255, 255, 255, 0.5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf-row > b { color: #9ddcff; flex: 0 0 auto; }
.perf-split {
  margin: 6px 0 3px; padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.38); font-size: 8px; letter-spacing: 1.1px;
}

/* Panel drużyny — lewy górny róg HUD-u. Zieleń jest ta sama, co znaczniki nad
   głowami, kropki na minimapie i nicki na czacie: jeden kolor na „moi ludzie". */
#fireteam-hud {
  position: fixed; left: 14px; top: 14px; width: 214px;
  display: none; flex-direction: column; gap: 4px;
  padding: 8px; box-sizing: border-box;
  border: 1px solid rgba(77, 255, 154, 0.28); border-radius: 12px;
  background: rgba(9, 16, 13, 0.52);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  pointer-events: none; font: 700 11px/1.2 system-ui;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .8);
}
body.playing #fireteam-hud { display: flex; }
/* Panel znika: bez drużyny (atrybut `hidden` ustawia `setVisible`), przy pustym
   składzie, w menu i w oknie debugowania.
   UWAGA na kolejność: ta reguła MUSI zostać osobna. Dopisanie do niej przez
   przecinek selektora dla widoku dowódcy (0.50.5) sprawiło, że wszystkie cztery
   powyższe przypadki dostały zamiast `display: none` — współrzędne, więc panel
   pokazywał się bez drużyny, na globusie i w menu. */
#fireteam-hud:empty,
body:not(.playing) #fireteam-hud,
#fireteam-hud[hidden], #fireteam-hud.empty,
body.menu-open #fireteam-hud, body.debug-open #fireteam-hud { display: none !important; }
/* W widoku dowódcy panel ZOSTAJE, ale schodzi pod mapę strategiczną: ta
   przenosi się wtedy w lewy górny róg i zajęłaby to samo miejsce. */
body.commander-view #fireteam-hud {
  top: calc(18px + 380px + 12px);
  left: 18px;
  width: 236px;
}
/* Strzałka kierunku jest liczona względem SPOJRZENIA gracza, a dowódca patrzy
   z góry — wskazywałaby więc bok jego ciała, nie kierunek na mapie. Zostaje
   sam dystans, który znaczy to samo w obu widokach. */
body.commander-view .fth-arrow { display: none; }
/* Rzędy klikalne tylko tam, gdzie jest kursor i jest dokąd skoczyć. */
#fireteam-hud.clickable { pointer-events: auto; }
#fireteam-hud.clickable .fireteam-hud-row {
  padding: 3px 5px; margin: -3px -5px;
  border-radius: 7px; cursor: pointer;
  transition: background 120ms ease-out;
}
#fireteam-hud.clickable .fireteam-hud-row:hover,
#fireteam-hud.clickable .fireteam-hud-row:focus-visible {
  background: rgba(77, 255, 154, 0.16); outline: none;
}
.fireteam-hud-row { display: flex; align-items: center; gap: 7px; }
.fireteam-hud-row.down { opacity: .45; }
.fth-icon { display: inline-flex; flex: 0 0 auto; color: rgba(77, 255, 154, .85); }
.fth-body { flex: 1; min-width: 0; }
.fth-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.fth-name { color: #d6ffe9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fth-range { color: rgba(255,255,255,.52); font: 700 9px/1 ui-monospace, monospace; letter-spacing: .4px; }
.fth-bar {
  margin-top: 3px; height: 4px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
}
.fth-bar > i {
  display: block; width: 100%; height: 100%; border-radius: inherit;
  background: #55d271; transform-origin: left center;
  transition: transform 140ms linear, background 140ms linear;
}
.fth-bar > i.low { background: #ef4c58; }
/* Strzałka kierunku: wyraźna GROTKA Z OGONKIEM (clip-path) zamiast nagiego
   trójkąta — na trójkącie nie dało się odróżnić, który wierzchołek wskazuje
   kolegę. 0° = prosto przed graczem, obrót zgodnie z ruchem wskazówek. */
.fth-arrow {
  flex: 0 0 auto;
  width: 15px; height: 17px;
  background: rgba(77, 255, 154, .9);
  clip-path: polygon(50% 0, 100% 55%, 70% 55%, 70% 100%, 30% 100%, 30% 55%, 0 55%);
  transition: transform 120ms linear;
}
.fireteam-hud-row.down .fth-arrow { background: rgba(255, 255, 255, .35); }
/* Krawędziowe wskaźniki kolegów (fireteam-markers.js): gdy kolega jest poza
   kadrem albo tuż przy krawędzi, strzałka przy ramce ekranu pokazuje, w którą
   stronę się obrócić. Jeden kontener na wszystkich, strzałki per kolega. */
#fireteam-edge {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 2;
  display: none;
}
#fireteam-edge.active { display: block; }
.fireteam-edge-arrow {
  position: absolute;
  left: 0; top: 0;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;   /* kotwica w środku strzałki */
  background: rgba(77, 255, 154, .95);
  clip-path: polygon(50% 0, 100% 100%, 50% 74%, 0 100%);
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, .9));
  will-change: transform;
}
body:not(.playing) #game, body.menu-open #game {
  filter: brightness(0.52) saturate(0.72);
}
body.debug-open #game { filter: brightness(0.62) saturate(0.85); }
/* `--minimap-size` to rozmiar STARTOWY karty i zaczep dla modułów pod nią.
   Właściwy rozmiar canvasu ustawia `Minimap.resize()` stylem inline (musi znać
   devicePixelRatio) — obie liczby trzeba trzymać zgodne z `this.infantrySize`
   w public/js/ui/minimap.js. */
:root { --minimap-size: 272px; --minimap-top: 14px; }
#minimap {
  position: fixed; top: var(--minimap-top); right: 14px;
  width: var(--minimap-size); height: var(--minimap-size);
  display: none; pointer-events: none; image-rendering: pixelated;
  border-radius: 10px; background: rgba(20, 24, 34, 0.58);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s cubic-bezier(0.16, 1, 0.3, 1), top 0.25s, right 0.25s, border-color 0.25s, transform 0.25s;
}
/* Tryb celowania z rozstawionego moździerza: powiększona mapa jest po prawej
   stronie celownika, lecz z oddechem od ramy ekranu — nie przyklejona do niej. */
#minimap.mortar-aim {
  top: 50%;
  /* Dokładnie 100 px dalej w lewo od poprzedniej pozycji: mapa zostaje po
     prawej stronie celownika artyleryjskiego, ale nie wchodzi w jego strefę. */
  right: clamp(148px, calc(7vw + 100px), 212px);
  transform: translateY(-50%);
  width: 400px;
  height: 400px;
  border-radius: 16px;
  border: 1.8px solid rgba(255, 170, 60, 0.85);
  box-shadow: 0 20px 56px rgba(0,0,0,0.75), 0 0 28px rgba(255, 140, 30, 0.35);
}
body.playing #minimap { display: block; }
body.menu-open #minimap, body.debug-open #minimap { display: none; }
#team-support {
  /* Pod paskiem funduszy, nie na nim: przy 212 i 214 px oba moduły leżały na
     sobie i napis „TEAM FUNDS" wychodził spod listy wsparcia. */
  position: fixed; top: calc(var(--minimap-top) + var(--minimap-size) + 52px); right: 14px;
  width: var(--minimap-size); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 3px; padding: 8px 9px;
  background: rgba(20, 24, 34, 0.58); border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.3); backdrop-filter: blur(18px);
  pointer-events: none;
}
#team-support[hidden], body:not(.playing) #team-support, body.menu-open #team-support,
body.debug-open #team-support, body.commander-view #team-support { display: none; }
#team-support > b { font: 700 8px/1 system-ui; letter-spacing: 1.5px; color: rgba(157,220,255,.72); margin-bottom: 2px; }
.team-support-row { display: grid; grid-template-columns: 7px 1fr auto; align-items: center; gap: 6px; min-height: 15px; }
.team-support-row i { width: 5px; height: 5px; border-radius: 50%; background: #77808b; }
.team-support-row strong { font: 700 8px/1 system-ui; letter-spacing: .55px; color: rgba(255,255,255,.72); }
.team-support-row em { font: 700 8px/1 system-ui; font-style: normal; letter-spacing: .45px; color: rgba(255,255,255,.42); }
.team-support-row.ready i { background: #75df90; box-shadow: 0 0 7px rgba(117,223,144,.8); }
.team-support-row.ready em { color: #9cf0ac; }
.team-support-row.cooling i { background: #e7bd67; }
.team-support-row.cooling em { color: #f0c86f; }

/* ---------- Wspólne: szkło ---------- */
.chip, .panel, .slot {
  background: rgba(20, 24, 34, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ---------- Celownik ---------- */
#crosshair {
  position: fixed; left: 50%; top: 50%;
  width: 40px; height: 40px;
  transform: translate(-50%, -50%);
  --crosshair-gap: 4px;
  --crosshair-arm: 8px;
  pointer-events: none;
  display: none;
}
body.playing #crosshair { display: block; }
/* ---------- ADS blur (tunnel focus) ---------- */
/* Overlay siedzi na z-index 1: NAD kanwą (0), POD HUD-em (2) i winietą obrażeń
   (5), więc backdrop-filter rozmywa wyłącznie świat 3D — celownik, minimapa
   i dok HUD pozostają ostre. Opacity prowadzi ui/ads-blur.js z blendu AimSystem;
   display:none przy braku ADS, bo przezroczysty blur nadal kosztuje kompozycję. */
#ads-blur {
  position: fixed; inset: 0; z-index: 1; display: none; pointer-events: none;
  opacity: 0;
  /* Promień, ostre okno maski i siła winiety prowadzi ui/ads-blur.js. Wartości
     domyślne = samo ADS; przygwożdżenie (pocisk koło głowy) podbija promień do
     20px i zaciska ostry środek do 26%, więc obraz zamyka się wokół gracza. */
  --ads-blur-radius: 7px;
  --ads-mask-inner: 54%;
  --ads-vignette: 1;
  backdrop-filter: blur(var(--ads-blur-radius));
  -webkit-backdrop-filter: blur(var(--ads-blur-radius));
  /* Środek kadru ostry (celownik), krawędzie płynnie wchodzą w pełny blur. */
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, transparent var(--ads-mask-inner), #000 97%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, transparent var(--ads-mask-inner), #000 97%);
}
#ads-blur.active { display: block; }
body.menu-open #ads-blur, body.debug-open #ads-blur, body.commander-view #ads-blur { display: none; }
/* Delikatna winieta płynie RAZEM z blurem: ::after jest dzieckiem overlaya,
   więc dziedziczy jego opacity (blend ADS) i gaśnie tą samą krzywą. Poniżej
   HUD-u, więc przyciemnia wyłącznie świat — minimapa i dok zostają czytelne. */
#ads-blur::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 52%,
    rgba(9, 11, 15, calc(0.30 * var(--ads-vignette, 1))) 84%,
    rgba(7, 9, 13, calc(0.46 * var(--ads-vignette, 1))) 100%);
}
/* ---------- Stan ranny: pulsujące rogi ----------
   Ciągły STAN (ile zostało HP), nie zdarzenie — dlatego osobny overlay,
   a nie warstwa w #damage-feedback. z-index 1, czyli ta sama warstwa co blur
   ADS: NAD kanwą (0), POD HUD-em (2) i pod winietą obrażeń (5), więc błysk
   trafienia zawsze czyta się na wierzchu, a minimapa i dok zostają czytelne.
   Świadomie NIE z-index 2: tam o kolejności decydowałaby pozycja w index.html
   i wystarczyłoby przestawienie diva, żeby overlay zaczął przyciemniać HUD.
   Krycie, tempo i głębokość pulsu prowadzi ui/wound-vignette.js. Sam ruch
   robi animacja CSS — kompozytowana na GPU, więc nic nie kosztuje w pętli. */
#wound-vignette {
  position: fixed; inset: 0; z-index: 1; display: none; pointer-events: none;
  --wound-intensity: 0;
  --wound-period: 1.7s;
  --wound-floor: .9;
  /* Elipsa zostawia środek kadru czysty, a najmocniej dociska w ROGACH —
     tam jest najdalej od środka, więc gradient dochodzi tam do końca.
     Końcowy kolor musi być WYRAŹNIE czerwony także w jasnym świetle dnia;
     wcześniejsza niemal czarna mieszanka wyglądała jak zwykłe przyciemnienie
     i nie komunikowała, że gracz jest ranny. */
  background: radial-gradient(ellipse 80% 76% at 50% 50%,
    transparent 36%,
    rgba(172, 0, 14, calc(0.44 * var(--wound-intensity))) 58%,
    rgba(205, 0, 18, calc(0.78 * var(--wound-intensity))) 80%,
    rgba(122, 0, 9, calc(0.96 * var(--wound-intensity))) 100%);
  animation: wound-pulse var(--wound-period) ease-in-out infinite;
}
body.playing #wound-vignette.active { display: block; }
body.menu-open #wound-vignette, body.debug-open #wound-vignette,
body.commander-view #wound-vignette { display: none; }
/* Puls schodzi do --wound-floor i wraca. Przy lekkim zranieniu podłoga stoi
   wysoko (.9 — ledwo falujące), przy 10% HP nisko (.55 — wyraźne tętno). */
@keyframes wound-pulse {
  0%, 100% { opacity: var(--wound-floor); }
  50% { opacity: 1; }
}

/* ---------- FPP damage feedback ---------- */
#damage-feedback {
  position: fixed; inset: 0; z-index: 5; display: none; pointer-events: none; overflow: hidden;
  --damage-angle: 0rad; --damage-x: 50%; --damage-y: 18%; --damage-intensity: .45;
  --healing-intensity: .5;
}
body.playing #damage-feedback { display: block; }
#aim-health { position:fixed; top:calc(50% + 48px); left:50%; transform:translateX(-50%); width:190px; z-index:8; pointer-events:none; color:#fff; text-align:center; font:700 10px system-ui; text-shadow:0 1px 3px #000; }
#aim-health[hidden] { display:none; }
#aim-health > div { display:flex; gap:3px; margin-top:5px; }
#aim-health i { position:relative; height:8px; flex:1; background:#10151ce8; border:1px solid #ffffff65; }
#aim-health i::after { content:''; position:absolute; inset:0; background:#35ff6c; transform:scaleX(var(--fill,0)); transform-origin:left; }
#aim-health.repairing i::after { background:#6cecff; }
#aim-health.low i::after { background:#ff4654; }
.debug-map-save { display:grid; gap:10px; padding:15px; background:#ffffff0a; margin-bottom:12px; }
.debug-map-save input, .debug-map-save select { background:#152333; border:1px solid #6a8299; color:white; padding:10px; }
body.battle-intermission .campaign-layout,body.battle-intermission .campaign-header { visibility:hidden; }
body.battle-intermission #hint { pointer-events:none; }
.oxygen-bubbles { position:absolute; inset:0; pointer-events:none; }
.oxygen-bubbles i { position:absolute; bottom:20%; width:var(--size); height:var(--size); border:2px solid #b7f4ffbb; border-radius:50%; box-shadow:inset 2px 2px 3px #ffffff88; opacity:0; animation:oxygen-bubble-rise 1.1s ease-out forwards; }
@keyframes oxygen-bubble-rise { 0% { opacity:0; transform:translateY(0) scale(.6); } 15% { opacity:.85; } 100% { opacity:0; transform:translateY(-42vh) scale(1.3); } }
.damage-blood {
  position: absolute; inset: 0; opacity: 0;
  background:
    linear-gradient(to bottom,
      rgba(205, 0, 18, var(--damage-intensity)) 0%,
      rgba(174, 0, 15, calc(var(--damage-intensity) * .25)) 12%,
      transparent 24%, transparent 76%,
      rgba(174, 0, 15, calc(var(--damage-intensity) * .25)) 88%,
      rgba(205, 0, 18, var(--damage-intensity)) 100%),
    linear-gradient(to right,
      rgba(205, 0, 18, var(--damage-intensity)) 0%,
      rgba(174, 0, 15, calc(var(--damage-intensity) * .22)) 10%,
      transparent 20%, transparent 80%,
      rgba(174, 0, 15, calc(var(--damage-intensity) * .22)) 90%,
      rgba(205, 0, 18, var(--damage-intensity)) 100%);
  box-shadow: inset 0 0 58px rgba(255, 18, 32, calc(var(--damage-intensity) * .38));
}
.damage-direction {
  position: absolute; inset: 0; opacity: 0;
}
/* Łuk i grot są jednoznacznym kompasem trafienia, ale stoją bliżej centrum:
   0° = góra/przód, dodatni kąt obraca wskaźnik w prawo. */
.damage-direction::before {
  content: '';
  position: absolute; left: var(--damage-x); top: var(--damage-y);
  width: clamp(150px, 18vw, 270px); height: 44px;
  transform: translate(-50%, -50%) rotate(var(--damage-angle));
  border-top: 8px solid rgba(255, 68, 78, .98);
  border-radius: 50%;
  filter: drop-shadow(0 0 5px #ff1f32) drop-shadow(0 0 16px rgba(255,0,25,.85));
}
.damage-direction::after {
  content: '';
  position: absolute; left: var(--damage-x); top: var(--damage-y);
  width: 36px; height: 25px;
  transform: translate(-50%, 10px) rotate(var(--damage-angle));
  clip-path: polygon(50% 0, 100% 100%, 72% 100%, 50% 48%, 28% 100%, 0 100%);
  background: #ff5360;
  filter: drop-shadow(0 0 5px #ff1027) drop-shadow(0 0 12px rgba(255,0,20,.9));
}
.healing-aura {
  position: absolute; inset: 0; opacity: 0;
  background:
    radial-gradient(ellipse at center,
      transparent 38%,
      rgba(54, 218, 111, calc(var(--healing-intensity) * .12)) 58%,
      rgba(42, 226, 106, calc(var(--healing-intensity) * .55)) 86%,
      rgba(117, 255, 164, var(--healing-intensity)) 100%);
  box-shadow: inset 0 0 70px rgba(63, 255, 129, calc(var(--healing-intensity) * .45));
  mix-blend-mode: screen;
}
.death-blood-drip {
  position: absolute;
  inset: 0;
  opacity: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -12%, rgba(112, 0, 8, .72), transparent 56%),
    radial-gradient(ellipse at center, transparent 42%, rgba(72, 0, 5, .42) 100%);
}
.death-blood-drip i {
  position: absolute;
  top: -22vh;
  width: clamp(18px, 3.2vw, 52px);
  height: 30vh;
  border-radius: 45% 55% 65% 35%;
  background: linear-gradient(to bottom, rgba(116, 0, 9, .96), rgba(154, 4, 13, .82) 62%, rgba(88, 0, 7, .15));
  filter: blur(.7px);
  transform: translateY(-100%);
}
.death-blood-drip i:nth-child(1) { left: 5%; height: 42vh; animation-delay: 0s; }
.death-blood-drip i:nth-child(2) { left: 20%; width: 2vw; height: 31vh; animation-delay: .18s; }
.death-blood-drip i:nth-child(3) { left: 42%; height: 48vh; animation-delay: .06s; }
.death-blood-drip i:nth-child(4) { left: 63%; width: 2.4vw; height: 36vh; animation-delay: .28s; }
.death-blood-drip i:nth-child(5) { left: 79%; height: 45vh; animation-delay: .12s; }
.death-blood-drip i:nth-child(6) { left: 93%; width: 1.7vw; height: 34vh; animation-delay: .34s; }
#damage-feedback.death .death-blood-drip {
  animation: death-blood-vignette 5.8s ease-out forwards;
}
#damage-feedback.death .death-blood-drip i {
  animation-name: death-blood-flow;
  animation-duration: 4.8s;
  animation-timing-function: cubic-bezier(.16,.74,.28,1);
  animation-fill-mode: forwards;
}
.damage-feedback-active {}
#damage-feedback.active .damage-blood { animation: damage-blood-flash .34s ease-out forwards; }
#damage-feedback.active .damage-direction { animation: damage-direction-flash .52s ease-out forwards; }
#damage-feedback.healing .healing-aura { animation: healing-aura-pulse .68s ease-out forwards; }

/* ——— Efekt trafienia i pęknięcia wizjera (Visor Hit & Shatter) ——— */
.visor-crack {
  position: absolute; left: var(--crack-x); top: var(--crack-y); width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
  animation: visor-crack-fade var(--crack-life) ease-out forwards;
}
/* Jasny, natychmiastowy rozbłysk uderzenia pocisku w punkt na szkle (impact flash) */
.visor-crack .crack-flash {
  position: absolute; left: -36px; top: -36px; width: 72px; height: 72px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle,
    #ffffff 0%,
    rgba(255, 245, 200, 1) 20%,
    rgba(255, 160, 60, 0.85) 45%,
    rgba(255, 60, 30, 0.4) 65%,
    transparent 80%);
  mix-blend-mode: screen;
  box-shadow: 0 0 24px rgba(255, 255, 255, 1), 0 0 48px rgba(255, 140, 50, 0.9);
  animation: crack-flash-burst .28s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}
/* Rozchodzący się pierścień naprężenia uderzenia w szkle wizjera */
.visor-crack .crack-shockwave {
  position: absolute; left: -20px; top: -20px; width: 40px; height: 40px;
  border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 14px rgba(200, 240, 255, 0.9), inset 0 0 8px rgba(255, 200, 150, 0.6);
  animation: crack-shockwave-ring .35s ease-out forwards;
}
/* Trwała, świetlista poświata naprężenia wokół krateru */
.visor-crack .crack-glow {
  position: absolute; left: -24px; top: -24px; width: 48px; height: 48px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.8) 0%,
    rgba(180, 230, 255, calc(var(--crack-opacity) * 0.6)) 35%,
    transparent 70%);
  mix-blend-mode: screen;
  animation: crack-glow-pulse 1.2s ease-out forwards;
}
/* Krater uderzenia i pierścień mikropęknięć wokół otworu */
.visor-crack .crack-crater {
  position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 255, 255, 1) 0%,
    rgba(210, 240, 255, var(--crack-opacity)) 40%,
    rgba(15, 22, 32, 0.95) 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 12px rgba(180, 235, 255, 0.9), inset 0 0 6px rgba(10, 15, 22, 0.95);
  animation: crack-crater-pop .2s cubic-bezier(.17,.89,.32,1.3) forwards;
}
/* Promienie pęknięć rozchodzące się od punktu uderzenia */
.visor-crack i {
  position: absolute; left: 0; top: 0; width: var(--crack-length); height: 2px;
  transform-origin: 0 50%; transform: rotate(var(--crack-angle)); opacity: 0;
  background: linear-gradient(to bottom,
    rgba(12, 18, 26, calc(var(--crack-opacity) * 0.98)) 0% 18%,
    rgba(255, 255, 255, 1) 22% 78%,
    rgba(12, 18, 26, calc(var(--crack-opacity) * 0.95)) 82% 100%);
  box-shadow: 0 0 6px rgba(220, 245, 255, 0.9), 0 0 2px rgba(255, 255, 255, 1), 0 0 1px rgba(10, 15, 22, 1);
  animation: visor-crack-branch .14s cubic-bezier(0.1, 0.9, 0.2, 1) var(--crack-delay) forwards;
}
/* Boczne mikropęknięcie wychodzące z głównego promienia */
.visor-crack i em {
  position: absolute; left: var(--sub-pos); top: 0; width: var(--sub-length); height: 1.5px;
  transform-origin: 0 50%; transform: rotate(var(--sub-angle)); opacity: 0;
  background: linear-gradient(to bottom,
    rgba(12, 18, 26, calc(var(--crack-opacity) * 0.9)) 0% 20%,
    rgba(245, 252, 255, 1) 25% 75%,
    rgba(12, 18, 26, calc(var(--crack-opacity) * 0.9)) 80% 100%);
  box-shadow: 0 0 4px rgba(200, 240, 255, 0.75);
  animation: visor-crack-sub .12s ease-out calc(var(--crack-delay) + 25ms) forwards;
}
/* Drobne odłamki / mikropęknięcia wokół krateru */
.visor-crack s {
  position: absolute; left: 0; top: 0; width: var(--shard-size); height: var(--shard-size);
  border-radius: 35%; pointer-events: none; opacity: 0;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 1), 0 0 2px rgba(20, 30, 42, 0.9);
  transform: rotate(var(--shard-angle)) translateX(var(--shard-dist));
  animation: crack-shard-appear .16s ease-out forwards;
}
@keyframes crack-flash-burst {
  0% { transform: scale(0.1); opacity: 1; filter: brightness(2); }
  20% { transform: scale(1.4); opacity: 1; filter: brightness(1.6); }
  60% { transform: scale(1.7); opacity: 0.6; }
  100% { transform: scale(2.0); opacity: 0; }
}
@keyframes crack-shockwave-ring {
  0% { transform: scale(0.1); opacity: 1; }
  40% { transform: scale(1.6); opacity: 0.9; }
  100% { transform: scale(2.8); opacity: 0; }
}
@keyframes crack-glow-pulse {
  0% { opacity: 0; transform: scale(0.5); }
  15% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.5; transform: scale(1); }
}
@keyframes crack-crater-pop {
  0% { transform: scale(0.1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
@keyframes crack-shard-appear {
  0% { opacity: 0; transform: rotate(var(--shard-angle)) translateX(2px) scale(0.2); }
  40% { opacity: 1; transform: rotate(var(--shard-angle)) translateX(var(--shard-dist)) scale(1.3); }
  100% { opacity: 0.9; transform: rotate(var(--shard-angle)) translateX(var(--shard-dist)) scale(1); }
}
@keyframes damage-blood-flash {
  0% { opacity: 0; }
  12% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes visor-crack-fade {
  0% { opacity: 0; }
  3% { opacity: 1; }
  60% { opacity: 0.92; }
  100% { opacity: 0; }
}
@keyframes visor-crack-branch {
  0% { opacity: 0; transform: rotate(var(--crack-angle)) scaleX(0.02); filter: drop-shadow(0 0 6px #ffffff); }
  25% { opacity: 1; transform: rotate(var(--crack-angle)) scaleX(1.02); filter: drop-shadow(0 0 8px #ffffff); }
  60% { transform: rotate(var(--crack-angle)) scaleX(1); filter: drop-shadow(0 0 3px rgba(220, 245, 255, 0.8)); }
  100% { opacity: 1; transform: rotate(var(--crack-angle)) scaleX(1); filter: none; }
}
@keyframes visor-crack-sub {
  0% { opacity: 0; transform: rotate(var(--sub-angle)) scaleX(0.02); }
  40% { opacity: 1; transform: rotate(var(--sub-angle)) scaleX(1.04); }
  100% { opacity: 0.95; transform: rotate(var(--sub-angle)) scaleX(1); }
}
@keyframes damage-direction-flash {
  0% { opacity: 0; }
  10% { opacity: 1; }
  38% { opacity: .92; }
  100% { opacity: 0; }
}
@keyframes healing-aura-pulse {
  0% { opacity: 0; transform: scale(1.025); }
  18% { opacity: 1; transform: scale(1); }
  58% { opacity: .58; }
  100% { opacity: 0; transform: scale(.985); }
}
@keyframes death-blood-vignette {
  0% { opacity: 0; }
  8% { opacity: 1; }
  72% { opacity: .82; }
  100% { opacity: .28; }
}
@keyframes death-blood-flow {
  0% { transform: translateY(-100%) scaleX(.65); }
  18% { transform: translateY(12vh) scaleX(1); }
  100% { transform: translateY(102vh) scaleX(.52); }
}

/* ---------- Kill Feed / Kill Notifications ---------- */
#kill-feed, #score-feed {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 3;
}
#kill-feed { top: 67%; }
#score-feed {
  left: calc(50% + 38px); top: 50%;
  transform: translateY(-50%);
  align-items: flex-start;
}
body:not(.playing) #kill-feed,
body:not(.playing) #score-feed,
body.menu-open #kill-feed,
body.menu-open #score-feed,
body.debug-open #kill-feed,
body.debug-open #score-feed {
  display: none !important;
}

.kill-msg {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  padding: 2px 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  animation: killPopIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.kill-msg .kill-name {
  font-size: inherit;
  font-weight: 800;
  text-shadow: 0 0 12px currentColor, 0 2px 8px rgba(0, 0, 0, 0.9);
}
.kill-msg .kill-name.red {
  color: #ff4d4d;
}
.kill-msg .kill-name.blue {
  color: #4da6ff;
}
/* Komunikat dowódcy (dziś AI): bursztyn odróżnia rozkaz od zabójstwa, żeby
   oko nie myliło informacji taktycznej z wynikiem walki. */
.kill-msg .kill-notice {
  font-weight: 800;
  letter-spacing: .04em;
  color: #ffc061;
  text-shadow: 0 0 12px currentColor, 0 2px 8px rgba(0, 0, 0, 0.9);
}
.score-combo {
  display: flex; flex-direction: column; align-items: center;
  min-width: 150px; color: #fff; opacity: 1;
  transition: opacity .35s ease, transform .35s ease;
}
.score-combo > strong {
  color: #ffd76a; font: 900 25px/1 ui-monospace, monospace;
  text-shadow: 0 0 14px rgba(255,215,106,.72), 0 2px 8px #000;
}
.score-combo > div {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 2px 8px; max-width: 260px; margin-top: 3px;
}
.score-combo small {
  color: rgba(255,255,255,.82); font-size: 9px; font-weight: 850;
  letter-spacing: 1.1px; text-shadow: 0 2px 6px #000;
}
.score-combo.score-bump > strong { animation: scoreComboBump .2s ease-out; }
.score-combo.fade-out { opacity: 0; transform: translateY(-8px) scale(.94); }
@keyframes scoreComboBump {
  0% { transform: scale(.72); }
  65% { transform: scale(1.13); }
  100% { transform: scale(1); }
}

.kill-msg.fade-out {
  opacity: 0;
  transform: translateY(-12px) scale(0.92);
}

@keyframes killPopIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.85);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#crosshair::before, #crosshair::after {
  content: ""; position: absolute;
  mix-blend-mode: difference;
}
#crosshair::before {
  left: 50%; top: 0; width: 2px; height: 100%; margin-left: -1px;
  background: linear-gradient(to bottom,
    transparent 0 calc(50% - var(--crosshair-gap) - var(--crosshair-arm)),
    rgba(255,255,255,.9) calc(50% - var(--crosshair-gap) - var(--crosshair-arm)) calc(50% - var(--crosshair-gap)),
    transparent calc(50% - var(--crosshair-gap)) calc(50% + var(--crosshair-gap)),
    rgba(255,255,255,.9) calc(50% + var(--crosshair-gap)) calc(50% + var(--crosshair-gap) + var(--crosshair-arm)),
    transparent calc(50% + var(--crosshair-gap) + var(--crosshair-arm)) 100%);
}
#crosshair::after {
  top: 50%; left: 0; height: 2px; width: 100%; margin-top: -1px;
  background: linear-gradient(to right,
    transparent 0 calc(50% - var(--crosshair-gap) - var(--crosshair-arm)),
    rgba(255,255,255,.9) calc(50% - var(--crosshair-gap) - var(--crosshair-arm)) calc(50% - var(--crosshair-gap)),
    transparent calc(50% - var(--crosshair-gap)) calc(50% + var(--crosshair-gap)),
    rgba(255,255,255,.9) calc(50% + var(--crosshair-gap)) calc(50% + var(--crosshair-gap) + var(--crosshair-arm)),
    transparent calc(50% + var(--crosshair-gap) + var(--crosshair-arm)) 100%);
}
#crosshair.dot::before {
  left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  border-radius: 50%; background: rgba(255,255,255,.95);
}
#crosshair.dot::after { display: none; }
.crosshair-ring {
  display: none; position: absolute; inset: -8px; border-radius: 50%;
  background: conic-gradient(#f5c542 calc(var(--reload-progress, 0) * 1turn), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
}
#crosshair.reloading .crosshair-ring { display: block; }

/* ---------- Scoreboard 64 vs 64 (Tab) ---------- */
#scoreboard.scoreboard-panel {
  position: fixed; inset: 7vh 4vw; z-index: 14;
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px; pointer-events: none; overflow: hidden;
  color: #fff; background: rgba(9, 14, 22, .86);
  border: 1px solid rgba(255,255,255,.18); border-radius: 18px;
  backdrop-filter: blur(24px) saturate(1.15); -webkit-backdrop-filter: blur(24px) saturate(1.15);
  box-shadow: 0 30px 90px rgba(0,0,0,.58), inset 0 1px rgba(255,255,255,.08);
}
#scoreboard.scoreboard-panel[hidden] { display: none; }
.scoreboard-title { display: flex; align-items: baseline; gap: 12px; padding: 0 4px 4px; }
.scoreboard-title span { font: 900 12px/1 system-ui; letter-spacing: 2.8px; color: #9ddcff; }
.scoreboard-title strong { font: 800 22px/1 system-ui; letter-spacing: 1.8px; }
.scoreboard-title small { margin-left: auto; font: 700 9px/1 system-ui; letter-spacing: 1.5px; color: rgba(255,255,255,.38); }
.scoreboard-teams { min-height: 0; flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.score-team { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.1); }
.score-team > header { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 11px 13px; }
.score-team.red > header { background: linear-gradient(90deg, rgba(224,69,79,.34), rgba(224,69,79,.08)); }
.score-team.blue > header { background: linear-gradient(90deg, rgba(63,134,230,.34), rgba(63,134,230,.08)); }
.score-team > header strong { font: 900 13px/1 system-ui; letter-spacing: 1.5px; }
.score-team > header b { font: 900 20px/1 ui-monospace, monospace; }
.score-team > header span { font: 700 10px/1 system-ui; color: rgba(255,255,255,.56); }
.score-columns, .score-row {
  display: grid; grid-template-columns: 24px 42px minmax(110px,1fr) 62px 32px 32px 32px 36px;
  align-items: center; column-gap: 5px;
}
.score-columns { min-height: 27px; padding: 0 9px; color: rgba(255,255,255,.42); font: 800 8px/1 system-ui; letter-spacing: .7px; }
.score-columns > :nth-child(n+4), .score-row > :nth-child(n+4) { text-align: right; }
.score-rows { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.score-row { min-height: 30px; padding: 2px 9px; border-top: 1px solid rgba(255,255,255,.055); font: 650 10px/1 system-ui; }
.score-row:nth-child(even) { background: rgba(255,255,255,.025); }
.score-row.local { background: rgba(255,215,106,.13); box-shadow: inset 3px 0 #ffd76a; }
.score-row.dead { opacity: .66; }
.score-row .rank { color: rgba(255,255,255,.36); }
.score-class { display: grid; place-items: center; color: rgba(255,255,255,.82); }
.score-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 850; letter-spacing: .15px;
  text-shadow: 0 2px 7px rgba(0,0,0,.95), 0 0 10px currentColor;
}
.score-team.red .score-name { color: #ff5963; }
.score-team.blue .score-name { color: #58a1ff; }
.score-row.local .score-name { color: #ffe07a; text-shadow: 0 2px 7px #000, 0 0 12px rgba(255,215,106,.72); }
/* Kolega z mojego fireteamu — ta sama zieleń co w czacie, na minimapie i nad głową. */
.score-team.red .score-row.mate .score-name,
.score-team.blue .score-row.mate .score-name { color: #4dff9a; text-shadow: 0 2px 7px #000, 0 0 12px rgba(77,255,154,.55); }
.score-name small { margin-left: 7px; font-size: 7px; letter-spacing: 1px; color: rgba(255,255,255,.32); }
.score-row b { color: #fff; font: 850 11px/1 ui-monospace, monospace; }
.score-empty { padding: 28px; text-align: center; color: rgba(255,255,255,.3); font: 800 9px/1 system-ui; letter-spacing: 1.5px; }
@media (max-width: 820px) {
  #scoreboard.scoreboard-panel { inset: 3vh 2vw; padding: 10px; }
  .scoreboard-teams { grid-template-columns: 1fr; }
  .score-team { max-height: 42vh; }
}

/* War funds — zjednoczony moduł pieniążków drużynowych tuż pod minimapą. */
#warfunds {
  position: fixed; top: calc(var(--minimap-top) + var(--minimap-size) + 10px); right: 14px;
  width: var(--minimap-size); z-index: 2;
  display: none; align-items: center; justify-content: space-between;
  box-sizing: border-box; padding: 7px 12px; border-radius: 10px; pointer-events: none;
  font: 800 15px/1 ui-monospace, monospace; letter-spacing: .5px; color: #72ff9e;
  background: rgba(20, 26, 36, 0.65); border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
#warfunds.pulse {
  transform: scale(1.06);
  border-color: rgba(114, 255, 158, 0.6);
  box-shadow: 0 0 20px rgba(114, 255, 158, 0.4);
}
#warfunds-label {
  display: flex; align-items: center; gap: 6px;
  font: 700 9px/1 system-ui, -apple-system, sans-serif; letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.55); text-transform: uppercase;
}
#warfunds-icon {
  font-size: 13px; color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}
#warfunds-val {
  font: 800 16px/1 ui-monospace, monospace; color: #72ff9e;
  text-shadow: 0 0 10px rgba(114, 255, 158, 0.4);
}
body.playing #warfunds { display: flex; }
body.menu-open #warfunds, body.debug-open #warfunds { display: none; }

/* Przyrost gotówki pojawia się wyłącznie po lewej stronie TEAM FUNDS. */
#floating-funds { position: fixed; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.floating-funds-item {
  position: absolute; white-space: nowrap; opacity: 0;
}
.floating-funds-item.badge-float {
  padding: 4px 7px; border-radius: 7px;
  font: 900 18px/1 ui-monospace, monospace; color: #72ff9e;
  background: rgba(10,18,16,.76); border: 1px solid rgba(114,255,158,.22);
  text-shadow: 0 2px 6px rgba(0,0,0,.9), 0 0 14px rgba(114,255,158,.8);
  box-shadow: 0 4px 14px rgba(0,0,0,.32);
}
.floating-funds-item.badge-float.rise { animation: floating-funds-badge 1.25s ease-out forwards; }
@keyframes floating-funds-badge {
  0% { opacity: 0; transform: translate(-85%, -50%) scale(.8); }
  18% { opacity: 1; transform: translate(-100%, -50%) scale(1.08); }
  100% { opacity: 0; transform: translate(-115%, -90%) scale(1); }
}

/* ---------- Ekran startowy ---------- */
/* Domyślnie #hint jest tylko RAMĄ na całym ekranie — bez własnej karty, tła
   ani blura. Globus (public/js/campaign/globe-view.js) wypełnia tło POD nim
   jako osobna, stała warstwa (`.globe-container`), więc kosmos i planeta
   widać przez cały ekran, a nie tylko w wycinku panelu mapy. Klikalne są
   tylko właściwe dzieci (nagłówek, panel wdrożenia) — reszta przepuszcza
   kliki do globusu pod spodem. Wyjątek: `.version-mismatch` (patrz niżej)
   wraca do dawnej, wyśrodkowanej karty z blurem — to osobny, mały dialog,
   nie widok kampanii. */
#hint {
  position: fixed;
  inset: 0;
  padding: 26px;
  overflow: hidden;
  cursor: default;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  z-index: 1;
}
#hint > * { pointer-events: auto; }
body.playing #hint { display: none; }
body.playing.menu-open #hint { display: flex; }
body.playing .globe-container { display: none; }
body.playing.menu-open .globe-container { display: block; }
body.menu-open #crosshair,
body.menu-open #damage-feedback,
body.menu-open #hitmarker,
body.menu-open #kill-cam,
body.menu-open #scoreboard,
body.menu-open #loadout,
body.menu-open #ammo-counter,
body.menu-open #health,
body.menu-open #respawn-wave,
body.menu-open #vehicle-prompt { display: none; }
/* W pojeździe toolbar piechoty i licznik amunicji nie znaczą nic — ich miejsce
   zajmuje panel pojazdu. CELOWO oddzielna reguła, nie dopisek do listy wyżej:
   doklejanie selektorów do cudzych list już raz wywróciło cały HUD (0.50.5). */
body.driving-tank #loadout,
body.driving-tank #ammo-counter { display: none; }
body.menu-open #tank-hud,
body.debug-open #tank-hud,
body.commander-view #tank-hud { display: none; }
/* Odmowa rozłożenia dwunogu. Czerwień i miganie są tu ŚWIADOMIE nachalne:
   gracz wciska PPM w środku walki i musi w ułamku sekundy zrozumieć, że broń
   nie odmówiła działania, tylko nie ma o co się oprzeć. Szary tekst w tym
   miejscu jest nieczytelny — sprawdzone na pozostałych podpowiedziach HUD-u. */
#vehicle-prompt.alert {
  color: #ff5c62;
  text-shadow: 0 0 12px rgba(255, 60, 68, 0.55), 0 2px 6px rgba(0, 0, 0, 0.9);
  animation: prompt-alert 0.34s steps(1, end) infinite;
}
@keyframes prompt-alert {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0.28; }
}
/* Inspektor zawartości to narzędzie DEBUGOWE świata — na ekranie kampanii
   zasłania róg panelu i nie ma czego opisywać (kursor jest nad menu). */
body:not(.playing) #content-inspector,
body.menu-open #content-inspector { display: none !important; }
body.debug-open #crosshair,
body.debug-open #damage-feedback,
body.debug-open #hitmarker,
body.debug-open #scoreboard,
body.debug-open #loadout,
body.debug-open #ammo-counter,
body.debug-open #health,
body.debug-open #respawn-wave,
body.debug-open #vehicle-prompt { display: none; }
body.commander-view #crosshair,
body.commander-view #hitmarker,
body.commander-view #kill-cam,
body.commander-view #damage-feedback,
body.commander-view #vehicle-prompt { display: none; }
body.commander-view #health { display: none !important; }
body.commander-view #stamina { display: none !important; }
/* Pusty licznik amunicji u dowódcy wygląda jak drugi, zbędny slotbar. */
body.commander-view #ammo-counter { display: none !important; }
/* Commander ma własne informacje w panelu budowy i mapie strategicznej.
   Debugowe współrzędne oraz drugi kafel funduszy tylko zasłaniały pole.

   TABELA WYNIKÓW ZOSTAJE (Topek, 5.09.2026). Była tu ukryta razem z resztą
   HUD-u piechoty i przez to Tab u dowódcy nie robił nic — a to jemu tabela
   przydaje się najbardziej: widzi z niej skład obu stron i to, kto z jego
   drużyny realnie walczy. Sam pasek jest chowany klawiszem, więc niczego
   nie zasłania na stałe. */
body.commander-view #content-inspector,
body.commander-view #warfunds { display: none !important; }
body.commander-view #minimap {
  top: 18px; left: 18px; right: auto;
  pointer-events: auto;
  cursor: crosshair;
  border-radius: 14px;
  border-color: rgba(157,220,255,.32);
  box-shadow: 0 14px 44px rgba(0,0,0,.46), inset 0 0 0 1px rgba(255,255,255,.05);
}
body.commander-view #game { cursor: default; }
#commander-overlay { position: fixed; inset: 0; z-index: 4; pointer-events: none; display: none; }
#commander-overlay.active { display: block; }
#commander-selection-box {
  position: fixed; border: 1px solid rgba(92,255,132,.95); background: rgba(70,220,104,.14);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset;
}
#commander-selection-summary {
  position: fixed; left: 18px; bottom: 18px; display: flex; gap: 7px; padding: 8px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 12px;
  background: rgba(10,18,15,.78); backdrop-filter: blur(14px); pointer-events: auto;
}
.commander-group {
  display: flex; align-items: center; gap: 7px; min-width: 104px; padding: 7px 9px;
  color: rgba(255,255,255,.86); background: rgba(69,214,104,.13);
  border: 1px solid rgba(102,255,139,.38); border-radius: 8px; cursor: pointer;
  font: 700 10px/1 system-ui; letter-spacing: .6px;
}
.commander-group:hover { background: rgba(69,214,104,.28); border-color: rgba(125,255,157,.8); }
.commander-group i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: #09200e; background: #62ff8b; font-style: normal; font-weight: 900; }
.commander-group span { flex: 1; text-align: left; }
.commander-group b { color: #8dffa8; font-size: 12px; }

/* ——— Szyna dowódcy: karta funduszy + menu budowy (Liquid Glass) ———
   Dwie OSOBNE karty w jednej kolumnie: stan konta zmienia się sam (dochód,
   zniszczenia), a katalog jest wyborem dowódcy. Wspólna karta sprawiała, że
   licznik funduszy czytał się jak nagłówek listy budowli. */
#commander-rail {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  z-index: 12; width: min(410px, calc(100vw - 36px)); display: flex; flex-direction: column; gap: 10px;
  max-height: calc(100dvh - 120px);
  pointer-events: none;
}
#commander-rail[hidden] { display: none; }
/* `.commander-ui` to marker klikalności (patrz `world/commander-control.js`) —
   NIE wolno wieszać na nim wyglądu, bo nosi go też canvas minimapy. Wygląd
   karty siedzi w osobnej klasie. */
.commander-card {
  padding: 15px; border-radius: 16px; pointer-events: auto;
  color: rgba(255,255,255,.9); font: 12px/1.3 system-ui;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 90px), rgba(24,30,42,.55);
  backdrop-filter: blur(28px) saturate(1.3); -webkit-backdrop-filter: blur(28px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 22px 64px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.12);
}
#commander-build { display: flex; flex-direction: column; gap: 11px; min-height: 0; overflow: hidden; }
#commander-build .commander-build-list { min-height: 0; overflow-y: auto; padding-right: 3px; }
#commander-build .commander-build-item { flex-shrink: 0; }
#commander-sales, #commander-funds-card { flex-shrink: 0; }
#commander-sales { padding: 0; overflow: hidden; }
#commander-sales > button { width:100%; display:flex; justify-content:space-between; padding:12px 15px; border:0; background:transparent; color:#eaf7ff; cursor:pointer; font:700 10px system-ui; letter-spacing:.8px; }
#commander-sales > button:hover { background:#ffffff12; }
#commander-sales-modal { position:fixed; inset:0; margin:auto; width:min(520px,calc(100vw - 40px)); max-height:calc(100dvh - 80px); box-sizing:border-box; padding:20px; }
#commander-sales-modal::backdrop { background:rgba(5,10,18,.55); backdrop-filter:blur(3px); }
#commander-sales-modal header { display:flex; justify-content:space-between; align-items:center; gap:16px; }
#commander-sales-modal h2 { margin:0; font:700 18px system-ui; }
#commander-sales-modal p { color:#b6c6d3; margin:10px 0 16px; }
#commander-sales-modal .commander-sales-list { max-height:calc(100dvh - 210px); overflow-y:auto; }
#commander-sales-modal button { color:#eaf7ff; background:#293846; border:1px solid #526779; border-radius:6px; cursor:pointer; padding:7px 10px; }
#commander-sales-modal button:hover { background:#405668; }
#commander-sales-modal button:focus-visible { outline:2px solid #9ddcff; outline-offset:2px; }
#commander-funds-card {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 11px 15px;
}
#commander-funds-card span { font-size: 8px; letter-spacing: 1.5px; color: rgba(157,220,255,.62); font-weight: 700; }
#commander-funds-card strong { font: 800 22px/1 ui-monospace, monospace; color: #eaf7ff; }
#commander-funds-card strong::before { content: '$'; opacity: .5; font-size: 13px; margin-right: 1px; }
.commander-build-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-content: start; }
.commander-build-list .build-category { grid-column: 1 / -1; }
#commander-build .commander-build-item { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 0 5px; padding: 7px 6px; min-height: 49px; }
#commander-build .commander-build-item > b { font-size: 11px; line-height: 1.2; overflow-wrap: anywhere; }
#commander-build .commander-build-item .cost { font-size: 11px; }
#commander-build .commander-build-item .build-icon { width: 22px; height: 24px; }
/* Nagłówek kategorii: rysowany jak etykieta sekcji, nie jak pozycja listy —
   ma się czytać jednym spojrzeniem jako podział, a nie jako coś klikalnego. */
.commander-build-list .build-category {
  margin-top: 7px; font: 700 8px/1 system-ui; letter-spacing: 1.6px;
  color: rgba(157,220,255,.62); text-transform: uppercase;
}
.commander-build-list .build-category:first-child { margin-top: 0; }
.commander-build-item {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 0 9px; align-items: center;
  text-align: left; padding: 8px 11px; border-radius: 11px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.9); transition: background 120ms ease-out, border-color 120ms ease-out;
}
.commander-build-item:hover { background: rgba(97,170,255,.18); border-color: rgba(157,220,255,.42); }
.commander-build-item.active { background: rgba(97,170,255,.3); border-color: rgba(157,220,255,.72); }
.commander-build-item .build-icon {
  grid-column: 1; grid-row: 1 / -1; display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 8px; background: rgba(157,220,255,.12); color: #cfe9ff;
}
.commander-build-item .build-icon svg { width: 17px; height: 17px; display: block; }
.commander-build-item b { grid-column: 2; font-size: 12px; color: #fff; }
.commander-build-item b { grid-row: 1; }
.commander-build-item .cost {
  grid-column: 3; grid-row: 1; font: 800 13px/1 ui-monospace, monospace; color: #9dffb5; font-style: normal;
}
/* Ile już stoi z dozwolonych sztuk. Drugi wiersz pod nazwą, bo to informacja
   o STANIE, a nie o cenie — pozycje bez limitu nie mają tego wiersza wcale
   i kafelek zostaje jednowierszowy. */
.commander-build-item .build-limit {
  grid-column: 2 / -1; grid-row: 2; margin-top: 3px;
  font: 700 9px/1 ui-monospace, monospace; font-style: normal;
  letter-spacing: .8px; color: rgba(157,220,255,.6);
}
.commander-build-item .build-limit b { font-size: 11px; color: #cfe9ff; }
.commander-build-item.at-limit .build-limit b { color: #9dffb5; }
/* Znacznik „już postawione" zajmuje miejsce kosztu — pozycja zostaje na
   liście, ale przestaje być ofertą i staje się skrótem do budowli. */
.commander-build-item .build-check { grid-column: 3; grid-row: 1; display: none; font-style: normal;
  font-weight: 900; font-size: 14px; color: #62ff8b; text-shadow: 0 0 10px rgba(98,255,139,.5); }
.commander-build-item.at-limit .cost { display: none; }
.commander-build-item.at-limit .build-check { display: block; }
.commander-build-item.at-limit { background: rgba(98,255,139,.09); border-color: rgba(98,255,139,.3); }
.commander-build-item.at-limit:hover { background: rgba(98,255,139,.18); border-color: rgba(98,255,139,.55); }
.commander-build-item.at-limit .build-icon { background: rgba(98,255,139,.14); color: #9dffb5; }
#commander-build-hint { font-size: 9px; letter-spacing: .5px; color: rgba(255,255,255,.42); text-align: center; }

/* Zdolności dowódcy (ostrzał rakietowy z silosu): kafelek ląduje wprost
   w istniejącym pasku `#loadout`, więc dziedziczy wygląd slotów piechoty.
   Poniżej tylko dodatki: nazwa, stan gotowości i pasek przeładowania.
   `#commander-abilities` trzyma już wyłącznie podpowiedź nad dokiem HUD. */
#commander-abilities {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  z-index: 12; display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
}
#commander-abilities[hidden] { display: none; }
#loadout .commander-slot { overflow: hidden; cursor: pointer; padding: 0; pointer-events: auto; }
#loadout .commander-slot .slot-name {
  position: absolute; left: 0; right: 0; bottom: 2px;
  font-size: 8px; letter-spacing: 0.6px; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75); text-align: center;
  pointer-events: none; padding: 0;
}
#loadout .commander-slot b { top: 2px; bottom: auto; }
#loadout .commander-slot .cooldown {
  position: absolute; left: 5px; top: 3px;
  font: 800 10px/1 ui-monospace, monospace; font-style: normal;
  color: #9dffb5; letter-spacing: .4px; text-shadow: 0 1px 3px #000;
}
/* Pasek postępu przeładowania — rośnie w prawo pod treścią przycisku. */
#loadout .commander-slot .sweep {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, rgba(255,143,94,.5), #ff8f5e);
  transition: transform 220ms linear;
}
#loadout .commander-slot.ready { border-color: rgba(125,255,157,.5); }
#loadout .commander-slot.ready:hover {
  background: rgba(97, 255, 139, 0.12);
}
#loadout .commander-slot.active {
  border-color: rgba(255,143,94,.85);
  background: rgba(255,143,94,.16);
  box-shadow: inset 0 0 12px rgba(255,143,94,.18), 0 0 16px rgba(255,143,94,.2);
}
#loadout .commander-slot.cooling { cursor: default; opacity: .72; }
#loadout .commander-slot.cooling .cooldown { color: #ffc98f; }
#loadout .commander-slot.locked { cursor: default; opacity: .45; }
#loadout .commander-slot.locked .cooldown {
  color: rgba(255,255,255,.5); font-size: 8px;
}
#commander-ability-hint {
  font: 9px/1 system-ui; letter-spacing: .8px; text-transform: uppercase;
  color: rgba(255,255,255,.55); text-shadow: 0 1px 3px rgba(0,0,0,.6); min-height: 10px;
}

/* Komendy drużynowe (V) — menu w stylu Enemy Territory. */
#squad-menu {
  position: fixed; left: 20px; bottom: 96px; z-index: 8;
  min-width: 196px; display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border-radius: 14px; pointer-events: none;
  background: rgba(18,24,34,.62); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 14px 44px rgba(0,0,0,.4);
  font: 12px/1.35 system-ui; color: rgba(255,255,255,.9);
}
#squad-menu[hidden] { display: none; }
#squad-menu b { font: 700 9px/1 system-ui; letter-spacing: 2px; color: rgba(157,220,255,.7); margin-bottom: 4px; }
#squad-menu span { padding: 2px 2px; color: rgba(255,255,255,.86); }

/* Podpowiedź COMMANDER COMMS usunięta razem z wejściem pod klawiszem V
   (0.50.8) — wróci jako menu kontekstowe pod prawym przyciskiem myszy. */

#commander-order-feedback {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%); padding: 8px 13px;
  color: #baffc8; background: rgba(10,30,16,.78); border: 1px solid rgba(113,255,143,.4);
  border-radius: 8px; font: 800 10px/1 system-ui; letter-spacing: 1px;
}
#conquest-hud {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%);
  display: none; pointer-events: none; color: rgba(255,255,255,.88);
  text-align: center; font-size: 11px;
}
body.playing #conquest-hud { display: block; }
body.menu-open #conquest-hud, body.debug-open #conquest-hud { display: none; }
.conquest-tickets {
  display: flex; align-items: center; gap: 18px; padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  background: rgba(20,24,34,.58); backdrop-filter: blur(16px);
  box-shadow: 0 8px 28px rgba(0,0,0,.24); font-size: 10px; letter-spacing: 1px;
}
.conquest-tickets span { display: flex; align-items: baseline; gap: 6px; }
.conquest-tickets strong { font-size: 18px; letter-spacing: 0; color: #fff; }
.ticket-red b { color: #ef5b64; }
.ticket-blue b { color: #6da7ff; }
.ticket-zone { gap: 4px !important; }
.ticket-zone .ticket-point {
  display: grid; position: relative; place-items: center; width: 19px; height: 19px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 50%;
  color: rgba(255,255,255,.48); font-size: 10px; font-weight: 800;
  letter-spacing: 0; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.75);
  transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.ticket-zone .ticket-point.red {
  color: #ff7c83; border-color: rgba(239,91,100,.82); background: rgba(239,91,100,.18);
  box-shadow: 0 0 8px rgba(239,91,100,.34);
}
.ticket-zone .ticket-point.blue {
  color: #88baff; border-color: rgba(109,167,255,.82); background: rgba(109,167,255,.18);
  box-shadow: 0 0 8px rgba(109,167,255,.34);
}
.ticket-zone .ticket-point.capturing::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--capture-color) calc(var(--capture-progress) * 1turn), rgba(255,255,255,.18) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  filter: drop-shadow(0 0 3px var(--capture-color));
}
.conquest-capture { display: none; width: 220px; margin: 7px auto 0; padding: 6px 10px 8px;
  border-radius: 9px; background: rgba(20,24,34,.66); border: 1px solid rgba(255,255,255,.12); }
#conquest-hud.in-zone .conquest-capture { display: block; }
.capture-title { display: block; font-size: 10px; letter-spacing: 1.5px; }
.capture-state { display: block; margin: 3px 0 5px; color: rgba(255,255,255,.62); font-size: 9px; letter-spacing: .8px; }
.conquest-capture i { display: block; height: 4px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.14); }
.conquest-capture em { display: block; width: 0; height: 100%; border-radius: inherit; transition: width .15s linear; }

/* ——— Pasek komunikatów systemowych i rozkazów dowódcy ———
   Góra ekranu, POD HUD-em Conquest: to informacja taktyczna, którą czyta się
   podnosząc wzrok, a nie spuszczając go na slotbar. Bursztyn jest tu kolorem
   dowodzenia (jak w `.kill-notice`), czerwień zostaje dla rozkazu ataku. */
#comms-feed {
  position: fixed; left: 50%; top: 96px; transform: translateX(-50%);
  display: none; flex-direction: column; align-items: center; gap: 5px;
  pointer-events: none; width: max-content; max-width: 62vw;
}
body.playing #comms-feed { display: flex; }
body.menu-open #comms-feed, body.debug-open #comms-feed { display: none; }
.comms-msg {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 7px; border-radius: 11px;
  border: 1px solid rgba(255,192,97,.28); background: rgba(20,24,34,.58);
  backdrop-filter: blur(16px); box-shadow: 0 8px 28px rgba(0,0,0,.28);
  font-size: 11px; font-weight: 800; letter-spacing: .09em; color: rgba(255,255,255,.9);
  white-space: nowrap;
  animation: commsPopIn .22s cubic-bezier(.175,.885,.32,1.275) both;
  transition: opacity .35s ease, transform .35s ease;
}
.comms-msg .comms-icon {
  display: grid; place-items: center; flex: none; width: 22px; height: 22px;
  border-radius: 7px; font-style: normal; font-weight: 900; font-size: 14px;
  color: #2a1b02; background: #ffc061; box-shadow: 0 0 14px rgba(255,192,97,.55);
  transition: opacity .18s ease, transform .18s ease;
}
/* Ikona „wypuszczona" do świata: znika z paska w tej samej klatce, w której
   startuje przelot, ale ZOSTAWIA swoje miejsce — inaczej napis skacze w bok. */
.comms-msg .comms-icon.released { opacity: 0; transform: scale(.4); }
/* NADAWCA ma własny kolor, treść zostaje biała. Dzięki temu „kto mówi" czyta
   się szybciej niż „co mówi" — a gdy dojdą inne komunikaty systemowe, będą
   się różnić właśnie tym słowem, nie całym kafelkiem. */
.comms-msg .comms-source {
  font-weight: 900; letter-spacing: .12em; color: #ffc061;
  text-shadow: 0 0 10px rgba(255,192,97,.45);
}
/* Kreska rozdzielająca nadawcę od treści — zamiast dwukropka w tekście. */
.comms-msg .comms-source + .comms-text::before {
  content: ''; display: inline-block; vertical-align: -1px;
  width: 1px; height: 10px; margin-right: 8px;
  background: rgba(255,255,255,.24);
}
/* Zgłoszenie OD PIECHOTY (prośba o ostrzał): błękit zamiast bursztynu, bo
   nadawcą jest kolega z drużyny, a nie dowodzenie. To jest dokładnie ten
   przypadek, dla którego nadawca dostał osobne pole i własny kolor. */
.comms-msg.kind-artilleryRequest { border-color: rgba(157,220,255,.34); }
.comms-msg.kind-artilleryRequest .comms-source { color: #9dd6ff; text-shadow: 0 0 10px rgba(157,220,255,.45); }
.comms-msg.kind-artilleryRequest .comms-icon { background: #9dd6ff; color: #06202e; box-shadow: 0 0 14px rgba(157,220,255,.55); }
.comms-msg.kind-attackOrder { border-color: rgba(255,91,98,.34); }
.comms-msg.kind-attackOrder .comms-source { color: #ff8087; text-shadow: 0 0 10px rgba(255,91,98,.45); }
.comms-msg.kind-attackOrder .comms-icon { background: #ff5b62; color: #2a0406; box-shadow: 0 0 14px rgba(255,91,98,.55); }
.comms-msg.fade-out { opacity: 0; transform: translateY(-10px) scale(.94); }
@keyframes commsPopIn {
  from { opacity: 0; transform: translateY(-10px) scale(.88); }
  to   { opacity: 1; transform: none; }
}

/* ——— Wskaźniki punktów w świecie (`ui/world-pings.js`) ———
   Pozycję ustawia JS co klatkę (transform), CSS odpowiada wyłącznie za wygląd.
   Poza kadrem dochodzi strzałka obracana ku celowi. */
/* z-index 3: wskaźnik ślizgający się po krawędzi WCHODZI na minimapę i pasek
   funduszy — przykryty przez nie byłby bezużyteczny dokładnie w tym rogu,
   w którym najczęściej ląduje. */
#world-pings { position: fixed; inset: 0; pointer-events: none; display: none; z-index: 3; }
body.playing #world-pings { display: block; }
body.menu-open #world-pings, body.debug-open #world-pings { display: none; }
.world-ping {
  position: absolute; top: 0; left: 0; will-change: transform, opacity;
  display: grid; place-items: center;
}
.world-ping .ping-icon {
  display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 8px; font-style: normal; font-weight: 900; font-size: 16px;
  color: #2a1b02; background: #ffc061;
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 0 18px rgba(255,192,97,.6), 0 4px 14px rgba(0,0,0,.45);
}
.world-ping.kind-attackOrder .ping-icon { background: #ff5b62; color: #2a0406; box-shadow: 0 0 18px rgba(255,91,98,.6), 0 4px 14px rgba(0,0,0,.45); }
.world-ping.kind-artilleryRequest .ping-icon { background: #9dd6ff; color: #06202e; box-shadow: 0 0 18px rgba(157,220,255,.6), 0 4px 14px rgba(0,0,0,.45); }
/* Strzałka: trójkąt wskazujący W PRAWO w pozycji zerowej, obracany przez JS
   o `atan2` kierunku do celu. Widoczna wyłącznie poza kadrem. */
.world-ping .ping-arrow {
  position: absolute; left: 50%; top: 50%; opacity: 0;
  width: 0; height: 0; margin: -7px 0 0 -7px;
  border: 7px solid transparent; border-left-color: #ffc061;
  transform-origin: 7px 7px; filter: drop-shadow(0 0 6px rgba(255,192,97,.7));
  transition: opacity .12s ease;
}
.world-ping.kind-attackOrder .ping-arrow { border-left-color: #ff5b62; }
.world-ping.kind-artilleryRequest .ping-arrow { border-left-color: #9dd6ff; }
/* Strzałka wychodzi POZA pigułkę: przesunięcie po obrocie robi `translate`
   wzdłuż lokalnej osi X, czyli zawsze w kierunku celu. */
.world-ping.offscreen .ping-arrow { opacity: 1; }
.campaign-brand {
  display: flex; align-items: center;
}
.blockfield-brand-logo {
  display: block;
  height: 82px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.85));
  transition: transform 160ms ease-out, filter 160ms ease-out;
  user-select: none;
  pointer-events: none;
}

#hint.version-mismatch {
  inset: auto;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 92vw);
  max-height: 97vh;
  padding: 22px;
  overflow: auto;
  text-align: center;
  display: block;
  background: rgba(13, 17, 25, 0.62);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
#hint.version-mismatch h1 { margin: 10px 0 14px; }
#hint #version-reload {
  width: 100%; margin-top: 16px; padding: 13px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  cursor: pointer;
  transition: background 140ms ease-out, border-color 140ms ease-out;
}
#hint #version-reload:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.5);
}
#hint #version-reload:disabled { opacity: .6; cursor: wait; }
.campaign-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5px 16px;
}
/* Battle brief siedzi w górnej belce: tryb, front, obłożenie — trzy liczby,
   zero prozy. Poprzedni panel-akapit w kolumnie deploymentu zniknął. */
.battle-brief {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(10, 14, 21, 0.5);
  overflow: hidden;
}
.brief-cell {
  padding: 8px 18px; text-align: left;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}
.brief-cell:first-child { border-left: none; }
.brief-cell span {
  display: block; font-size: 9px; letter-spacing: 1.6px;
  color: rgba(255, 255, 255, 0.4); margin-bottom: 3px;
}
.brief-cell strong { font-size: 15px; letter-spacing: .8px; }
#brief-mode { color: #ffd76a; }
.campaign-layout {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  /* `flex-end` + `margin-right: auto` na panelu fireteamu, a NIE `space-between`:
     przed meczem panel fireteamu jest ukryty i przy `space-between` panel
     wdrożenia zostawał sam, więc odjeżdżał na lewą krawędź ekranu. */
  justify-content: flex-end;
}
/* Ten box jest przezroczysty i rozciągnięty na CAŁĄ szerokość ekranu (lewa
   strona to tylko pusty kosmos nad globusem) — bez `none` przechwytywałby
   przeciąganie/scroll myszy nad globusem, zanim dotrą do kanwy pod spodem.
   Selektor `#hint > .campaign-layout` (nie sama klasa) musi przebić
   specyficzność `#hint > *` z bloku `#hint` powyżej, który daje `auto`
   wszystkim bezpośrednim dzieciom. Panel wdrożenia odzyskuje `auto`. */
#hint > .campaign-layout { pointer-events: none; }
.deployment-panel, .fireteam-panel { pointer-events: auto; }
body.playing.menu-open .fireteam-panel { display: flex; }
/* Fireteamy: lewa kolumna mapy świata, naprzeciw panelu wdrożenia.
   WYŁĄCZNIE w trakcie meczu (mapa świata otwarta na „L"). Na ekranie przed
   pierwszym DEPLOY panel nie ma czym się wypełnić — nie ma połączenia, więc nie
   ma składów, do których można dołączyć — a pusta lista sześciu drużyn tylko
   sugerowała, że coś się zepsuło. */
.fireteam-panel {
  width: 300px;
  margin-right: auto;
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(10, 14, 21, 0.55);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.fireteam-header { display: flex; align-items: baseline; justify-content: space-between; }
.fireteam-hint { color: rgba(255,255,255,.34); font: 800 9px/1 system-ui; letter-spacing: 1.1px; }
.fireteam-list { display: flex; flex-direction: column; gap: 6px; }
.fireteam-row {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 140ms ease-out, background 140ms ease-out;
}
/* Własna drużyna świeci tą samą zielenią, co znaczniki w świecie i nick na
   czacie — jeden kolor na „moi ludzie" w całej grze. */
.fireteam-row.mine {
  border-color: rgba(77, 255, 154, 0.5);
  background: rgba(77, 255, 154, 0.10);
}
.fireteam-row.full { opacity: .55; }
.fireteam-row-top { display: flex; align-items: center; gap: 8px; }
.fireteam-row-top strong { flex: 1; color: #fff; font: 800 12px/1 system-ui; letter-spacing: 1.4px; }
.fireteam-count { color: rgba(255,255,255,.5); font: 700 10px/1 system-ui; letter-spacing: .6px; }
.fireteam-action {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font: 800 9px/1 system-ui; letter-spacing: 1.1px;
  cursor: pointer;
  transition: background 140ms ease-out, border-color 140ms ease-out;
}
.fireteam-action:hover:not(:disabled) { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.42); }
.fireteam-action.leave { border-color: rgba(255, 120, 128, 0.5); background: rgba(224, 69, 79, 0.22); }
.fireteam-action:disabled { opacity: .38; cursor: not-allowed; }
.fireteam-members { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.fireteam-member {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px 2px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255,255,255,.82);
  font: 700 10px/1.5 system-ui;
}
.fireteam-member i { display: inline-flex; opacity: .8; }
.fireteam-member.self { background: rgba(77, 255, 154, 0.18); color: #d6ffe9; }
.fireteam-member.empty { background: none; color: rgba(255,255,255,.24); letter-spacing: 1px; font-size: 9px; }
.fireteam-notice { margin: 0; min-height: 12px; color: #ffb36b; font: 700 10px/1.3 system-ui; }
.fireteam-panel.no-faction .fireteam-list { opacity: .45; }

/* Globus jest jedynym widokiem teatru działań I tłem CAŁEGO ekranu menu
   kampanii (Topek, 2026-09-02) — nie siedzi już w karcie panelu mapy, tylko
   wypełnia widok pod nagłówkiem i panelem wdrożenia jako stała warstwa. */
.globe-container {
  position: fixed; inset: 0;
  overflow: hidden; user-select: none;
  z-index: 0;
}
.globe-container.hidden { display: none; }
#globe-canvas {
  width: 100%; height: 100%; display: block; outline: none; cursor: default;
}
.globe-tooltip {
  position: absolute; top: 0; left: 0;
  padding: 6px 12px; border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  pointer-events: none; transform: translate(-50%, -100%);
  transition: opacity 120ms ease-out, transform 120ms ease-out;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 20; text-align: center;
}
.globe-tooltip.hidden { opacity: 0; pointer-events: none; }
.globe-tooltip strong { display: block; font-size: 12px; color: #fff; letter-spacing: 0.5px; }
.globe-tooltip small { display: block; font-size: 9px; color: rgba(255, 255, 255, 0.6); margin-top: 1px; }

.deployment-panel {
  display: flex; flex-direction: column; gap: 14px;
  width: min(380px, 92vw);
  max-height: 100%;
  overflow: auto;
  padding: 16px;
  background: rgba(14, 18, 28, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.setup-block { text-align: left; }
.setup-label {
  display: flex; align-items: center; gap: 6px;
  font-family: ui-monospace, monospace;
  font-size: 10px; font-weight: 800; letter-spacing: 2px;
  color: rgba(157, 220, 255, 0.7); margin-bottom: 6px;
  text-transform: uppercase;
}
.setup-label::before {
  content: ''; display: inline-block; width: 4px; height: 10px;
  background: #61aaff; border-radius: 1px;
}
#name-input {
  width: 100%; padding: 11px 14px;
  background: rgba(8, 12, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #fff; font-size: 15px; font-weight: 700; font-family: inherit;
  letter-spacing: 0.8px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
  transition: border-color 140ms ease-out, box-shadow 140ms ease-out, background 140ms ease-out;
}
#name-input:focus {
  outline: none; border-color: rgba(157, 220, 255, 0.7);
  background: rgba(10, 16, 26, 0.8);
  box-shadow: 0 0 16px rgba(97, 170, 255, 0.25), inset 0 2px 6px rgba(0,0,0,0.4);
}
.faction-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.faction-card {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 14px;
  color: #fff; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, rgba(255,255,255,.05) 0%, rgba(0,0,0,.35) 100%);
  border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.1);
  transition: background 140ms ease-out, border-color 140ms ease-out, transform 140ms ease-out, box-shadow 140ms ease-out;
  overflow: hidden;
}
.faction-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  transition: opacity 160ms ease-out;
}
.faction-card.red::before {
  background: radial-gradient(circle at 30% 50%, rgba(224,69,79,.32), transparent 70%);
}
.faction-card.blue::before {
  background: radial-gradient(circle at 30% 50%, rgba(63,134,230,.32), transparent 70%);
}
.faction-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.3);
  box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.2);
}
.faction-card:hover::before { opacity: 0.6; }
.faction-card.red.selected {
  border-color: var(--red);
  background: linear-gradient(180deg, rgba(224,69,79,.28) 0%, rgba(35,8,12,.65) 100%);
  box-shadow: 0 0 24px rgba(224,69,79,.38), inset 0 1px 0 rgba(255,140,148,.4);
}
.faction-card.blue.selected {
  border-color: var(--blue);
  background: linear-gradient(180deg, rgba(63,134,230,.28) 0%, rgba(8,20,40,.65) 100%);
  box-shadow: 0 0 24px rgba(63,134,230,.38), inset 0 1px 0 rgba(140,195,255,.4);
}
.faction-card.selected::before { opacity: 1; }
.faction-shield-wrap {
  display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
  transition: transform 160ms ease-out;
}
.faction-card:hover .faction-shield-wrap { transform: scale(1.06); }
.faction-card.selected .faction-shield-wrap { transform: scale(1.1); }
.faction-shield-svg { display: block; overflow: visible; }
.faction-label { display: flex; flex-direction: column; min-width: 0; }
.faction-label strong {
  font-family: ui-monospace, "Segoe UI", system-ui, sans-serif;
  font-size: 16px; font-weight: 900; letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
.faction-card.red .faction-label strong { color: #ff6e75; }
.faction-card.blue .faction-label strong { color: #7cb5ff; }
.faction-card.red.selected .faction-label strong { color: #ffffff; text-shadow: 0 0 12px rgba(255,80,90,.8); }
.faction-card.blue.selected .faction-label strong { color: #ffffff; text-shadow: 0 0 12px rgba(90,165,255,.8); }

/* Karty klas: kafelki ze ZNACZKIEM klasy (public/js/ui/class-icons.js).
   Wierne militarnemu stylowi gry z dynamicznym taktycznym medalionem. */
.class-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.class-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%; padding: 11px 8px 9px;
  color: #fff; text-align: center; cursor: pointer;
  background: linear-gradient(180deg, rgba(255,255,255,.05) 0%, rgba(10,14,22,.45) 100%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.07);
  transition: background 140ms ease-out, border-color 140ms ease-out, transform 140ms ease-out, box-shadow 140ms ease-out;
}
.class-card:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255,255,255,.11) 0%, rgba(18,24,36,.55) 100%);
  border-color: rgba(255,255,255,.32);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.15);
}
.class-card.selected {
  border-color: #ffd76a;
  background: linear-gradient(180deg, rgba(255,215,106,.18) 0%, rgba(20,24,32,.75) 100%);
  box-shadow: 0 0 20px rgba(255,215,106,.28), inset 0 1px 0 rgba(255,235,160,.4);
}
.class-badge {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(10, 15, 24, 0.65);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.25);
  transition: border-color 140ms ease-out, background 140ms ease-out, transform 140ms ease-out;
}
.class-card:hover:not(:disabled) .class-badge {
  border-color: rgba(255,255,255,.35);
  transform: scale(1.05);
}
.class-card.selected .class-badge {
  background: rgba(255,215,106,.15);
  border-color: #ffd76a;
  box-shadow: 0 0 14px rgba(255,215,106,.4);
  transform: scale(1.08);
}
.class-badge .class-mark { display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }

/* Kolor znaczka jest cechą KLASY, nie karty — dokładany z modułu ikon */
.class-card[data-class-id="soldier"] .class-badge { color: #9fe0a8; }
.class-card[data-class-id="medic"] .class-badge { color: #ff8f96; }
.class-card[data-class-id="support"] .class-badge { color: #f3c169; }
.class-card[data-class-id="engineer"] .class-badge { color: #8ecdf5; }
.class-card[data-class-id="recon"] .class-badge { color: #b7a6f4; }
.class-card[data-class-id="commander"] .class-badge { color: #ffd76a; }

.class-card strong {
  font-size: 11px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
}
.class-card > b {
  font-family: ui-monospace, monospace;
  font-size: 11px; font-weight: 800; letter-spacing: .6px; color: #87d59b;
}
.class-card > b.full { color: #ef6b73; }
.class-card.locked { opacity: .36; cursor: default; }
.class-card.locked .class-badge { color: rgba(255,255,255,.6); }
.class-card.locked > b { color: rgba(255,255,255,.45); }

/* Deploy zostaje w kolumnie deploymentu (na prawo od mapy), zjeżdża na SAM DÓŁ */
.deploy-bar { margin-top: auto; padding-top: 6px; }
#hint #deploy {
  width: 100%; padding: 15px;
  background: linear-gradient(180deg, rgba(255,255,255,.2) 0%, rgba(255,255,255,.08) 100%);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 12px;
  color: #fff; font-size: 15px; font-weight: 900; letter-spacing: 4px;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.25);
  transition: background 140ms ease-out, border-color 140ms ease-out, box-shadow 140ms ease-out, transform 120ms ease-out;
}
#hint #deploy:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255,255,255,.32) 0%, rgba(255,255,255,.15) 100%);
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 28px rgba(255,255,255,.3), 0 8px 30px rgba(0,0,0,.45);
  transform: translateY(-2px);
}
#hint #deploy:disabled {
  opacity: .35; cursor: default; background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12);
  box-shadow: none; transform: none;
}

/* Przełącznik muzyki menu: prosty toggle w panelu deploymentu, pod DEPLOY. */
.music-bar {
  display: flex; align-items: center; justify-content: space-between;
  grid-column: 1 / -1; padding: 2px 2px 0;
}
.music-caption {
  font-family: ui-monospace, monospace;
  font-size: 10px; font-weight: 800; letter-spacing: 2px;
  color: rgba(157, 220, 255, 0.7);
}
.music-switch { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.music-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.music-switch i {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(8, 12, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
  transition: background 140ms ease-out, border-color 140ms ease-out;
}
.music-switch i::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #9fb2c8);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  transition: transform 140ms ease-out;
}
.music-switch input:checked + i { background: rgba(97, 170, 255, 0.35); border-color: rgba(157, 220, 255, 0.7); }
.music-switch input:checked + i::after { transform: translateX(18px); }
.music-switch input:focus-visible + i { outline: 2px solid rgba(157, 220, 255, 0.8); outline-offset: 2px; }
@media (max-width: 960px), (max-height: 720px) {
  #hint { padding: 14px; }
  /* Wąsko/nisko: panele stają jeden nad drugim zamiast obok siebie. Fireteam
     NIE znika — bez niego funkcji nie da się użyć na małym oknie. */
  .campaign-layout {
    flex-direction: column; justify-content: flex-end; align-items: center;
    gap: 10px; overflow-y: auto;
  }
  .fireteam-panel { width: min(560px, 96vw); margin-right: 0; }
  .fireteam-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .deployment-panel { width: min(560px, 96vw); display: grid; grid-template-columns: 1fr 1fr; }
  .class-setup { grid-row: span 2; }
  .class-list { grid-template-columns: repeat(3, 1fr); }
  .deploy-bar { grid-column: 1 / -1; margin-top: 4px; }
  .campaign-header { flex-wrap: wrap; gap: 10px; }
  .brief-cell { padding: 6px 12px; }
  .brief-cell strong { font-size: 13px; }
}

/* ---------- Zjednoczony dolny dok HUD (Unified HUD Dock Bar) ---------- */
#hud-dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}
body.playing #hud-dock { display: flex; }
body.menu-open #hud-dock,
body.debug-open #hud-dock { display: none !important; }

/* Mrugnięcie kafelka HUD przy porcji ze zrzutu zaopatrzenia. Zielone, bo
   sygnalizuje PRZYROST — czerwień na tym samym kafelku znaczy już utratę HP.
   Animacja jest restartowana z JS (`pulseHud`), inaczej kolejne ticki w tej
   samej sekundzie nie odpaliłyby jej ponownie. */
@keyframes supply-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(122, 231, 138, 0); }
  25%  { box-shadow: 0 0 18px 3px rgba(122, 231, 138, 0.85); }
  100% { box-shadow: 0 0 0 0 rgba(122, 231, 138, 0); }
}
.supply-pulse {
  animation: supply-pulse 460ms ease-out, supply-pulse-text 520ms ease-out;
}
/* Poświata wokół kafelka mówi „coś się stało", ale nie mówi CO. Dopiero
   mrugnięcie samej LICZBY na zielono pokazuje, że to ona urosła — dlatego
   wartość dostaje osobną animację z podbiciem skali.
   Kolor jest animowany także na kafelku, bo w liczniku amunicji zapas (to,
   co uzupełnia zrzut) leży POZA `<b>`: w `<b>` siedzi magazynek. */
@keyframes supply-pulse-text {
  0%   { color: inherit; }
  20%  { color: #7ae78a; }
  100% { color: inherit; }
}
@keyframes supply-pulse-value {
  0%   { color: #fff; transform: scale(1); text-shadow: 0 1px 3px rgba(0,0,0,.6); }
  20%  { color: #7ae78a; transform: scale(1.26); text-shadow: 0 0 16px rgba(122,231,138,.95); }
  100% { color: #fff; transform: scale(1); text-shadow: 0 1px 3px rgba(0,0,0,.6); }
}
.supply-pulse b {
  animation: supply-pulse-value 520ms ease-out;
}

.hud-card {
  position: relative;
  height: 64px;
  min-width: 96px;
  padding: 0 16px;
  border-radius: 12px;
  background: rgba(20, 24, 34, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: border-color 140ms ease-out, background 140ms ease-out, box-shadow 140ms ease-out;
}

#health {
  margin: 0;
}
#health b {
  font: 800 24px/1 system-ui;
  color: #ffffff;
  /* inline-block, żeby `transform` w mrugnięciu zrzutu w ogóle zadziałał —
     na elemencie inline transform jest ignorowany. */
  display: inline-block;
}
#health.critical b {
  color: var(--red);
}
#health.critical {
  border-color: rgba(224, 69, 79, 0.7);
  background: rgba(224, 69, 79, 0.22);
  box-shadow: 0 0 20px rgba(224, 69, 79, 0.35);
}

#stamina {
  position: fixed;
  left: 50%;
  bottom: calc(var(--hud-dock-height, 76px) + 30px);
  width: 260px;
  height: 9px;
  transform: translateX(-50%);
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 220ms ease;
}
#stamina.active { opacity: 1; }
#stamina.oxygen .stamina-fill { background: #70dfff; }
#stamina.low .stamina-fill { background: #ff4545; }
body.underwater::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 50% 45%, rgba(20,120,155,.06), rgba(0,30,55,.58)); }
body.underwater #stamina { display: block !important; }
/* Pasek składania/montowania ma pozycję `bottom: 84px`. Gdy jest aktywny,
   stamina odsuwa się nad niego; poza montowaniem pozostaje na dawnej pozycji. */
#stamina:has(~ #vehicle-prompt.active) { bottom: calc(var(--hud-dock-height, 76px) + 76px); }
.stamina-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform-origin: left center;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.5);
  transition: transform 70ms linear;
}

#ammo-counter {
  margin: 0;
}
#ammo-counter b {
  font: 800 24px/1 system-ui;
  color: #ffffff;
  display: inline-block;
}
#loadout {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(20, 24, 34, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: background 240ms ease-out, border-color 240ms ease-out, box-shadow 240ms ease-out;
}
/* Zabarwienie frakcyjne toolbaru (półprzezroczyste szkło drużynowe) */
body.faction-red #loadout {
  background: linear-gradient(180deg, rgba(62, 18, 22, 0.48) 0%, rgba(32, 14, 18, 0.54) 100%);
  border-color: rgba(224, 69, 79, 0.26);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.32), 0 0 24px -4px rgba(224, 69, 79, 0.22);
}
body.faction-blue #loadout {
  background: linear-gradient(180deg, rgba(16, 32, 58, 0.48) 0%, rgba(12, 22, 42, 0.54) 100%);
  border-color: rgba(63, 134, 230, 0.26);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.32), 0 0 24px -4px rgba(63, 134, 230, 0.22);
}
/* Panel pojazdu — zastępuje toolbar na miejscu kierowcy/strzelca. To samo
   półprzezroczyste szkło co toolbar, w barwie frakcji. */
#tank-hud[hidden] { display: none; }
#tank-hud.transport-mode .tank-ammo,
#tank-hud.transport-mode .tank-reload,
#tank-hud.transport-mode .tank-compass { display: none; }
body.driving-vehicle #stamina { display: none !important; }
#tank-hud.transport-mode { min-width: 280px; max-width: min(460px, 48vw); }
#tank-hud.transport-mode { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); width: 320px; }
#tank-hud.transport-mode .tank-crew { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.vehicle-heat { margin-top: 8px; height: 8px; overflow: hidden; border-radius: 5px; background: #ffffff25; }
.vehicle-heat[hidden] { display: none; }
.vehicle-heat i { display: block; height: 100%; transform-origin: left; background: #ffb743; }
.vehicle-heat.overheated i { background: #ff453a; animation: mg-overheat 620ms infinite; }
#tank-hud {
  min-width: 250px;
  padding: 8px 12px 10px;
  background: rgba(20, 24, 34, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  font-family: system-ui;
}
body.faction-red #tank-hud {
  background: linear-gradient(180deg, rgba(62, 18, 22, 0.48) 0%, rgba(32, 14, 18, 0.54) 100%);
  border-color: rgba(224, 69, 79, 0.26);
}
body.faction-blue #tank-hud {
  background: linear-gradient(180deg, rgba(16, 32, 58, 0.48) 0%, rgba(12, 22, 42, 0.54) 100%);
  border-color: rgba(63, 134, 230, 0.26);
}
.tank-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tank-ammo {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tank-shell-icon { flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.tank-shell-count {
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
}
/* Segmentowe HP jak tagi graczy: 10 segmentów, twardy czarny obrys,
   stała jaskrawa zieleń (poziom mówi długość, nie kolor). */
.tank-hp-segments {
  display: flex;
  gap: 3px;
  /* W wierszu .tank-top kontener musi rosnąć — inaczej kratki dostają
     szerokość 0 (flex: 1 dzieci dzieli wtedy zero). */
  flex: 1;
  min-width: 0;
}
.tank-hp-seg {
  flex: 1;
  height: 13px;
  border-radius: 2px;
  background: transparent;
  box-shadow: 0 0 0 2px rgba(0,0,0,.92), inset 0 0 0 1px rgba(0,0,0,.68);
}
.tank-reload {
  height: 8px;
  margin-top: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.tank-reload-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
}
.tank-reload-fill { background: linear-gradient(90deg, #e09a2e, #ffd98a); }
.tank-reload.ready .tank-reload-fill { background: linear-gradient(90deg, #57c46b, #8fe89e); }
#tank-hud.mg-mode .tank-reload { display: none; }
/* Obsada pojazdu: fotel [klawisz], rola, kto siedzi. Własny fotel podświetlony. */
.tank-crew {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}
.tank-seat {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  font-weight: 700;
  color: #cfd4dc;
  white-space: nowrap;
  overflow: hidden;
}
.tank-seat b {
  flex: none;
  min-width: 15px;
  height: 15px;
  line-height: 15px;
  text-align: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 10px;
}
.tank-seat span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.tank-seat.you {
  border-color: rgba(255, 207, 77, 0.65);
  color: #ffe1a1;
}
/* Towarzysz z fireteamu: imię na zielono (jak znaczniki kolegów w świecie). */
.tank-seat.mate span { color: #4dff9a; }
.tank-seat.mate {
  border-color: rgba(77, 255, 154, 0.45);
}
.tank-seat.empty { opacity: 0.55; }
/* W pojeździe nie ma sprintu ani staminy — zielony pasek tylko zasłania. */
/* W czołgu stamina nie ma czego pokazywać — ale TEN SAM pasek służy
   strzelcowi za wskaźnik przegrzania CKM-u (`#stamina.heat`), więc chowamy
   go tylko wtedy, gdy nie jest ciepłem lufy. */
body.driving-tank #stamina:not(.heat) { display: none !important; }
/* Ciepło lufy: bursztyn przechodzący w czerwień. Kolor niesie tu informację,
   której nie niesie sama długość paska — gracz kątem oka widzi, czy jeszcze
   może przytrzymać spust, czy już nie. */
#stamina.heat .stamina-fill {
  background: linear-gradient(90deg, #ffd166 0%, #ff8f3c 62%, #ff4d3d 100%);
  box-shadow: 0 0 8px rgba(255, 140, 60, 0.55);
}
/* Przegrzanie: broń NIE STRZELA i to jest jedyny stan, w którym pasek sam
   się o siebie upomina. Pulsowanie zatrzymuje się razem z wystygnięciem. */
#stamina.heat.overheated .stamina-fill {
  background: #ff3b30;
  box-shadow: 0 0 12px rgba(255, 59, 48, 0.85);
  animation: mg-overheat 620ms ease-in-out infinite;
}
@keyframes mg-overheat {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
/* Kompas orientacji: LUFA jest ZAWSZE na północy (sztywna bursztynowa kreska
   od środka do góry), a bryła KADŁUBA (niebieski prostokąt — masa czołgu
   widziana z góry) kręci się wokół środka przy obrocie wieży. Obrócisz wieżę
   o 90°, prostokąt spłynie o ćwierć obrotu; na wprost lufy prostokąt stoi
   pionowo (kadłub jedzie tam, gdzie celuje). */
.tank-compass { margin-top: 7px; display: flex; justify-content: center; }
.tank-compass-dial {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.tank-compass-tick {
  position: absolute;
  left: 50%; top: 50%;
  width: 1px; height: 7px;
  background: rgba(255, 255, 255, 0.4);
  /* rotacja ustawiana z JS (rotate(angle) translateY(-r)) */
}
.tank-compass-barrel {
  position: absolute;
  left: 50%; bottom: 50%;
  width: 3px; height: 29px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: #ffb347;
  box-shadow: 0 0 3px rgba(0,0,0,.8);
  /* Lufa RYSUJE SIĘ NAD bryłą — to ona jest punktem odniesienia (północ). */
  z-index: 2;
}
.tank-compass-hull {
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 34px;
  border-radius: 3px;
  /* rotacja ustawiana z JS: translate(-50%,-50%) rotate(angle) */
  background: #6db9ff;
  box-shadow: 0 0 4px rgba(0,0,0,.85), inset 0 0 0 1px rgba(0,0,0,.4);
  z-index: 1;
}
/* Strzałka PRZODU na bryle: jasny trójkąt na przedniej (górnej) krawędzi
   prostokąta — kręci się razem z nim, więc zawsze wiadomo, którym końcem
   kadłub jedzie do przodu. */
.tank-compass-hull::after {
  content: "";
  position: absolute;
  left: 50%; top: -9px;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid #bfe3ff;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.9));
}

#loadout .slot {
  position: relative;
  width: 68px; height: 50px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(14, 18, 26, 0.45);
  box-shadow: none;
  backdrop-filter: none;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 120ms ease-out, background 120ms ease-out, transform 120ms ease-out, box-shadow 120ms ease-out;
}
body.faction-red #loadout .slot {
  background: rgba(46, 16, 20, 0.42);
  border-color: rgba(224, 69, 79, 0.20);
}
body.faction-red #loadout .slot:hover {
  background: rgba(72, 22, 28, 0.55);
  border-color: rgba(224, 69, 79, 0.45);
}
body.faction-blue #loadout .slot {
  background: rgba(14, 28, 52, 0.42);
  border-color: rgba(63, 134, 230, 0.20);
}
body.faction-blue #loadout .slot:hover {
  background: rgba(20, 42, 78, 0.55);
  border-color: rgba(63, 134, 230, 0.45);
}

#loadout .slot.active {
  border-color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.1), 0 0 16px rgba(255, 255, 255, 0.12);
}
body.faction-red #loadout .slot.active {
  border-color: rgba(255, 120, 130, 0.95);
  background: rgba(224, 69, 79, 0.26);
  box-shadow: inset 0 0 12px rgba(224, 69, 79, 0.2), 0 0 16px rgba(224, 69, 79, 0.3);
}
body.faction-blue #loadout .slot.active {
  border-color: rgba(130, 185, 255, 0.95);
  background: rgba(63, 134, 230, 0.26);
  box-shadow: inset 0 0 12px rgba(63, 134, 230, 0.2), 0 0 16px rgba(63, 134, 230, 0.3);
}

/* Zabarwienie bocznych kafelków doku (HP i amunicja) w tonacji drużyny */
body.faction-red .hud-card {
  background: linear-gradient(180deg, rgba(62, 18, 22, 0.48) 0%, rgba(32, 14, 18, 0.54) 100%);
  border-color: rgba(224, 69, 79, 0.26);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.32), 0 0 20px -4px rgba(224, 69, 79, 0.2);
}
body.faction-blue .hud-card {
  background: linear-gradient(180deg, rgba(16, 32, 58, 0.48) 0%, rgba(12, 22, 42, 0.54) 100%);
  border-color: rgba(63, 134, 230, 0.26);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.32), 0 0 20px -4px rgba(63, 134, 230, 0.2);
}
#loadout .slot .slot-icon {
  width: 36px; height: 36px;
  display: block; position: relative; z-index: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
}
#loadout .slot.deployable-slot { overflow: hidden; }
/* Wypełnienie jest we WŁAŚCIWYM slocie skrzynki: po użyciu startuje od zera,
   rośnie do pełna przez cooldown, a sama ikona pozostaje zawsze na wierzchu. */
#loadout .slot .slot-charge {
  position: absolute; inset: 0; z-index: 0; transform: scaleX(1);
  transform-origin: left center; pointer-events: none;
  background: linear-gradient(90deg, rgba(214,144,40,.5), rgba(255,213,86,.9));
  transition: transform 180ms linear;
}
#loadout .slot.deployable-slot.charging { border-color: rgba(240,195,75,.58); }
#loadout .slot span {
  font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8); text-align: center; padding: 0 4px;
}
#loadout .slot b {
  position: absolute; right: 5px; bottom: 2px;
  font: 700 12px/1 system-ui; color: #fff; text-shadow: 0 1px 3px #000;
}

/* Baner „KILLED BY" na ekranie śmierci. Siedzi tuż NAD odliczaniem respawnu
   (top 64%) i dzieli z nim oś pionową: oba mówią o tym samym stanie i mają
   się czytać jednym spojrzeniem w dół, jako jedna kolumna. */
#kill-cam {
  position: fixed; left: 50%; top: 55%; transform: translateX(-50%);
  z-index: 2; pointer-events: none; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  opacity: 0;
}
#kill-cam[hidden] { display: none; }
/* Wejście z góry i lekkiego przybliżenia: baner ma DOJECHAĆ w chwili, gdy
   kamera odwraca się do zabójcy, a nie mrugnąć razem z ekranem śmierci. */
#kill-cam.active { animation: kill-cam-in 420ms cubic-bezier(.2,.9,.25,1) 260ms forwards; }
@keyframes kill-cam-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(.94); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.kill-cam-label {
  font: 800 11px/1 system-ui; letter-spacing: 3px;
  color: rgba(255, 255, 255, .62);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .9);
}
/* Nazwisko dostaje barwę frakcji zabójcy — tę samą, co w feedzie zabójstw
   i na tabeli wyników, żeby oko wiązało je z tą samą osobą. */
.kill-cam-name {
  font: 800 30px/1.05 system-ui; letter-spacing: 1px;
  text-shadow: 0 0 16px currentColor, 0 3px 10px rgba(0, 0, 0, .95);
}
.kill-cam-name.red { color: #ff4d4d; }
.kill-cam-name.blue { color: #4da6ff; }
@media (max-width: 900px) {
  .kill-cam-name { font-size: 22px; }
}

#respawn-wave {
  position: fixed; left: 50%; top: 64%; transform: translateX(-50%);
  display: none; min-width: 220px; padding: 12px 18px;
  text-align: center; font-size: 11px; letter-spacing: 2px;
  color: rgba(255,255,255,.7); background: rgba(13,17,25,.64);
  border: 1px solid rgba(255,255,255,.15); border-radius: 12px;
  backdrop-filter: blur(14px); pointer-events: none;
}
/* Czarna kurtyna respawnu: ściemnia w ostatniej sekundzie odliczania i trzyma
   czerń ~1 s po odrodzeniu, ukrywając doczytywanie bloków i drop klatek.
   Nad grą/HUD (z-index 2), pod menusami (z-index 20). */
#respawn-fade {
  position: fixed; inset: 0; z-index: 15;
  background: #000; opacity: 0; pointer-events: none;
  transition: opacity 700ms ease-out;
}

#respawn-wave.active { display: block; }
#respawn-wave b { display: block; margin-top: 3px; font-size: 34px; color: #fff; }

#vehicle-prompt {
  position: fixed; left: 50%; bottom: calc(var(--hud-dock-height, 64px) + 20px); transform: translateX(-50%);
  display: none; padding: 7px 12px; border-radius: 9px;
  color: rgba(255,255,255,.86); background: rgba(13,17,25,.58);
  border: 1px solid rgba(255,255,255,.12); font-size: 11px;
  letter-spacing: .8px; pointer-events: none;
}
#vehicle-prompt.active { display: block; }
/* Chwilowy toast błędów (np. brak kasy u dowódcy). Sam znika — w przeciwieństwie
   do statycznych hintów nie zostaje na ekranie. Z-index nad HUD-em, pod menu. */
#toast {
  position: fixed; left: 50%; bottom: 132px; transform: translateX(-50%) translateY(8px);
  display: block; padding: 9px 18px; border-radius: 11px;
  font: 800 13px/1 system-ui; letter-spacing: 1px;
  color: #ffd9dc; background: rgba(62, 14, 18, 0.72);
  border: 1px solid rgba(224, 69, 79, 0.55);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 24px -4px rgba(224, 69, 79, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none; z-index: 60;
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#vehicle-prompt.bipod-progress {
  width: 176px; height: 12px; padding: 2px;
  overflow: hidden; color: transparent;
  background: rgba(10, 14, 21, .72);
  border-color: rgba(255, 255, 255, .2);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .38);
}
#vehicle-prompt.bipod-progress::after {
  content: "";
  position: absolute; inset: 2px;
  border-radius: 5px;
  background: #f0c34b;
  box-shadow: 0 0 9px rgba(240, 195, 75, .38);
  transform: scaleX(var(--bipod-progress, 0));
  transform-origin: left center;
}

/* ---------- Hitmarker ----------
   Cztery osobne ticki + pierścień, a nie jedno tło z gradientami: tylko wtedy
   ramiona X mogą ROZJEŻDŻAĆ SIĘ NA ZEWNĄTRZ przy fadzie. To rozjechanie niesie
   siłę trafienia — skalowanie całego kwadratu wygląda jak zwykłe zniknięcie.
   Czytelność daje czarny obrys 1px na każdym ticku (`box-shadow`), dzięki czemu
   znacznik trzyma kontrast na śniegu tak samo jak na ciemnym wnętrzu.
   Warianty i czasy opisuje public/js/ui/hitmarker.js — `--hm-dur` MUSI zgadzać
   się ze stałą DURATION w tamtym module. */
#hitmarker {
  position: fixed; left: 50%; top: 50%;
  width: 0; height: 0;
  pointer-events: none;
  --hm-color: #fff;
  --hm-glow: rgba(255, 255, 255, 0.55);
  --hm-len: 9px;
  --hm-thick: 2.5px;
  --hm-gap: 7px;
  --hm-spread: 1.85;
  --hm-ring: 20px;
  --hm-ring-opacity: 0;
  --hm-dur: 260ms;
}
#hitmarker i {
  position: absolute; left: 50%; top: 50%;
  width: var(--hm-thick); height: var(--hm-len);
  margin: calc(var(--hm-len) / -2) 0 0 calc(var(--hm-thick) / -2);
  border-radius: calc(var(--hm-thick) / 2);
  background: var(--hm-color);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85), 0 0 7px var(--hm-glow);
  opacity: 0;
  transform: rotate(var(--a)) translateY(calc(var(--hm-gap) * -1));
}
#hitmarker u {
  position: absolute; left: 50%; top: 50%;
  width: var(--hm-ring); height: var(--hm-ring);
  margin: calc(var(--hm-ring) / -2) 0 0 calc(var(--hm-ring) / -2);
  border: 2px solid var(--hm-color); border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 0 10px var(--hm-glow);
  opacity: 0;
}
#hitmarker.hit i { animation: hm-tick var(--hm-dur) cubic-bezier(0.15, 0.85, 0.3, 1) both; }
#hitmarker.hit u { animation: hm-ring var(--hm-dur) cubic-bezier(0.1, 0.75, 0.3, 1) both; }

/* Tick: krótkie „kopnięcie" na zewnątrz (0→22% — tu jest cała siła uderzenia),
   potem powolny wylot i fade. Rotacja `var(--a)` powtarza się w KAŻDEJ klatce,
   bo transform jest jedną własnością — pominięcie jej wyprostowałoby ramię. */
@keyframes hm-tick {
  0% {
    opacity: 1;
    transform: rotate(var(--a)) translateY(calc(var(--hm-gap) * -0.3)) scaleY(0.7);
  }
  22% {
    opacity: 1;
    transform: rotate(var(--a)) translateY(calc(var(--hm-gap) * -1)) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(calc(var(--hm-gap) * -1 * var(--hm-spread))) scaleY(0.85);
  }
}
@keyframes hm-ring {
  0% { opacity: var(--hm-ring-opacity); transform: scale(0.3); }
  60% { opacity: calc(var(--hm-ring-opacity) * 0.45); }
  100% { opacity: 0; transform: scale(1.4); }
}

/* Trafiony człowiek — biały, drobny, szybki. Wariant bazowy. */
#hitmarker.v-chest { --hm-dur: 260ms; }

/* Headshot — czerwień, grubsze i dłuższe ramiona + delikatny pierścień. */
#hitmarker.v-head {
  --hm-color: #ff4646;
  --hm-glow: rgba(255, 60, 60, 0.7);
  --hm-len: 10px; --hm-thick: 2.5px; --hm-gap: 7px;
  --hm-ring: 22px; --hm-ring-opacity: 0.55;
  --hm-dur: 320ms;
}

/* Pojazd / budowla — stalowy błękit i wolniejszy, „twardy" rozjazd. Inny kolor
   niż mięso, bo niesie inną decyzję taktyczną: tego celu nie zabijesz karabinem. */
#hitmarker.v-armor {
  --hm-color: #8fd8ff;
  --hm-glow: rgba(110, 200, 255, 0.6);
  --hm-len: 7px; --hm-thick: 2.5px; --hm-gap: 9px;
  --hm-spread: 1.35;
  --hm-dur: 300ms;
}

/* Zabójstwo — największy, najdłuższy, z mocnym pierścieniem. Ma się przebić
   przez serię zwykłych ticków, bo kończy walkę o ten cel. */
#hitmarker.v-kill {
  --hm-color: #ff2f2f;
  --hm-glow: rgba(255, 40, 40, 0.85);
  --hm-len: 13px; --hm-thick: 3px; --hm-gap: 8px;
  --hm-spread: 2.4;
  --hm-ring: 30px; --hm-ring-opacity: 0.9;
  --hm-dur: 440ms;
}

/* ---------- Narzędzia debug (O) ---------- */
#debug-menu {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center; padding: 5vh 4vw;
  background: rgba(6, 10, 16, 0.30); cursor: default;
  backdrop-filter: blur(9px) saturate(1.1); -webkit-backdrop-filter: blur(9px) saturate(1.1);
}
#debug-menu[hidden] { display: none; }
#content-inspector {
  position: fixed; left: 14px; top: 14px; z-index: 25;
  min-width: 290px; padding: 13px 16px; display: flex; flex-direction: column; gap: 5px;
  border: 1px solid rgba(157,220,255,.42); border-radius: 12px;
  background: rgba(8, 14, 22, .84); backdrop-filter: blur(16px);
  box-shadow: 0 12px 35px rgba(0,0,0,.38); pointer-events: none;
  font: 10px/1.3 system-ui; letter-spacing: .7px; color: rgba(255,255,255,.64);
}
#content-inspector[hidden] { display: none; }
.content-inspector-title { color: #9ddcff; font-size: 9px; letter-spacing: 1.8px; }
.content-inspector-kind { color: rgba(255,255,255,.46); font-size: 9px; }
.content-inspector-id { color: #fff; font: 800 14px/1.2 ui-monospace, monospace; letter-spacing: .2px; }
.content-inspector-meta { color: rgba(255,255,255,.52); font: 9px/1.3 ui-monospace, monospace; }

/* Czat: Enter otwiera pole, Tab przełącza kanał. Zakładka pokazuje kanał
   kolejnej wiadomości, a nick zachowuje kolor swojej frakcji. */
#chat {
  position: fixed; left: 18px; bottom: 104px; width: min(470px, 44vw); display: none;
  flex-direction: column; gap: 6px; pointer-events: none; font: 700 14px/1.4 system-ui;
  text-shadow: 0 2px 5px rgba(0,0,0,.8);
}
body.playing #chat { display: flex; }
body.menu-open #chat, body.debug-open #chat { display: none; }
/* Czat znika, gdy nikt nic nie pisze (klasa `idle` z chat.js): gasną zakładki
   i wpisy, ale układ zostaje — nic nie skacze. Pisanie zawsze pokazuje. */
.chat-tabs, .chat-lines { transition: opacity .45s ease; }
#chat.idle .chat-tabs, #chat.idle .chat-lines { opacity: 0; }
#chat.typing .chat-tabs, #chat.typing .chat-lines { opacity: 1; }
/* Dowódca MA czat — to on rozdaje rozkazy, więc odcięcie go od rozmowy było
   najgorszym możliwym miejscem na oszczędność miejsca. Podnosimy okno nad
   podsumowanie zaznaczenia, które w tym widoku siedzi w lewym dolnym rogu. */
body.commander-view #chat { bottom: 92px; }
.chat-tabs { display: flex; gap: 4px; pointer-events: auto; }
.chat-tabs button { padding: 5px 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 6px; background: rgba(8,13,20,.54); color: rgba(255,255,255,.46); font: 800 10px/1 system-ui; letter-spacing: .9px; }
.chat-tabs button.active { color: #fff; border-color: rgba(157,220,255,.58); background: rgba(72,132,188,.42); }
.chat-lines { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 20px; }
.chat-line { max-width: 100%; padding: 5px 9px; border-radius: 6px; background: rgba(7,11,17,.42); opacity: 0; transform: translateX(-8px); transition: opacity .16s ease, transform .16s ease; }
.chat-line.visible { opacity: 1; transform: none; }
.chat-channel { margin-right: 6px; color: rgba(255,255,255,.45); font-size: 10px; letter-spacing: .7px; }
/* Wpis SYSTEMU (podpowiedzi, potwierdzenia): bursztynowy, bez nicka. */
.chat-line.system { background: rgba(46,32,8,.6); border: 1px solid rgba(255,190,80,.35); }
.chat-system-tag { margin-right: 7px; color: #ffbe50; font-size: 10px; letter-spacing: .9px; }
.chat-name { margin-right: 6px; }.chat-name.faction-red { color: #ff7c82; }.chat-name.faction-blue { color: #82b8ff; }
/* Przynależność do fireteamu bije frakcję: zielony nick to „mój człowiek". */
.chat-name.fireteam { color: #4dff9a; }
.chat-tabs button:disabled { opacity: .38; cursor: not-allowed; }
.chat-tabs button[data-chat-channel="group"].active { border-color: rgba(77,255,154,.6); background: rgba(46,150,96,.42); }
.chat-line.channel-group { background: rgba(12, 30, 21, .5); }
.chat-line.channel-group .chat-channel { color: rgba(120, 255, 185, .7); }
.chat-text { color: rgba(255,255,255,.94); overflow-wrap: anywhere; }
#chat input { display: none; width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid rgba(157,220,255,.55); border-radius: 7px; outline: none; background: rgba(7,12,20,.86); color: #fff; font: 700 14px system-ui; box-shadow: 0 8px 28px rgba(0,0,0,.34); pointer-events: auto; }
#chat.typing input { display: block; }
.debug-window {
  width: min(940px, 92vw); height: min(650px, 86vh);
  display: flex; flex-direction: column; overflow: hidden;
  color: rgba(255,255,255,.92);
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.02) 130px),
    rgba(28, 34, 48, 0.55);
  backdrop-filter: blur(34px) saturate(1.4); -webkit-backdrop-filter: blur(34px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.16); border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.14);
  animation: debug-window-in 200ms ease-out;
}
@keyframes debug-window-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.debug-window > header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid rgba(255,255,255,.10);
}
.debug-window > header div { display: flex; align-items: baseline; gap: 12px; }
.debug-window > header span { color: rgba(157,220,255,.6); font-size: 9px; letter-spacing: 2.5px; font-weight: 700; }
.debug-window > header strong { font-size: 14px; letter-spacing: 2.5px; color: #fff; }
.debug-window > header button {
  width: 32px; height: 32px; color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; font-size: 20px; cursor: pointer;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.debug-window > header button:hover { background: rgba(255,255,255,.14); color: #fff; }
.debug-layout { display: flex; flex: 1; min-height: 0; }
.debug-nav {
  width: 162px; flex-shrink: 0; padding: 16px 12px;
  border-right: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 4px;
}
.debug-nav button {
  position: relative;
  padding: 11px 14px; color: rgba(255,255,255,.6); background: transparent;
  border: 0; border-radius: 10px; text-align: left; font: 700 11px/1 system-ui;
  letter-spacing: 1.3px; cursor: pointer;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.debug-nav button:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.85); }
.debug-nav button.active { color: #fff; background: rgba(97,170,255,.20); }
.debug-nav button.active::before {
  content: ''; position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 3px; background: #61aaff;
}
.debug-content { flex: 1; padding: 24px 28px; overflow-y: auto; }
.debug-section-heading {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.debug-section-heading strong { font-size: 12px; letter-spacing: 1.8px; color: #fff; }
.debug-section-heading span { font-size: 8px; letter-spacing: 1px; color: rgba(255,255,255,.34); }
.debug-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 4px; border-bottom: 1px solid rgba(255,255,255,.06);
}
.debug-row > div { display: flex; flex-direction: column; gap: 5px; }
.debug-row > div strong { font-size: 13px; color: rgba(255,255,255,.94); }
.debug-row > div span { font-size: 10px; color: rgba(255,255,255,.44); }
.debug-action {
  min-width: 84px; padding: 9px 14px; color: #eaf7ff;
  background: rgba(97,170,255,.20); border: 1px solid rgba(157,220,255,.34);
  border-radius: 10px; font: 700 10px/1 system-ui; letter-spacing: 1px; cursor: pointer;
  transition: background 120ms ease-out, border-color 120ms ease-out;
}
.debug-action:hover { background: rgba(97,170,255,.34); border-color: rgba(157,220,255,.7); }
.debug-counter { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px !important; }
.debug-counter-button {
  width: 30px; height: 30px; color: #eaf7ff; background: rgba(97,170,255,.20);
  border: 1px solid rgba(157,220,255,.34); border-radius: 9px; font: 700 17px/1 system-ui; cursor: pointer;
  transition: background 120ms ease-out, transform 80ms ease-out;
}
.debug-counter-button:hover { background: rgba(97,170,255,.36); }
.debug-counter-button:active { transform: translateY(1px); }
.debug-counter strong { min-width: 26px; color: #fff; text-align: center; font: 800 15px/1 ui-monospace, monospace; }
.debug-window > footer {
  display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-top: 1px solid rgba(255,255,255,.08); color: rgba(255,255,255,.4);
  font-size: 9px; letter-spacing: 1px;
}
.debug-window > footer > span {
  display: grid; place-items: center; width: 22px; height: 22px;
  border: 1px solid rgba(255,255,255,.2); border-radius: 7px;
  color: rgba(255,255,255,.78); font-weight: 800;
}
.debug-result { margin-left: auto; color: #87d59b; font-size: 9px; letter-spacing: .8px; }

/* ---------- Strefa wycofania ---------- */
#boundary-warning {
  position: fixed; inset: 0;
  display: none; pointer-events: none;
  box-shadow: inset 0 0 220px 60px rgba(224, 69, 79, 0.5);
  align-items: flex-start; justify-content: center;
}
#boundary-warning.active { display: flex; }
.boundary-title {
  margin-top: 14vh;
  font-size: 24px; font-weight: 800; letter-spacing: 4px;
  color: #ffe3e5; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
.boundary-timer {
  position: absolute; top: calc(14vh + 38px);
  font-size: 42px; font-weight: 800;
  color: var(--red); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
