Initial Release v1.0.0

This commit is contained in:
db9979 committed 2026-09-23 12:10:58 +02:00
commit 3b3753cf4e
756 files changed
+150611

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
# Environments
.venv/
venv/
env/
# Builds and packaging
build/
dist/
*.egg-info/
.eggs/
# Test, coverage and type-check caches
.pytest_cache/
.coverage
.coverage.*
htmlcov/
.mypy_cache/
.ruff_cache/
.tox/
.nox/
# Editors and operating systems
.idea/
.vscode/
*.swp
*~
.DS_Store
Thumbs.db
# Local runtime files
.u-jagd/
*.log
+113
View File
@@ -0,0 +1,113 @@
# Coding Agent Guide
## Authority and scope
- This is U-Jagd 1.0.0 (`src/core/version.py`); current saves are v11-only. Treat these as compatibility contracts, not changelog entries.
- Resolve conflicts in this order: executable code and focused tests; packaged JSON/runtime resources; `pyproject.toml` and provenance/license notices; `README.md`; design/history documents under `docs/`. A plan or old comment is not an implementation contract.
- Preserve explicit compatibility tests and user data unless a task intentionally changes the contract. Add a regression test for behavior changes.
- Older phase/milestone labels under `docs/GDD.md`, `docs/implementation-plan.md`, `docs/plan-0.1.6.md`, and `docs/plan-0.1.7.md` are historical. Current resumable work is tracked in `docs/plan-0.1.8.md` and `docs/resume.md`.
## Architecture
- `main.py`: CLI and saved-preference/CLI override wiring.
- `src/core/game.py`: composition root, event precedence, main loop, simulation orchestration, custom-mission runtime bridge, and save/load.
- `src/core/config.py`: gameplay constants, units/conversions, scenarios, layout, and timing.
- `src/core/mission*.py`, `commands.py`, `station.py`, `preferences.py`, `i18n.py`: mission models, shared commands, UI state, settings, and localization.
- `src/world/`: coastline/bathymetry, real-sector loading, projection, terrain queries, weather/time.
- `src/sonar/` and `src/sensors/`: measurements, receiver/TMA, and persistent observation tracks.
- `src/ship/`, `src/enemies/`, `src/air/`, `src/weapons/`: simulation entities and mechanics.
- `src/ui/`: rendering, hit testing, viewport, tooltips, and editors. Views should consume game-facing observations, not discover hidden entity state.
- `src/audio/`: bounded NumPy synthesis/analysis and non-blocking Pygame playback.
- `src/data/`: packaged catalog loading, validation, fingerprints, and secure user-content persistence. `data/` contains package resources; `tests/` is the behavioral contract; `tools/` contains validators/reproducible generators.
## Simulation invariants
- World position/range is nautical miles, speed is knots, simulation duration is seconds, depth is metres, frequency is Hz, and headings/bearings are nautical degrees: 0 north, clockwise; movement uses `x += sin(course)`, `y -= cos(course)`.
- At 1x, one real second is one simulation second. Convert knots with `kn / 3600`; do not add hidden tactical compression. `GAME_TIME_PER_SEC` advances the 24-hour clock separately.
- Time acceleration multiplies simulation time exactly once. `Game.update()` subdivides accelerated time to at most `PHYS_SUBSTEP_S` subject to `PHYS_SUBSTEP_MAX`; the main loop clamps wall-frame `dt` to 0.1 s. Preserve swept collision behavior and the update ordering in `_update_sim()`.
- Paused, menu, game-over, splash, editor, and administrative states must not accidentally advance simulation. Cosmetic/UI timers and audio cadence use wall time where the code says so.
- Same seed, world mode, and input/update sequence must produce the same state. Use explicit local `random.Random` streams, stable hashes, stable iteration/order, and saved RNG states. Never introduce simulation dependence on global randomness, hash randomization, rendering frequency, audio availability, or wall clock.
- Save/load must preserve deterministic continuation, entity ID progression, generated coastline/bathymetry snapshots, pending sensor/projectile state, and operator focus. When adding random draws, consider stream/order compatibility and update determinism and round-trip tests.
## Input ownership and precedence
- Keep `Game.handle_event()` single-owner semantics: splash, editor, pinned-tooltip escape, administrative overlay, menu, numeric entry, then live global/station controls. `Alt+Enter` is intercepted before contextual confirmation; key-repeat `KEYDOWN` is ignored.
- Only one administrative overlay owns input, clears held/joystick/drag/audio state, and blocks background devices and simulation. Focus loss clears controls and pauses; focus gain never auto-resumes.
- `Esc` first clears a pinned tooltip, then cancels the active owner, then opens quit confirmation. Numeric entry is intentionally live while simulation runs, but held controls are cleared and invalid input remains editable.
- Station keys are contextual and must not leak across stations. Clear held controls on station/pause/administration transitions. Trackball axes are station-specific; steering is Bridge-only. Map zoom/pan/follow only operate where a map is visible.
- Transform display coordinates through `_window_to_canvas()` and reject letterbox space before hit testing. Keep draw and hit-test geometry aligned.
## Observation boundary
- The player has no general ground-truth access. Sonar exposes noisy bearing-only contacts unless a current ping/TMA/fused observation supplies range/depth/course; stale fixes decay or disappear. Radar, AIS, ESM, HFDF, and radio publish `SensorTrack` observations with age/quality.
- Workstations, targeting, weapon guidance, tooltips, and logs must use contacts/tracks/datalink data, not live enemy `x`, `y`, `depth`, class, hostility, or object references. Do not put simulation objects into serialized/public tracks.
- Legitimate truth is limited to own ship and commanded own assets, known geography/synthetic chart depth, authored/static preview data, and explicitly modeled friendly datalink truth. Physics, AI, collision, sensor generation, and terminal weapon seekers may use underlying entities internally.
- Manual classification and NATO affiliation are operator annotations, not inferred truth. A sensor domain comes from the observation. Weapons require the modeled track/fix freshness and engagement envelope; pre-terminal torpedo guidance uses the commanded datum, not a hidden target.
## Data and localization
- `data/contacts/*.json` is the single source of truth for built-in platform/acoustic/torpedo/decoy profile values. Load through `src/data/catalog.py`; do not duplicate JSON-owned values in Python. `tools/gen_contacts.py` is a strict validator despite its historical name; it never generates files.
- `data/editor_templates/*.json` supplies editor templates, while Python validators define acceptance and runtime code defines effectiveness. Validation success does not imply runtime support.
- All new user-visible prose needs matching keys in `data/i18n/en.json` and `de.json`. English is the reference/fallback; catalogs require exact key parity and identical named placeholders. Use named placeholders only.
- Route rendering through `Translator`, `localize`, `translation_scope`, and bounded layout helpers. Do not add direct `Font.render` prose; the test allowlist is technical labels only. Verify English, German, large text where relevant, and the pseudolocale/layout tests.
## Persistence and user content
- Runtime root is `~/.u-jagd/`: `settings.json`; `slot1.json` through `slot5.json`; editor files in `missions/` and `units/`. Tests replace save paths with temporary directories; never write real user paths from tests. `.u-jagd/`, build products, caches, and egg metadata stay untracked.
- Preferences persist language/fullscreen/audio/large text/tooltips in `settings.json`; v11 saves also retain the mission's tooltip state. CLI `--windowed` and `--no-audio` override saved values for one launch; no inverse fullscreen or CLI-language switch exists.
- Write and load save v11 only. Require the exact `u-jagd-save-v11` schema and the complete current catalog, platform, ESM, ASW, and RNG state. Reject malformed, non-integer, older, newer, incomplete, or unknown schemas without migration.
- Writes must stage beside the destination, flush and `fsync`, then atomically `os.replace`; failure leaves the prior file intact and save-and-quit quits only after success. Load into a candidate state and commit only after complete validation/restoration; failure must leave the live game and global ID counters unchanged.
- Treat imported/editor JSON as hostile. Require finite typed/bounded values, strict schemas, `user.<lowercase/digit/_/->` keys, confined destinations, and no symlinked root/file. Never interpret a logical reference as a filesystem path.
- Bundle import validates every item and collision before the first visible write, stages all files, rechecks confinement/symlinks, and rolls back the whole commit on failure. Preserve backups if rollback itself fails. JSON output must reject NaN/Infinity.
## Remote Crew multiplayer
- Remote Crew is authoritative-host multiplayer for multiple authenticated browser clients. The uConsole process remains the sole simulation authority. Browsers never run simulation, advance time, resolve physics, read live entities, or mutate game state from transport threads.
- Multiplayer protocol versions are independent of application and save versions. Remote Crew is protocol v2-only; every `/api/v1/*` route is retired and returns 404. Saves remain exact v11; credentials, clients, station leases, network queues, drafts, and unaccepted commands are transient and never enter saves or settings.
- Support a hard-bounded client count. Each client has an independent cryptographic session, expiry, request namespace, and revocation state. The host explicitly grants one exclusive station role per client and can revoke or take over any role. Reconnect never inherits another client's authority.
- Role capabilities are allowlisted. A granted browser may directly operate its station, including weapons when the host separately enables direct fire, but every action must pass the same observation freshness, damage, inventory, ROE, envelope, and readiness checks as local input. Save/load, reset, editors, options, quit, network administration, and credentials remain host-only, with one explicit exception: solo mode (below).
- Transport handlers accept only strict, finite, size-bounded, versioned messages and enqueue detached envelopes. The main thread revalidates client, role, lease generation, world epoch, resource revision, freshness, and readiness immediately before applying each command. Never synthesize Pygame events or dispatch arbitrary method names from network data.
- Apply accepted remote commands exactly once in deterministic station order and per-client FIFO order before `Game.update()`. Wall clock, packet scheduling, polling frequency, browser rendering, and hash iteration must not affect simulation results. Administrative transitions, pause, focus loss, role loss, disconnect, save/load, and world replacement reject unsafe queued commands and clear held remote controls.
- Each normal role view receives only an allowlisted detached projection of own ship and commanded assets, published observations, annotations, and known geography. Never export simulation objects, hidden IDs, undiscovered positions, true hostile identity, RNG state, or save dumps through station state. The explicit host-granted SimLog capability is the sole diagnostic exception: its read-only history may include detached full-truth snapshots, but never simulation objects, RNG state, credentials, settings, or save dumps.
- Solo mode is a per-launch, never-persisted host decision (`--solo-crew` or the F9 "Crew mode" row; changing it revokes every session and rotates the code). One paired session then holds all nine stations and may use the closed host command surface: pause/resume, time scale, save/load slots 1-5 and new game, sent as pseudo-role `host` over the normal command pipeline (same CSRF/Origin, exactly-once, phase and world-session checks; rejected in crew mode and while a host menu/overlay is open). Editors, options, quit, network administration and credentials stay host-only, saves stay exact v11, and a world replacement keeps the solo session but re-leases every station and drops queued commands. The browser runs on a desktop PC, so the web UI targets large screens; `data/commander/` keeps the accessible single-column fallback for narrow windows only.
- Browser sessions may use host-only HttpOnly SameSite cookies for reload recovery. Credentials never enter JavaScript, URLs, DOM, logs, settings, or saves. State-changing requests also require exact Origin and a separate CSRF token. Plain HTTP remains trusted-LAN-only; Internet-capable deployment requires a separately reviewed encrypted endpoint or reverse proxy.
- Keep clients, histories, queues, projections, polling, and render work bounded for the uConsole. Cache immutable projections shared by clients with identical visibility, apply backpressure, and verify maximum-client CPU, memory, bandwidth, frame time, reconnect, and thermal behavior on real hardware.
- New multiplayer prose uses exact EN/DE catalog parity and safe DOM insertion. Browser controls require keyboard and touch access, bounded responsive layouts, explicit stale/revoked states, and tests at desktop, mobile, large zoom, and pseudolocale where applicable.
## Coastline provenance
- `data/coastlines/region.json` is the hand-maintained stylized legacy map. `data/coastlines/real_sectors.json.gz` is a generated runtime artifact: exactly 128 distinct, validated 500 NM sectors selected by `seed % 128`.
- Never hand-edit, casually recompress, or replace the generated catalog. `tools/build_coastline_sectors.py` is offline and deterministic (sorted JSON, gzip `mtime=0`) and accepts only the pinned Natural Earth and Wikidata snapshots with exact SHA-256 values embedded in the tool.
- The source snapshots are not runtime assets. Regenerate only from rights-cleared pinned inputs, then verify embedded provenance, `THIRD_PARTY_NOTICES.md`, loader/integrity tests, package inclusion, deterministic seed mapping, and geographic disclaimers together. Gameplay roles and synthetic bathymetry are not claims about real states or real seabed.
- Private WaveOps PDFs are non-distributable inspiration only. Do not add, quote, transcribe, imitate, or derive text, images, layouts, or data from them. New third-party assets require source, author, license, modification terms, attribution, and redistribution rights documented before release.
## Current intentional limits
- Editor authoring/validation is broader than runtime. Unit-editor profiles currently have no simulation effect.
- A user mission starts only via `F5` from the Mission Editor browser and only if it uses a 500 NM `fixed` world, clear weather, no events or random groups, exact built-in submarine/surface profiles, hostile submarines, and a `sink` or `survive` objective. For `sink`, targets must exactly equal all placed submarines.
- Runtime-effective mission fields are seed/name, player pose/speed, sea state/start time/thermocline, exact-unit placement (fixed coordinates or authored sectors)/course/speed/sub depth, and objective/time limit. Reference worlds, alternate sizes, protect/reach, aircraft, animals, torpedoes, decoys, random groups, events, and user unit profiles are rejected, never silently ignored. Mission world definitions do not replace the packaged coastline dataset.
- Audio is optional and synthesized at runtime; no device, disabled audio, or an incompatible shared mixer must degrade to silence without changing simulation. There are currently no external image/font/audio assets.
## uConsole and performance
- The canonical virtual canvas is 1280x720 at 60 FPS. Preserve semantic station layout and bounded text/tooltips at that size. Other windows use aspect-correct letterboxing (`FILL_SCREEN=False`); do not distort tactical geometry.
- The uConsole is a low-power target. Keep render paths free of disk I/O and hidden simulation mutation; cache metadata/surfaces, cull by bounds before point transforms, bound histories/queues/caches, and use NumPy/vectorized processing for signal/waterfall work. Avoid per-frame synthesis and expensive full-world scans.
- Audio updates at 0.25 s cadence. Engine and sonar streams generate short continuous blocks and retain at most the current plus one queued block. Preserve their phase/filter state, independent reserved channels, bounded queues, and an already initialized compatible shared mixer.
- Headless CI is not hardware acceptance. Changes affecting frame time, display scaling, controls, mixer behavior, or readability still need testing on the real 1280x720 uConsole target when available.
## Build and verification
Use Python 3.11+ from the repository root:
```sh
python -m pip install -e '.[dev]'
pytest
python tools/gen_contacts.py --check
python tools/smoke_full.py
python -m build
```
- `pytest` configures SDL dummy video/audio and isolates saves. Run focused tests while iterating, then the full suite for cross-system changes.
- `python -m build` requires the `build` extra/package and produces both sdist and wheel. Packaging tests build/install artifacts and verify package resources.
- For releases, verify `src/core/version.py`, save compatibility, README release statements, package metadata, wheel/sdist resources, notices/licenses, full tests, catalog check, smoke test, and a clean install. Do not include caches, local saves/settings, build trees, source snapshots, private references, or unlicensed assets.
- Keep commits narrowly scoped; inspect status/diff before staging, never overwrite unrelated work, never commit secrets or local user data, and do not rewrite history or force-push without explicit approval. Generated artifacts must be reproducible and accompanied by their provenance updates.
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Dominik Bornhaeusser
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+7
View File
@@ -0,0 +1,7 @@
include packaging/uconsole/install-hotspot-helper.sh
include packaging/uconsole/io.github.db9979.u-jagd.hotspot.policy
include packaging/uconsole/u-jagd-hotspot-helper
include docs/station-shortcuts.de.md
include docs/station-shortcuts.de.pdf
include docs/web-host.de.md
include tools/build_station_shortcuts_pdf.py
+500
View File
@@ -0,0 +1,500 @@
[English README](README.md)
# U-Jagd
Optionaler Browserbetrieb für einen vollständigen LAN-Spielraum: siehe
[Webspiel im LAN](docs/web-host.de.md). Der Modus startet mit `--web-host` und
benötigt einen eigenen HTTPS-Reverse-Proxy.
U-Jagd ist ein Echtzeit-Taktikspiel zur U-Boot-Jagd für Linux, das für die
Arbeitsfläche von 1280 x 720 Pixeln der ClockworkPi uConsole entwickelt wurde.
Sie führen eine fiktive Fregatte und wechseln zwischen neun Arbeitsplätzen, um
zu navigieren, zu suchen, Kontakte zu klassifizieren, Ziele zu bekämpfen und das
Schiff einsatzfähig zu halten.
Aktuelle Version: **1.0.0**
Version 1.0.0 teilt jede Arbeitsstation in zwei per Tab wählbare Unterseiten,
ergänzt manuelle Freigabeschalter für CIWS und FLAK neben den bestehenden
automatischen Feuerfreigaben und gibt der Autocrew-Brücke ein Ausweich- und
Grundberührungs-Vermeidungsverhalten gegen ASM-/Torpedo-Bedrohungen. TMA-
Neulösungen nutzen jetzt eine Hysterese gegen fast gleichwertige
Peilungslösungen, und feindliche Seezielflugkörper tragen einen aktiven
Radar-Suchkopf in der Terminalphase, der eine ESM/RWR-Warnung liefert, bevor
das Suchradar sie erfasst. Ein konsolidiertes Theme-System ergänzt eine
optionale High-Contrast-Palette für Farbfehlsichtigkeit. Speicherformat v11
und das Remote-Crew-v2-Protokoll bleiben unverändert.
Dies ist ein von einem einzelnen Entwickler erstelltes Hobbyprojekt. Es ist ein Spiel und kein Ausbildungs-
oder Navigationsprodukt. Die Systeme sind vereinfacht und erheben nicht den
Anspruch, geheime Fähigkeiten, Daten oder Einsatzgrundsätze nachzubilden.
## Screenshots
![U-Jagd-Hauptmenü](docs/screenshots/main-menu.png)
![Brücke, Sonar, Waffen und Schadensabwehr](docs/screenshots/stations-overview-1.png)
![OPZ/CIC, Funk, Maschinenraum und Helikopter](docs/screenshots/stations-overview-2.png)
![Elektronische Kampfführung / ESM](docs/screenshots/stations-overview-3.png)
Arbeitsplätze in voller Auflösung: [Brücke](docs/screenshots/station-bridge.png),
[Sonar](docs/screenshots/station-sonar.png),
[Waffen](docs/screenshots/station-weapons.png),
[Schadensabwehr](docs/screenshots/station-damage-control.png),
[OPZ/CIC](docs/screenshots/station-opz-cic.png),
[Funk](docs/screenshots/station-radio.png),
[Maschinenraum](docs/screenshots/station-engineering.png),
[Helikopter](docs/screenshots/station-helicopter.png) und
[Elektronische Kampfführung/ESM](docs/screenshots/station-eloka.png).
Beispiel der Schadensabwehr mit vorgegebenen Flutungen, Bränden, ausgefallenen
Zonen und Reparaturtrupps:
[F-217-Schadensschema](docs/screenshots/damage-control-alert.png).
Commander-Browser: [OPZ/CIC mit 1920 x 1080](docs/screenshots/commander-v2-de-opz-desktop.png),
[Sonar mit 1920 x 1080](docs/screenshots/commander-v2-de-sonar-desktop.png) und die
[vollständige deutsche/englische Desktop- und Mobilmatrix](docs/screenshots/commander-captures.de.md).
[Lokale Commander-Optionen](docs/screenshots/commander-options.png).
## Highlights
- Neun Stationen: Brücke, Sonar, Waffen, Schadensabwehr, OPZ/CIC, Funk,
Maschinenraum, Helikopterdeck und Elektronische Kampfführung/ESM.
- Vier integrierte Szenarien, drei Schwierigkeitsgrade, Pause und Echtzeitsimulation.
- Passives HMS und Schleppsonar, aktives Sonar, Breitband- und LOFAR-Anzeigen,
DEMON-Analyse, Bathythermografmessungen und rein peilungsbasierte TMA.
- Seeziel- und Luftraumradar, AIS, ESM, HFDF, manuelle Klassifikation und
Zugehörigkeitsbewertung sowie ein gemeinsames Lagebild.
- Schiffs- und Helikoptertorpedos, Sonarbojen, feindliche Flugkörper, ESSM,
CIWS und Düppel.
- Zivile Schifffahrt, feindliche Überwasserschiffe, Luftfahrzeuge, biologische
Kontakte und akustische Täuschkörper.
- Flutung, Feuer, neun auswählbare Zonen in einem prozedural erzeugten
F-217-Systemschema und drei zuweisbare Reparaturtrupps. Das Schema ist fiktiv
und kein realer F123-Abteilungsplan.
- Fünf lokale Speicherplätze mit deterministischen Weltzuständen.
- Englische und deutsche Oberflächenkataloge, Erkennung der Systemsprache und
ein Optionsbildschirm.
- Kontexthinweise an allen neun Stationen: Mit dem Mauszeiger erscheint eine
vorübergehende Erklärung; ein Linksklick auf ein angezeigtes Element fixiert
den Hinweis. `Esc` entfernt eine Fixierung, bevor der Beenden-Dialog geöffnet
wird.
- Eine native Oberfläche mit 1280 x 720 Pixeln, die bei Bedarf unter Wahrung des
Seitenverhältnisses mit Balken dargestellt wird. Karten und Symbole zeichnet
Pygame; Audio wird zur Laufzeit synthetisiert.
- Optionale Remote Crew für vertrauenswürdige LANs: Mehrere authentifizierte
Browser-Clients können exklusive Stationsrollen innehaben, zwischen ihren
behaltenen Rollen wechseln, dieselben beobachtungsbasierten Bedienelemente
nutzen und mit einer getrennten Freigabe direkt Waffen einsetzen.
- Konservative stationsbezogene Autocrew mit `F2` und einer Übersicht mit `F3`.
Remote Crew pausiert Autocrew nur für die jeweils belegte Station.
- Deterministisches Seewetter mit Wind, Regen, Sicht und weichen
Seegangübergängen. Wetter beeinflusst Radar, Ausguck, Sonar und
Helikoptergrenzen, erzeugt aber keine verborgene Winddrift.
- Modellierter Treibstoffverbrauch mit Ausdauer, Reichweite und Reparaturtrends
im Maschinenraum.
## Voraussetzungen
- Linux
- Python 3.11 oder neuer
- Pygame 2.6 oder neuer
- NumPy 2.0 oder neuer
- Eine von Pygame unterstützte Anzeige
- Ein Audiogerät ist optional; ist kein Audiogerät verfügbar, wird der Start
lautlos fortgesetzt
## Schnellstart
```sh
git clone https://github.com/db9979/uconsole_asw_game.git
cd uconsole_asw_game
python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python main.py
```
Systempakete, Aktualisierungen und Fehlerbehebung für die ClockworkPi uConsole
sind in [`docs/install-uconsole.md`](docs/install-uconsole.md) beschrieben.
## Kommandozeile
Der Standardstart verwendet entsprechend der gespeicherten Einstellung den
Vollbildmodus und wählt einen zufälligen Missions-Seed:
```sh
python main.py
```
Folgende Argumente werden unterstützt:
```sh
python main.py 12345
python main.py 12345 --windowed
python main.py --no-audio
python main.py --version
```
`--windowed` und `--no-audio` überschreiben für diesen Start die entsprechenden
gespeicherten Optionen. Es gibt weder `--fullscreen` noch eine
Kommandozeilenoption für die Sprache. Nach einer Paketinstallation ist derselbe
Einstiegspunkt als `u-jagd` verfügbar, beispielsweise `u-jagd --windowed`.
## Spiel starten
Das Hauptmenü enthält Einträge für ein neues Spiel, Laden, Missionseditor,
Einheiteneditor, Optionen und Beenden. Bei einem neuen Spiel folgen die Auswahl
des Szenarios und, beim Zufallsszenario, die Auswahl des Schwierigkeitsgrads.
- `W` wechselt zwischen dem durch den Seed gewählten realen Sektor, der
festen klassischen Referenzkarte und einem fest wählbaren realen Sektor.
- Im festen realen Modus wählen `Bild auf`/`Bild ab` den Küstenabschnitt.
- `R` erzeugt einen neuen Seed; im festen realen Modus bleibt der Abschnitt erhalten.
- `F` schaltet im Menü den Vollbildmodus um.
- Mit den Pfeiltasten wird ein Eintrag ausgewählt; `Enter` oder `Space`
bestätigt ihn.
Ein Seed wählt einen von 128 aus realen Daten abgeleiteten Küstensektoren mit
500 NM Ausdehnung und erzeugt im selben Weltmodus immer dieselbe Welt. Die feste
klassische Karte bleibt als getrennte stilisierte Option verfügbar.
Beim Missionsstart geht im Funkraum ein grober, statischer Aufklärungshinweis
auf mögliche Unterwasser- oder feindliche Überwasseraktivität ein. Peilung und
Entfernung sind bewusst grob gerundet, die Position ist ausdrücklich unbestätigt
und stellt keinen Sensor-Fix dar. Ist keine verlässliche anfängliche Position
verfügbar, fordert die Meldung dazu auf, den Missionssektor mit den Bordsensoren
aufzuklären.
## Steuerung
Drücken Sie im Spiel `F1`, um die kontextsensitive Hilfe aufzurufen. Eine
vollständige druckbare Übersicht der lokalen Tastenkürzel steht als
[`docs/station-shortcuts.de.pdf`](docs/station-shortcuts.de.pdf) bereit; die
Textquelle ist [`docs/station-shortcuts.de.md`](docs/station-shortcuts.de.md).
Die wichtigsten globalen Bedienelemente sind:
| Eingabe | Aktion |
|---|---|
| `1` bis `9` | Brücke, Sonar, Waffen, Schadensabwehr, OPZ/CIC, Funk, Maschinenraum, Helikopter, Elektronische Kampfführung/ESM; erneutes Drücken der Nummer der aktiven Station wechselt, sofern vorhanden, zur nächsten Seite |
| `F` / `Umschalt+F` / `B` bei ESM | Signalstatus-, Mindestbedrohungs- und Frequenzbandfilter wechseln |
| `Tab` / `Shift+Tab` | Nächste / vorherige Station |
| `P` | Pause / fortsetzen |
| `F1` | Kontextsensitive Hilfe |
| `F2` / `F3` | Autocrew der aktuellen Station umschalten / Autocrew-Übersicht öffnen |
| `F4` | SimLog öffnen, sofern aktiviert |
| `F8` | Taktischen Einheitenanalysator öffnen; gegebenenfalls sichtbaren Commander-Vorschlag wechseln |
| `F10` | Optionen; während der Pause öffnet auch `O` die Optionen |
| `F9` | Lokale Commander-LAN-Verwaltung |
| `S` / `L` | Speichern / Laden über die Plätze 1 bis 5; in der OPZ ist `L` der kontextbezogene Fusionsbefehl |
| `+` / `-` | Maschinentelegraf |
| `Alt+Enter` | Vollbildmodus umschalten |
| `Ctrl+Enter` | Primäre Waffenaktion an den Stationen Waffen, OPZ/CIC oder Helikopter; die normalen Bereitschaftsprüfungen gelten |
| `Q` / `E` oder Mausrad | Sichtbare Karten an den Stationen Brücke, Waffen und Helikopter zoomen |
| Ziehen mit der Maus | Eine sichtbare Karte verschieben und die Kameraverfolgung ausschalten |
| `K` | Kameraverfolgung auf einer sichtbaren Karte umschalten |
| `Esc` | Einen fixierten Hinweis entfernen, die aktuelle Ansicht/Eingabe abbrechen oder die Beenden-Bestätigung öffnen |
Stationstasten sind bewusst kontextabhängig. Beispielsweise sendet `Shift+A` am
Sonar einen aktiven Ping, während dort `A` den Breitband-Hörmodus wählt und im
Maschinenraum den Akustikmodus ändert. Verwenden
Sie `F1`, statt davon auszugehen, dass eine Taste an jeder Station dieselbe
Bedeutung hat.
In der Hilfe wechselt Links/Rechts die Kategorie; Auf/Ab oder Page Up/Page Down
scrollt den Inhalt. Bestehende stationsbezogene Tastenkürzel für Waffen bleiben
verfügbar. Gedrückt gehaltene Kurs- und Torpedotiefensteuerungen verwenden
Echtzeit.
Der Ereignis-Feed am unteren Rand gilt stationsübergreifend. Er bewahrt operative
Meldungen, abgeschlossene Befehle und Alarme auf, darunter Missionsergebnis,
Waffen- und Abwehrereignisse, Schaden, Funkverkehr, Navigation sowie Pause.
Kurzlebige Eingabe-, Fehler-, Auswahl- und Anzeigehinweise bleiben im
Statusbanner, damit sie die operative Historie nicht verdrängen.
Klicken Sie bei der Schadensabwehr auf eine Zone oder deren Beschriftung, um sie
auszuwählen und die Zuweisung des aktuell gewählten Trupps zu versuchen. Sind
Kontexthinweise aktiviert, fixiert der Klick zugleich ihre Details. Auf/Ab wählt
einen Trupp, Enter weist ihn zu und Backspace zieht ihn ab. Flutungs- und
Brandtrends zeigen die
Nettorate des Modells einschließlich der Auswirkungen von Schwierigkeitsgrad und
mehreren Trupps.
## Sonar-Hinweise
Passives Sonar liefert unsichere Peilungen, keine tatsächlichen Positionen oder
Tiefen. TMA benötigt eine Peilungshistorie und Manöver des eigenen Schiffs, bevor
eine brauchbare Schätzung von Position und Bewegung möglich ist. Aktive Echos
liefern nach der modellierten Schalllaufzeit gemessene Peilung, Entfernung und
Tiefe mit Unsicherheit; sie bleiben auf der Seite `ACTIVE` erhalten und
verblassen mit zunehmendem Alter. Ein aktiver Fix läuft ab, und eine Aussendung
kann U-Boote aus größerer Entfernung alarmieren, als die Fregatte ein Echo
empfangen kann. Abschattung durch die Küste, Seegang, Geometrie der
Thermokline, Eigengeräusch und Array-Auswahl beeinflussen die Ergebnisse.
TMA- und Sonarbojen-Fixes laufen ebenfalls unabhängig davon ab, ob weiterhin
passiv etwas gehört wird. Hinweise zu historischen Plotpunkten beziehen sich auf
die angezeigte Messung. Aktive Echos behalten die zum Sendezeitpunkt eingefrorene
Geometrie; eine getrennte auslaufende Welle und das Abfangen durch einen bewegten
Empfänger werden nicht simuliert, und Ping-Warnungen für U-Boote erfolgen
weiterhin sofort.
Die Sonar-Wiedergabe verarbeitet die begrenzte Blockübergabe des
Empfängers der Reihe nach und versucht einen nicht angenommenen Block erneut,
wenn die Wiedergabewarteschlange voll ist. Bei einem Überlauf startet der Stream
neu, statt unzusammenhängende Abtastwerte zu verbinden. Die Analyse bleibt unabhängig von Wiedergabeverfügbarkeit und
Lautstärke. Nach dem Laden eines Spielstands durchläuft DSP bewusst erneut seine
Anlaufphase; gespeicherte taktische Beobachtungen bleiben erhalten.
Die Sonarbedienung umfasst:
- `Shift+A`: Einen aktiven Ping senden; der Sender hat 30 Sekunden Abklingzeit.
- `Shift+B`: HMS oder TAS als Empfangs-/Sende-Array auswählen.
- `A` / `B` / `H`: Breitband-, gefilterten oder Heterodyn-Hörmodus wählen.
- `Y`: TAS ausbringen oder einholen.
- `U` / `V`: Nach dem Ausbringen die TAS/VDS-Solltiefe anpassen.
- `Page Up` / `Page Down`: Zwischen den Seiten Broadband, LOFAR, DEMON, TMA,
Environment und ACTIVE wechseln.
- `2` bei bereits aktivem Sonar: Zur nächsten Sonarseite wechseln.
Das Bedienen des TAS schreitet nur zwischen 3 und 12 kn voran. Das Ausbringen
dauert sechs Simulationsminuten, das Einholen acht; das vollständig ausgebrachte
Array benötigt weitere 30 Sekunden zum Einschwingen, bevor es seine volle
Leistung erreicht. Außerhalb des Bereichs von 3 bis 12 kn pausiert die Bedienung.
Werden bei ausgebrachtem Kabel 20 kn überschritten, fällt das Array für den Rest
des aktuellen Spiels aus. Die TAS-Tiefe wird ebenfalls durch die Schiffsfahrt
begrenzt.
Die Auswahl von TAS macht es nicht automatisch verfügbar: Ein TAS-Ping kann erst
Echos erzeugen, nachdem genügend Kabel ausgebracht wurde. Wird `Shift+A` bei nicht
verfügbarem TAS gedrückt, wird der Befehl abgelehnt, ohne zu senden oder die
gemeinsame Ping-Abklingzeit zu verbrauchen. Die aktive Reichweite von TAS ist
geringer als die von HMS; sein Hauptvorteil liegt in der Genauigkeit passiver
Peilungen und der Leistung gegen passend geschichtete Kontakte nach dem
Einschwingen.
## Radar-Hinweise
In der OPZ/CIC wählen `Page Up` und `Page Down` ausschließlich Anzeigebereiche
von **10, 20, 40, 80 oder 120 NM**; sie wechseln weder die Seite noch die
Sensorleistung. Die modellierten Erfassungsgrenzen bei klarem Wetter betragen
30 NM für das Seezielradar und 100 NM für das Luftraumradar, mit
Leistungseinbußen ab Seegang 5 und durch Regenclutter. Seeziel- und
Luftraumradar können mit `R` und `Shift+R` getrennt gesteuert werden.
## Sprache und Optionen
Beim ersten Start wählt U-Jagd bei einer deutschen Systemsprache Deutsch und bei
einer englischen oder nicht unterstützten Systemsprache Englisch. Im
Optionsbildschirm kann ausdrücklich zwischen `en` und `de` gewechselt werden;
dort werden außerdem Vollbildmodus, Audio, Großschrift und Kontexthinweise
eingestellt.
Die Einstellungen für Sprache, Vollbildmodus, Audio, Großschrift und
Kontexthinweise werden in `~/.u-jagd/settings.json` geschrieben. Der Zustand der
Kontexthinweise gilt daher global und wird für die deterministische
Wiederherstellung bestehender Sitzungen zusätzlich in Spielständen des Formats
v11 gespeichert.
## Commander-LAN-Koop
Verwenden Sie auf der uConsole **F10 > Commander LAN** oder **F9**. Wählen Sie bei
ausgeschaltetem Dienst ausdrücklich eine private IPv4-Adresse und aktivieren Sie
ihn anschließend. Öffnen Sie auf jedem Besatzungsgerät die angezeigte URL. Die
Voreinstellung `127.0.0.1:8765` gilt nur für das lokale Gerät und ist von anderen
Geräten nicht erreichbar. Eine Router-Portweiterleitung ist weder erforderlich
noch unterstützt.
Alternativ kann die uConsole einen temporären WPA2-Hotspot für Remote Crew
bereitstellen. Installieren Sie dafür einmalig den eng begrenzten Helper mit
`sudo ./packaging/uconsole/install-hotspot-helper.sh`, wählen Sie in F9 den
Hotspot-Netzmodus und aktivieren Sie den Dienst. U-Jagd erzeugt bei jedem Start
eine neue SSID und ein neues WLAN-Passwort und speichert beides nicht. Beim
Beenden von Remote Crew wird der Hotspot entfernt und die vorherige
WLAN-Verbindung wiederhergestellt. Das Spiel selbst darf nicht mit `sudo`
gestartet werden.
Koppeln Sie den Browser mit dem sechsstelligen Code: **drei Ziffern gefolgt von
drei Großbuchstaben**, beispielsweise `482KMT`. Fünf falsche Versuche innerhalb
einer gleitenden Minute sperren weitere Versuche vorübergehend. Der angezeigte
Code bleibt für weitere Besatzungsmitglieder gültig, bis der Host den Zugriff
widerruft oder der fünfte Fehlversuch ihn erneuert. Browser-Eingaben in
Kleinbuchstaben werden in Großbuchstaben umgewandelt. Das Beispiel ist kein
gültiger Zugangscode.
Nach der Kopplung fordert jeder Browser eine oder mehrere Stationen an. Der Host
vergibt jede Station exklusiv; mit der Genehmigung wird die normale
Stationsbedienung automatisch aktiviert, während Sonaraudio und direktes Feuer
getrennte Freigaben bleiben. Ein Browser zeigt jeweils eine aktive Station an,
fordert über **Station hinzufügen** eine weitere an und behält seine anderen
Stations-Leases für einen schnellen Wechsel über die Stationsauswahl. Eine
genehmigte zusätzliche Station wird automatisch geöffnet. Jeder Befehl wird im
Hauptthread der Simulation erneut
anhand von Stationsschaden, Aktualität der Beobachtung, Bestand, Bereitschaft,
Einsatzregeln und aktueller Weltgeneration geprüft. Die Kommunikation ist
weiterhin auf eine externe Sprachverbindung angewiesen; Mikrofon und Chat sind
nicht enthalten.
Die Sonarbesatzung kann Zielvorschläge und die Brückenbesatzung Kurs- und
Fahrtvorschläge bereitstellen. Diese Anfragen wirken niemals direkt: Der Host
prüft sie lokal und nimmt sie an oder lehnt sie ab. Browseralarme bleiben
rollenbegrenzt. Das separat vom Host freigegebene, schreibgeschützte SimLog ist
eine Diagnoseausnahme und zeigt abgelöste Full-Truth-Snapshots einschließlich
versteckter Einheiten; eine Neuverbindung setzt eine stille
Ereignis-Ausgangsbasis, anstatt alte Alarme erneut abzuspielen.
Solange ein Browser eine Stations-Lease besitzt, ist die Bedienung der
entsprechenden Station auf der uConsole schreibgeschützt. Host-Verwaltung, Pause
und der Wechsel zu einer anderen Station bleiben verfügbar; der Widerruf der
Lease stellt die lokale Bedienung sofort wieder her.
Der Dienst startet **bei jedem Programmstart ausgeschaltet**. Zugriffe und
Freigaben werden nicht gespeichert. Zugangsdaten, Clients, Stations-Leases,
Netzwerkwarteschlangen, Entwürfe und nicht angenommene Befehle gelangen weder in
Spielstände noch in die Einstellungen. Ein Austausch der Welt widerruft aktive
Berechtigungen im nächsten Frame des Hauptthreads. Manuelle Pause, Fokusverlust,
Speichern/Laden, Beenden, Länderübersicht, die eigentlichen Editoren, Menüs und
Splashscreen sperren Änderungen aus dem Browser. Bei einer aktiven Crew-Station
lassen die F1-Hilfe, der spielinterne F8-Analysator, die Crew-Verwaltung mit F9
und die Optionen mit F10 Simulation und Browser-Stationen weiterlaufen.
Sonarklang im Browser erfordert eine ausdrückliche Host-Freigabe und eine lokale
Benutzeraktion; nach einer Neuverbindung werden alte Audiodaten nicht
nachgespielt. Die Hörmodi Broadband, Filtered und Heterodyne verwenden die
gewählten Einstellungen für Band, Kerbfilter und Verstärkung. Ein Klick oder Tap
auf den Broadband-Wasserfall setzt die manuelle Horchpeilung des Sonars; LOFAR
tut dies nicht. Dieselbe lokale Ton-Schaltfläche aktiviert auf der Brücke ein
synthetisiertes Eigenschiff-Kavitationsgeräusch. Es verwendet ausschließlich die
projizierte Kavitationswarnung und steuert niemals das uConsole-Audio.
Beim Überfahren eines nicht verfügbaren Browser-Bedienelements erscheint der
aktuelle lokalisierte Grund, etwa fehlende Freigabe, Stationsschaden, Abklingzeit,
leerer Bestand, ausstehender Befehl oder die TAS-Fahrtgrenze.
Anwendungsversion **1.0.0**, API-Protokoll **v2** und Speicherformat **v11** sind
voneinander unabhängige Kompatibilitätsverträge. Remote Crew verwendet
ausschließlich Protokoll v2; sämtliche Legacy-Routen unter `/api/v1/*` sind
entfernt und liefern 404.
**Sicherheit:** HTTP ist unverschlüsselt. Verwenden Sie den Dienst nur in einem
vertrauenswürdigen LAN. Internet-Hosting, Bindung an Wildcard-Adressen, CDN,
ferne Steuerung von Einsatzregeln, Zeit oder Speicherständen sowie verborgene
Entity-Daten werden nicht bereitgestellt. Siehe
[Einrichtung von Remote Crew](docs/commander-coop.de.md) und
[Protokoll/Sicherheit](docs/commander-protocol.de.md).
## Editoren und aktuelle Einschränkungen
Das Hauptmenü enthält einen Missionseditor und einen Einheiteneditor. Sie bieten
schreibgeschützte integrierte Bibliotheken, die Anzeige von Benutzerinhalten,
Validierung, Klonen, editierbare typisierte Felder und eine deterministische
statische Missionsvorschau. Missionsautoren können exakte Platzierungen,
Seed-basierte Zufallsgruppen, Ziele und zeitgesteuerte Ereignisse bearbeiten.
Einheitenautoren können alle sechs Profilarten erstellen und verschachtelte
Akustik- und Listendaten über sichere strukturierte Eingaben bearbeiten.
`Ctrl+E` und `Ctrl+I` dienen zum Exportieren und Importieren von Bundles. Die
JSON-Vorlagen unter `data/editor_templates/` beschreiben die akzeptierten
Schemata; Benutzerdateien werden unter `~/.u-jagd/missions/` und
`~/.u-jagd/units/` gespeichert.
Validiert bedeutet nicht, dass ein Wert zur Laufzeit wirksam ist. In Version
1.0.0 gilt:
- Eine Benutzermission kann nur dann mit `F5` aus der Browseransicht des
Missionseditors gestartet werden, wenn sie die unterstützte Laufzeitteilmenge
verwendet.
- Wirksame Missionswerte sind Seed und Name; Platzierungssektoren einer festen
500-NM-Welt; Position, Kurs und Fahrt des Spielerschiffs; Seegang, Startzeit
und Thermoklinentiefe; exakte integrierte U-Boot- und Überwasserprofile mit
ihrer Platzierung, ihrem Kurs, ihrer Fahrt und der Tiefe der U-Boote; sowie
Ziele vom Typ `sink` oder `survive` mit einem Zeitlimit.
- Eine Laufzeitmission muss eine 500-NM-Welt vom Typ `fixed` und Wetter vom Typ
`clear` festlegen. Andere Weltgrößen und Referenzwelten werden abgelehnt. Die
Weltdefinition des Editors ersetzt nicht den Küstendatensatz des Spiels.
- Platzierte U-Boote müssen feindlich sein. Bei einem Ziel vom Typ `sink` muss
dessen Zielliste exakt allen platzierten U-Booten entsprechen.
- Zufallsgruppen, zeitgesteuerte Ereignisse, Ziele vom Typ `protect` und `reach`,
Luftfahrzeuge, Tiere, Torpedos, Täuschkörper und selbst erstellte
Einheitenprofile werden für das Spielen der Mission abgelehnt und nicht
stillschweigend ignoriert.
- Ausgaben des Einheiteneditors sind ausschließlich Validierungs- und
Erstellungsdaten. Derzeit beeinflusst kein Feld eines Benutzer-Einheitenprofils
die laufende Simulation.
## Spielstände und Benutzerdaten
Version 1.0.0 schreibt und lädt ausschließlich das Speicherformat **v11**. V11
verlangt das exakte Schema `u-jagd-save-v11` einschließlich des aktuellen
Schnappschusses des Laufzeitkatalogs und des gesamten Zustands für die
deterministische Fortsetzung. Ältere, neuere, fehlerhafte oder unvollständige
Spielstände werden abgelehnt, ohne das laufende Spiel zu ersetzen.
Die fünf Speicherplätze sind `~/.u-jagd/slot1.json` bis `slot5.json`.
Spielstände enthalten einen Schnappschuss der Küstengeometrie und der
synthetischen Bathymetrie, damit ein bestehendes Spiel nicht mit einer späteren
Version des Weltgenerators neu erzeugt wird.
## Weltdaten und Haftungsausschluss
`data/coastlines/real_sectors.json.gz` enthält exakt 128 vorab validierte
500-NM-Sektoren, die aus Ländergeometrien von Natural Earth und einem
Wikidata-Schnappschuss von Flugplatzkoordinaten abgeleitet wurden. Daher können
echte Orts-, Länder- und Militärstützpunktnamen sowie Quellkoordinaten erscheinen.
Freundliche, feindliche, neutrale und zivile Rollen werden unabhängig davon als
fiktive Übungsrollen zugewiesen und beschreiben weder die realen Staaten noch die
realen Einrichtungen.
Die Bathymetrie ist synthetisch; alle taktischen Reichweiten,
Plattformleistungen, akustischen Eigenschaften, Zugehörigkeiten und Übungsrollen
sind Daten des Spielmodells. Nichts in diesem Repository eignet sich für
Navigation, Vermessung, die Bestimmung realer Fähigkeiten oder Einsatzplanung.
U-Jagd steht weder mit Natural Earth, Wikidata, deren Mitwirkenden,
Plattformherstellern, militärischen Organisationen, Regierungen oder Inhabern
von Rechten an Quellen in Verbindung noch wird es von ihnen unterstützt.
Die genaue Herkunft, Versionen, Hashes, Hinweise zur Verarbeitung und Lizenzen
sind in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) dokumentiert. Privates
WaveOps/MNW-Material ist keine Quelle des Repositorys. Es werden daraus weder
Texte, Bilder, Layouts, Daten, Nachahmungen, Transkriptionen noch abgeleitete
Materialien verwendet.
## Entwicklung und Tests
Die Prüfung der Arbeitsplätze und Modelle, umgesetzte Korrekturen, verbleibende
Modellgrenzen und die Checkliste für die Hardware-Abnahme sind in
[`docs/workstation-review.md`](docs/workstation-review.md) dokumentiert.
Aktuelle Arbeiten werden in [`docs/plan-0.1.8.md`](docs/plan-0.1.8.md) und
[`docs/resume.md`](docs/resume.md) verfolgt. Der abgeschlossene
Stabilisierungsplan für 0.1.6 bleibt unter
[`docs/plan-0.1.6.md`](docs/plan-0.1.6.md) verfügbar.
Installieren Sie das Projekt und die Entwicklungsabhängigkeit und führen Sie
anschließend die Testsuite aus:
```sh
python -m pip install -e '.[dev]'
pytest
```
Validieren Sie den erzeugten Kontaktkatalog mit:
```sh
python tools/gen_contacts.py --check
```
Erzeugen Sie ein Wheel mit einem PEP-517-Frontend:
```sh
python -m pip install build
python -m build
```
## Lizenz und Danksagungen
Der Projektcode und die projektspezifische Dokumentation stehen unter der
MIT-Lizenz; siehe [`LICENSE`](LICENSE). Pygame, NumPy, geografische Quelldaten
und alle zukünftigen Assets behalten ihre jeweiligen Lizenzen und
Attributionsanforderungen. Siehe
[`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) und
[`assets/README.md`](assets/README.md).
+453
View File
@@ -0,0 +1,453 @@
[Deutsche README](README.de.md)
# U-Jagd
An optional browser-only LAN room is available with `--web-host` behind a
separate HTTPS reverse proxy. See the [German web-host guide](docs/web-host.de.md).
U-Jagd is a real-time anti-submarine warfare tactics game for Linux, designed
around the ClockworkPi uConsole's 1280 x 720 workspace. You command a fictional
frigate and move between nine workstations to navigate, search, classify,
engage, and keep the ship operational.
Current release: **1.0.0**
Release 1.0.0 splits every workstation into two tabbed sub-pages, adds manual
CIWS and FLAK release authorization alongside the existing automatic gates,
and gives the autocrew bridge ASM/torpedo evasion and grounding-avoidance
behavior. TMA re-solves now use hysteresis against near-tied bearing
solutions, and inbound anti-ship missiles carry a terminal-active radar
seeker that gives an ESM/RWR warning before search radar acquires them. A
consolidated theme system adds an optional high-contrast, colorblind-safe
palette. Save format v11 and the Remote Crew v2 protocol are unchanged.
This is a hobby project built by a single developer. It is a game, not a training or navigation
product. Its systems are simplified and do not claim to reproduce classified
capabilities, data, or doctrine.
## Screenshots
![U-Jagd main menu](docs/screenshots/main-menu.png)
![Bridge, Sonar, Weapons, and Damage Control](docs/screenshots/stations-overview-1.png)
![OPZ/CIC, Radio, Engineering, and Helicopter](docs/screenshots/stations-overview-2.png)
![Electronic Warfare / ESM](docs/screenshots/stations-overview-3.png)
Full-resolution workstations: [Bridge](docs/screenshots/station-bridge.png),
[Sonar](docs/screenshots/station-sonar.png),
[Weapons](docs/screenshots/station-weapons.png),
[Damage Control](docs/screenshots/station-damage-control.png),
[OPZ/CIC](docs/screenshots/station-opz-cic.png),
[Radio](docs/screenshots/station-radio.png),
[Engineering](docs/screenshots/station-engineering.png),
[Helicopter](docs/screenshots/station-helicopter.png), and
[Electronic Warfare/ESM](docs/screenshots/station-eloka.png).
Damage-control example with authored flooding, fire, lost zones and repair teams:
[F-217 damage schematic](docs/screenshots/damage-control-alert.png).
Commander browser: [OPZ/CIC at 1920 x 1080](docs/screenshots/commander-overview.png),
[Sonar at 2560 x 1440](docs/screenshots/commander-wide.png), and the
[complete English/German desktop and mobile matrix](docs/screenshots/commander-captures.md).
[Local Commander options](docs/screenshots/commander-options.png).
## Highlights
- Nine stations: Bridge, Sonar, Weapons, Damage Control, OPZ/CIC, Radio,
Engineering, Helicopter Deck, and Electronic Warfare/ESM.
- Four built-in scenarios, fully configurable custom difficulty, pause, and real-time simulation.
- Passive HMS and towed-array sonar, active sonar, broadband and LOFAR
displays, DEMON analysis, bathythermograph readings, and bearing-only TMA.
- Surface and air radar, AIS, ESM, HFDF, manual classification and affiliation,
and a common operational picture.
- Ship and helicopter torpedoes, sonobuoys, hostile missiles, ESSM, CIWS, and
chaff.
- Civilian shipping, hostile surface ships, aircraft, biological contacts, and
acoustic decoys.
- Flooding, fire, nine selectable zones in a procedural F-217 system schematic,
and three assignable repair teams. The schematic is fictional, not a real
F123 compartment plan.
- Five local save slots with deterministic world snapshots.
- English and German interface catalogs, system-language detection, and an
options screen.
- Context tooltips on all nine stations: hover for a temporary explanation,
or left-click a displayed item to pin its tooltip. `Esc` clears a pin before
opening the quit dialog.
- A native 1280 x 720 interface, aspect-correctly letterboxed when necessary.
Maps and symbols are drawn by Pygame; audio is synthesized at runtime.
- Optional trusted-LAN Remote Crew: multiple authenticated browser clients can
hold exclusive station roles, switch among their retained roles, operate the
same observation-led controls, and use separately granted direct fire.
The browser console is a one-viewport desktop layout with a station tab bar.
`python main.py --solo-crew` (or the F9 "Crew mode" row) lets one browser run
all nine stations plus pause, save/load and new game while the
uConsole stays the simulation server; see [Remote Crew setup](docs/commander-coop.md).
- Conservative station Autocrew with local `F2` control and an `F3` overview.
Remote Crew temporarily suspends Autocrew only for the leased station.
- Deterministic marine weather with wind, rain, visibility and smooth sea-state
transitions. Weather affects radar, lookout, sonar and helicopter limits but
does not add hidden wind drift.
- Modeled fuel consumption, endurance, range and repair trends in Engineering.
## Requirements
- Linux
- Python 3.11 or newer
- Pygame 2.6 or newer
- NumPy 2.0 or newer
- A Pygame-supported display
- An audio device is optional; startup continues silently if audio is
unavailable
## Quick Start
```sh
git clone https://github.com/db9979/uconsole_asw_game.git
cd uconsole_asw_game
python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python main.py
```
For ClockworkPi uConsole system packages, updates, and troubleshooting, see
[`docs/install-uconsole.en.md`](docs/install-uconsole.en.md).
## Command Line
The default launch uses fullscreen according to the saved preference and picks
a random mission seed:
```sh
python main.py
```
The supported arguments are:
```sh
python main.py 12345
python main.py 12345 --windowed
python main.py --no-audio
python main.py --version
```
`--windowed` and `--no-audio` override the corresponding saved options for that
launch. There is no `--fullscreen` or command-line language option. After a
package installation, the same entry point is available as `u-jagd`, for
example `u-jagd --windowed`.
## Starting a Game
The main menu provides new game, load, mission editor, unit editor, options,
and quit entries. A new game leads through scenario selection and, for the
random scenario, a custom difficulty screen (submarine stealth, repair rate,
torpedo count and hit tolerance, enemy aggression, starting sea state,
submarine/warship/traffic counts, air raid frequency, and time limit).
- `W` cycles through the seed-selected real sector, the fixed legacy reference
map, and a fixed selectable real sector.
- `Page Up`/`Page Down` select the coast in the fixed real-sector mode.
- `R` generates a new seed while retaining the selected fixed real sector.
- `F` toggles fullscreen from the menu.
- Arrow keys select an entry; `Enter` or `Space` confirms it.
A seed selects one of 128 real-data-derived 500 NM coastal sectors and produces
the same generated world for the same world mode. The fixed legacy map remains
available as a separate stylized option.
At mission start, Radio receives coarse, static intelligence about possible
underwater or hostile surface activity. Bearing and range are deliberately
rounded, the position is explicitly unconfirmed, and the report is not a sensor
fix. If no useful initial position exists, HQ directs the crew to develop the
picture with onboard sensors.
## Controls
Press `F1` in the game for context-sensitive help. A printable complete local
keyboard reference is available as
[`docs/station-shortcuts.de.pdf`](docs/station-shortcuts.de.pdf), with its text
source at [`docs/station-shortcuts.de.md`](docs/station-shortcuts.de.md). The
most important global controls are:
| Input | Action |
|---|---|
| `1` to `9` | Bridge, Sonar, Weapons, Damage, OPZ/CIC, Radio, Engineering, Helicopter, Electronic Warfare/ESM; press the active station number again to advance its page when available |
| `F` / `Shift+F` / `B` at ESM | Cycle signal-status, minimum-threat, and frequency-band filters |
| `Tab` / `Shift+Tab` | Next / previous station |
| `P` | Pause / resume |
| `F1` | Context-sensitive help |
| `F2` / `F3` | Toggle Autocrew for the current station / open the Autocrew overview |
| `F4` | Open SimLog when enabled |
| `F8` | Open the tactical unit analyzer; cycles a visible Commander proposal when applicable |
| `F10` | Options; while paused, `O` also opens options |
| `F9` | Local Commander LAN administration |
| `S` / `L` | Save / load using slots 1 to 5; at OPZ/CIC, `L` is the contextual fusion command |
| `+` / `-` | Engine telegraph |
| `Alt+Enter` | Toggle fullscreen |
| `Ctrl+Enter` | Primary weapon action at Weapons, OPZ/CIC, or Helicopter; normal readiness checks apply |
| `Q` / `E` or mouse wheel | Zoom maps on Bridge, Weapons, and Helicopter; the OPZ chart uses the mouse wheel |
| Mouse drag | Pan a visible map, including the OPZ chart, and disable its independent camera follow |
| `K` | Toggle camera follow on the current map or OPZ chart |
| `Esc` | Clear a pinned tooltip, cancel the current view/input, or open quit confirmation |
Station keys are deliberately contextual. For example, `Shift+A` sends an active
ping at Sonar, plain `A` selects Broadband listening there, and `A` changes
acoustic mode in Engineering. Use `F1` rather than
assuming that a key has the same meaning at every station.
In help, Left/Right switches category; Up/Down or Page Up/Page Down scrolls its
contents. Existing station weapon shortcuts remain available. Held course and
torpedo-depth adjustments use real time, not the selected simulation multiplier.
The bottom event feed is shared by all stations. It retains operational reports,
completed orders, and alerts—including mission outcome, weapon and defensive
events, damage, radio traffic, navigation, and pause/time state. Short-lived
input prompts, invalid-entry hints, selections, and display settings remain in
the transient status banner instead of displacing operational history.
At Damage Control, click a zone or its label to select it and attempt to assign
the currently selected team. With tooltips enabled, the click also pins its
details. Up/Down selects a team, Enter assigns it, and Backspace withdraws it.
Flood and fire trends show the
model's net rate, including difficulty and multi-team effectiveness.
## Sonar Notes
Passive sonar produces uncertain bearings, not ground-truth positions or
depths. TMA needs a bearing history and own-ship maneuvering before it can
produce a useful position and motion estimate. Active echoes provide measured
bearing, range, and depth with uncertainty after the modeled sound-travel delay;
they are retained on the `ACTIVE` page and fade with age. An active fix expires,
and transmitting can alert submarines at a greater distance than the frigate
can receive an echo. Coastline occlusion, sea state, thermocline geometry, own
noise, and array selection affect results.
TMA and sonobuoy fixes also expire independently of continued passive hearing.
Historical plot tooltips inspect the displayed sample. Active returns retain
frozen transmit-time geometry; the separate outbound wave and moving-receiver
intercept are not simulated, and submarine ping warnings remain immediate.
Sonar audition consumes the receiver's bounded block handoff in order and
retries an unaccepted block when the playback queue is full. An overrun restarts
the stream rather than joining discontinuous samples. Analysis remains independent of playback
availability and volume. DSP deliberately warms up again after loading a save;
saved tactical observations are retained.
Sonar controls include:
- `Shift+A`: transmit an active ping; the transmitter has a 30-second cooldown.
- `Shift+B`: select HMS or TAS as the receiving/transmitting array.
- `A` / `B` / `H`: select Broadband, Filtered or Heterodyne listening.
- `Y`: deploy or retrieve TAS.
- `U` / `V`: adjust TAS/VDS target depth after deployment.
- `Page Up` / `Page Down`: move through Broadband, LOFAR, DEMON, TMA,
Environment, and ACTIVE pages.
- `2` while already at Sonar: advance to the next sonar page.
TAS handling progresses only between 3 and 12 kn. Deployment takes six
simulation minutes, retrieval takes eight, and the fully streamed array needs
30 more seconds to settle before reaching full performance. Handling pauses
outside the 3-12 kn envelope. Exceeding 20 kn while the cable is out faults the
array for the rest of the current game. TAS depth is also constrained by ship
speed.
Selecting TAS does not make it available: a TAS ping can produce echoes only
after enough cable is streamed. Pressing `Shift+A` while TAS is unavailable is
rejected without transmitting or consuming the shared ping cooldown. TAS active
range is lower than HMS active range; its primary advantage is passive bearing
accuracy and performance against suitably layered contacts after it has
settled.
## Radar Notes
At OPZ/CIC, `Page Up` and `Page Down` select the ship-centred radar range of
**10, 20, 40, 80, or 120 NM**; they do not move or zoom the chart and do not
change pages or sensor power. The full-height, north-up OPZ chart has its own
camera: the mouse wheel zooms around the pointer down to a 5 NM radius, dragging
free chart space pans, and `K` toggles own-ship follow. Its initial view is about
a 40 NM radius. The event feed and telemetry continue collecting while hidden
on this station and reappear unchanged elsewhere. The modeled
clear-weather detection limits are 30 NM for surface radar and 100 NM for air
radar, with degradation from sea state 5 and rain clutter. Surface and air radar can be
controlled separately with `R` and `Shift+R`.
## Language and Options
On first launch, U-Jagd selects German for a German system locale and English
for English or unsupported locales. The options screen switches explicitly
between `en` and `de` and controls fullscreen, audio, large text, and tooltips.
Language, fullscreen, audio, large-text, and tooltip preferences are written to
`~/.u-jagd/settings.json`. Tooltip state is therefore global and is also stored
in v11 game saves for deterministic restoration of existing sessions.
## Commander LAN Co-op
Use **F10 > Commander LAN**, or **F9**, on the uConsole. Select an explicit
private IPv4 while the service is off, then enable it. Open the displayed URL on
each crew device. The default `127.0.0.1:8765` is local-only, not reachable from
another device. No router forwarding is needed or supported.
Alternatively, the uConsole can create a temporary WPA2 Remote Crew hotspot.
Install its narrowly scoped privileged helper once with
`sudo ./packaging/uconsole/install-hotspot-helper.sh`, select the hotspot network
mode in F9, and enable the service. U-Jagd generates a fresh SSID and Wi-Fi
password each time, starts the listener only after the private hotspot address is
ready, and stores neither credential. Stopping Remote Crew removes the hotspot
and restores the previous Wi-Fi connection. The game itself must not run with
`sudo`.
Pair using the six-character code: **three digits followed by three uppercase
letters**, for example `482KMT`. Five wrong guesses in a rolling minute
temporarily block further attempts. The displayed code remains valid for
additional crew until the host revokes access or the fifth failure rotates it.
Lowercase browser input is normalized to uppercase. The example is not a
functioning credential.
After pairing, each browser requests one or more stations. The host grants each
station exclusively; ordinary station operation is enabled on approval, while
sonar audio and direct fire remain separate grants. A browser displays one active
station at a time, requests another through **Add station**, and retains its other
leases for quick switching through the station selector. An approved added station
opens automatically. Every
command is revalidated on the main
simulation thread against station damage, observation freshness, inventory,
readiness, ROE, and the current world generation. Communication still relies on
external voice; no microphone or chat is included.
Sonar crew may stage target proposals and Bridge crew may stage course and speed
proposals. These requests never act directly: the host reviews and accepts or
rejects them locally. Browser alerts remain role-scoped. The separately
host-granted, read-only SimLog is a diagnostic exception and exposes detached
full-truth snapshots, including hidden units; reconnecting establishes a silent
event baseline rather than replaying old alarms.
While a browser owns a station lease, matching station input on the uConsole is
read-only. Host administration, pause, and switching to another station remain
available; revoking the lease restores local operation immediately.
The service starts **off on every launch**. Access and grants are not saved.
World replacement revokes active authority on the next main-thread frame. Manual
pause, focus loss, save/load, quit, nations, real editors, menus and splash lock
browser changes. With an active crew station, F1 help, the in-game F8 analyzer,
F9 crew administration and F10 options keep simulation and browser stations live.
Browser sonar sound requires an explicit host grant and a local user gesture;
reconnecting does not replay old audio. Its Broadband, Filtered, and Heterodyne
listening modes use the selected band, notch, and gain controls. Clicking or
tapping the Broadband waterfall sets Sonar's manual listening bearing; LOFAR
does not. The same local sound toggle also enables synthesized own-ship cavitation
noise on the Bridge; it uses only the projected cavitation warning and never
controls host audio.
Hover over an unavailable browser control to see its current localized reason,
such as a missing grant, damaged station, cooldown, empty inventory, pending
order, or the TAS handling-speed limit.
**Commander LAN security:** HTTP is unencrypted. Use only a trusted LAN. This
mode does not expose Internet hosting, wildcard binding, CDN, or remote crew
control of ROE/time/save. The separate web-host mode requires an HTTPS proxy
and a host login. See [Remote Crew setup](docs/commander-coop.md) and
[protocol/security](docs/commander-protocol.md).
## Editors and Current Limits
The main menu exposes a Mission Editor and Unit Editor. They provide read-only
built-in libraries, user-content browsing, validation, cloning, editable typed
fields, and a deterministic static mission preview. Mission authors can edit
exact placements, seeded random groups, objectives, and timed events. Unit
authors can create all six profile kinds and edit nested acoustic and list data
through safe structured input. `Ctrl+E` and `Ctrl+I` expose bundle export and
import. JSON templates under `data/editor_templates/` describe the accepted
schemas; user files are stored under `~/.u-jagd/missions/` and
`~/.u-jagd/units/`.
Validated does not mean runtime-effective. In release 1.0.0:
- A user mission can be started with `F5` from the Mission Editor browser only
when it uses the supported runtime subset.
- Effective mission values are the seed and name; 500 NM fixed-world placement
sectors; player position, course, and speed; sea state, start time, and
thermocline depth; exact built-in submarine and surface profiles with their
placement, course, speed, and submarine depth; and `sink` or `survive`
objectives with a time limit.
- A runtime mission must specify a 500 NM `fixed` world and `clear` weather.
Alternate world sizes and reference worlds are rejected. The editor's world
definition does not replace the game's coast dataset.
- Submarine placements must be hostile. For a `sink` objective, its target list
must exactly match all placed submarines.
- Random groups, timed events, `protect` and `reach` objectives, aircraft,
animals, torpedoes, decoys, and user-created unit profiles are rejected for
runtime play rather than silently ignored.
- Unit Editor output is validation/authoring data only. No user unit-profile
field currently changes the running simulation.
## Saves and User Data
Release 1.0.0 writes and loads save format **v11** only. V11 requires the exact
`u-jagd-save-v11` schema, including the current runtime catalog snapshot and all
deterministic continuation state. Older, newer, malformed, or incomplete saves
are rejected without replacing the running game.
The five slots are `~/.u-jagd/slot1.json` through `slot5.json`. Saves include a
snapshot of coastline geometry and synthetic bathymetry so an existing game is
not regenerated against a later world generator.
## World Data and Disclaimer
`data/coastlines/real_sectors.json.gz` contains exactly 128 prevalidated 500 NM
sectors derived from Natural Earth country geometry and a Wikidata airbase
coordinate snapshot. Real place, country, and military-base names and source
coordinates may therefore appear. Friendly, hostile, neutral, and civil roles
are assigned independently as fictional exercise roles and do not describe the
real states or facilities.
Bathymetry is synthetic and all tactical ranges, platform performance,
acoustics, affiliations, and exercise roles are game-model data. Nothing in the
repository is suitable for navigation, surveying, identification of real-world
capability, or operational planning. U-Jagd is not affiliated with or endorsed
by Natural Earth, Wikidata, their contributors, any platform manufacturer,
military organization, government, or source rights holder.
Exact provenance, versions, hashes, transformation notes, and licenses are in
[`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). Private WaveOps/MNW material
is not a repository source. No text, images, layouts, data, imitation,
transcription, or derived material from it is used.
## Development and Tests
The workstation/model review, delivered corrections, remaining modeling limits,
and hardware acceptance checklist are documented in
[`docs/workstation-review.md`](docs/workstation-review.md).
Current work is tracked in [`docs/plan-0.1.8.md`](docs/plan-0.1.8.md) and
[`docs/resume.md`](docs/resume.md). The completed 0.1.6 stabilization plan remains
available in [`docs/plan-0.1.6.md`](docs/plan-0.1.6.md).
Install the project and development dependency, then run the test suite:
```sh
python -m pip install -e '.[dev]'
pytest
```
Validate the generated contact catalog with:
```sh
python tools/gen_contacts.py --check
```
Build a wheel with a PEP 517 frontend:
```sh
python -m pip install build
python -m build
```
## License and Credits
Project code and project-specific documentation are licensed under the MIT
License; see [`LICENSE`](LICENSE). Pygame, NumPy, geographic source data, and any
future assets retain their own licenses and attribution requirements. See
[`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) and
[`assets/README.md`](assets/README.md).
+77
View File
@@ -0,0 +1,77 @@
# Drittanbieterhinweise
U-Jagd selbst steht unter der MIT-Lizenz. Die folgenden Laufzeitabhängigkeiten
werden nicht als Quellcode in diesem Repository geführt, sondern bei der
Installation separat bezogen. Sie unterliegen ihren eigenen Lizenzbedingungen.
## Python-Pakete
| Komponente | Verwendung | Projekt / Lizenzhinweis |
|---|---|---|
| Pygame | Fenster, Eingabe, Rendering und Audioausgabe | <https://www.pygame.org/>; überwiegend GNU LGPL 2.1, einzelne eingebundene Komponenten können abweichende kompatible Lizenzen besitzen |
| NumPy | numerische Berechnung und Audiosynthese | <https://numpy.org/>; BSD-3-Clause mit zusätzlichen Hinweisen für gebündelte Komponenten |
Die maßgeblichen Lizenztexte werden von den installierten Distributionen
mitgeliefert. Vor einer Weitergabe eines gebauten Pakets sind deren
Distributionsdateien und Lizenzverzeichnisse in der konkret verwendeten Version
zu prüfen und beizubehalten.
## Projektinhalte und Assets
- Das Repository enthält derzeit keine übernommenen Bild-, Audio- oder
Schriftdateien Dritter.
- Sonar-, Maschinen- und Alarmklänge werden zur Laufzeit algorithmisch aus
NumPy-Signalen synthetisiert. Anzeigen und Symbole werden durch Projektcode
gezeichnet; es werden keine vorgerenderten Medien ausgeliefert.
- `data/contacts/*.json` enthält für das Spiel erstellte Modellprofile. Namen
realer oder realistisch anmutender Plattformklassen bezeichnen keine
Übernahme geschützter Herstellerdaten und keine technische Verifikation.
- `data/coastlines/region.json` ist die feste, stilisierte Legacy-Kartenoption
und keine reale Navigations- oder Vermessungsquelle.
## Geografische Daten
`data/coastlines/real_sectors.json.gz` ist ein abgeleitetes Laufzeit-Dataset.
Seine im Katalog eingebettete, reproduzierbare Provenienz lautet exakt:
| Quelle | Stand und Rechte | Fixierung |
|---|---|---|
| Natural Earth | `Natural Earth 1:50m Admin 0 Countries v5.1.1`; Public Domain | Commit `9380cca83db5f9aef52d5e762765100745f84b27`; SHA-256 `3e458fc036ad0a66411f2c1e6cac49c5d7bfb81cb1123bc513b22511a2b7fdeb`; <https://github.com/nvkelso/natural-earth-vector> |
| Wikidata | `Wikidata airbase (Q695850) coordinate query snapshot`; CC0 1.0; abgerufen am `2026-09-06` | SHA-256 `f7126b7680afe9dcbb76ee8212ac82175e5b8e586f8fb3fafe57a071a8a6ffa9`; Abfrage: `?item wdt:P31/wdt:P279* wd:Q695850; wdt:P625 ?coord; optional P17` |
Die Build-Transformation lädt äußere Länderpolygone und englische bzw.
administrative Ländernamen, verwirft ohne topologisches Dateline-Splitting nicht
verarbeitbare Außenringe, projiziert Längen-/Breitengrade lokal
equirektangulär mit 60 NM je Breitengrad, schneidet und rundet Polygone auf
500 x 500 NM und entfernt sehr kleine Flächen. Kandidaten entstehen
deterministisch um reale Stützpunktkoordinaten. Es werden nur Sektoren mit
zusammenhängendem zentralem Fahrwasser, geeignetem Landanteil und mindestens
vier plausibel küstennahen Stützpunkten ausgewählt; eine 5-Grad-Zellenauswahl
begrenzt regionale Häufung. Pro Sektor bleiben höchstens zwölf stabil sortierte
Stützpunkteinträge. Das Ergebnis sind genau 128 vorvalidierte Sektoren; der Seed
wählt einen Katalogeintrag.
Geografische, Länder- und Militärstützpunktnamen sowie die Stützpunktkoordinaten
stammen aus diesen Quellen. Die Gameplay-Rollen `friendly`, `hostile`, `neutral`
und `civil` werden unabhängig von realen Staaten deterministisch als fiktionale
Übungsrollen vergeben. Bathymetrie stammt aus keiner geografischen Quelle: Sie
wird als 17-x-17-Raster synthetisch aus Küstenabstand, trigonometrischer
Variation und einem Sektor-Seed erzeugt. Sämtliche abgeleiteten Karten und
Tiefen sind nicht für Navigation, Vermessung oder reale Einsatzplanung geeignet.
Natural Earth, Wikidata, ihre Beitragenden und Rechteinhaber sind weder mit
U-Jagd verbunden noch unterstützen, billigen oder empfehlen sie das Projekt.
## Private Designreferenzen
Drei WaveOps-PDF-Dokumente wurden privat als Designreferenzen bereitgestellt.
Sie sind all-rights-reserved und nicht Bestandteil dieses Repositorys oder
eines Distributionspakets. Es werden weder Text noch Bilder, Gestaltung oder
Daten daraus gebündelt oder kopiert. Berücksichtigt wurde ausschließlich
abstrakte Inspiration für Arbeitsabläufe. Weitere Abgrenzung:
[`docs/design-references.md`](docs/design-references.md).
Für später hinzugefügte Medien gelten die Dokumentationsanforderungen in
[`assets/README.md`](assets/README.md). Markennamen und Produktnamen gehören
gegebenenfalls ihren jeweiligen Inhabern; ihre Nennung bedeutet keine
Verbindung, Billigung oder Empfehlung.
+25
View File
@@ -0,0 +1,25 @@
# Assets
Dieses Verzeichnis ist die vorgesehene Ablage für künftige Medien des Spiels.
Der aktuelle Stand benötigt keine externen Bild-, Schrift- oder Audiodateien:
- Oberfläche, CRT-Effekt und taktische Symbole werden zur Laufzeit mit Pygame
gezeichnet.
- Sonar-Pings, Maschinenklang, Warnsignale und Kontaktgeräusche werden zur
Laufzeit algorithmisch mit NumPy synthetisiert.
- Kontaktprofile und die stilisierte Küstenkarte liegen als Projektdaten unter
`data/`, nicht als Medien in diesem Verzeichnis.
Damit enthält `assets/` derzeit absichtlich nur diese Dokumentation.
## Anforderungen für neue Assets
Für jede später hinzugefügte Datei müssen Herkunft, Urheber, Lizenz, erlaubte
Bearbeitungen und gegebenenfalls ein Link zur Quelle dokumentiert werden. Die
Angaben gehören in `THIRD_PARTY_NOTICES.md` oder in eine eindeutig zugeordnete
Begleitdatei. Dateien ohne nachvollziehbare Weitergaberechte dürfen nicht in
Release-Artefakte aufgenommen werden.
Bevorzugt werden offene Formate und Lizenzen, die eine Weitergabe zusammen mit
dem MIT-lizenzierten Projekt erlauben. Eine kompatible Lizenz ersetzt nicht die
erforderliche Namensnennung oder den Lizenztext des jeweiligen Assets.
+38
View File
@@ -0,0 +1,38 @@
"""pytest-Setup: Projektroot auf sys.path + headlose SDL-Treiber."""
import os
import sys
from tempfile import TemporaryDirectory
import pytest
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
os.environ.setdefault("SDL_VIDEODRIVER", "dummy")
os.environ.setdefault("SDL_AUDIODRIVER", "dummy")
def pytest_configure(config):
from src.core import config as game_config
# Protect collection and session fixtures as well as individual tests.
saves = TemporaryDirectory(prefix="u-jagd-pytest-")
config.add_cleanup(saves.cleanup)
patch = pytest.MonkeyPatch()
config.add_cleanup(patch.undo)
patch.setattr(game_config, "SAVE_DIR", saves.name)
patch.setattr(game_config, "SAVE_PATH", os.path.join(saves.name, "save.json"))
@pytest.fixture(autouse=True)
def isolated_saves(tmp_path, monkeypatch):
from src.core import config
from src.core import preferences as preferences_module
saves = tmp_path / "saves"
saves.mkdir()
monkeypatch.setattr(config, "SAVE_DIR", str(saves))
monkeypatch.setattr(config, "SAVE_PATH", str(saves / "save.json"))
monkeypatch.setattr(
preferences_module, "default_preferences_path",
lambda: saves / "settings.json")
return saves
Binary file not shown.
+32
View File
@@ -0,0 +1,32 @@
{
"world_nm": 500.0,
"note": "Stilisierter Nordsee/Ostsee-Sektor. Koordinaten in NM, y nach Sueden.",
"landmasses": [
{"name": "Britannia", "nation": "ZIVIL", "points": [
[0,0],[30,0],[34,30],[28,60],[38,95],[33,130],[40,170],[30,210],[36,250],
[28,290],[34,330],[26,370],[32,410],[24,450],[30,480],[0,500],[0,0]]},
{"name": "Juetland", "nation": "HANSE", "points": [
[195,0],[240,0],[238,30],[246,60],[238,95],[248,130],[240,165],[226,195],
[216,225],[206,242],[198,238],[202,210],[194,175],[186,140],[192,100],
[184,60],[190,25],[195,0]]},
{"name": "Fellhorn", "nation": "HANSE", "points": [
[252,168],[268,172],[274,184],[268,196],[254,194],[248,182],[252,168]]},
{"name": "Gothem", "nation": "ZIVIL", "points": [
[372,150],[398,142],[420,152],[430,172],[426,196],[408,210],[384,206],
[370,190],[366,168],[372,150]]},
{"name": "Ostrand", "nation": "SKANDIA", "points": [
[402,38],[416,34],[424,48],[420,74],[410,86],[400,72],[398,52],[402,38]]},
{"name": "Kriegsklau", "nation": "ZIVIL", "points": [
[92,132],[102,130],[106,138],[100,146],[92,142],[92,132]]},
{"name": "Ostkueste", "nation": "BOREN", "points": [
[445,0],[500,0],[500,500],[470,500],[474,460],[462,420],[470,380],
[458,340],[466,300],[454,260],[462,220],[450,180],[458,140],[448,100],
[456,60],[448,25],[445,0]]}
],
"airbases": [
{"id": "ab_westhaven", "name": "WESTHAVEN", "nation": "HANSE", "x": 20.0, "y": 300.0},
{"id": "ab_nordhavn", "name": "NORDHAVN", "nation": "HANSE", "x": 208.0, "y": 90.0},
{"id": "ab_gothost", "name": "GOTH-OST", "nation": "BOREN", "x": 480.0, "y": 240.0},
{"id": "ab_ostland", "name": "OSTLAND", "nation": "SKANDIA", "x": 410.0, "y": 55.0}
]
}
+1
View File
@@ -0,0 +1 @@
"""Self-contained Commander browser resources; translations live in data.i18n."""
+98
View File
@@ -0,0 +1,98 @@
:root {
color-scheme: dark;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
font-size: clamp(15px, .3vw + 10px, 17px);
--bg: #0b151c;
--panel: #111f29;
--line: #30434e;
--text: #e9eee8;
--muted: #a7b9bf;
--accent: #a1e7cc;
--amber: #f3c577;
--red: #ff9090;
--blue: #81c5ff;
--surface: #14232e;
--control-bg: #162936;
--on-accent: #102b23;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; min-height: 100dvh; background: var(--bg); color: var(--text); overflow-wrap: anywhere; }
button, input, select { max-width: 100%; min-width: 0; font: inherit; color: inherit; }
button, input, select, .play-link { min-height: 2.7rem; padding: .55rem .75rem; border: 1px solid #536873; border-radius: .2rem; background: var(--control-bg); }
button { cursor: pointer; font-weight: 600; }
button:hover:not(:disabled), .play-link:hover { background: #29424d; border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover:not(:disabled) { background: #c3f4e1; color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h2 { color: var(--accent); font-size: .84rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.masthead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2rem; padding: 1.1rem 1.7rem; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.brand h1 { font-size: 1.3rem; font-weight: 650; letter-spacing: -.02em; }
.brand h1 span { font-weight: 350; }
.brand-mark { width: 2rem; height: 2rem; margin: .3rem; border: 1px solid var(--accent); display: inline-block; transform: rotate(45deg); position: relative; flex: 0 0 auto; }
.brand-mark::after { content: ""; position: absolute; inset: .4rem; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1.2rem; margin-left: auto; }
.play-link { display: inline-flex; align-items: center; color: var(--accent); font-weight: 600; text-decoration: none; }
.language { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .85rem; }
.language select { color: var(--text); }
.status { min-height: 2.5rem; padding: .6rem max(1.5rem, calc((100vw - 96rem) / 2)); border-bottom: 1px solid var(--line); background: #182d31; color: var(--accent); font-size: .85rem; }
.status:empty { color: transparent; }
.auth-layout { width: min(100%, 78rem); margin: 0 auto; padding: clamp(2rem, 8vh, 7rem) 1.5rem; }
.auth-layout:has(> section[hidden]:nth-child(2)):has(> section[hidden]:first-child) { display: none; }
.auth-card { width: min(100%, 32rem); margin: auto; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--panel); }
.auth-card h2 { margin-bottom: 1.4rem; font-size: 1rem; }
.auth-card form { display: grid; gap: .7rem; }
.auth-card label, .field > label { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.auth-card input { width: 100%; margin-bottom: .5rem; }
.auth-card button { margin-top: .5rem; }
.dashboard { width: min(100%, 96rem); margin: 0 auto; padding: clamp(1.2rem, 4vh, 3rem) 1.5rem 3rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .8rem; }
.card { min-width: 0; padding: clamp(1rem, 2vw, 1.5rem); border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--panel); }
.card h2 { margin-bottom: 1.2rem; }
.room-card, .proposal-card { min-height: 11rem; }
.room-code { display: grid; gap: .2rem; margin-bottom: 1.2rem; color: var(--muted); font-size: .82rem; }
.room-code strong { color: var(--text); font: 600 clamp(1.4rem, 2.5vw, 2rem) ui-monospace, monospace; letter-spacing: .13em; }
.crew-card, .options-card { grid-column: 1 / -1; }
#clients { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: .7rem; }
.client { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 1rem; border: 1px solid var(--line); border-left: 3px solid var(--blue); background: var(--surface); }
.client > strong { width: 100%; font-size: 1rem; }
.client > button { min-height: 2.2rem; padding: .35rem .6rem; font-size: .82rem; }
.client > button:first-of-type { border-color: #8b5a5a; color: var(--red); }
.station { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; width: 100%; min-width: 0; padding: .65rem 0; border-top: 1px solid var(--line); }
.station > span { width: 100%; color: var(--muted); font-size: .82rem; font-weight: 600; }
.station button { min-height: 2.2rem; padding: .35rem .6rem; font-size: .82rem; }
#proposals:empty, #clients:empty { color: var(--muted); }
#proposals > .station:first-child { border-top: 0; padding-top: 0; }
#proposals > .station > span { color: var(--text); font-weight: 400; }
#proposals:not(:has(.station)) { color: var(--muted); }
#options-form { display: grid; gap: 1.2rem; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: .8rem; }
.field { min-width: 0; display: grid; align-content: start; gap: .45rem; }
.field > select { width: 100%; }
.field-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.field-actions input { flex: 1 1 14rem; }
.field-actions button { flex: 0 0 auto; }
.toggle { display: flex; align-items: center; gap: .7rem; min-width: 0; min-height: 2.7rem; padding: .55rem .75rem; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .85rem; line-height: 1.35; }
.toggle input { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; accent-color: var(--accent); }
.feed-field { min-width: 0; }
.feed-status { margin-top: .4rem; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.feed-status[data-status="connected"] { color: var(--accent); }
.feed-status[data-status="rate_limited"], .feed-status[data-status="no_geography"] { color: var(--amber); }
.feed-status[data-status="auth_error"], .feed-status[data-status="error"] { color: var(--red); }
.form-footer { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
#options-status { color: var(--accent); font-size: .85rem; }
@media (max-width: 760px) {
.masthead { padding: .8rem 1rem; }
.header-actions { width: 100%; justify-content: space-between; margin-left: 0; }
.status { padding-inline: 1rem; }
.dashboard { grid-template-columns: minmax(0, 1fr); padding: 1rem; }
.room-card, .proposal-card { min-height: 0; }
.crew-card, .options-card { grid-column: 1; }
.option-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
.header-actions { align-items: stretch; }
.language { flex-wrap: wrap; }
.field-actions button { width: 100%; }
}
+88
View File
@@ -0,0 +1,88 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self'; connect-src 'self'; img-src 'self'; font-src 'none'; media-src 'none'; object-src 'none'; base-uri 'none'; form-action 'self'">
<title>U-Jagd Web Host</title>
<link rel="stylesheet" href="/admin.css">
<script src="/admin.js" defer></script>
</head>
<body>
<header class="masthead">
<div class="brand">
<span class="brand-mark" aria-hidden="true"></span>
<h1>U-Jagd <span data-i18n="admin_title"></span></h1>
</div>
<div class="header-actions">
<nav><a class="play-link" href="/" data-i18n="admin_play"></a></nav>
<label class="language"><span data-i18n="language"></span>
<select id="language"><option value="en">English</option><option value="de">Deutsch</option></select>
</label>
</div>
</header>
<p id="message" class="status" role="status" aria-live="polite"></p>
<div class="auth-layout">
<section id="setup" class="auth-card" hidden>
<h2 data-i18n="admin_setup"></h2>
<form id="setup-form">
<label for="setup-code" data-i18n="admin_setup_code"></label>
<input id="setup-code" autocomplete="off" required>
<label for="setup-password" data-i18n="admin_password"></label>
<input id="setup-password" type="password" minlength="12" maxlength="256" autocomplete="new-password" required>
<button class="primary" type="submit" data-i18n="admin_setup_submit"></button>
</form>
</section>
<section id="login" class="auth-card" hidden>
<h2 data-i18n="admin_login"></h2>
<form id="login-form">
<label for="login-password" data-i18n="admin_password"></label>
<input id="login-password" type="password" autocomplete="current-password" required>
<button class="primary" type="submit" data-i18n="admin_login_submit"></button>
</form>
</section>
</div>
<main id="room" class="dashboard" hidden>
<section class="card room-card">
<h2 data-i18n="admin_room"></h2>
<div class="room-code"><span data-i18n="admin_room_code"></span><strong id="room-code"></strong></div>
<button id="rotate-code" type="button" data-i18n="admin_rotate_code"></button>
</section>
<section class="card proposal-card">
<h2 data-i18n="admin_proposals"></h2>
<div id="proposals"></div>
</section>
<section class="card crew-card">
<h2 data-i18n="admin_clients"></h2>
<div id="clients"></div>
</section>
<section class="card options-card">
<h2 data-i18n="admin_options"></h2>
<form id="options-form">
<div class="option-grid">
<div class="field">
<label for="option-language" data-i18n="language"></label>
<select id="option-language"><option value="en">English</option><option value="de">Deutsch</option></select>
</div>
<label class="toggle"><input id="option-simlog" type="checkbox"><span data-i18n="admin_simlog"></span></label>
<label class="toggle"><input id="option-voice" type="checkbox"><span data-i18n="admin_voice"></span></label>
<div class="feed-field"><label class="toggle"><input id="option-ais" type="checkbox"><span data-i18n="admin_live_ais"></span></label><p id="option-ais-status" class="feed-status" role="status"></p></div>
<div class="feed-field"><label class="toggle"><input id="option-adsb" type="checkbox"><span data-i18n="admin_live_adsb"></span></label><p id="option-adsb-status" class="feed-status" role="status"></p></div>
<div class="field">
<label for="option-ais-key" data-i18n="admin_ais_key"></label>
<div class="field-actions"><input id="option-ais-key" type="password" maxlength="256" autocomplete="off"><button id="clear-ais-key" type="button" data-i18n="admin_clear_key"></button></div>
</div>
<div class="field">
<label for="option-opensky-key" data-i18n="admin_opensky_key"></label>
<div class="field-actions"><input id="option-opensky-key" type="password" maxlength="256" autocomplete="off"><button id="clear-opensky-key" type="button" data-i18n="admin_clear_key"></button></div>
</div>
</div>
<div class="form-footer"><button class="primary" type="submit" data-i18n="admin_options_save"></button><p id="options-status" role="status"></p></div>
</form>
</section>
</main>
</body>
</html>
+182
View File
@@ -0,0 +1,182 @@
"use strict";
const $ = (id) => document.getElementById(id);
let strings = {}, csrf = "", lastRoom = null;
const t = (key) => strings[`commander.web.${key}`] || key;
async function api(path, body) {
const options = {credentials:"same-origin", cache:"no-store"};
if (body !== undefined) {
options.method="POST";
options.headers={"Content-Type":"application/json",
"X-U-Jagd-Request-ID":crypto.randomUUID()};
if (csrf) options.headers["X-U-Jagd-CSRF"]=csrf;
options.body=JSON.stringify(body);
}
const response=await fetch(path, options);
let value={};
try { value=await response.json(); } catch (_) {}
if (!response.ok) {
const key=`commander.web.admin_error_${value.error}`;
throw new Error(strings[key] || t("admin_error_generic"));
}
return value;
}
function say(value) { $("message").textContent=value; }
function button(label, handler) {
const element=document.createElement("button");
element.type="button"; element.textContent=t(label); element.addEventListener("click", handler);
return element;
}
async function action(name, client_id="", station="", value=false) {
try {
const queued=await api("/api/v2/web/admin", {action:name, client_id, station, value});
const result=await waitResult(queued.id);
say(result===true || result?.ok===true?t("admin_applied"):t("admin_failed"));
await refresh();
}
catch (error) { say(error.message); }
}
function render(room) {
lastRoom=room; csrf=room.csrf; $("room").hidden=false; $("setup").hidden=true; $("login").hidden=true;
$("room-code").textContent=room.code;
const clients=$("clients"); clients.replaceChildren();
for (const client of room.clients) {
const article=document.createElement("article"); article.className="client";
const name=document.createElement("strong"); name.textContent=client.name; article.append(name);
article.append(button("admin_revoke_client",()=>action("revoke_client",client.client_id)));
const simlog=button(client.simlog?"admin_disable":"admin_enable",
()=>action("simlog",client.client_id,"",!client.simlog));
simlog.textContent=`${t("admin_simlog_grant")}: ${t(client.simlog?"admin_disable":"admin_enable")}`;
article.append(simlog);
for (const [station, detail] of Object.entries(client.stations)) {
if (!detail.requested && !detail.leased) continue;
const row=document.createElement("div"); row.className="station";
const label=document.createElement("span"); label.textContent=t(`station_${station}`); row.append(label);
if (detail.requested || detail.leased) row.append(button("admin_assign",()=>action("assign",client.client_id,station)));
if (detail.leased) {
row.append(button("admin_revoke",()=>action("revoke",client.client_id,station)));
for (const capability of ["command","direct_fire","sonar_audio"]) {
if (capability==="direct_fire" && !["weapons","opz","helicopter"].includes(station)) continue;
if (capability==="sonar_audio" && station!=="sonar") continue;
const current=detail.grants[capability];
const control=button(current?"admin_disable":"admin_enable",
()=>action(capability,client.client_id,station,!current));
control.textContent=`${t(`admin_${capability}`)}: ${t(current?"admin_disable":"admin_enable")}`;
row.append(control);
}
}
article.append(row);
}
clients.append(article);
}
const proposals=$("proposals"); proposals.replaceChildren();
for (const [kind, proposal] of Object.entries(room.proposals||{})) {
if (!proposal || proposal.status!=="pending") continue;
const row=document.createElement("div"); row.className="station";
const detail=document.createElement("span");
detail.textContent=kind==="target"?`${t("admin_target")}: ${proposal.label}`:
`${t("admin_navigation")}: ${proposal.course??"-"}° / ${proposal.speed_kn??"-"} kn`;
row.append(detail,button("admin_accept",()=>action(kind==="target"?"accept_target":"accept_navigation")),
button("admin_reject",()=>action(kind==="target"?"reject_target":"reject_navigation")));
proposals.append(row);
}
if (!proposals.children.length) proposals.textContent=t("admin_no_proposals");
}
async function refresh() {
try { render(await api("/api/v2/web/room")); }
catch (_) {
csrf=""; $("room").hidden=true;
const status=await api("/api/v2/web/status");
$("setup").hidden=status.configured; $("login").hidden=!status.configured;
}
}
async function language(value) {
strings=await api(`/api/v2/ui?lang=${value}`);
document.documentElement.lang=value;
for (const element of document.querySelectorAll("[data-i18n]")) element.textContent=t(element.dataset.i18n);
for (const element of document.querySelectorAll("[data-i18n-aria]"))
element.setAttribute("aria-label",t(element.dataset.i18nAria));
if (lastRoom) render(lastRoom);
for (const element of document.querySelectorAll(".feed-status[data-status]"))
element.textContent=t(`admin_live_status_${element.dataset.status}`);
}
function renderLiveStatus(state) {
for (const [id, key] of [["option-ais-status", "live_ais_status"],
["option-adsb-status", "live_adsb_status"]]) {
const element=$(id), status=state[key]||"unavailable";
element.dataset.status=status;
element.textContent=t(`admin_live_status_${status}`);
}
}
async function loadLiveStatus() { renderLiveStatus(await api("/api/v2/web/options")); }
async function loadOptions() {
const state=await api("/api/v2/web/options");
$("option-language").value=state.language;
$("option-simlog").checked=state.simlog;
$("option-voice").checked=state.voice_enabled;
$("option-ais").checked=state.live_ais_enabled;
$("option-adsb").checked=state.live_adsb_enabled;
$("option-ais-key").placeholder=state.aisstream_api_key_set?t("admin_key_saved"):"";
$("option-opensky-key").placeholder=state.opensky_credentials_set?t("admin_key_saved"):"";
renderLiveStatus(state);
}
async function waitResult(id) {
for (let attempt=0; attempt<20; attempt++) {
await new Promise((resolve)=>setTimeout(resolve,250));
const room=await api("/api/v2/web/room");
if (Object.hasOwn(room.results,id)) return room.results[id];
}
return {ok:false,error:"pending"};
}
$("options-form").addEventListener("submit",async(event)=>{
event.preventDefault();
const fields=[
["language",$("option-language").value],
["simlog",$("option-simlog").checked],
["voice_enabled",$("option-voice").checked],
["live_ais_enabled",$("option-ais").checked],
["live_adsb_enabled",$("option-adsb").checked],
];
if ($("option-ais-key").value) fields.push(["aisstream_api_key",$("option-ais-key").value]);
if ($("option-opensky-key").value) fields.push(["opensky_credentials",$("option-opensky-key").value]);
try {
for (const [name,value] of fields) {
const queued=await api("/api/v2/web/options",{name,value});
const result=await waitResult(queued.id);
if (!result.ok) throw new Error(result.error||t("admin_options_failed"));
}
$("option-ais-key").value=""; $("option-opensky-key").value="";
$("options-status").textContent=t("admin_options_saved");
await loadOptions();
} catch(error) { $("options-status").textContent=error.message; }
});
for (const [id,name] of [["clear-ais-key","aisstream_api_key"],
["clear-opensky-key","opensky_credentials"]]) {
$(id).addEventListener("click",async()=>{
if (!confirm(t("admin_confirm_clear_key"))) return;
try {
const queued=await api("/api/v2/web/options",{name,value:""});
const result=await waitResult(queued.id);
if (!result.ok) throw new Error(result.error||t("admin_options_failed"));
await loadOptions(); $("options-status").textContent=t("admin_options_saved");
} catch(error) { $("options-status").textContent=error.message; }
});
}
$("language").value=(navigator.language||"").startsWith("de")?"de":"en";
$("language").addEventListener("change",()=>language($("language").value));
$("setup-form").addEventListener("submit",async(event)=>{
event.preventDefault();
try { await api("/api/v2/web/setup",{code:$("setup-code").value,password:$("setup-password").value}); $("setup-password").value=""; await refresh(); }
catch(error) { say(error.message); }
});
$("login-form").addEventListener("submit",async(event)=>{
event.preventDefault();
try { const session=await api("/api/v2/web/login",{password:$("login-password").value}); $("login-password").value=""; csrf=session.csrf; await refresh(); await loadOptions(); }
catch(error) { say(error.message); }
});
$("rotate-code").addEventListener("click",()=>action("rotate_code"));
Promise.all([language($("language").value), refresh()]).then(()=>{
if (!$("room").hidden) loadOptions().catch((error)=>say(error.message));
});
setInterval(()=>{if(!$("room").hidden) {
refresh(); loadLiveStatus().catch(()=>{});
}},3000);
File diff suppressed because it is too large. Load diff
+263
View File
@@ -0,0 +1,263 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self'; connect-src 'self'; img-src 'self'; font-src 'none'; media-src 'none'; object-src 'none'; base-uri 'none'; form-action 'self'">
<title>U-Jagd Commander</title>
<link rel="stylesheet" href="./style.css">
<script src="./app.js" defer></script>
<script src="./voice.js" defer></script>
</head>
<body>
<div id="bootstrap" class="bootstrap"><span class="brand-mark" aria-hidden="true"></span><strong>U-Jagd Commander</strong><span class="loading" role="progressbar" data-i18n-aria="loading"></span></div>
<div id="shell" hidden>
<div id="toast-region" aria-hidden="true"></div>
<header class="masthead">
<div class="brand"><span class="brand-mark" aria-hidden="true"></span><div><strong>U-Jagd <span>Commander</span></strong><p data-i18n="subtitle"></p></div></div>
<div class="preferences">
<label class="language"><span data-i18n="language"></span><select id="language"><option value="en" data-i18n="english"></option><option value="de" data-i18n="german"></option></select></label>
<button id="sound" type="button" aria-pressed="false" data-i18n="sound_off"></button>
<label class="volume"><span data-i18n="volume"></span><input id="volume" type="range" min="0" max="100" value="25"></label>
<div class="voice-controls" role="group" data-i18n-aria="voice_group"><button id="voice-enable" type="button" disabled data-i18n="voice_start"></button><button id="voice-stop" type="button" disabled data-i18n="voice_stop"></button><button id="voice-ptt" type="button" disabled aria-pressed="false" data-i18n="voice_ptt"></button><span id="voice-status" role="status" aria-live="polite"></span></div>
<button id="disabled-control-explain" type="button" aria-expanded="false" aria-controls="disabled-control-help" data-i18n-aria="disabled_control_explain" hidden>?</button>
<button id="disconnect" type="button" class="quiet" data-i18n="disconnect" hidden></button>
</div>
</header>
<p id="connection" class="connection" role="status" aria-live="polite"></p>
<p id="disabled-control-help" class="disabled-control-help" role="status" aria-live="polite" hidden></p>
<section id="pairing" class="pairing">
<div class="pair-intro"><p class="eyebrow" data-i18n="pair_eyebrow"></p><h1 data-i18n="pair_title"></h1><p data-i18n="pair_intro"></p><div class="scope-note"><span class="scope-line" aria-hidden="true"></span><p data-i18n="authority_note"></p></div></div>
<form id="pair-form" class="pair-card">
<h2 data-i18n="pair_heading"></h2><p id="pair-help" data-i18n="pair_help"></p>
<label for="name" data-i18n="pair_name"></label><input id="name" name="name" type="text" required minlength="1" maxlength="32" autocomplete="name" data-i18n-placeholder="pair_name_default">
<label for="code" data-i18n="pair_code"></label><input id="code" name="code" type="text" required maxlength="6" pattern="[0-9]{3}[A-Za-z]{3}" placeholder="482KMT" aria-describedby="pair-help" autocomplete="off" autocapitalize="characters" spellcheck="false">
<button id="pair-submit" class="primary" type="submit" data-i18n="pair_submit"></button><p id="pair-error" class="error" role="alert"></p>
<p class="fine" data-i18n="pair_security"></p>
</form>
</section>
<main id="lobby" class="lobby" hidden>
<header class="lobby-heading"><p class="eyebrow" data-i18n="lobby_eyebrow"></p><h1 data-i18n="lobby_title"></h1><p data-i18n="lobby_intro"></p><button id="lobby-back" type="button" data-i18n="lobby_back" hidden></button></header>
<p id="lobby-status" class="lobby-status" role="status" aria-live="polite"></p>
<div id="station-cards" class="station-cards" data-i18n-aria="lobby_stations"></div>
</main>
<aside id="role-rail" class="role-rail" hidden aria-labelledby="role-rail-title">
<p class="eyebrow" data-i18n="role_assigned"></p><h2 id="role-rail-title"></h2><p id="role-grants" class="fine"></p><button id="add-station" type="button" data-i18n="role_add_station"></button><button id="release-station" type="button" data-i18n="role_release"></button><p id="role-status" role="status" aria-live="polite"></p>
</aside>
<section id="mobile-role" class="mobile-role" hidden>
<label for="mobile-station" data-i18n="role_assigned"></label><select id="mobile-station" disabled></select><button id="mobile-add-station" type="button" data-i18n="role_add_station"></button><button id="mobile-release-station" type="button" data-i18n="role_release"></button>
</section>
<section id="host-screen" class="host-screen" hidden aria-labelledby="host-screen-title">
<div class="host-screen-card"><p class="eyebrow" data-i18n="host_eyebrow"></p><h1 id="host-screen-title" data-i18n="host_menu_title"></h1><p data-i18n="host_menu_note"></p><div class="host-screen-actions"><button id="host-screen-new" type="button" class="primary" data-i18n="host_new"></button><button id="host-screen-load" type="button" data-i18n="host_load"></button></div><p id="host-screen-status" class="host-status" role="status" aria-live="polite"></p></div>
</section>
<main id="operations" hidden>
<div class="tablist" role="tablist" data-i18n-aria="tabs">
<div id="workstation-station-label" class="workstation-station" hidden><div id="station-tabs" class="station-tabs" role="tablist" data-i18n-aria="station_tabs"></div><button id="workstation-add-station" type="button" data-i18n="role_add_station"></button></div>
<details id="workstation-tools" hidden><summary data-i18n="workstation_tools"></summary><div class="workstation-menu"><button id="workstation-help" type="button" data-i18n="workstation_help"></button><button id="workstation-library" type="button" data-i18n="workstation_library"></button><button id="workstation-lookout" type="button" data-i18n="workstation_lookout"></button><button id="workstation-release" type="button" data-i18n="role_release"></button></div></details>
<button id="tab-operations" type="button" role="tab" aria-selected="true" aria-controls="panel-operations" tabindex="0" data-i18n="tab_operations"></button>
<button id="tab-lookout" type="button" role="tab" aria-selected="false" aria-controls="panel-lookout" tabindex="-1" data-i18n="tab_lookout"></button>
<button id="tab-guide" type="button" role="tab" aria-selected="false" aria-controls="panel-guide" tabindex="-1" data-i18n="tab_guide"></button>
<button id="tab-contacts" type="button" role="tab" aria-selected="false" aria-controls="panel-contacts" tabindex="-1" data-i18n="tab_contacts"></button>
</div>
<div class="tab-deck">
<section id="panel-operations" class="tab-panel operations-panel" role="tabpanel" aria-labelledby="tab-operations" tabindex="0">
<section class="mission-strip" data-i18n-aria="mission">
<div class="mission-name"><p class="eyebrow" data-i18n="mission"></p><h1 id="mission-name"></h1><p id="objective"></p></div>
<dl id="mission-metrics" class="metrics"></dl>
<div class="session"><span id="phase" class="badge"></span><p id="command-permission"></p><p id="autocrew-status"></p></div>
<div id="host-bar" class="host-bar" role="group" data-i18n-aria="host_bar" hidden><a id="web-admin-link" href="/admin" data-i18n="admin_room" hidden></a><button id="host-pause" type="button" aria-pressed="false" data-i18n="host_pause"></button><button id="host-save" type="button" data-i18n="host_save"></button><button id="host-load" type="button" data-i18n="host_load"></button><button id="host-new" type="button" data-i18n="host_new"></button><button id="host-instructor" type="button" data-i18n="instructor_open"></button><span id="host-status" class="host-status" role="status" aria-live="polite"></span></div>
</section>
<section id="station-view" class="station-view" aria-label="" data-i18n-aria="station_view" hidden>
<section id="station-bridge" class="station-section" data-station-role="bridge" aria-labelledby="station-bridge-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-bridge-title" data-i18n="station_bridge"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="bridge_navigation_title"></h3><dl id="bridge-navigation" class="detail-metrics"></dl></article><article class="station-card-view"><h3 data-i18n="station_orders"></h3><dl id="bridge-orders-summary" class="detail-metrics"></dl></article><article class="station-card-view bridge-weather"><h3 data-i18n="weather_picture"></h3><canvas id="bridge-weather-canvas" width="360" height="120" data-i18n-aria="weather_picture"></canvas><p id="bridge-weather-text" class="fine"></p></article><article class="station-card-view"><h3 data-i18n="station_tactical_summary"></h3><div id="bridge-tactical" class="station-list"></div></article></div></section>
<section id="station-sonar" class="station-section" data-station-role="sonar" aria-labelledby="station-sonar-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-sonar-title" data-i18n="station_sonar"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="station_settings"></h3><dl id="sonar-settings" class="detail-metrics"></dl></article><article class="station-card-view station-controls station-wide"><h3 data-i18n="sonar_controls"></h3><label for="sonar-control-page" data-i18n="sonar_control_page"></label><select id="sonar-control-page"><option value="listen" data-i18n="sonar_page_listen"></option><option value="array" data-i18n="sonar_page_array"></option><option value="analysis" data-i18n="sonar_page_analysis"></option></select><div class="control-page" data-sonar-page="listen"><form id="sonar-bearing-form" class="control-form"><label for="sonar-bearing" data-i18n="sonar_listen_bearing"></label><input id="sonar-bearing" type="number" min="0" max="359.99999999999994" step="any" inputmode="decimal" autocomplete="off" required><button id="sonar-bearing-submit" type="submit" data-i18n="sonar_set_bearing"></button></form><button id="sonar-clear-focus" type="button" data-i18n="sonar_clear_focus"></button><button id="sonar-ping" type="button" data-i18n="sonar_ping"></button></div><div class="control-page" data-sonar-page="array" hidden><label for="sonar-array-mode" data-i18n="sonar_array_mode"></label><select id="sonar-array-mode"><option value="BOW" data-i18n="sonar_bow"></option><option value="TOWED" data-i18n="sonar_towed"></option></select><button id="sonar-array-apply" type="button" data-i18n="apply"></button><button id="sonar-tas" type="button"></button><form id="sonar-depth-form" class="control-form"><label for="sonar-depth" data-i18n="sonar_tow_depth"></label><input id="sonar-depth" type="number" min="20" max="260" step="any" inputmode="decimal" autocomplete="off" required><button id="sonar-depth-submit" type="submit" data-i18n="sonar_set_depth"></button></form><button id="sonar-bt" type="button" data-i18n="sonar_bt"></button></div><div class="control-page" data-sonar-page="analysis" hidden><label class="toggle"><input id="sonar-tma" type="checkbox"><span data-i18n="sonar_tma"></span></label><label class="toggle"><input id="sonar-notch" type="checkbox"><span data-i18n="sonar_notch"></span></label><label class="toggle"><input id="sonar-peak" type="checkbox"><span data-i18n="sonar_peak_hold"></span></label><form id="sonar-gain-form" class="control-form"><label for="sonar-gain" data-i18n="sonar_gain"></label><input id="sonar-gain" type="number" min="-12" max="24" step="any" inputmode="decimal" autocomplete="off" required><button id="sonar-gain-submit" type="submit" data-i18n="apply"></button></form><label for="sonar-band" data-i18n="sonar_band"></label><select id="sonar-band"><option value="FULL">FULL</option><option value="LOW">LOW</option><option value="SHAFT">SHAFT</option><option value="MID">MID</option></select><button id="sonar-band-apply" type="button" data-i18n="apply"></button><form id="sonar-harmonic-form" class="control-form"><label for="sonar-harmonic-input" data-i18n="sonar_harmonic_frequency"></label><input id="sonar-harmonic-input" type="number" min="0.000001" max="300" step="any" inputmode="decimal" autocomplete="off" list="sonar-harmonic-candidates"><datalist id="sonar-harmonic-candidates"></datalist><button id="sonar-harmonic-submit" type="submit" data-i18n="sonar_set_harmonic"></button><button id="sonar-harmonic-clear" type="button" data-i18n="sonar_clear_harmonic"></button></form></div></article><article class="station-card-view station-wide"><h3 data-i18n="station_observations"></h3><div id="sonar-observations" class="station-list"></div></article></div></section>
<section id="station-weapons" class="station-section" data-station-role="weapons" aria-labelledby="station-weapons-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-weapons-title" data-i18n="station_weapons"></h2></div><div class="station-grid"><article class="station-card-view card-readout"><h3 data-i18n="inventory"></h3><dl id="weapons-inventory" class="detail-metrics"></dl></article><article class="station-card-view card-readout"><h3 data-i18n="station_readiness"></h3><dl id="weapons-readiness" class="detail-metrics"></dl></article><article class="station-card-view card-readout"><h3 data-i18n="weapons_tubes"></h3><div id="weapons-tubes" class="station-list compact-list"></div></article><article class="station-card-view card-readout"><h3 data-i18n="station_designated_target"></h3><div id="weapons-target" class="station-list"></div></article><article class="station-card-view station-wide direct-fire-controls" aria-labelledby="weapons-fire-title"><h3 id="weapons-fire-title" data-i18n="weapons_fire_control"></h3><div class="fire-grid"><label for="weapons-fire-target" data-i18n="fire_target"></label><select id="weapons-fire-target"></select><label for="weapons-fire-depth" data-i18n="fire_depth"></label><input id="weapons-fire-depth" type="number" min="10" max="300" step="any" inputmode="decimal" autocomplete="off"><button id="weapons-fire-torpedo" type="button" data-fire-action="weapons_launch_torpedo" data-i18n="weapons_launch_torpedo"></button><button id="weapons-fire-helicopter" type="button" data-fire-action="helicopter_launch_torpedo" data-i18n="helicopter_launch_torpedo"></button><button id="weapons-fire-nixie" type="button" data-fire-action="weapons_deploy_nixie" data-i18n="weapons_deploy_nixie"></button></div><p id="weapons-fire-status" class="fire-status" role="status" aria-live="polite"></p></article><article class="station-card-view station-wide card-readout"><h3 data-i18n="station_own_weapons"></h3><div id="weapons-own" class="station-list"></div></article></div></section>
<section id="station-damage" class="station-section" data-station-role="damage" aria-labelledby="station-damage-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-damage-title" data-i18n="station_damage"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="station_damage_summary"></h3><dl id="damage-summary" class="detail-metrics"></dl></article><article class="station-card-view"><h3 data-i18n="station_damage_teams"></h3><div id="damage-teams" class="station-list"></div></article><article class="station-card-view station-wide"><h3 data-i18n="station_compartments"></h3><div id="damage-compartments" class="station-list"></div></article></div></section>
<section id="station-opz" class="station-section" data-station-role="opz" aria-labelledby="station-opz-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-opz-title" data-i18n="station_opz"></h2></div><div class="station-grid"><article class="station-card-view card-readout"><h3 data-i18n="station_radar"></h3><dl id="opz-radar-summary" class="detail-metrics"></dl></article><article class="station-card-view card-readout"><h3 data-i18n="opz_asm_defense"></h3><dl id="opz-defense" class="detail-metrics"></dl></article><article class="station-card-view station-wide direct-fire-controls" aria-labelledby="opz-fire-title"><h3 id="opz-fire-title" data-i18n="opz_asm_engagement"></h3><div class="fire-grid"><label for="opz-fire-target" data-i18n="fire_target"></label><select id="opz-fire-target"></select><button id="opz-fire-essm" type="button" data-fire-action="opz_launch_essm" data-i18n="opz_launch_essm"></button><button id="opz-fire-chaff" type="button" data-fire-action="opz_launch_chaff" data-i18n="opz_launch_chaff"></button></div><p id="opz-fire-status" class="fire-status" role="status" aria-live="polite"></p></article><article class="station-card-view card-readout"><h3 data-i18n="station_own_assets"></h3><div id="opz-assets" class="station-list"></div></article><article class="station-card-view card-readout"><h3 data-i18n="station_source_classifications"></h3><div id="opz-classifications" class="station-list"></div></article><article class="station-card-view card-readout"><h3 data-i18n="station_fusions"></h3><div id="opz-fusions" class="station-list"></div></article><article class="station-card-view station-wide card-readout"><h3 data-i18n="station_observations"></h3><div id="opz-observations" class="station-list"></div></article></div></section>
<section id="station-radio" class="station-section" data-station-role="radio" aria-labelledby="station-radio-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-radio-title" data-i18n="station_radio"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="station_observations"></h3><div id="radio-observations" class="station-list"></div></article><article class="station-card-view"><h3 data-i18n="station_logged_fixes"></h3><div id="radio-fixes" class="station-list"></div></article><article class="station-card-view"><h3 data-i18n="station_logged_bearings"></h3><div id="radio-bearings" class="station-list"></div></article><article class="station-card-view"><h3 data-i18n="station_messages"></h3><div id="radio-messages" class="station-list"></div></article></div></section>
<section id="station-engine" class="station-section" data-station-role="engine" aria-labelledby="station-engine-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-engine-title" data-i18n="station_engine"></h2></div><div class="station-grid"><article class="station-card-view card-readout"><h3 data-i18n="station_propulsion"></h3><dl id="engine-propulsion" class="detail-metrics"></dl></article><article class="station-card-view card-readout"><h3 data-i18n="station_machinery"></h3><dl id="engine-machinery" class="detail-metrics"></dl></article><article class="station-card-view card-readout"><h3 data-i18n="station_environment_effects"></h3><dl id="engine-environment" class="detail-metrics"></dl></article><article class="station-card-view station-controls station-wide card-controls"><h3 data-i18n="engine_controls"></h3><label for="engine-telegraph" data-i18n="telegraph"></label><select id="engine-telegraph"></select><button id="engine-telegraph-submit" type="button" data-i18n="engine_order_telegraph"></button><form id="engine-course-form" class="control-form"><label for="engine-course" data-i18n="engine_course"></label><input id="engine-course" type="number" min="0" max="359.99999999999994" step="any" inputmode="decimal" autocomplete="off" required><button id="engine-course-submit" type="submit" data-i18n="engine_order_course"></button></form><form id="engine-speed-form" class="control-form"><label for="engine-speed" data-i18n="engine_speed"></label><input id="engine-speed" type="number" min="0" max="25" step="any" inputmode="decimal" autocomplete="off" required><button id="engine-speed-submit" type="submit" data-i18n="engine_order_speed"></button></form><button id="engine-quiet" type="button"></button></article></div></section>
<section id="station-helicopter" class="station-section" data-station-role="helicopter" aria-labelledby="station-helicopter-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-helicopter-title" data-i18n="station_helicopter"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="station_asset"></h3><dl id="helicopter-asset" class="detail-metrics"></dl></article><article class="station-card-view"><h3 data-i18n="station_readiness"></h3><dl id="helicopter-readiness" class="detail-metrics"></dl></article><article class="station-card-view"><h3 data-i18n="station_waypoint"></h3><dl id="helicopter-waypoint" class="detail-metrics"></dl><form id="helicopter-waypoint-form" class="control-form"><label for="helicopter-x" data-i18n="helicopter_x"></label><input id="helicopter-x" type="number" min="0" max="1000" step="any" inputmode="decimal" autocomplete="off" required><label for="helicopter-y" data-i18n="helicopter_y"></label><input id="helicopter-y" type="number" min="0" max="1000" step="any" inputmode="decimal" autocomplete="off" required><button id="helicopter-waypoint-submit" type="submit" data-i18n="helicopter_set_waypoint"></button></form></article><article class="station-card-view station-controls"><h3 data-i18n="helicopter_controls"></h3><button id="helicopter-launch" type="button" data-i18n="helicopter_launch"></button><button id="helicopter-return" type="button" data-i18n="helicopter_return"></button><button id="helicopter-buoy" type="button" data-i18n="helicopter_buoy"></button></article><article class="station-card-view station-wide direct-fire-controls" aria-labelledby="helicopter-fire-title"><h3 id="helicopter-fire-title" data-i18n="helicopter_release_control"></h3><div class="fire-grid"><label for="helicopter-fire-target" data-i18n="fire_target"></label><select id="helicopter-fire-target"></select><label for="helicopter-fire-depth" data-i18n="fire_depth"></label><input id="helicopter-fire-depth" type="number" min="10" max="300" step="any" inputmode="decimal" autocomplete="off"><button id="helicopter-fire-torpedo" type="button" data-fire-action="helicopter_launch_torpedo" data-i18n="helicopter_launch_torpedo"></button></div><p id="helicopter-fire-status" class="fire-status" role="status" aria-live="polite"></p></article><article class="station-card-view station-wide"><h3 data-i18n="buoys"></h3><div id="helicopter-buoys" class="station-list"></div></article></div></section>
<article id="helicopter-dip-display" class="station-card-view station-wide" hidden><h3 data-i18n="helicopter_dip_picture"></h3><canvas id="helicopter-dip-canvas" width="640" height="320" data-i18n-aria="helicopter_dip_picture"></canvas><dl id="helicopter-dip-environment" class="detail-metrics"></dl><div id="helicopter-dip-observations" class="station-list" aria-live="polite"></div></article>
<section id="helicopter-buoy-console" class="visual-panel helicopter-acoustic-visual" hidden data-i18n-aria="helicopter_visual_acoustic">
<div class="helicopter-acoustic-controls"><label for="helicopter-buoy-mode" data-i18n="helicopter_buoy_mode"></label><select id="helicopter-buoy-mode"><option value="PASSIVE" data-i18n="helicopter_buoy_passive"></option><option value="ACTIVE" data-i18n="helicopter_buoy_active"></option></select><label for="helicopter-listen-source" data-i18n="helicopter_listen_source"></label><select id="helicopter-listen-source"></select></div>
<div class="helicopter-acoustic-controls"><form id="helicopter-listen-bearing-form" class="helicopter-inline-form"><label for="helicopter-listen-bearing" data-i18n="sonar_listen_bearing"></label><input id="helicopter-listen-bearing" type="number" min="0" max="359.99999999999994" step="any" inputmode="decimal" autocomplete="off" required><button type="submit" data-i18n="sonar_set_bearing"></button></form><button id="helicopter-listen-auto" type="button" data-i18n="helicopter_listen_auto"></button></div>
<details id="helicopter-audio-controls"><summary data-i18n="helicopter_audio_controls"></summary>
<div class="helicopter-acoustic-controls"><label for="helicopter-audition-mode" data-i18n="sonar_audition_mode"></label><select id="helicopter-audition-mode"><option value="BROADBAND" data-i18n="sonar_audition_broadband"></option><option value="FILTERED" data-i18n="sonar_audition_filtered"></option><option value="HETERODYNE" data-i18n="sonar_audition_heterodyne"></option></select><label for="helicopter-audio-band" data-i18n="sonar_band"></label><select id="helicopter-audio-band"><option value="FULL">0–300 Hz</option><option value="LOW">4–80 Hz</option><option value="SHAFT">8–55 Hz</option><option value="MID">20–120 Hz</option></select><label class="check"><input id="helicopter-audio-notch" type="checkbox"><span data-i18n="sonar_notch"></span></label></div>
<div class="helicopter-acoustic-controls"><label for="helicopter-audio-gain" data-i18n="sonar_gain"></label><input id="helicopter-audio-gain" type="range" min="-12" max="24" step="1" value="0"><output id="helicopter-audio-gain-value" for="helicopter-audio-gain">0 dB</output><label for="helicopter-audio-volume" data-i18n="helicopter_audio_volume"></label><input id="helicopter-audio-volume" type="range" min="0" max="100" step="5" value="100"><output id="helicopter-audio-volume-value" for="helicopter-audio-volume">100 %</output></div>
<div class="helicopter-acoustic-controls"><label for="helicopter-audio-highpass" data-i18n="sonar_audio_highpass"></label><input id="helicopter-audio-highpass" type="range" min="0" max="250" step="1" value="0"><output id="helicopter-audio-highpass-value" for="helicopter-audio-highpass">0 Hz</output><label for="helicopter-audio-lowpass" data-i18n="sonar_audio_lowpass"></label><input id="helicopter-audio-lowpass" type="range" min="50" max="2000" step="10" value="2000"><output id="helicopter-audio-lowpass-value" for="helicopter-audio-lowpass">2000 Hz</output></div>
</details>
<div id="helicopter-acoustic-plot-tabs" class="helicopter-visual-tabs" role="tablist"><button type="button" role="tab" data-helicopter-plot-tab="broadband" aria-controls="helicopter-plot-broadband" aria-selected="false" data-i18n="helicopter_broadband"></button><button type="button" role="tab" data-helicopter-plot-tab="lofar" aria-controls="helicopter-plot-lofar" aria-selected="true" data-i18n="helicopter_lofar"></button><button type="button" role="tab" data-helicopter-plot-tab="demon" aria-controls="helicopter-plot-demon" aria-selected="false" data-i18n="helicopter_demon"></button></div>
<div class="helicopter-acoustic-workspace"><div class="helicopter-acoustic-plots"><div id="helicopter-plot-broadband" data-helicopter-plot="broadband" hidden><canvas id="helicopter-broadband-canvas" class="role-canvas" data-i18n-aria="helicopter_broadband"></canvas></div><div id="helicopter-plot-lofar" data-helicopter-plot="lofar"><canvas id="helicopter-spectrum-canvas" class="role-canvas helicopter-spectrum-canvas" data-i18n-aria="helicopter_lofar"></canvas><canvas id="helicopter-lofar-canvas" class="role-canvas" data-i18n-aria="helicopter_lofar"></canvas></div><div id="helicopter-plot-demon" data-helicopter-plot="demon" hidden><canvas id="helicopter-demon-canvas" class="role-canvas" data-i18n-aria="helicopter_demon"></canvas></div></div><div class="helicopter-acoustic-rail"><p id="helicopter-acoustic-text" class="visual-equivalent"></p><div id="helicopter-buoy-observations" class="station-list" aria-live="polite"></div></div></div>
</section>
<article id="helicopter-dipping-controls" class="station-card-view station-controls" hidden><h3 data-i18n="helicopter_dip_title"></h3><button id="helicopter-dip-toggle" type="button" data-i18n="helicopter_dip_deploy"></button><button id="helicopter-dip-ping" type="button" data-i18n="helicopter_dip_ping"></button><form id="helicopter-dip-depth-form" class="control-form"><label for="helicopter-dip-depth" data-i18n="helicopter_dip_depth"></label><input id="helicopter-dip-depth" type="number" min="15" max="300" step="any" inputmode="decimal" autocomplete="off" required><button id="helicopter-dip-depth-submit" type="submit" data-i18n="helicopter_dip_set_depth"></button></form></article>
<section id="station-eloka" class="station-section" data-station-role="eloka" aria-labelledby="station-eloka-title" hidden><div class="station-heading"><p class="eyebrow" data-i18n="station_dashboard"></p><h2 id="station-eloka-title" data-i18n="station_eloka"></h2></div><div class="station-grid"><article class="station-card-view"><h3 data-i18n="eloka_hardware"></h3><dl id="eloka-hardware" class="metrics"></dl></article><article class="station-card-view station-controls station-wide"><h3 data-i18n="eloka_filters"></h3><label for="eloka-status-filter" data-i18n="eloka_filter_status"></label><select id="eloka-status-filter"><option value="OPERATIONAL" data-i18n="eloka_filter_operational"></option><option value="LIVE" data-i18n="eloka_filter_live"></option><option value="MEMORY" data-i18n="eloka_filter_memory"></option><option value="ALL" data-i18n="eloka_filter_all"></option></select><label for="eloka-threat-filter" data-i18n="eloka_filter_threat"></label><select id="eloka-threat-filter"><option value="ALL" data-i18n="eloka_filter_all"></option><option value="LOW" data-i18n="eloka_threat_low"></option><option value="MEDIUM" data-i18n="eloka_threat_medium"></option><option value="HIGH" data-i18n="eloka_threat_high"></option><option value="CRITICAL" data-i18n="eloka_threat_critical"></option></select><label for="eloka-band-filter" data-i18n="eloka_filter_band"></label><select id="eloka-band-filter"><option value="ALL" data-i18n="eloka_filter_all"></option><option value="a_c">A/C</option><option value="d">D</option><option value="e_f">E/F</option><option value="g_h">G/H</option><option value="i_j">I/J</option><option value="k">K</option></select><output id="eloka-filter-count" aria-live="polite"></output></article><article class="station-card-view station-wide"><h3 data-i18n="station_intercepts"></h3><div id="eloka-intercepts" class="station-list"></div></article></div></section>
<section id="role-visuals" class="role-visuals station-wide" hidden aria-labelledby="role-visual-title">
<div class="visual-heading"><h3 id="role-visual-title" data-i18n="visual_picture"></h3><p id="role-visual-state" class="visual-state" role="status" aria-live="polite"></p></div>
<div id="helicopter-visual-tabs" class="helicopter-visual-tabs" role="tablist" hidden><button id="helicopter-visual-acoustic" type="button" role="tab" aria-controls="helicopter-buoy-console" aria-selected="true" data-i18n="helicopter_visual_acoustic"></button><button id="helicopter-visual-map" type="button" role="tab" aria-controls="map-visual" aria-selected="false" data-i18n="helicopter_visual_map"></button></div>
<section id="map-visual" class="visual-panel map-visual" hidden>
<div class="visual-toolbar"><button id="role-map-zoom-in" type="button" data-i18n="zoom_in"></button><button id="role-map-zoom-out" type="button" data-i18n="zoom_out"></button><button id="role-map-fit" type="button" data-i18n="fit"></button><button id="role-map-follow" type="button" aria-pressed="false" data-i18n="follow"></button><output id="role-map-scale"></output></div>
<div class="role-map-frame"><canvas id="role-map" class="role-canvas" tabindex="0" data-i18n-aria="role_map_help" aria-describedby="role-map-help role-map-text"></canvas><canvas id="role-map-sweep" aria-hidden="true"></canvas></div>
<p id="role-map-help" class="fine" data-i18n="role_map_help"></p><ul id="role-map-text" class="visual-equivalent"></ul>
</section>
<section id="sonar-visual" class="visual-panel sonar-visual" hidden>
<div class="sonar-live-audio"><button id="sonar-live-toggle" type="button" aria-pressed="false" data-i18n="sonar_live_start"></button><p id="sonar-live-status" role="status" aria-live="polite" data-i18n="sonar_live_off"></p></div>
<div class="sonar-audition-controls">
<label for="sonar-audition-mode" data-i18n="sonar_audition_mode"></label><select id="sonar-audition-mode"><option value="BROADBAND" data-i18n="sonar_audition_broadband"></option><option value="FILTERED" data-i18n="sonar_audition_filtered"></option><option value="HETERODYNE" data-i18n="sonar_audition_heterodyne"></option></select>
<label for="sonar-listen-band" data-i18n="sonar_band"></label><select id="sonar-listen-band"><option value="FULL">0-300 Hz</option><option value="LOW">4-80 Hz</option><option value="SHAFT">8-55 Hz</option><option value="MID">20-120 Hz</option></select>
<label class="check"><input id="sonar-listen-notch" type="checkbox"><span data-i18n="sonar_notch"></span></label>
<label for="sonar-audio-highpass" data-i18n="sonar_audio_highpass"></label><input id="sonar-audio-highpass" type="range" min="0" max="250" step="1" value="0">
<output id="sonar-audio-highpass-value" for="sonar-audio-highpass">0 Hz</output>
<label for="sonar-audio-lowpass" data-i18n="sonar_audio_lowpass"></label><input id="sonar-audio-lowpass" type="range" min="50" max="2000" step="10" value="2000">
<output id="sonar-audio-lowpass-value" for="sonar-audio-lowpass">2000 Hz</output>
</div>
<div class="sonar-display-controls" role="group" data-i18n-aria="sonar_display_controls">
<label for="sonar-palette" data-i18n="sonar_palette"></label><select id="sonar-palette"><option value="green" data-i18n="sonar_palette_green"></option><option value="amber" data-i18n="sonar_palette_amber"></option><option value="cyan" data-i18n="sonar_palette_cyan"></option></select>
<label for="sonar-black-level" data-i18n="sonar_black_level"></label><input id="sonar-black-level" type="range" min="0" max="0.8" step="0.01" value="0">
<label for="sonar-contrast" data-i18n="sonar_contrast"></label><input id="sonar-contrast" type="range" min="0.5" max="4" step="0.1" value="2.5">
<label for="sonar-history" data-i18n="sonar_history"></label><select id="sonar-history"><option value="60">60 s</option><option value="300" selected>300 s</option><option value="600">600 s</option></select>
<button id="sonar-detach" type="button" data-i18n="sonar_detach"></button>
<output id="sonar-cursor-readout" class="sonar-cursor-readout" aria-live="polite" data-i18n="sonar_cursor_idle"></output>
</div>
<div id="sonar-page-tabs" class="visual-tabs" role="tablist" data-i18n-aria="sonar_visual_pages">
<button id="sonar-tab-overview" type="button" role="tab" aria-controls="sonar-plots" aria-selected="false" tabindex="-1" data-sonar-visual="overview" data-i18n="sonar_visual_overview"></button><button id="sonar-tab-broadband" type="button" role="tab" aria-controls="sonar-plot-broadband" aria-selected="false" tabindex="-1" data-sonar-visual="broadband" data-i18n="sonar_visual_broadband"></button><button id="sonar-tab-lofar" type="button" role="tab" aria-controls="sonar-plot-lofar" aria-selected="false" tabindex="-1" data-sonar-visual="lofar" data-i18n="sonar_visual_lofar"></button><button id="sonar-tab-demon" type="button" role="tab" aria-controls="sonar-plot-demon" aria-selected="false" tabindex="-1" data-sonar-visual="demon" data-i18n="sonar_visual_demon"></button><button id="sonar-tab-tma" type="button" role="tab" aria-controls="sonar-plot-tma" aria-selected="false" tabindex="-1" data-sonar-visual="tma" data-i18n="sonar_visual_tma"></button><button id="sonar-tab-environment" type="button" role="tab" aria-controls="sonar-plot-environment" aria-selected="false" tabindex="-1" data-sonar-visual="environment" data-i18n="sonar_visual_environment"></button><button id="sonar-tab-active" type="button" role="tab" aria-controls="sonar-plot-active" aria-selected="false" tabindex="-1" data-sonar-visual="active" data-i18n="sonar_visual_active"></button>
</div>
<div id="sonar-plots" class="sonar-plots" data-layout="single">
<section id="sonar-plot-broadband" role="tabpanel" aria-labelledby="sonar-tab-broadband" data-sonar-plot="broadband"><canvas id="sonar-broadband" class="role-canvas actionable-canvas" data-i18n-aria="sonar_broadband_help"></canvas><div id="sonar-broadband-text" class="visual-equivalent"></div></section>
<section id="sonar-plot-lofar" role="tabpanel" aria-labelledby="sonar-tab-lofar" data-sonar-plot="lofar" hidden><canvas id="sonar-lofar" class="role-canvas" data-i18n-aria="sonar_visual_lofar"></canvas><canvas id="sonar-spectrum" class="role-canvas spectrum-canvas" data-i18n-aria="sonar_spectrum"></canvas><div class="sonar-band-plots"><canvas id="sonar-band-low" class="role-canvas band-canvas" data-i18n-aria="sonar_band_low"></canvas><canvas id="sonar-band-mid" class="role-canvas band-canvas" data-i18n-aria="sonar_band_mid"></canvas><canvas id="sonar-band-high" class="role-canvas band-canvas" data-i18n-aria="sonar_band_high"></canvas></div><div id="sonar-lofar-text" class="visual-equivalent"></div></section>
<section id="sonar-plot-demon" role="tabpanel" aria-labelledby="sonar-tab-demon" data-sonar-plot="demon" hidden><canvas id="sonar-demon" class="role-canvas" data-i18n-aria="sonar_visual_demon"></canvas><canvas id="sonar-demon-spectrum" class="role-canvas spectrum-canvas" data-i18n-aria="sonar_demon_spectrum"></canvas><div id="sonar-demon-text" class="visual-equivalent"></div></section>
<section id="sonar-plot-tma" role="tabpanel" aria-labelledby="sonar-tab-tma" data-sonar-plot="tma" hidden><canvas id="sonar-tma-plot" class="role-canvas" data-i18n-aria="sonar_visual_tma"></canvas><div id="sonar-tma-text" class="visual-equivalent"></div></section>
<section id="sonar-plot-environment" role="tabpanel" aria-labelledby="sonar-tab-environment" data-sonar-plot="environment" hidden><canvas id="sonar-environment" class="role-canvas" data-i18n-aria="sonar_visual_environment"></canvas><div id="sonar-environment-text" class="visual-equivalent"></div></section>
<section id="sonar-plot-active" role="tabpanel" aria-labelledby="sonar-tab-active" data-sonar-plot="active" hidden><div class="sonar-active-plots"><canvas id="sonar-active" class="role-canvas" data-i18n-aria="sonar_visual_active"></canvas><canvas id="sonar-a-scan" class="role-canvas" data-i18n-aria="sonar_a_scan"></canvas></div><div id="sonar-active-text" class="visual-equivalent"></div></section>
</div>
</section>
<section id="damage-visual" class="visual-panel" hidden><div class="damage-visual-controls"><label for="damage-team" data-i18n="team"></label><select id="damage-team"></select></div><canvas id="damage-schematic" class="role-canvas actionable-canvas" data-i18n-aria="damage_schematic"></canvas><div id="damage-schematic-text" class="visual-equivalent"></div></section>
<section id="engine-visual" class="visual-panel" hidden><canvas id="engine-instruments" class="role-canvas" data-i18n-aria="engine_instruments"></canvas><div id="engine-instruments-text" class="visual-equivalent"></div></section>
<section id="eloka-visual" class="visual-panel" hidden><canvas id="eloka-scope" class="role-canvas" data-i18n-aria="eloka_scope"></canvas><div id="eloka-scope-text" class="visual-equivalent"></div></section>
<section id="weapons-visual" class="visual-panel" hidden><canvas id="weapons-system" class="role-canvas" data-i18n-aria="weapons_system"></canvas><div id="weapons-system-text" class="visual-equivalent"></div></section>
</section>
<p id="station-command-status" class="command-status" role="status" aria-live="polite"></p>
</section>
<section id="bridge-orders" class="panel bridge-orders" aria-labelledby="bridge-orders-title" hidden>
<div class="bridge-order-heading"><div><p class="eyebrow" data-i18n="bridge_orders_eyebrow"></p><h2 id="bridge-orders-title" data-i18n="bridge_orders_title"></h2></div><p data-i18n="bridge_orders_note"></p></div>
<dl id="bridge-order-values" class="metrics bridge-order-values"></dl>
<div class="bridge-order-controls">
<form id="bridge-course-form" class="bridge-order-form"><label for="bridge-course" data-i18n="bridge_course_label"></label><div class="setter"><input id="bridge-course" name="course" type="number" min="0" max="359.99999999999994" step="any" inputmode="decimal" autocomplete="off" required><button id="bridge-course-submit" type="submit" class="primary" data-i18n="bridge_course_submit"></button></div></form>
<form id="bridge-speed-form" class="bridge-order-form"><label for="bridge-speed" data-i18n="bridge_speed_label"></label><div class="setter"><input id="bridge-speed" name="speed_kn" type="number" min="0" max="25" step="any" inputmode="decimal" autocomplete="off" required><button id="bridge-speed-submit" type="submit" class="primary" data-i18n="bridge_speed_submit"></button></div></form>
</div>
<p id="bridge-order-status" class="command-status" role="status" aria-live="polite"></p>
</section>
<section id="opz-controls" class="panel opz-controls" aria-labelledby="opz-controls-title" hidden>
<div><p class="eyebrow" data-i18n="opz_controls_eyebrow"></p><h2 id="opz-controls-title" data-i18n="opz_controls_title"></h2></div>
<div class="opz-radars"><label><input id="opz-radar-surface" type="checkbox"> <span data-i18n="opz_surface_radar"></span></label><label><input id="opz-radar-air" type="checkbox"> <span data-i18n="opz_air_radar"></span></label></div>
<label for="opz-range" data-i18n="opz_range"></label><select id="opz-range"><option value="10">10 NM</option><option value="20">20 NM</option><option value="40">40 NM</option><option value="80">80 NM</option><option value="120">120 NM</option></select>
<button id="opz-create-fusion" type="button" class="primary" data-i18n="opz_create_fusion"></button>
<label class="opz-manage"><input id="opz-manage" type="checkbox"> <span data-i18n="opz_manage_suppressed"></span></label>
<p id="opz-mark-status" class="fine" aria-live="polite"></p>
</section>
<div id="operations-workspace" class="workspace">
<section class="panel contacts-panel"><div class="panel-heading"><h2 data-i18n="contacts"></h2><span id="track-count" class="counter"></span></div><p class="panel-help" data-i18n="selection_note"></p><label class="contact-filter" for="contact-filter"><span data-i18n="contact_filter"></span><input id="contact-filter" type="search" maxlength="48" autocomplete="off" spellcheck="false" data-i18n-placeholder="contact_filter_placeholder"></label><div id="track-list" class="track-list" data-i18n-aria="contacts"></div></section>
<section class="panel chart-panel">
<div class="panel-heading"><h2 data-i18n="picture"></h2><span class="north" data-i18n="north_up"></span></div>
<div class="chart-toolbar"><button id="zoom-in" type="button" data-i18n="zoom_in"></button><button id="zoom-out" type="button" data-i18n="zoom_out"></button><button id="fit" type="button" data-i18n="fit"></button><button id="follow" type="button" aria-pressed="false" data-i18n="follow"></button><output id="chart-scale"></output></div>
<canvas id="chart" tabindex="0" data-i18n-aria="chart_help"></canvas>
<p class="chart-help" data-i18n="chart_help"></p>
<div class="legend"><span class="selected-key" data-i18n="selected"></span><span class="bearing-key" data-i18n="bearing_only"></span></div>
<p id="chart-disclaimer" class="fine"></p>
</section>
<section class="panel details-panel"><div class="panel-heading"><h2 data-i18n="contact_detail"></h2><span class="local-tag" data-i18n="local"></span></div>
<p id="no-selection" class="empty" data-i18n="select_contact"></p>
<div id="track-detail" hidden><h3 id="detail-label"></h3><div id="detail-badges" class="badges"></div><dl id="detail-metrics" class="detail-metrics"></dl>
<form id="classification-form" class="annotation-form"><label for="classification" data-i18n="classification"></label><div class="setter"><select id="classification"><option value="" data-i18n="unknown"></option><option value="U_BOOT" data-i18n="class_submarine"></option><option value="KAMPFSCHIFF" data-i18n="class_warship"></option><option value="BIOLOGISCH" data-i18n="class_biological"></option><option value="FAHRZEUG" data-i18n="class_vehicle"></option><option value="FLUGZEUG" data-i18n="class_aircraft"></option></select><button id="apply-classification" type="submit" data-i18n="apply"></button></div></form>
<button id="helicopter-qualify" type="button" hidden data-i18n="helicopter_qualify"></button><button id="helicopter-buoy-release" type="button" hidden data-i18n="sonar_release_to_opz"></button>
<form id="affiliation-form" class="annotation-form"><label for="affiliation" data-i18n="affiliation"></label><div class="setter"><select id="affiliation"><option value="UNKNOWN" data-i18n="aff_unknown"></option><option value="FRIEND" data-i18n="aff_friend"></option><option value="NEUTRAL" data-i18n="aff_neutral"></option><option value="HOSTILE" data-i18n="aff_hostile"></option></select><button id="apply-affiliation" type="submit" data-i18n="apply"></button></div></form>
<form id="track-id-form" class="annotation-form" hidden><label for="track-id" data-i18n="shared_track_label"></label><div class="setter"><input id="track-id" type="text" minlength="1" maxlength="16" pattern="[A-Za-z0-9-]*[A-Za-z0-9][A-Za-z0-9-]*" autocomplete="off" autocapitalize="characters" spellcheck="false" required><button id="apply-track-id" type="submit" data-i18n="apply"></button></div></form>
<div id="opz-track-actions" class="opz-track-actions" hidden><button id="opz-mark" type="button" data-i18n="opz_mark"></button><button id="opz-suppress" type="button" data-i18n="opz_suppress"></button><button id="opz-dissolve" type="button" data-i18n="opz_dissolve"></button><button id="opz-designate" type="button" data-i18n="opz_designate"></button></div>
<p id="opz-release-status" class="fine" hidden></p>
<button id="sonar-release" type="button" hidden data-i18n="sonar_release_to_opz"></button>
<div id="target-proposal-controls" hidden><p class="fine" data-i18n="annotation_note"></p><button id="propose" type="button" class="primary" data-i18n="propose"></button></div>
</div>
<div id="target-proposal" class="proposal-box" hidden><h3 data-i18n="proposal"></h3><p id="proposal-status"></p><p class="fine" data-i18n="proposal_note"></p><button id="clear-proposal" type="button" data-i18n="clear_proposal"></button></div>
<div id="navigation-proposal" class="proposal-box" hidden><h3 data-i18n="navigation"></h3>
<p id="navigation-status" role="status" aria-live="polite"></p>
<p id="navigation-note" class="fine" data-i18n="navigation_note"></p>
<form id="navigation-form" class="annotation-form" aria-describedby="navigation-note">
<label for="navigation-course" data-i18n="navigation_course"></label><input id="navigation-course" name="course" type="number" min="0" max="359.99999999999994" step="any" inputmode="decimal" autocomplete="off">
<label for="navigation-speed" data-i18n="navigation_speed"></label><input id="navigation-speed" name="speed_kn" type="number" min="0" max="25" step="any" inputmode="decimal" autocomplete="off">
<button id="propose-navigation" type="submit" class="primary" data-i18n="navigation_propose"></button>
</form>
</div>
<p id="command-status" class="command-status" role="status" aria-live="polite"></p>
<div id="command-reconcile" class="command-reconcile" hidden><p id="command-retry-note" class="fine" data-i18n="command_retry_note"></p><button id="retry-command" type="button" aria-describedby="command-retry-note" data-i18n="command_retry"></button></div>
</section>
</div>
<section class="panel events-panel"><div class="panel-heading"><h2 data-i18n="events"></h2><span class="local-tag" data-i18n="live_feed"></span></div><ol id="event-list" class="event-list"></ol></section>
<footer><span data-i18n="observation_note"></span><span id="snapshot-meta"></span></footer>
</section>
<section id="panel-lookout" class="tab-panel lookout-panel" role="tabpanel" aria-labelledby="tab-lookout" tabindex="0" hidden>
<header class="lookout-bar">
<div class="lookout-title"><p class="eyebrow" data-i18n="lookout_eyebrow"></p><h1 data-i18n="lookout_title"></h1></div>
<div class="lookout-environment" aria-live="polite"><span><span data-i18n="sea_state"></span> <strong id="lookout-sea"></strong></span><span id="lookout-light"></span></div>
<div class="lookout-toolbar"><button id="lookout-zoom-in" type="button" data-i18n="zoom_in"></button><button id="lookout-zoom-out" type="button" data-i18n="zoom_out"></button><button id="lookout-reset" type="button" data-i18n="lookout_default_short" data-i18n-aria="lookout_reset"></button><output id="lookout-range"></output></div>
</header>
<div id="lookout-scope" class="lookout-scope"><canvas id="lookout" tabindex="0" aria-describedby="lookout-note lookout-own" data-i18n-aria="lookout_help"></canvas></div>
<p id="lookout-note" class="lookout-note" data-i18n="lookout_note"></p>
<section class="visually-hidden"><h2 data-i18n="lookout_observations"></h2><p id="lookout-own"></p><ul id="lookout-observations"></ul></section>
</section>
<section id="panel-guide" class="tab-panel guide-panel" role="tabpanel" aria-labelledby="tab-guide" tabindex="0" hidden>
<header class="guide-header"><p class="eyebrow" data-i18n="guide_eyebrow"></p><h1 data-i18n="guide_title"></h1><p data-i18n="guide_intro"></p><p class="guide-manual"><a id="guide-manual-link" href="/manual-en" target="_blank" rel="noopener" data-i18n="guide_manual_link"></a></p></header>
<section id="workstation-guide" class="panel" hidden><h2 id="workstation-guide-title"></h2><p id="workstation-guide-body"></p><p data-i18n="workstation_help_common"></p><p class="guide-manual"><a id="workstation-manual-link" href="/manual-en" target="_blank" rel="noopener" data-i18n="workstation_manual"></a></p></section>
<div class="guide-layout">
<nav id="guide-nav" class="guide-nav panel" data-i18n-aria="guide_navigation">
<h2 data-i18n="guide_navigation"></h2>
<ol>
<li><a href="#guide-access" data-i18n="guide_nav_access"></a></li>
<li><a href="#guide-operations" data-i18n="guide_nav_operations"></a></li>
<li><a href="#guide-observations" data-i18n="guide_nav_observations"></a></li>
<li><a href="#guide-proposals" data-i18n="guide_nav_proposals"></a></li>
<li><a href="#guide-eloka" data-i18n="guide_nav_eloka"></a></li>
<li><a href="#guide-analyzer" data-i18n="guide_nav_analyzer"></a></li>
<li><a href="#guide-connection" data-i18n="guide_nav_connection"></a></li>
<li><a href="#guide-authority" data-i18n="guide_nav_authority"></a></li>
</ol>
</nav>
<article class="guide-copy">
<section id="guide-access" tabindex="-1"><h2 data-i18n="guide_access_title"></h2><p data-i18n="guide_access_pairing"></p><p data-i18n="guide_access_grant"></p><p data-i18n="guide_access_revoke"></p></section>
<section id="guide-operations" tabindex="-1"><h2 data-i18n="guide_operations_title"></h2><p data-i18n="guide_operations_picture"></p><p data-i18n="guide_operations_local"></p><p data-i18n="guide_lookout"></p></section>
<section id="guide-observations" tabindex="-1"><h2 data-i18n="guide_observations_title"></h2><p data-i18n="guide_observations_age"></p><p data-i18n="guide_observations_quality"></p><p data-i18n="guide_observations_annotations"></p></section>
<section id="guide-proposals" tabindex="-1"><h2 data-i18n="guide_proposals_title"></h2><p data-i18n="guide_target_proposal"></p><p data-i18n="guide_navigation_proposal"></p><p data-i18n="guide_message_box"></p><p data-i18n="guide_reconciliation"></p></section>
<section id="guide-eloka" tabindex="-1"><h2 data-i18n="guide_eloka_title"></h2><p data-i18n="guide_eloka_esm"></p><p data-i18n="guide_eloka_correlation"></p><p data-i18n="guide_emcon"></p></section>
<section id="guide-analyzer" tabindex="-1"><h2 data-i18n="guide_analyzer_title"></h2><p data-i18n="guide_analyzer_contacts"></p><p data-i18n="guide_analyzer_limits"></p></section>
<section id="guide-connection" tabindex="-1"><h2 data-i18n="guide_connection_title"></h2><p data-i18n="guide_security"></p><p data-i18n="guide_reconnect"></p></section>
<section id="guide-authority" class="guide-warning" tabindex="-1"><h2 data-i18n="guide_authority_title"></h2><p data-i18n="guide_authority_forbidden"></p><p data-i18n="guide_authority_summary"></p></section>
</article>
</div>
</section>
<section id="panel-contacts" class="tab-panel analyzer-panel" role="tabpanel" aria-labelledby="tab-contacts" tabindex="0" hidden>
<header class="analyzer-header"><div><p class="eyebrow" data-i18n="analyzer_eyebrow"></p><h1 data-i18n="analyzer_title"></h1><p class="panel-help" data-i18n="analyzer_note"></p></div><span id="analysis-count" class="counter"></span></header>
<div class="analyzer-workspace">
<section class="panel analyzer-browser"><div class="analyzer-filters"><label for="analysis-filter" data-i18n="analyzer_filter"></label><input id="analysis-filter" type="search" maxlength="96" autocomplete="off"><label for="analysis-category" data-i18n="analyzer_category"></label><select id="analysis-category"><option value="" data-i18n="analyzer_all"></option><option value="subs.json" data-i18n="analyzer_submarines"></option><option value="warships.json" data-i18n="analyzer_warships"></option><option value="civilians.json" data-i18n="analyzer_civilians"></option><option value="aircraft.json" data-i18n="analyzer_aircraft"></option><option value="animals.json" data-i18n="analyzer_animals"></option><option value="torpedoes.json" data-i18n="analyzer_torpedoes"></option><option value="decoys.json" data-i18n="analyzer_decoys"></option></select></div><div id="analysis-list" class="analysis-list" data-i18n-aria="analyzer_results"></div></section>
<section class="panel analyzer-detail"><p id="analysis-status" class="empty" role="status" aria-live="polite"></p><article id="analysis-profile" hidden><div class="panel-heading"><div><p id="analysis-key" class="eyebrow"></p><h2 id="analysis-name"></h2></div><span id="analysis-resource" class="local-tag"></span></div><div class="analysis-legend"><p data-i18n="analyzer_spectrum_legend"></p><p data-i18n="analyzer_hypothesis_legend"></p><p data-i18n="analyzer_radar_spectrum_legend"></p><p data-i18n="analyzer_radar_prf_legend"></p></div><div id="analysis-images" class="analysis-images"></div><dl id="analysis-metrics" class="detail-metrics analyzer-metrics"></dl><section class="analysis-components"><h3 data-i18n="analyzer_systems"></h3><dl id="analysis-systems" class="detail-metrics"></dl><div class="analysis-component-groups"><section><h3 data-i18n="analyzer_sensors"></h3><div id="analysis-sensors" class="analysis-component-list"></div></section><section><h3 data-i18n="analyzer_emitters"></h3><div id="analysis-emitters" class="analysis-component-list"></div></section></div></section></article></section>
</div>
</section>
</div>
</main>
<main id="simlog-view" hidden>
<section class="panel simlog-panel">
<div class="panel-heading"><h2 data-i18n="simlog_title"></h2><span id="simlog-count" class="counter"></span></div>
<p id="simlog-status" class="empty" role="status" aria-live="polite" data-i18n="simlog_empty"></p>
<section class="simlog-current-section">
<div class="simlog-section-heading"><h3 data-i18n="simlog_current_title"></h3></div>
<p class="fine" data-i18n="simlog_current_note"></p>
<div id="simlog-current" class="simlog-current" aria-live="polite"></div>
</section>
<ol id="simlog-list" class="simlog-list" data-i18n-aria="simlog_list"></ol>
</section>
</main>
<dialog id="fire-confirm-dialog" hidden><h2 id="fire-confirm-title" data-i18n="fire_confirm_dialog_title"></h2><p id="fire-confirm-summary"></p><div class="fire-confirm-actions"><button id="fire-confirm-cancel" type="button" data-i18n="fire_confirm_dialog_cancel"></button><button id="fire-confirm-confirm" type="button" class="danger" data-i18n="fire_confirm_dialog_confirm"></button></div></dialog>
<dialog id="host-slot-dialog" class="host-dialog" hidden aria-labelledby="host-slot-title"><h2 id="host-slot-title"></h2><p id="host-slot-note" class="fine"></p><ol id="host-slot-list" class="host-slot-list"></ol><div class="host-dialog-actions"><button id="host-slot-cancel" type="button" data-i18n="host_dialog_cancel"></button></div></dialog>
<dialog id="host-new-dialog" class="host-dialog" hidden aria-labelledby="host-new-title"><form id="host-new-form" method="dialog"><h2 id="host-new-title" data-i18n="host_new_title"></h2><p class="fine" data-i18n="host_new_note"></p><label for="host-new-scenario" data-i18n="host_new_scenario"></label><select id="host-new-scenario"></select><p id="host-new-scenario-note" class="fine"></p><label for="host-new-world" data-i18n="host_new_world"></label><select id="host-new-world"><option value="fixed" data-i18n="world_fixed"></option><option value="procedural" data-i18n="world_procedural"></option><option value="real_fixed" data-i18n="world_real_fixed"></option></select><label data-i18n="host_new_difficulty"></label><p id="host-new-difficulty-note" class="fine"></p><div id="host-new-difficulty" class="host-new-difficulty-grid"></div><label for="host-new-seed" data-i18n="host_new_seed"></label><input id="host-new-seed" type="number" min="1" max="999999999" step="1" inputmode="numeric" autocomplete="off" data-i18n-placeholder="host_new_seed_hint"><div class="host-dialog-actions"><button id="host-new-cancel" type="button" data-i18n="host_dialog_cancel"></button><button id="host-new-start" type="submit" class="danger" data-i18n="host_new_start"></button></div></form></dialog>
<dialog id="instructor-dialog" class="host-dialog instructor-dialog" hidden aria-labelledby="instructor-title"><form id="instructor-form" method="dialog"><p class="eyebrow" data-i18n="instructor_eyebrow"></p><h2 id="instructor-title" data-i18n="instructor_title"></h2><p class="fine" data-i18n="instructor_note"></p><label for="instructor-sea-state" data-i18n="sea_state"></label><select id="instructor-sea-state"><option value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option></select><label for="instructor-event" data-i18n="instructor_event"></label><select id="instructor-event"><option value="" data-i18n="instructor_no_event"></option><option value="targets_quiet" data-i18n="instructor_targets_quiet"></option><option value="targets_cruise" data-i18n="instructor_targets_cruise"></option><option value="targets_flank" data-i18n="instructor_targets_flank"></option><option value="torpedo_transient" data-i18n="instructor_torpedo_transient"></option></select><div class="host-dialog-actions"><button id="instructor-cancel" type="button" data-i18n="host_dialog_cancel"></button><button id="instructor-apply" type="submit" class="danger" data-i18n="apply"></button></div></form></dialog>
<dialog id="simlog-map-dialog" hidden><div class="simlog-map-shell"><div class="simlog-map-header"><div><p class="eyebrow" data-i18n="simlog_map_eyebrow"></p><h2 data-i18n="simlog_map_title"></h2></div><button id="simlog-map-close" type="button" data-i18n="close"></button></div><div class="simlog-map-toolbar"><button id="simlog-map-world" type="button" aria-pressed="true" data-i18n="fit"></button><button id="simlog-map-units-fit" type="button" aria-pressed="false" data-i18n="simlog_map_fit_units"></button><button id="simlog-current-map" type="button" disabled></button><output id="simlog-map-count"></output></div><div class="simlog-map-layout"><div class="simlog-map-plot"><canvas id="simlog-map"></canvas></div><div class="simlog-map-sidebar"><h3 data-i18n="simlog_map_units_heading"></h3><ol id="simlog-map-units"></ol></div></div><p id="simlog-map-stamp"></p></div></dialog>
</div>
</body>
</html>
+58
View File
@@ -0,0 +1,58 @@
/* Script-free player manual page (/manual-en, /manual-de); generated by src/core/manual.py. */
:root {
color-scheme: dark;
--bg: #0b151c;
--panel: #111f29;
--line: #30434e;
--text: #e9eee8;
--muted: #a7b9bf;
--accent: #a1e7cc;
--amber: #f3c577;
--scope-bg: #071117;
--mono: "DejaVu Sans Mono", "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body { margin: 0; background: var(--bg); color: var(--text);
font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.manual-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.manual-head h1 { margin: 0; font-size: 1.5rem; letter-spacing: .04em; }
.manual-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 2rem;
max-width: 96rem; margin: 0 auto; padding: 1.5rem; }
.toc { position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem);
overflow-y: auto; padding: 1rem; border: 1px solid var(--line); background: var(--panel); }
.toc h2 { margin: 0 0 .5rem; font-size: 1rem; color: var(--muted); text-transform: uppercase; }
.toc ol { margin: 0; padding-left: 1.4rem; }
.toc li { margin: .25rem 0; }
main { min-width: 0; }
article { padding-bottom: 2rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
article > h2 { margin-top: 0; font-size: 1.6rem; color: var(--accent); }
section h3 { margin: 1.6rem 0 .5rem; font-size: 1.2rem; }
section h4 { margin: 1.2rem 0 .4rem; font-size: 1.05rem; color: var(--muted); }
p, li { max-width: 70rem; }
kbd { display: inline-block; padding: 0 .35em; border: 1px solid var(--line); border-bottom-width: 2px;
border-radius: 4px; background: var(--scope-bg); font: .9em var(--mono); white-space: nowrap; }
.note { margin: 1rem 0; padding: .6rem 1rem; border-left: 4px solid var(--amber); background: var(--panel); }
.note p { margin: 0; }
pre.diagram { overflow-x: auto; padding: .8rem 1rem; border: 1px solid var(--line);
background: var(--scope-bg); color: var(--accent); font: .9rem/1.35 var(--mono); }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; min-width: 50%; }
th, td { padding: .35rem .7rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--panel); color: var(--muted); }
table.keys td:first-child { white-space: nowrap; }
ol.sop { padding-left: 1.6rem; }
ol.sop li { margin: .2rem 0; }
@media (max-width: 52rem) {
.manual-layout { grid-template-columns: minmax(0, 1fr); padding: 1rem; gap: 1rem; }
.toc { position: static; max-height: none; }
.manual-head { padding: .8rem 1rem; }
}
@media print {
:root { --bg: #fff; --panel: #fff; --text: #000; --muted: #333; --accent: #000; --scope-bg: #fff; --line: #999; }
.toc { display: none; }
.manual-layout { display: block; }
}
+98
View File
@@ -0,0 +1,98 @@
/* Protocol v2 live audio. This processor receives only detached 4096 Hz PCM. */
class SonarAudioProcessor extends AudioWorkletProcessor {
constructor() {
super();
this.blocks = [];
this.current = null;
this.cursor = 0;
this.last = null;
this.previous = 0;
this.lastSequence = null;
this.gaps = 0;
this.evictions = 0;
this.repeats = 0;
this.freshFrames = 0;
this.outputFrames = 0;
this.fade = 0;
this.stale = false;
this.primed = false;
this.neutral = false;
this.noise = 0x5a17;
this.port.onmessage = ({data}) => {
if (data?.type === "reset") {
this.blocks = []; this.current = null; this.last = null;
this.cursor = 0; this.lastSequence = null; this.primed = false;
this.freshFrames = 0; this.stale = false; this.fade = 0; this.neutral = false;
return;
}
if (data?.type !== "pcm" || !(data.bytes instanceof ArrayBuffer) ||
data.bytes.byteLength !== 2048 || !Number.isSafeInteger(data.sequence) || data.sequence < 1) return;
if (this.lastSequence !== null && data.sequence <= this.lastSequence) return;
if (this.lastSequence !== null && data.sequence !== this.lastSequence + 1) this.gaps++;
this.lastSequence = data.sequence;
// Bound delay even if a browser tab resumes after a long suspension.
if (this.blocks.length >= 8) { this.blocks.shift(); this.evictions++; }
this.blocks.push(new Int16Array(data.bytes));
};
}
nextBlock() {
if (!this.primed && this.blocks.length < 4) return null;
this.primed = true;
if (this.blocks.length) {
this.current = this.blocks.shift();
this.neutral = false;
this.last = this.current;
this.freshFrames = 0;
if (this.stale) { this.stale = false; this.port.postMessage({type: "stale", value: false}); }
} else if (this.last && this.freshFrames < sampleRate * 2) {
this.current = this.last;
this.repeats++;
} else {
this.current = null;
this.neutral = true;
if (!this.stale) { this.stale = true; this.port.postMessage({type: "stale", value: true}); }
}
this.cursor = 0;
this.fade = Math.max(1, Math.round(sampleRate * .01));
return this.current;
}
process(_inputs, outputs) {
const output = outputs[0][0];
for (let index = 0; index < output.length; index++) {
if (this.current && this.cursor >= 1024 || !this.current &&
(!this.primed && this.blocks.length >= 4 || this.neutral && this.blocks.length))
this.nextBlock();
let value;
if (this.current) {
const left = Math.min(1023, Math.floor(this.cursor));
const right = Math.min(1023, left + 1);
const fraction = this.cursor - left;
value = (this.current[left] * (1 - fraction) + this.current[right] * fraction) / 32768;
this.cursor += 4096 / sampleRate;
this.freshFrames++;
} else if (this.primed) {
// Low level neutral noise remains audible after two seconds without data.
this.noise = (Math.imul(this.noise, 1664525) + 1013904223) >>> 0;
value = ((this.noise / 0xffffffff) * 2 - 1) * .006;
} else value = 0;
if (this.fade > 0) {
const fraction = 1 - this.fade / Math.max(1, Math.round(sampleRate * .01));
value = this.previous * (1 - fraction) + value * fraction;
this.fade--;
}
output[index] = value;
this.previous = value;
}
this.outputFrames += output.length;
if (this.outputFrames >= sampleRate) {
this.outputFrames -= sampleRate;
this.port.postMessage({type: "metrics", buffered: this.blocks.length + (this.current ? 1 - this.cursor / 1024 : 0),
gaps: this.gaps, evictions: this.evictions,
repeats: this.repeats, stale: this.stale});
}
return true;
}
}
registerProcessor("sonar-audio-v2", SonarAudioProcessor);
+769
View File
@@ -0,0 +1,769 @@
:root {
color-scheme: dark;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
font-size: clamp(15px, .3vw + 10px, 17px);
--bg: #0b151c;
--panel: #111f29;
--line: #30434e;
--text: #e9eee8;
--muted: #a7b9bf;
--accent: #a1e7cc;
--amber: #f3c577;
--red: #ff9090;
--blue: #81c5ff;
/* Derived tones previously duplicated as ad hoc hex literals throughout
this file - one definition each, reused everywhere that shade appears. */
--surface-1: #0e1b23;
--surface-2: #14232e;
--control-bg: #162936;
--selected-bg: #273932;
--warn-bg: #342b20;
--warn-border: #6b5733;
--on-accent: #102b23;
--scope-bg: #071117;
/* Font-size steps for the values repeated most often; near-duplicate
one-off sizes (.75rem/.76rem/.78rem/...) are left as-is rather than
forced onto this scale without a visual pass to confirm it's safe. */
--font-xs: .72rem;
--font-sm: .8rem;
--font-md: .85rem;
}
/* Console layout. In workstation mode every station fits one viewport: a
station tab bar, the instrument at full height between the contact list and
the controls, and no page scroll. Only lists and forms scroll inside their
own panel. The compact single-column fallback is the max-width: 850px block. */
body.workstation-mode[data-remote-role="assigned"] #shell { grid-template-columns: minmax(0, 1fr); }
body.workstation-mode[data-remote-role="assigned"] #operations { grid-column: 1; }
body.workstation-mode[data-remote-role="assigned"] #simlog-view { grid-column: 1; }
body.workstation-mode .role-rail, body.workstation-mode .mobile-role { display: none; }
body.workstation-mode .masthead { padding: .2rem .7rem; min-height: 0; gap: .8rem; }
body.workstation-mode .masthead .volume { display: flex; align-items: center; }
body.workstation-mode .masthead .volume > span, body.workstation-mode .masthead .language > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body.workstation-mode .masthead .volume input { width: 5rem; }
body.workstation-mode .masthead button, body.workstation-mode .masthead select { min-height: 1.8rem; padding: .1rem .5rem; font-size: var(--font-sm); }
body.workstation-mode .brand p, body.workstation-mode .brand-mark { display: none; }
body.workstation-mode .brand strong { font-size: 1rem; }
body.workstation-mode .preferences { gap: .6rem; }
body.workstation-mode button, body.workstation-mode select, body.workstation-mode input[type="text"], body.workstation-mode input[type="number"] { min-height: 2.1rem; padding: .3rem .6rem; }
body.workstation-mode .masthead { grid-row: 1; }
body.workstation-mode .connection { grid-row: 1; justify-self: center; align-self: center; z-index: 2; margin: 0; padding: 0; background: none; border: 0; font-size: var(--font-sm); pointer-events: none; }
body.workstation-mode .tablist { display: flex; align-items: center; gap: .5rem; padding: .15rem .6rem; }
body.workstation-mode #tab-operations { display: none; }
.workstation-station { display: flex; align-items: center; gap: .4rem; flex: 1 1 auto; min-width: 0; }
.station-tabs { display: flex; gap: .2rem; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.station-tab { display: inline-flex; align-items: center; flex: 0 0 auto; gap: .35rem; min-height: 2rem; padding: .1rem .55rem; border-radius: 0; border-color: transparent; border-bottom: 2px solid var(--line); background: transparent; color: var(--muted); font-size: var(--font-md); white-space: nowrap; }
.station-tab[aria-selected="true"] { border-bottom-color: var(--accent); background: var(--control-bg); color: var(--accent); }
.station-key { padding: 0 .3rem; border: 1px solid var(--line); color: var(--muted); font: var(--font-xs) ui-monospace, monospace; line-height: 1.35; }
.station-tab[aria-selected="true"] .station-key { border-color: var(--accent); color: var(--accent); }
#workstation-add-station { flex: 0 0 auto; min-height: 2rem; padding: .15rem .6rem; font-size: var(--font-sm); font-weight: 500; }
#workstation-tools { position: relative; flex: 0 0 auto; font-size: var(--font-md); }
#workstation-tools summary { cursor: pointer; padding: .4rem .5rem; }
.workstation-menu { position: absolute; right: 0; top: 100%; z-index: 20; display: grid; min-width: 15rem; padding: .5rem; gap: .4rem; background: var(--panel); border: 1px solid var(--line); }
.host-bar { display: flex; align-items: center; flex: 0 0 auto; gap: .3rem; margin-left: auto; }
.host-bar button, .host-bar select { min-height: 2rem; padding: .15rem .55rem; font-size: var(--font-sm); }
.host-time { display: flex; align-items: center; gap: .3rem; color: var(--muted); font-size: var(--font-xs); }
.host-status { max-width: 20rem; color: var(--amber); font-size: var(--font-xs); line-height: 1.3; }
.host-status[data-status="applied"] { color: var(--accent); }
.host-status[data-status="rejected"] { color: var(--red); }
body.workstation-mode .operations-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 0 .5rem .25rem; overflow: hidden; }
body.workstation-mode .mission-strip { padding: .15rem 0; gap: .8rem; flex-wrap: nowrap; }
body.workstation-mode .mission-name { flex: 0 1 auto; }
body.workstation-mode .mission-strip .metrics { flex: 1 1 auto; justify-content: flex-end; }
body.workstation-mode .host-time > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body.workstation-mode .mission-strip .eyebrow, body.workstation-mode #objective { display: none; }
body.workstation-mode .mission-strip h1 { font-size: .9rem; }
body.workstation-mode .mission-strip .metrics { gap: .2rem .9rem; }
body.workstation-mode .mission-strip .metrics > div { display: flex; align-items: baseline; gap: .35rem; }
body.workstation-mode .mission-strip dt { margin: 0; }
body.workstation-mode .session { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem .7rem; max-width: none; text-align: left; }
body.workstation-mode .session p { margin: 0; }
body.workstation-mode #command-permission { display: none; }
body.workstation-mode .station-view { height: 100%; min-height: 0; margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; }
body.workstation-mode #station-command-status { min-height: 0; margin: .15rem .2rem 0; }
body.workstation-mode .station-section { min-height: 0; padding: .3rem; border-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(20rem, 27vw, 34rem); grid-template-rows: minmax(0, 1fr); gap: .5rem; overflow: hidden; }
body.workstation-mode .station-section.track-workstation { grid-template-columns: clamp(13rem, 16vw, 21rem) minmax(0, 1fr) clamp(20rem, 27vw, 34rem); grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr); }
body.workstation-mode .station-heading { display: none; }
body.workstation-mode .role-visuals { display: flex; flex-direction: column; min-width: 0; min-height: 0; margin: 0; padding: .35rem; overflow: hidden; }
body.workstation-mode .role-visuals { grid-column: 1; grid-row: 1; }
body.workstation-mode .track-workstation .role-visuals { grid-column: 2; grid-row: 1 / -1; }
body.workstation-mode .visual-heading { padding-bottom: .2rem; }
body.workstation-mode .visual-panel:not([hidden]) { display: flex; flex: 1; flex-direction: column; min-height: 0; }
body.workstation-mode #map-visual:not([hidden]) { flex-grow: 2.2; }
body.workstation-mode .role-canvas { flex: 1; height: auto; min-height: 6rem; }
body.workstation-mode .role-map-frame { flex: 1; height: auto; min-height: 6rem; }
body.workstation-mode .spectrum-canvas { flex: 0 0 5rem; min-height: 5rem; }
body.workstation-mode .sonar-band-plots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 0 0 6rem; gap: .3rem; min-height: 0; }
body.workstation-mode .band-canvas { height: 6rem; min-height: 0; }
body.workstation-mode .sonar-plots:not([data-layout="single"]) .sonar-band-plots { display: none; }
body.workstation-mode .sonar-plots { display: flex; flex: 1; flex-direction: column; min-height: 0; }
body.workstation-mode .sonar-plots > section:not([hidden]) { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
body.workstation-mode .sonar-plots[data-layout="overview"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: .35rem; }
body.workstation-mode .sonar-live-audio { display: flex; align-items: center; gap: .6rem; min-width: 0; padding-bottom: .3rem; }
.sonar-live-audio p { font-size: var(--font-sm); color: var(--muted); line-height: 1.3; }
.sonar-audition-controls { grid-template-columns: auto minmax(6rem, 1fr) auto minmax(6rem, 1fr) auto; }
body.workstation-mode .visual-toolbar, body.workstation-mode .visual-tabs { padding-bottom: .25rem; margin-bottom: 0; }
/* The prose equivalents of every canvas stay in the DOM for screen readers but
no longer take viewport height from the picture. */
body.workstation-mode .visual-equivalent, body.workstation-mode #role-map-help { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body.workstation-mode .station-grid { grid-column: 2; grid-row: 1; height: 100%; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: .2rem; gap: .4rem; }
body.workstation-mode .track-workstation .station-grid { grid-column: 3; grid-row: 1; }
body.workstation-mode .station-card-view { padding: .5rem; flex-shrink: 0; }
body.workstation-mode .station-list { display: block; max-height: none; overflow: visible; }
body.workstation-mode .station-row { margin-bottom: .4rem; padding: .4rem; }
body.workstation-mode .detail-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
/* Contacts (left) and contact detail (right) become grid items of the section. */
body.workstation-mode .track-workstation #operations-workspace { display: contents; }
body.workstation-mode #operations-workspace .chart-panel { display: none; }
body.workstation-mode .contacts-panel, body.workstation-mode .details-panel { height: auto; contain: none; min-height: 0; padding: .5rem; overflow: hidden auto; }
body.workstation-mode .contacts-panel { grid-column: 1; grid-row: 1 / -1; }
body.workstation-mode .details-panel { grid-column: 3; grid-row: 2; }
body.workstation-mode .contacts-panel .panel-help { display: none; }
body.workstation-mode #track-list { max-height: none; }
body.workstation-mode #detail-label { margin: .35rem 0 .3rem; font-size: 1.05rem; }
body.workstation-mode #detail-badges { margin-bottom: .4rem; }
body.workstation-mode #detail-metrics { padding-bottom: .3rem; }
body.workstation-mode .annotation-form { margin: .35rem 0; }
body.workstation-mode #operations-workspace .station-row-actions { padding-top: .4rem; }
body.workstation-mode #bridge-orders, body.workstation-mode #opz-controls { display: flex; flex: 0 0 auto; flex-direction: column; align-items: stretch; margin: 0; padding: .5rem; }
body.workstation-mode .bridge-order-heading p, body.workstation-mode #bridge-order-values { display: none; }
body.workstation-mode .station-grid > :has(#bridge-tactical), body.workstation-mode .station-grid > :has(#sonar-observations), body.workstation-mode .station-grid > :has(#opz-observations), body.workstation-mode .station-grid > :has(#radio-observations) { display: none; }
body.workstation-mode .station-card-view summary { cursor: pointer; padding: .45rem; }
body.workstation-mode .station-card-view summary h3 { display: inline; font-size: var(--font-md); }
body.workstation-mode .station-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.workstation-mode .station-controls > h3 { margin-bottom: .25rem; }
body.workstation-mode footer { display: none; }
/* The newest events stay in view as a two-line ticker along the bottom edge. */
body.workstation-mode .events-panel { display: flex; margin: 0; padding: .1rem .5rem; max-height: 4.6rem; min-height: 0; }
body.workstation-mode .events-panel .panel-heading { display: none; }
body.workstation-mode .event-list { margin: 0; }
body.workstation-mode .event-list li { padding: .1rem .5rem; border-bottom: 0; font-size: .75rem; line-height: 1.35; }
body.workstation-mode .event-meta { display: inline; margin: 0 .5rem 0 0; }
/* A just-switched station shows its cached picture; dim it only if the fresh
state takes noticeably long, so a normal switch does not flicker. */
body[data-role-stale="true"] .station-view { opacity: .6; transition: opacity .15s ease .3s; }
body[data-sonar-scope][data-remote-role="assigned"] #shell { grid-template-rows: minmax(0, 1fr); }
body[data-sonar-scope][data-remote-role="assigned"] .masthead,
body[data-sonar-scope][data-remote-role="assigned"] .tablist,
body[data-sonar-scope][data-remote-role="assigned"] .mission-strip,
body[data-sonar-scope][data-remote-role="assigned"] #operations-workspace,
body[data-sonar-scope][data-remote-role="assigned"] .events-panel,
body[data-sonar-scope][data-remote-role="assigned"] #station-command-status,
body[data-sonar-scope][data-remote-role="assigned"] #sonar-page-tabs { display: none !important; }
body[data-sonar-scope][data-remote-role="assigned"] #operations { min-height: 0; }
body[data-sonar-scope][data-remote-role="assigned"] .operations-panel,
body[data-sonar-scope][data-remote-role="assigned"] .station-view { height: 100%; padding: 0; }
body[data-sonar-scope][data-remote-role="assigned"] .station-section:not([hidden]) { height: 100%; min-height: 0; }
body[data-sonar-scope][data-remote-role="assigned"] .station-section:not([hidden]) > :not(#role-visuals) { display: none !important; }
body[data-sonar-scope][data-remote-role="assigned"] .role-visuals { grid-column: 1 / -1; grid-row: 1; width: 100%; height: 100%; margin: 0; border: 0; }
body[data-sonar-scope][data-remote-role="assigned"] .sonar-plots > section:not([hidden]) { display: flex; flex: 1; flex-direction: column; min-height: 0; }
@media (max-width: 850px) {
body.workstation-mode .operations-panel { display: block; overflow-y: auto; }
body.workstation-mode .station-view, body.workstation-mode .station-section { height: auto; overflow: visible; }
body.workstation-mode .station-section, body.workstation-mode .station-section.track-workstation { display: flex; flex-direction: column; }
body.workstation-mode .role-visuals { height: auto; overflow: visible; }
body.workstation-mode .station-grid { height: auto; overflow: visible; }
body.workstation-mode .track-workstation #operations-workspace, body.workstation-mode #operations-workspace { display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; }
body.workstation-mode #operations-workspace .panel { max-height: none; }
body.workstation-mode #track-list { max-height: min(18rem, 45svh); }
body.workstation-mode #detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.workstation-mode .role-canvas { height: 22rem; }
body.workstation-mode .track-workstation .role-canvas { flex: none; height: 22rem; }
body.workstation-mode .role-map-frame, body.workstation-mode .track-workstation .role-map-frame { flex: none; height: 22rem; }
body.workstation-mode .spectrum-canvas, body.workstation-mode .track-workstation .spectrum-canvas { flex: none; height: 8rem; min-height: 8rem; }
body.workstation-mode .sonar-plots[data-layout="overview"] { display: flex; flex-direction: column; }
body.workstation-mode .mission-strip { flex-wrap: wrap; }
body.workstation-mode .tablist { flex-wrap: wrap; }
body.workstation-mode .contacts-panel { grid-column: auto; grid-row: auto; }
body.workstation-mode .details-panel { grid-column: auto; grid-row: auto; }
body.workstation-mode .events-panel { max-height: 8rem; }
.workstation-station { min-width: min(100%, 18rem); }
body.workstation-mode .station-controls, body.workstation-mode .detail-metrics { grid-template-columns: minmax(0, 1fr); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
body { margin: 0; background: var(--bg); color: var(--text); overflow-wrap: anywhere; }
#shell { height: 100vh; height: 100svh; height: 100dvh; display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: clip; }
button, input, select { font: inherit; color: inherit; max-width: 100%; min-width: 0; }
button, select, input[type="text"], input[type="number"] { border: 1px solid #536873; border-radius: .2rem; background: var(--control-bg); min-height: 2.7rem; padding: .55rem .75rem; }
button { cursor: pointer; font-weight: 600; }
button:hover:not(:disabled) { background: #29424d; border-color: var(--accent); }
button:disabled, select:disabled { opacity: .45; cursor: not-allowed; }
#disabled-control-explain { width: 2.2rem; min-height: 2.2rem; padding: .2rem; color: var(--amber); }
.disabled-control-help { position: fixed; z-index: 30; right: 1rem; bottom: 1rem; max-width: min(42rem, calc(100vw - 2rem)); max-height: min(16rem, calc(100vh - 2rem)); overflow: auto; margin: 0; padding: .7rem; pointer-events: none; color: var(--amber); background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: .2rem; box-shadow: 0 .4rem 1.2rem #0008; font-size: .82rem; }
button[aria-pressed="true"] { background: #28493f; border-color: var(--accent); color: var(--accent); }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
button.primary:hover:not(:disabled) { background: #c3f4e1; color: var(--on-accent); }
button.quiet { background: transparent; min-height: 2rem; padding: .3rem .5rem; font-size: var(--font-sm); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
h1, h2, h3, p, dl { margin: 0; }
h1 { font-size: 1.55rem; font-weight: 650; letter-spacing: -.035em; }
h2 { font-size: .84rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 600; }
p { line-height: 1.55; }
.eyebrow, .local-tag, .north, .counter, dt, .fine, .chart-help, footer { color: var(--muted); }
.eyebrow { font-size: var(--font-xs); letter-spacing: .18em; text-transform: uppercase; margin-bottom: .5rem; }
.fine, .chart-help { font-size: .78rem; line-height: 1.5; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 1.1rem 1.7rem; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.brand strong { font-size: 1.3rem; letter-spacing: -.02em; }
.brand strong span { font-weight: 350; }
.brand p { color: var(--muted); font-size: var(--font-xs); text-transform: uppercase; letter-spacing: .17em; margin-top: .2rem; }
.brand-mark { width: 2rem; height: 2rem; border: 1px solid var(--accent); display: inline-block; transform: rotate(45deg); position: relative; flex: 0 0 auto; margin: .3rem; }
.brand-mark::after { content: ""; position: absolute; inset: .4rem; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.preferences { display: flex; align-items: center; gap: 1rem; font-size: var(--font-sm); }
.language { display: flex; align-items: center; gap: .65rem; min-width: 0; max-width: 100%; }
.volume { display: grid; gap: .2rem; font-size: .7rem; }
.volume input { width: 7rem; accent-color: var(--accent); min-height: 1.5rem; }
.voice-controls { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; max-width: 19rem; }
.voice-controls button { min-height: 2.6rem; touch-action: none; }
.voice-controls #voice-ptt[aria-pressed="true"] { background: var(--amber); color: #101d24; }
.voice-controls #voice-status { font-size: var(--font-xs); color: var(--muted); width: 100%; }
.connection { background: #182d31; border-bottom: 1px solid #385b53; color: var(--accent); padding: .5rem 1.7rem; font-size: .82rem; }
#toast-region { position: fixed; top: 1rem; right: 1rem; z-index: 40; display: flex; flex-direction: column; gap: .5rem; max-width: min(90vw, 26rem); pointer-events: none; }
.toast { padding: .6rem .9rem; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: var(--font-sm); box-shadow: 0 .3rem .9rem rgba(0, 0, 0, .35); }
.toast-danger { border-color: var(--red); color: var(--red); }
.toast-ok { border-color: var(--accent); color: var(--accent); }
.connection[data-state="reconnecting"] { color: var(--blue); }
.connection[data-state="stale"], .connection[data-state="syncing"], .connection[data-state="protocol_error"] { color: var(--amber); background: var(--warn-bg); border-color: var(--warn-border); }
.connection[data-state="protocol_error"] { color: var(--red); }
.connection[data-state="unpaired"] { color: var(--muted); background: #13212c; border-color: var(--line); }
.bootstrap { min-height: 100svh; display: flex; align-items: center; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.loading { width: 1rem; height: 1rem; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pairing { width: 100%; max-width: 78rem; min-height: 0; margin: 0 auto; padding: clamp(2rem, 8vh, 7rem) 2rem; display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 6vw, 8rem); align-items: center; overflow-y: auto; }
.pair-intro h1 { font-size: clamp(2.5rem, 4vw, 4.5rem); line-height: 1.08; margin-bottom: 1.5rem; max-width: 12ch; }
.pair-intro > p:not(.eyebrow) { color: var(--muted); max-width: 40ch; font-size: 1.1rem; }
.scope-note { display: flex; gap: 1rem; color: var(--accent); margin-top: 2rem; font-size: .9rem; max-width: 42ch; }
.scope-line { width: .2rem; flex-shrink: 0; background: var(--accent); }
.pair-card { padding: 2rem; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); display: grid; gap: 1rem; }
.pair-card h2 { font-size: 1rem; }
.pair-card > p { color: var(--muted); }
.pair-card input { width: 100%; font: 1.8rem ui-monospace, monospace; letter-spacing: .12em; }
.error { color: var(--red) !important; min-height: 1.5em; }
.lobby { width: min(100%, 96rem); margin: 0 auto; padding: clamp(1.2rem, 4vh, 3rem) 1.5rem; overflow-y: auto; }
.lobby-heading { max-width: 58rem; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.lobby-heading > p:last-child { margin-top: .55rem; color: var(--muted); }
.lobby-status { min-height: 2.7rem; padding: .75rem 0; color: var(--amber); }
.station-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .6rem; padding: 6px; }
.station-card { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--panel); display: grid; grid-template-rows: auto 1fr auto; gap: .65rem; }
.station-card h2 { overflow-wrap: anywhere; }
.station-occupancy { color: var(--muted); font-size: .78rem; }
.station-occupied { border-top-color: var(--red); }
.station-mine { border-top-color: var(--blue); }
.role-rail { grid-row: 3; grid-column: 1; width: 12rem; padding: 1rem; border-right: 1px solid var(--line); background: var(--surface-1); display: flex; flex-direction: column; gap: .7rem; overflow-y: auto; }
.role-rail h2 { color: var(--accent); font-size: 1.05rem; letter-spacing: 0; text-transform: none; }
.role-rail button { margin-top: auto; }
.role-rail #role-status { color: var(--red); font-size: .75rem; }
body[data-remote-role="assigned"] #shell { grid-template-columns: 12rem minmax(0, 1fr); }
body[data-remote-role="assigned"] .masthead, body[data-remote-role="assigned"] .connection { grid-column: 1 / -1; }
body[data-remote-role="assigned"] #operations, body[data-remote-role="assigned"] #simlog-view { grid-row: 3; grid-column: 2; }
.mobile-role { display: none; }
main { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: clip; }
.tablist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 0; padding: .45rem 1.2rem; gap: .35rem; border-bottom: 1px solid var(--line); }
.tablist [role="tab"] { min-width: 0; min-height: 2.5rem; padding: .4rem .6rem; border-color: transparent; border-bottom-color: var(--line); border-radius: 0; background: transparent; color: var(--muted); overflow-wrap: anywhere; }
.tablist [role="tab"][aria-selected="true"] { border-color: var(--accent); background: var(--control-bg); color: var(--accent); }
.tab-deck { min-width: 0; min-height: 0; overflow: clip; }
.tab-panel { width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 0 1.2rem 1rem; overflow-y: auto; overscroll-behavior: contain; }
.pending-panel { place-content: center; text-align: center; color: var(--muted); }
.pending-panel:not([hidden]) { display: grid; }
.lookout-panel:not([hidden]) { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .65rem; padding-top: .8rem; overflow: hidden; }
.lookout-bar { display: grid; grid-template-columns: minmax(8rem, 1fr) auto auto; align-items: center; gap: .8rem 1.2rem; min-width: 0; }
.lookout-title .eyebrow { margin-bottom: .15rem; }
.lookout-title h1 { font-size: 1.25rem; }
.lookout-environment { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1rem; color: var(--muted); font-size: .78rem; }
.lookout-environment strong { color: var(--text); font: .9rem ui-monospace, monospace; }
.lookout-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); align-items: center; gap: .35rem; }
.lookout-toolbar button { min-height: 2.4rem; padding: .35rem .55rem; font-size: var(--font-xs); }
.lookout-toolbar output { grid-column: 1 / -1; text-align: right; color: var(--muted); font: var(--font-xs) ui-monospace, monospace; }
.lookout-scope { min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--line); background: var(--scope-bg); }
#lookout { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; touch-action: none; }
.lookout-note { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.guide-panel { scroll-behavior: auto; }
.guide-panel:not([hidden]) { display: block; padding-top: 1.3rem; }
.guide-header { max-width: 60rem; padding: .5rem .2rem 1.5rem; border-bottom: 1px solid var(--line); }
.guide-header > p:last-child { max-width: 58rem; margin-top: .6rem; color: var(--muted); }
.guide-manual a { color: var(--accent); font-weight: 600; }
.guide-layout { display: grid; grid-template-columns: minmax(13rem, .6fr) minmax(0, 2fr); align-items: start; gap: 1rem; max-width: 78rem; margin: 1rem auto 0; }
.guide-nav { position: sticky; top: 0; padding: .8rem; }
.guide-nav h2 { padding: .3rem .45rem .7rem; }
.guide-nav ol { list-style: none; display: grid; gap: .2rem; margin: 0; padding: 0; }
.guide-nav a { display: block; min-height: 2.4rem; padding: .55rem .65rem; border-left: 2px solid var(--line); color: var(--muted); font-size: var(--font-sm); line-height: 1.45; text-decoration: none; }
.guide-nav a:hover { border-left-color: var(--accent); background: #1a2d36; color: var(--accent); }
.guide-copy { display: grid; gap: .8rem; min-width: 0; padding-bottom: 1rem; }
.guide-copy section { min-width: 0; padding: 1.2rem; scroll-margin-top: 1rem; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid #55717a; }
.guide-copy section:focus { border-top-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -2px; }
.guide-copy h2 { margin-bottom: .8rem; color: var(--accent); }
.guide-copy p { color: var(--muted); }
.guide-copy p + p { margin-top: .7rem; }
.guide-copy .guide-warning { border-top-color: var(--amber); background: #28251f; }
.guide-copy .guide-warning h2 { color: var(--amber); }
.analyzer-panel:not([hidden]) { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .7rem; padding-top: .8rem; overflow: hidden; }
.analyzer-header { display: flex; justify-content: space-between; align-items: end; gap: 1rem; min-width: 0; }
.analyzer-header .eyebrow { margin-bottom: .15rem; }
.analyzer-header .panel-help { padding: .25rem 0 0; }
.analyzer-workspace { display: grid; grid-template-columns: minmax(15rem, .75fr) minmax(0, 2fr); gap: .8rem; min-width: 0; min-height: 0; overflow: hidden; }
.analyzer-browser { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .8rem; overflow: hidden; }
.analyzer-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; }
.analyzer-filters label { color: var(--muted); font-size: var(--font-xs); }
.analysis-list { display: flex; flex-direction: column; gap: .4rem; min-width: 0; min-height: 0; padding: 6px; margin: -6px; overflow-y: auto; overscroll-behavior: contain; }
.analysis-item { flex: 0 0 auto; width: 100%; text-align: left; padding: .65rem .75rem; background: var(--surface-2); border-color: var(--line); }
.analysis-item span { display: block; overflow-wrap: anywhere; }
.analysis-item small { display: block; color: var(--muted); margin-top: .2rem; }
.analysis-item[aria-pressed="true"] { color: var(--text); background: var(--selected-bg); border-color: var(--accent); }
.analyzer-detail { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.analyzer-detail .panel-heading { align-items: start; }
#analysis-name { font-size: 1.25rem; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.analysis-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin: .9rem 0; }
.analysis-legend { margin-top: .8rem; padding: .55rem .65rem; border-left: 2px solid var(--accent); background: #0c1a22; color: var(--muted); font-size: var(--font-xs); line-height: 1.4; overflow-wrap: anywhere; }
.analysis-legend p + p { margin-top: .35rem; }
.analysis-image { margin: 0; min-width: 0; border: 1px solid var(--line); background: #09151c; }
.analysis-image img { display: block; width: 100%; height: auto; }
.analysis-image figcaption { color: var(--muted); padding: .4rem .55rem; font-size: .7rem; }
.analyzer-metrics { padding-top: .3rem; }
.analysis-components { border-top: 1px solid var(--line); padding-top: 1rem; }
.analysis-components h3 { margin-bottom: .8rem; }
.analysis-component-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: .8rem; }
.analysis-component-groups > section { min-width: 0; }
.analysis-component-list { display: grid; gap: .45rem; }
.analysis-component { min-width: 0; padding: .6rem; border-left: 3px solid var(--blue); background: var(--surface-2); }
.analysis-component h4 { margin: 0 0 .55rem; overflow-wrap: anywhere; }
.analysis-component .detail-metrics { grid-template-columns: minmax(0, 1fr); gap: .35rem; padding-bottom: 0; }
.analysis-component .detail-metrics > div { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0, 1.4fr); gap: .6rem; align-items: baseline; padding-bottom: .3rem; border-bottom: 1px solid #263944; }
.analysis-component .detail-metrics dt { margin: 0; }
.analysis-component .detail-metrics dd { text-align: right; }
.station-view { min-width: 0; margin-bottom: .8rem; }
.station-section { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--surface-1); }
.station-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.station-heading .eyebrow { margin: 0; }
.station-heading h2 { color: var(--accent); }
.station-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: .7rem; min-width: 0; }
.station-card-view { min-width: 0; padding: .8rem; border: 1px solid var(--line); background: var(--panel); }
.station-card-view > h3 { margin-bottom: .7rem; color: var(--muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.station-wide { grid-column: 1 / -1; }
.station-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: .5rem; max-height: 28rem; min-width: 0; overflow: auto; overscroll-behavior: contain; }
.station-row { min-width: 0; padding: .65rem; border-left: 3px solid var(--blue); background: var(--surface-2); }
.station-row h4 { margin: 0 0 .6rem; font-size: .88rem; overflow-wrap: anywhere; }
.station-row .detail-metrics, .station-card-view > .detail-metrics { padding-bottom: 0; }
.station-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .55rem; align-items: end; }
.station-controls > h3 { grid-column: 1 / -1; }
.bridge-weather canvas { display: block; width: 100%; height: clamp(4.5rem, 12vw, 7rem); border: 1px solid var(--line); }
.bridge-weather p { margin-top: .45rem; color: var(--muted); }
.station-controls label, .control-form label { display: block; color: var(--muted); font-size: var(--font-xs); }
.station-controls select, .station-controls button, .station-controls input { width: 100%; }
.control-page { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .55rem; align-items: end; padding-top: .35rem; }
.control-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; min-width: 0; }
.toggle { display: flex !important; align-items: center; gap: .45rem; min-height: 2.7rem; padding: .45rem; border: 1px solid var(--line); }
.toggle input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }
.station-row-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.station-row-actions button { flex: 1 1 8rem; min-height: 2.7rem; font-size: .75rem; }
.station-alert { color: var(--red); grid-column: 1 / -1; padding: .6rem; border: 1px solid var(--red); }
.compact-list { max-height: 12rem; }
.direct-fire-controls { border-top: 3px solid var(--red); }
.direct-fire-controls > h3 { color: var(--red); }
.card-controls { border-top: 3px solid var(--accent); }
.card-controls > h3 { color: var(--accent); }
.fire-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .4rem .55rem; align-items: end; }
.fire-grid label { color: var(--muted); font-size: var(--font-xs); }
.fire-grid input, .fire-grid select, .fire-grid button { width: 100%; }
.fire-grid button { border-color: #8e4b4b; }
.fire-grid button.armed { color: #170c0c; background: var(--red); border-color: var(--red); }
.fire-status { min-height: 1.5em; margin-top: .6rem; color: var(--muted); font-size: .76rem; }
.fire-status[data-state="armed"], .fire-status[data-state="fire_pending"], .fire-status[data-state="fire_uncertain"] { color: var(--amber); }
.fire-status[data-state="fire_revoked"], .fire-status[data-state="fire_stale"] { color: var(--red); }
#station-command-status { min-height: 1.4rem; margin: .55rem .2rem 0; }
.role-visuals { min-width: 0; margin-top: .7rem; padding: .8rem; border: 1px solid var(--line); background: #08151c; }
.visual-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; padding-bottom: .55rem; }
.visual-heading h3 { color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-size: var(--font-sm); }
.visual-state { color: var(--muted); font: var(--font-xs) ui-monospace, monospace; }
.visual-panel { min-width: 0; }
.visual-toolbar { display: flex; flex-wrap: wrap; gap: .35rem; padding-bottom: .45rem; }
.visual-toolbar button { min-height: 2.4rem; padding: .35rem .55rem; font-size: var(--font-xs); }
.visual-toolbar output { margin-left: auto; color: var(--muted); font: var(--font-xs) ui-monospace, monospace; }
.role-canvas { display: block; width: 100%; height: clamp(14rem, 42vh, 28rem); min-width: 0; border: 1px solid var(--line); background: #07151c; touch-action: none; }
.role-map-frame { position: relative; width: 100%; height: clamp(14rem, 42vh, 28rem); min-width: 0; overflow: hidden; border: 1px solid var(--line); background: #07151c; }
#role-map, #role-map-sweep { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-height: 0; border: 0; flex: none; }
#role-map-sweep { pointer-events: none; }
.actionable-canvas { cursor: pointer; }
.damage-visual-controls { display: grid; grid-template-columns: auto minmax(8rem, 16rem); gap: .55rem; align-items: center; padding-bottom: .45rem; }
.damage-visual-controls label { color: var(--muted); font-size: var(--font-xs); }
.visual-equivalent { max-height: 7rem; margin: .45rem 0 0; padding: .45rem .65rem; overflow: auto; border-left: 2px solid var(--line); color: var(--muted); font: .68rem/1.45 ui-monospace, monospace; }
ul.visual-equivalent { padding-left: 1.8rem; }
.visual-equivalent:empty { display: none; }
.visual-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; margin-bottom: .45rem; }
.visual-tabs button { min-height: 2.5rem; padding: .35rem; border-radius: 0; color: var(--muted); font-size: .7rem; }
.visual-tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); background: #173029; }
.sonar-audition-controls { display: grid; grid-template-columns: auto minmax(7rem, 1fr) auto minmax(7rem, 1fr) auto; align-items: center; gap: .35rem .55rem; min-width: 0; }
.sonar-audition-controls > label:not(.check) { color: var(--muted); font-size: var(--font-xs); }
.sonar-audition-controls select { min-width: 0; }
.sonar-audition-controls output, .sonar-display-controls output { color: var(--accent); font: var(--font-xs) ui-monospace, monospace; white-space: nowrap; }
.sonar-display-controls { display: grid; grid-template-columns: auto minmax(5rem, 1fr) auto minmax(5rem, 1fr) auto minmax(5rem, 1fr) auto minmax(5rem, 1fr) auto minmax(15rem, 2fr); align-items: center; gap: .25rem .45rem; margin: .25rem 0; padding: .25rem .4rem; border: 1px solid var(--line); background: var(--scope-bg); }
.sonar-display-controls label { color: var(--muted); font-size: var(--font-xs); text-transform: uppercase; letter-spacing: .05em; }
.sonar-display-controls select, .sonar-display-controls button { min-height: 1.9rem; padding: .15rem .35rem; border-radius: 0; font-size: var(--font-xs); }
.sonar-display-controls input[type="range"], .sonar-audition-controls input[type="range"] { accent-color: var(--accent); }
.sonar-cursor-readout { overflow: hidden; text-overflow: ellipsis; }
.sonar-active-plots { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); flex: 1; min-height: 0; gap: .35rem; }
.sonar-active-plots > canvas { min-width: 0; min-height: 6rem; }
.sonar-plots > section { min-width: 0; }
.sonar-band-plots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; margin-top: .35rem; }
.band-canvas { height: 8rem; }
.mission-strip { display: flex; align-items: center; gap: 2rem; padding: 1.4rem .5rem; }
.bridge-orders { margin-bottom: .8rem; border-top: 3px solid var(--blue); display: grid; grid-template-columns: minmax(12rem, .8fr) minmax(12rem, .7fr) minmax(22rem, 1.5fr); gap: 1rem 1.5rem; align-items: end; }
.bridge-order-heading > p:last-child { color: var(--muted); font-size: .78rem; margin-top: .45rem; }
.bridge-order-values { align-self: center; }
.bridge-order-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.bridge-order-form { min-width: 0; }
.bridge-order-form label { display: block; color: var(--muted); font-size: .75rem; margin-bottom: .35rem; }
.bridge-order-form .setter > * { min-width: 0; width: 50%; }
.bridge-orders > .command-status { grid-column: 1 / -1; margin-top: 0; }
.opz-controls { margin-bottom: .8rem; display: grid; grid-template-columns: minmax(10rem, 1fr) repeat(4, auto); gap: .65rem 1rem; align-items: center; border-top: 3px solid var(--amber); }
.opz-radars { display: flex; flex-wrap: wrap; gap: .6rem; }
.opz-radars label, .opz-manage { display: flex; align-items: center; gap: .35rem; min-height: 2.7rem; padding: .35rem; }
.opz-controls input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
.opz-controls > .fine { grid-column: 1 / -1; }
.opz-track-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.mission-name { flex: 1; min-width: 0; }
.mission-name p:last-child { color: var(--muted); margin-top: .4rem; font-size: .86rem; }
.mission-name h1, #detail-label, #objective, #chart-disclaimer { overflow-wrap: anywhere; }
.session { max-width: 18rem; text-align: right; font-size: .78rem; }
.session p { color: var(--muted); margin: .4rem 0; }
.badge { display: inline-block; border: 1px solid var(--line); padding: .25rem .5rem; font: .75rem ui-monospace, monospace; }
.workspace { display: grid; grid-template-columns: minmax(14rem, .7fr) minmax(0, 3.6fr) minmax(19rem, .9fr); gap: .8rem; align-items: stretch; }
.panel { background: var(--panel); border: 1px solid var(--line); min-width: 0; min-height: 0; padding: 1rem; }
.panel > *, .metrics > *, .detail-metrics > *, .panel-heading > * { min-width: 0; }
.contacts-panel { display: flex; flex-direction: column; overflow: hidden; }
.contacts-panel > :not(.track-list) { flex-shrink: 0; }
.details-panel { overflow: auto; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.local-tag, .north { font-size: .7rem; }
.counter { font: var(--font-md) ui-monospace, monospace; }
.panel-help { font-size: .76rem; color: var(--muted); padding: .8rem 0; }
.contact-filter { display: grid; gap: .3rem; padding: 0 0 .7rem; color: var(--muted); font-size: var(--font-xs); }
.contact-filter input { width: 100%; min-width: 0; }
.track-list { display: flex; flex-direction: column; gap: .45rem; flex: 1; min-height: 0; min-width: 0; overflow: auto; padding: 6px; margin: -6px; }
.track { position: relative; width: 100%; flex-shrink: 0; text-align: left; padding: .7rem .75rem; border-color: var(--line); border-left: 3px solid var(--aff-color); background: var(--surface-2); display: grid; grid-template-columns: 1.7rem minmax(0, 1fr); gap: .6rem; align-items: center; }
.track[aria-pressed="true"] { background: var(--selected-bg); border-color: var(--accent); border-left-color: var(--aff-color); color: var(--text); }
.track .track-name { display: block; overflow-wrap: anywhere; font-size: .92rem; }
.track .track-info { color: var(--muted); display: block; font-size: var(--font-xs); font-weight: 400; line-height: 1.5; margin-top: .25rem; }
.track .track-flags { color: var(--text); font-size: .68rem; font-weight: 500; }
.aff-unknown { --aff-color: #f3cf79; }
.aff-friend { --aff-color: var(--blue); }
.aff-neutral { --aff-color: #8fdfab; }
.aff-hostile { --aff-color: var(--red); }
.domain-symbol { color: var(--aff-color); border: 2px solid currentColor; display: inline-block; width: 1.3rem; height: 1.3rem; }
.domain-surface { border-radius: .15rem; }
.domain-air { border-bottom-color: transparent; border-radius: 60% 60% 0 0; }
.domain-subsurface { border-top-color: transparent; border-radius: 0 0 60% 60%; }
.domain-unknown { transform: rotate(45deg); width: 1.05rem; height: 1.05rem; margin-left: .1rem; }
.chart-panel { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chart-panel .panel-heading { padding: 1rem; }
.chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .6rem .75rem; }
.chart-toolbar button { font-size: .74rem; min-height: 2.5rem; padding: .4rem .6rem; }
.chart-toolbar output { margin-left: auto; color: var(--muted); font: .75rem ui-monospace, monospace; }
#chart { display: block; width: 100%; height: 72vh; flex: none; min-height: 20rem; background: #0c1c26; touch-action: none; cursor: grab; }
#chart:active { cursor: grabbing; }
.chart-help { padding: .6rem 1rem 0; max-height: 6rem; overflow: auto; }
.legend { display: flex; flex-wrap: wrap; gap: .6rem 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); font-size: .68rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; }
.legend span::before { content: ""; display: inline-block; flex-shrink: 0; width: .85rem; height: .85rem; border: 1px solid; }
.selected-key::before { border-color: var(--accent) !important; }
.bearing-key::before { height: 0 !important; border: 0 !important; border-top: 1px dashed var(--muted) !important; }
#chart-disclaimer { padding: .7rem 1rem; max-height: 6rem; overflow: auto; }
.empty { color: var(--muted); padding: 1.5rem 0; font-size: .88rem; }
#detail-label { margin: 1rem 0 .5rem; font-size: 1.4rem; }
.badges { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .8rem; }
.badges .badge { color: var(--aff-color, var(--muted)); }
.detail-metrics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .65rem; padding-bottom: 1rem; }
dt { font-size: var(--font-xs); margin-bottom: .3rem; }
dd { margin: 0; font: .92rem ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.annotation-form { margin: .8rem 0; }
.annotation-form label { display: block; color: var(--muted); font-size: .75rem; margin-bottom: .4rem; }
.setter { display: flex; gap: .4rem; }
.setter select, .setter input { width: 0; flex: 1; min-width: 0; }
.setter button, .setter select, .setter input { font-size: var(--font-sm); }
#navigation-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: .4rem; }
#navigation-form label { margin: .2rem 0 0; }
#navigation-form input, #navigation-form button { width: 100%; }
#propose { width: 100%; margin-top: .85rem; }
.proposal-box { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.proposal-box > p { margin: .5rem 0; }
.events-panel { margin-top: .8rem; max-height: 18rem; display: flex; flex-direction: column; }
.event-list { list-style: none; padding: 0; margin: .4rem 0 0; min-height: 0; overflow: auto; }
.event-list li { padding: .7rem 0 .7rem .7rem; border-bottom: 1px solid var(--line); border-left: 2px solid var(--line); font-size: .83rem; line-height: 1.5; overflow-wrap: anywhere; }
.event-list li.warning { border-left-color: var(--amber); }
.event-meta { display: block; color: var(--muted); font: .65rem ui-monospace, monospace; margin-bottom: .25rem; }
#proposal-status { color: var(--amber); font-size: var(--font-md); overflow-wrap: anywhere; }
#clear-proposal { font-size: var(--font-sm); }
.command-status { color: var(--amber); font-size: var(--font-sm); margin-top: .8rem; }
.command-status[data-status="applied"] { color: var(--accent); }
.command-status[data-status="rejected"] { color: var(--red); }
.command-reconcile { grid-column: 1 / -1; margin-top: .8rem; }
.command-reconcile button { margin-top: .5rem; }
.metrics { display: flex; gap: 1rem 1.5rem; flex-wrap: wrap; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem .2rem; font-size: var(--font-xs); }
@media (min-width: 1501px) {
/* Only the chart sizes this row; arbitrarily long side content scrolls. */
.contacts-panel, .details-panel { contain: size; }
}
@media (max-width: 1500px) {
.bridge-orders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bridge-order-controls { grid-column: 1 / -1; }
.workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-panel { grid-row: 1; grid-column: 1 / -1; }
.contacts-panel, .details-panel { height: max(20rem, 70svh); }
.mission-strip { flex-wrap: wrap; gap: 1rem; }
.mission-name { flex-basis: 45%; }
}
@media (max-width: 700px) {
.sonar-live-audio { align-items: stretch; flex-direction: column; }
.sonar-audition-controls { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
.sonar-display-controls { grid-template-columns: auto minmax(0, 1fr); }
.sonar-active-plots { grid-template-columns: minmax(0, 1fr); }
.sonar-band-plots { grid-template-columns: minmax(0, 1fr); }
.masthead { padding: 1rem; align-items: flex-start; flex-direction: column; gap: 1rem; }
.preferences { flex-wrap: wrap; gap: .6rem; width: 100%; }
.language { gap: .35rem; }
.volume { margin-left: auto; }
.volume input { width: 5rem; }
.connection { padding: .6rem 1rem; }
.tablist { padding: .4rem .6rem; }
.tab-panel { padding: 0 .6rem .6rem; }
.pairing { grid-template-columns: 1fr; padding: 2rem 1rem; gap: 2rem; }
.pair-intro h1 { max-width: 18ch; }
.pair-card { padding: 1.2rem; }
.lobby { padding: 1.2rem .65rem; }
.station-cards { grid-template-columns: minmax(0, 1fr); }
.station-card { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; }
.station-card .station-occupancy { grid-column: 1; }
.station-card button { grid-column: 2; grid-row: 1 / 3; min-width: 7.5rem; }
.role-rail { display: none; }
.mobile-role:not([hidden]) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .4rem; align-items: center; padding: .45rem .65rem; border-bottom: 1px solid var(--line); background: var(--surface-1); }
.mobile-role label { color: var(--muted); font-size: var(--font-xs); }
.mobile-role select, .mobile-role button { min-height: 2.4rem; padding: .35rem .45rem; font-size: .75rem; }
body[data-remote-role="assigned"] #shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr); }
body[data-remote-role="assigned"] #operations, body[data-remote-role="assigned"] #simlog-view { grid-row: 4; grid-column: 1; }
.workspace { grid-template-columns: minmax(0, 1fr); }
.chart-panel { grid-row: 1; }
#chart { height: 70svh; }
.mission-strip { padding: 1rem .4rem; }
.mission-name { flex-basis: 100%; }
.station-heading { display: block; }
.station-heading .eyebrow { margin-bottom: .3rem; }
.station-section { padding: .65rem; }
.station-list { max-height: 60svh; }
.bridge-orders, .bridge-order-controls { grid-template-columns: minmax(0, 1fr); }
.opz-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.station-controls, .control-page { grid-template-columns: minmax(0, 1fr); }
.fire-grid { grid-template-columns: minmax(0, 1fr); }
/* Outside workstation-mode, .detail-metrics previously stayed two columns
at every width - cramped with the project's characteristically long
German field labels on narrow screens. */
.detail-metrics { grid-template-columns: minmax(0, 1fr); }
.visual-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.role-canvas { height: min(54svh, 22rem); }
.role-map-frame { height: min(54svh, 22rem); }
.opz-controls > div:first-child, .opz-controls > .fine { grid-column: 1 / -1; }
.session { text-align: left; max-width: none; }
.metrics { gap: .8rem 1.2rem; }
footer { flex-direction: column; }
.lookout-bar { grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; }
.lookout-title { display: none; }
.lookout-environment { justify-content: flex-start; }
.lookout-toolbar { grid-template-columns: repeat(4, minmax(0, auto)); }
.lookout-toolbar output { grid-column: auto; }
.lookout-note { max-height: 1.35em; overflow: hidden; }
.guide-layout { grid-template-columns: minmax(0, 1fr); }
.guide-nav { position: static; }
.guide-nav ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.analyzer-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, .8fr) minmax(0, 1.2fr); }
.analyzer-header .panel-help { max-height: 3.1rem; overflow: hidden; }
.analysis-images { grid-template-columns: minmax(0, 1fr); }
.analysis-component-groups { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 24rem) {
.masthead { padding: .45rem .5rem; gap: .4rem; }
.brand-mark, .brand p { display: none; }
.brand strong { font-size: 1rem; }
.preferences { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.station-card { grid-template-columns: minmax(0, 1fr); }
.station-card button { grid-column: 1; grid-row: auto; width: 100%; }
.mobile-role:not([hidden]) { grid-template-columns: minmax(0, 1fr) auto; }
.mobile-role label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.preferences > *, .language select, .volume input { width: 100%; }
.language > span, .volume > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.connection { padding: .35rem .5rem; font-size: var(--font-xs); line-height: 1.2; }
.tablist { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .3rem .5rem; }
.tablist [role="tab"] { min-height: 2.35rem; padding: .3rem; font-size: .75rem; }
.tab-panel { padding: 0 .5rem .5rem; }
.lookout-panel:not([hidden]) { padding-top: .4rem; gap: .35rem; }
.lookout-bar { grid-template-columns: minmax(0, 1fr); }
.lookout-environment { font-size: .68rem; }
.lookout-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lookout-toolbar button { min-height: 2.1rem; padding: .2rem; font-size: .62rem; }
.lookout-toolbar output { grid-column: auto; text-align: right; font-size: .62rem; }
.lookout-note { font-size: .63rem; line-height: 1.2; max-height: 2.4em; overflow: hidden; }
.guide-panel:not([hidden]) { padding-top: .6rem; }
.guide-header { padding-bottom: .8rem; }
.guide-nav ol { grid-template-columns: minmax(0, 1fr); }
.guide-copy section { padding: .8rem; }
.analyzer-header .eyebrow, .analyzer-header .panel-help { display: none; }
.analyzer-workspace { grid-template-rows: minmax(0, .7fr) minmax(0, 1.3fr); gap: .4rem; }
.analyzer-browser, .analyzer-detail { padding: .55rem; }
.analyzer-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem; }
.analyzer-filters label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.visual-tabs button { min-height: 2.2rem; font-size: .62rem; }
.role-visuals { padding: .45rem; }
}
@media (max-height: 31.25rem) {
.masthead { min-height: 0; padding: .25rem .5rem; flex-direction: row; gap: .35rem; }
.brand-mark, .brand p, .volume { display: none; }
.brand strong { font-size: var(--font-md); }
.preferences { margin-left: auto; gap: .25rem; flex-wrap: nowrap; }
.preferences button, .preferences select { min-height: 1.8rem; padding: .15rem .3rem; font-size: .65rem; }
.language { gap: .2rem; font-size: .65rem; }
.connection { padding: .2rem .5rem; font-size: .65rem; line-height: 1.2; max-height: 1.8rem; overflow: hidden; }
.tablist { padding: .2rem .4rem; gap: .2rem; }
.tablist [role="tab"] { min-height: 1.8rem; padding: .15rem .25rem; font-size: .65rem; }
.lookout-panel:not([hidden]) { padding-top: .25rem; gap: .2rem; }
.lookout-bar { grid-template-columns: auto minmax(0, 1fr); gap: .25rem; }
.lookout-environment { flex-direction: column; gap: 0; font-size: .6rem; line-height: 1.2; }
.lookout-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .2rem; }
.lookout-toolbar button { min-height: 1.8rem; padding: .1rem; font-size: .58rem; }
.lookout-toolbar output { grid-column: auto; font-size: .58rem; overflow: hidden; white-space: nowrap; }
.lookout-note { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.guide-panel:not([hidden]) { padding-top: .25rem; }
.guide-header { padding: .2rem 0 .5rem; }
.guide-header .eyebrow { display: none; }
.guide-nav a { min-height: 1.8rem; padding: .2rem .4rem; font-size: .65rem; }
.analyzer-panel:not([hidden]) { grid-template-rows: minmax(0, 1fr); padding-top: .25rem; gap: 0; }
.analyzer-header { display: none; }
}
/* Hidden simulation-log view (#simlog fragment) */
#simlog-view { min-height: 0; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr); }
.simlog-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.simlog-current-section { min-height: 0; margin: .5rem 0 0; }
.simlog-current-section h3 { color: var(--accent); font-size: var(--font-md); margin: 0 0 .2rem; }
.simlog-section-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.simlog-current { min-height: 0; overflow: auto; margin: .35rem 0; padding: .6rem; background: #0a1418; border: 1px solid var(--line); border-radius: .25rem; max-height: 46vh; }
.simlog-current-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.simlog-events-heading { color: var(--accent); font-size: var(--font-md); margin: .5rem 0 .1rem; }
.simlog-metrics-wrap h4, .simlog-table-wrap h4 { color: var(--accent); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .3rem; }
.simlog-metrics-wrap .metrics div { display: flex; gap: .5rem; padding: .12rem 0; font-size: var(--font-md); }
.simlog-metrics-wrap .metrics dt { color: var(--muted); flex: 0 0 auto; min-width: 9ch; }
.simlog-metrics-wrap .metrics dd { color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.simlog-note-danger { color: var(--red); font-size: var(--font-sm); margin: .35rem 0 0; }
.simlog-table-wrap { grid-column: 1 / -1; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.simlog-table { width: 100%; border-collapse: collapse; font: .78rem/1.5 ui-monospace, monospace; }
.simlog-table th { color: var(--muted); text-align: left; font-weight: 600; padding: .18rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.simlog-table td { color: var(--text); padding: .18rem .5rem; border-bottom: 1px solid #1c2c34; white-space: nowrap; }
.simlog-table tr.simlog-flag-row td { color: var(--red); }
.simlog-snapshot { min-width: 0; border-bottom: 1px solid var(--line); }
.simlog-snapshot summary { display: flex; gap: .75rem; align-items: baseline; padding: .35rem 0; font-size: .83rem; cursor: pointer; list-style-position: outside; overflow-wrap: anywhere; }
.simlog-snapshot .simlog-current-body { grid-template-columns: 1fr; margin-top: .4rem; }
.simlog-list { list-style: none; margin: .5rem 0; padding: 6px; flex: 1; min-width: 0; min-height: 0; overflow: auto; }
.simlog-entry { display: grid; grid-template-columns: 11ch 5ch minmax(0, 1fr); gap: .75rem; align-items: baseline; min-width: 0; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .83rem; line-height: 1.45; }
.simlog-stamp { flex: 0 0 auto; min-width: 11ch; font: .7rem ui-monospace, monospace; color: var(--accent); }
.simlog-cat { flex: 0 0 auto; min-width: 5ch; font: .65rem ui-monospace, monospace; color: var(--muted); text-transform: uppercase; }
.simlog-text { min-width: 0; overflow-wrap: anywhere; }
#fire-confirm-dialog { width: min(92vw, 32rem); color: var(--text); background: var(--panel); border: 1px solid var(--red); padding: 1.1rem; }
#fire-confirm-dialog::backdrop { background: rgb(2 8 12 / .82); }
#fire-confirm-dialog h2 { color: var(--red); margin-bottom: .6rem; }
#fire-confirm-dialog p { margin-bottom: 1.1rem; }
.fire-confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; }
button.danger { border-color: var(--red); color: var(--red); }
button.danger:hover:not(:disabled) { background: var(--red); color: #170c0c; }
#simlog-map-dialog { width: min(96vw, 96rem); max-width: none; height: min(94dvh, 64rem); max-height: none; padding: 0; color: var(--text); background: var(--panel); border: 1px solid var(--accent); }
#simlog-map-dialog::backdrop { background: rgb(2 8 12 / .82); }
.simlog-map-shell { height: 100%; min-width: 0; min-height: 0; padding: .85rem; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: .65rem; overflow: hidden; }
.simlog-map-header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .6rem; }
.simlog-map-header .eyebrow { margin-bottom: .2rem; }
.simlog-map-header h2 { color: var(--accent); }
.simlog-map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.simlog-map-toolbar button { min-height: 2.2rem; padding: .35rem .6rem; font-size: .75rem; }
.simlog-map-toolbar output { margin-left: auto; color: var(--muted); font: .75rem ui-monospace, monospace; }
.simlog-map-layout { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 4fr) minmax(13rem, 1fr); gap: .65rem; }
.simlog-map-plot { min-width: 0; min-height: 15rem; overflow: hidden; border: 1px solid var(--line); background: var(--scope-bg); }
#simlog-map { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.simlog-map-sidebar { min-width: 0; min-height: 0; overflow: auto; padding: .65rem; border: 1px solid var(--line); background: #0a171e; }
.simlog-map-sidebar h3 { color: var(--accent); margin-bottom: .5rem; }
.simlog-map-sidebar ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.simlog-map-sidebar li { padding-left: .55rem; border-left: 3px solid var(--unit-color); color: var(--muted); font: .7rem/1.4 ui-monospace, monospace; overflow-wrap: anywhere; }
@media (max-width: 700px) {
#simlog-map-dialog { width: 100vw; height: 100dvh; border-width: 0; }
.simlog-map-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(12rem, 2fr) minmax(6rem, 1fr); }
.simlog-map-header { align-items: center; }
.simlog-map-toolbar output { flex-basis: 100%; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .loading { animation: none; } }
/* Status-heavy stations do not need to spend a desktop-width sidebar on one
narrow stack. Keep the instrument dominant, while showing independent
readouts side by side; command groups marked station-wide remain unbroken. */
@media (min-width: 1500px) and (min-height: 760px) {
body.workstation-mode .station-section:not(.track-workstation) { grid-template-columns: minmax(0, 1fr) clamp(34rem, 38vw, 44rem); }
body.workstation-mode .station-section:not(.track-workstation) .station-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; }
body.workstation-mode .station-section:not(.track-workstation) .station-grid > .station-wide { grid-column: 1 / -1; }
}
/* Wide desktop screens (the browser runs on a PC, not the uConsole): use the
extra width for a fourth column instead of stacking detail under the controls. */
@media (min-width: 1800px) and (min-height: 850px) {
body.workstation-mode .station-section.track-workstation { grid-template-columns: clamp(15rem, 14vw, 22rem) minmax(0, 1fr) clamp(22rem, 19vw, 32rem) clamp(22rem, 19vw, 32rem); grid-template-rows: minmax(0, 1fr); }
body.workstation-mode .track-workstation .role-visuals, body.workstation-mode .contacts-panel { grid-row: 1; }
body.workstation-mode .track-workstation .station-grid { grid-column: 3; grid-row: 1; }
body.workstation-mode .details-panel { grid-column: 4; grid-row: 1; }
body.workstation-mode .station-section:not(.track-workstation) { grid-template-columns: minmax(0, 1fr) clamp(38rem, 36vw, 48rem); }
body.workstation-mode .sonar-plots[data-layout="overview-wide"] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: .35rem; }
body.workstation-mode .events-panel { max-height: 7.5rem; }
}
/* Solo host screen (menu phase) and the game-control dialogs. */
.host-screen { grid-row: 3; grid-column: 1 / -1; display: grid; place-items: center; padding: 2rem 1rem; overflow: auto; }
.host-screen-card { width: min(100%, 40rem); padding: 1.6rem; display: grid; gap: .9rem; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); }
.host-screen-card > p { color: var(--muted); }
.host-screen-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.host-dialog { width: min(92vw, 30rem); color: var(--text); background: var(--panel); border: 1px solid var(--accent); padding: 1.1rem; }
.host-dialog::backdrop { background: rgb(2 8 12 / .82); }
.host-dialog h2 { color: var(--accent); margin-bottom: .5rem; }
.host-dialog label { display: block; margin-top: .6rem; color: var(--muted); font-size: var(--font-xs); }
.host-dialog select, .host-dialog input { width: 100%; }
.host-slot-list { display: grid; gap: .4rem; margin: .8rem 0; padding: 0; list-style: none; }
.host-slot-list button { width: 100%; text-align: left; }
.host-dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
#host-new-dialog { width: min(92vw, 42rem); }
.host-new-difficulty-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .3rem .9rem; margin: .5rem 0 .8rem; }
.host-new-difficulty-grid .field { display: flex; flex-direction: column; gap: .1rem; }
.host-new-difficulty-grid .field label { margin: 0; }
.host-new-difficulty-grid .field input { width: 100%; }
@media (pointer: coarse) {
button, select, input[type="text"], input[type="number"] { min-height: 2.75rem; }
.station-tab, .host-bar button, .host-bar select, #workstation-add-station { min-height: 2.75rem; }
}
#helicopter-dip-canvas { display: block; width: 100%; max-width: 640px; height: auto; margin: .75rem auto; border: 1px solid var(--line, #42645e); }
body.workstation-mode #station-helicopter #helicopter-dip-display { flex: 1 1 40%; min-height: 0; overflow-y: auto; }
body.workstation-mode #station-helicopter #map-visual:not([hidden]) { flex: 1 1 60%; }
body.workstation-mode #station-helicopter .role-map-frame { min-height: 8rem; }
body.workstation-mode #station-helicopter #helicopter-dip-canvas { max-width: 520px; margin: .35rem auto; }
.helicopter-visual-tabs { display: flex; gap: .4rem; margin-bottom: .4rem; }
.helicopter-visual-tabs button { flex: 1; min-height: 2.5rem; }
.helicopter-visual-tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); background: #173029; }
.helicopter-acoustic-visual { min-width: 0; min-height: 0; overflow: auto; }
.helicopter-acoustic-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.helicopter-acoustic-controls select { min-width: 8rem; flex: 1; }
.helicopter-acoustic-controls input[type="range"] { min-width: 7rem; flex: 1; }
.helicopter-acoustic-controls output { min-width: 3.5rem; color: var(--accent); font: var(--font-xs) ui-monospace, monospace; }
.helicopter-inline-form { display: flex; flex: 1; align-items: center; gap: .4rem; }
.helicopter-inline-form input { width: 7rem; }
#helicopter-audio-controls { border: 1px solid var(--line); padding: .3rem .5rem; }
#helicopter-audio-controls summary { cursor: pointer; color: var(--accent); }
#helicopter-audio-controls[open] { max-height: 13rem; overflow: auto; }
#helicopter-audio-controls .helicopter-acoustic-controls { margin-top: .4rem; }
.helicopter-acoustic-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 25%); gap: .55rem; flex: 1; min-height: 0; }
.helicopter-acoustic-plots { display: flex; min-height: 0; }
.helicopter-acoustic-plots > div:not([hidden]) { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.helicopter-acoustic-plots .role-canvas { flex: 1; height: auto; min-height: 14rem; }
.helicopter-acoustic-plots .helicopter-spectrum-canvas { flex: none; height: 6rem; min-height: 6rem; margin-bottom: .4rem; }
.helicopter-acoustic-rail { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); padding: .35rem; }
#helicopter-buoy-observations { flex: 1; min-height: 0; overflow: auto; }
@media (max-width: 760px) { .helicopter-acoustic-workspace { display: flex; flex-direction: column; } .helicopter-acoustic-plots { min-height: 16rem; } .helicopter-acoustic-rail { min-height: 7rem; max-height: 13rem; } }
@media (max-height: 750px) { .helicopter-acoustic-visual { overflow: auto; } .helicopter-acoustic-workspace { flex: none; min-height: min(50vh, 22rem); } }
+29
View File
@@ -0,0 +1,29 @@
// Capture 20 ms PCM frames only while the local push-to-talk gate is open.
class CrewVoiceCapture extends AudioWorkletProcessor {
constructor() {
super();
this.transmitting = false;
this.frame = new Int16Array(960);
this.offset = 0;
this.port.onmessage = ({data}) => {
this.transmitting = data === "down";
this.offset = 0;
};
}
process(inputs) {
const channel = inputs[0]?.[0];
if (!this.transmitting || !channel) return true;
for (const value of channel) {
const sample = Math.max(-1, Math.min(1, value + (Math.random() - .5) * .003));
this.frame[this.offset++] = Math.round(sample * 32767);
if (this.offset === 960) {
this.port.postMessage(this.frame.buffer, [this.frame.buffer]);
this.frame = new Int16Array(960);
this.offset = 0;
}
}
return true;
}
}
registerProcessor("crew-voice-capture", CrewVoiceCapture);
+189
View File
@@ -0,0 +1,189 @@
"use strict";
// Voice is an independent, transient browser channel. It never calls game commands.
(() => {
const $ = (id) => document.getElementById(id);
const stations = ["bridge", "sonar", "weapons", "damage", "opz", "radio",
"engine", "helicopter", "eloka"];
let strings = {}, availability = null, socket = null, context = null;
let stream = null, capture = null, held = false, ready = false, starting = false;
let station = null, generation = 0, lastError = "";
let translationSerial = 0;
let nextPlay = 0;
const t = (key) => strings[`commander.web.${key}`] || key;
const label = (name) => t(`station_${name}`);
async function translations() {
const serial = ++translationSerial;
const language = $("language").value === "de" ? "de" : "en";
try {
const response = await fetch(`/api/v2/ui?lang=${language}`, {cache: "no-store"});
if (response.ok) {
const values = await response.json();
if (serial === translationSerial) strings = values;
}
} catch (_) { /* The next status poll can retry. */ }
render();
}
function release() {
if (!held) return;
held = false;
$("voice-ptt").setAttribute("aria-pressed", "false");
capture?.port.postMessage("up");
if (ready && socket?.readyState === WebSocket.OPEN) socket.send("up");
}
function press() {
if (held || !ready || document.hidden || socket?.readyState !== WebSocket.OPEN) return;
held = true;
$("voice-ptt").setAttribute("aria-pressed", "true");
socket.send("down");
capture.port.postMessage("down");
}
function stop() {
generation += 1;
release();
ready = false; starting = false;
const oldSocket = socket; socket = null;
if (oldSocket && oldSocket.readyState < WebSocket.CLOSING) oldSocket.close();
stream?.getTracks().forEach((track) => track.stop()); stream = null;
if (context) context.close(); context = null;
capture = null; station = null; nextPlay = 0;
render();
}
function render() {
$("voice-enable").disabled = ready || starting || !availability?.enabled || !availability.station;
$("voice-enable").textContent = t("voice_start");
$("voice-stop").disabled = !ready && !starting;
$("voice-stop").textContent = t("voice_stop");
$("voice-ptt").disabled = !ready;
$("voice-ptt").textContent = t("voice_ptt");
$("voice-status").textContent = !availability?.enabled ? t("voice_disabled")
: !availability.station ? t("voice_no_station")
: lastError ? t(lastError)
: availability.talker ? t("voice_talker").replace("{station}", label(availability.talker))
: ready ? t("voice_ready") : t("voice_available");
}
function play(bytes) {
if (!context || bytes.byteLength !== 1921) return;
const sender = new Uint8Array(bytes)[0];
if (sender >= stations.length) return;
const pcm = new DataView(bytes, 1);
const buffer = context.createBuffer(1, 960, 48000);
const samples = buffer.getChannelData(0);
for (let i = 0; i < 960; i++) samples[i] = pcm.getInt16(i * 2, true) / 32768;
const source = context.createBufferSource();
source.buffer = buffer; source.connect(context.destination);
if (nextPlay < context.currentTime || nextPlay > context.currentTime + .3)
nextPlay = context.currentTime + .06;
source.start(nextPlay); nextPlay += .02;
}
async function start() {
if (ready || starting || !availability?.enabled || !availability.station) return;
starting = true;
lastError = "";
const started = generation;
station = availability.station;
render();
try {
if (!navigator.mediaDevices?.getUserMedia || !window.AudioWorkletNode)
throw new Error(t("voice_secure_context"));
const voiceContext = new AudioContext({sampleRate: 48000});
context = voiceContext;
await voiceContext.resume();
await voiceContext.audioWorklet.addModule("/voice-worklet.js");
if (generation !== started) return;
const acquired = await navigator.mediaDevices.getUserMedia({audio: {
channelCount: 1, echoCancellation: true, noiseSuppression: true
}});
if (generation !== started) { acquired.getTracks().forEach((track) => track.stop()); return; }
stream = acquired;
const source = context.createMediaStreamSource(stream);
const high = context.createBiquadFilter();
high.type = "highpass"; high.frequency.value = 300;
const low = context.createBiquadFilter();
low.type = "lowpass"; low.frequency.value = 3400;
const distortion = context.createWaveShaper();
distortion.curve = Float32Array.from({length: 1024}, (_, i) =>
Math.tanh(1.5 * (i / 511.5 - 1)) / Math.tanh(1.5));
capture = new AudioWorkletNode(context, "crew-voice-capture");
const silence = context.createGain(); silence.gain.value = 0;
source.connect(high).connect(low).connect(distortion).connect(capture)
.connect(silence).connect(context.destination);
const scheme = location.protocol === "https:" ? "wss:" : "ws:";
const currentSocket = new WebSocket(`${scheme}//${location.host}/ws/v2/voice`,
["u-jagd-voice-v2", `ujagd-csrf.${availability.csrf}`]);
socket = currentSocket;
socket.binaryType = "arraybuffer";
capture.port.onmessage = ({data}) => {
if (held && ready && socket === currentSocket &&
currentSocket.readyState === WebSocket.OPEN && currentSocket.bufferedAmount < 32768)
currentSocket.send(data);
};
socket.onmessage = (event) => {
if (event.data instanceof ArrayBuffer) { play(event.data); return; }
try {
const message = JSON.parse(event.data);
if (message.type === "ready" && message.station === station) {
starting = false; ready = true; availability.talker = message.talker; render();
} else if (message.type === "talker") {
availability.talker = message.station; render();
}
} catch (_) { stop(); }
};
socket.onclose = () => { if (socket === currentSocket) {
stop(); lastError = "voice_disconnected"; render();
} };
socket.onerror = () => { if (socket === currentSocket) {
stop(); lastError = "voice_disconnected"; render();
} };
} catch (error) {
stop(); lastError = error.message || "voice_error"; render();
}
}
async function poll() {
try {
const response = await fetch("/api/v2/voice/status", {credentials: "same-origin", cache: "no-store"});
if (!response.ok) {
if (response.status === 401 || response.status === 403 || response.status === 404) {
availability = null;
if (ready || starting) stop();
render();
}
return; // A busy server must not drop a working voice socket.
}
availability = await response.json();
if ((ready || starting) && (!availability?.enabled || availability.station !== station)) stop();
} catch (_) { return; }
render();
}
$("voice-enable").addEventListener("click", start);
$("voice-stop").addEventListener("click", stop);
$("voice-ptt").addEventListener("pointerdown", (event) => {
event.preventDefault(); $("voice-ptt").setPointerCapture(event.pointerId); press();
});
for (const name of ["pointerup", "pointercancel", "lostpointercapture"])
$("voice-ptt").addEventListener(name, release);
document.addEventListener("keydown", (event) => {
const target = event.target;
const editing = target instanceof Element && (
target.closest("input, select, textarea, dialog[open]") || target.isContentEditable);
if (event.code !== "KeyF" || event.repeat || event.ctrlKey || event.altKey || event.metaKey ||
editing) return;
if (ready) { event.preventDefault(); press(); }
});
document.addEventListener("keyup", (event) => { if (event.code === "KeyF") release(); });
window.addEventListener("blur", release);
document.addEventListener("visibilitychange", () => { if (document.hidden) release(); });
$("language").addEventListener("change", translations);
window.addEventListener("u-jagd-language", (event) => {
translationSerial += 1;
strings = event.detail.translations;
render();
});
translations(); poll(); setInterval(poll, 2000);
})();
+1
View File
@@ -0,0 +1 @@
"""Generated contact-analysis image resources."""
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Loaded 100 of 756 files, more files were not shown because too many files have changed in this diff. Show more