@font-face { font-family: 'Orbitron'; font-weight: 500; font-display: swap; src: url('vendor/orbitron-500.woff2') format('woff2'); }
@font-face { font-family: 'Orbitron'; font-weight: 800; font-display: swap; src: url('vendor/orbitron-800.woff2') format('woff2'); }
@font-face { font-family: 'Share Tech Mono'; font-weight: 400; font-display: swap; src: url('vendor/sharetechmono-400.woff2') format('woff2'); }

:root {
  --bg: #01060d;
  --cy: #5fdcff;
  --cy-dim: #2b88a8;
  --cy-faint: rgba(95, 220, 255, .28);
  --sea: #46ffb4;
  --mil: #ff4d6d;
  --fav: #ffb52e;
  --emg: #ff3b4e;
  --txt: #c9f1ff;
  --panel: rgba(3, 16, 28, .78);
  --mono: 'Share Tech Mono', 'Cascadia Mono', Consolas, monospace;
  --disp: 'Orbitron', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--txt); font-family: var(--mono); font-size: 13px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(95, 220, 255, .35); }

/* ───── Bühne ───── */
#stage {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 45%, rgba(10, 60, 100, .38), transparent 70%),
    radial-gradient(ellipse 40% 30% at 15% 90%, rgba(0, 120, 110, .12), transparent 70%),
    linear-gradient(#020a14, #01050b);
}
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#live { cursor: crosshair; }
#live.grab { cursor: grabbing; }
#live.hit { cursor: pointer; }
.fx { position: absolute; inset: 0; pointer-events: none; }
.scan { background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 10, 20, .22) 2px 3px); mix-blend-mode: multiply; }
.vignette { background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .62) 100%); }

/* ───── HUD-Grundelemente ───── */
/* --ui vergrößert alle Bedienelemente samt Schrift (Knopf SCHRIFT); die Karte selbst bleibt unberührt */
:root { --ui: 1; }
.hud { position: fixed; z-index: 5; zoom: var(--ui); }
dialog { zoom: var(--ui); }
.panel {
  background: var(--panel);
  border: 1px solid var(--cy-faint);
  backdrop-filter: blur(6px);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  box-shadow: inset 0 0 28px rgba(40, 160, 220, .08);
}
.phead {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--disp); font-weight: 500; font-size: 11px; letter-spacing: .2em;
  color: var(--cy); padding: 9px 14px 8px 12px;
  border-bottom: 1px solid var(--cy-faint);
  background: linear-gradient(to right, rgba(95, 220, 255, .14), transparent 80%);
}
.dim { color: var(--cy-dim); }
.hint { color: var(--cy-dim); font-size: 11px; line-height: 1.45; }
.hidden { display: none !important; }

/* ───── Kopfzeile ───── */
#top {
  top: 0; left: 0; right: 0; height: 58px; display: flex; align-items: center; gap: 22px; padding: 0 18px;
  background: linear-gradient(to bottom, rgba(1, 8, 16, .94), rgba(1, 8, 16, .62) 75%, transparent);
  border-top: 2px solid var(--cy);
}
#top::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; box-shadow: 0 0 18px 2px rgba(95, 220, 255, .55); }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 30px; height: 30px; border: 1px solid var(--cy); border-radius: 50%; position: relative; box-shadow: 0 0 12px rgba(95, 220, 255, .5), inset 0 0 10px rgba(95, 220, 255, .35); }
.logo::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--cy-faint); border-radius: 50%; }
.logo i { position: absolute; left: 50%; top: 50%; width: 50%; height: 1px; background: linear-gradient(to right, var(--cy), transparent); transform-origin: 0 0; animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
h1 { font-family: var(--disp); font-weight: 800; font-size: 19px; letter-spacing: .26em; margin: 0; color: #e6faff; text-shadow: 0 0 14px rgba(95, 220, 255, .75); }
.sub { font-size: 10px; letter-spacing: .22em; color: var(--cy-dim); }

/* Suche immer in der Bildmitte; die Breite lässt Platz für Favoriten (links) und Statusblock (rechts) */
.search { position: absolute; left: 50%; transform: translateX(-50%); width: min(520px, calc(100vw / var(--ui) - 1240px)); display: flex; align-items: center; border: 1px solid var(--cy-faint); background: rgba(3, 20, 34, .7); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.search .pfx { padding: 0 6px 0 18px; color: var(--cy); font-size: 11px; letter-spacing: .15em; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; padding: 8px 6px; text-transform: uppercase; letter-spacing: .08em; }
.search input::placeholder, #favForm input::placeholder { color: rgba(95, 220, 255, .32); text-transform: none; letter-spacing: 0; }
.search button { background: rgba(95, 220, 255, .14); border: 0; border-left: 1px solid var(--cy-faint); padding: 8px 22px 8px 14px; color: var(--cy); font-size: 11px; letter-spacing: .18em; }
.search button:hover { background: rgba(95, 220, 255, .3); }
.search:focus-within { border-color: var(--cy); box-shadow: 0 0 16px rgba(95, 220, 255, .25); }

#top .right { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.counts { display: flex; gap: 16px; }
.counts div { text-align: right; line-height: 1.15; }
.counts b { display: block; font-family: var(--disp); font-weight: 500; font-size: 15px; color: #e6faff; }
.counts span { font-size: 9px; letter-spacing: .2em; color: var(--cy-dim); }
.links { display: flex; flex-direction: column; gap: 2px; }
.link { display: flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: .14em; color: var(--cy-dim); background: none; border: 0; padding: 0; text-align: left; }
button.link:hover { color: var(--cy); }
.link i { width: 7px; height: 7px; border-radius: 50%; background: #29414d; }
.link.live i { background: var(--sea); box-shadow: 0 0 8px var(--sea); }
.link.live { color: var(--txt); }
.link.connecting i { background: var(--fav); animation: blink 1s steps(2) infinite; }
.link.error i { background: var(--mil); box-shadow: 0 0 8px var(--mil); }
@keyframes blink { 50% { opacity: .2; } }
.clock { text-align: right; }
.iconbtn { background: none; border: 1px solid var(--cy-faint); color: var(--cy-dim); font-size: 10px; letter-spacing: .14em; padding: 5px 8px; }
.iconbtn:hover { color: #fff; border-color: var(--cy); }
#clock { font-family: var(--disp); font-weight: 500; font-size: 18px; letter-spacing: .12em; color: #e6faff; text-shadow: 0 0 10px rgba(95, 220, 255, .6); }

/* ───── Favoriten ───── */
#favPanel { top: 12px; left: 16px; width: 286px; max-height: calc(100vh / var(--ui) - 162px); display: flex; flex-direction: column; z-index: 6; }
#favPanel .phead { color: var(--fav); border-color: rgba(255, 181, 46, .35); background: linear-gradient(to right, rgba(255, 181, 46, .16), transparent 80%); }
#favForm { display: flex; margin: 10px 12px 6px; border: 1px solid var(--cy-faint); }
#favForm:focus-within { border-color: var(--fav); }
#favForm input { flex: 1; min-width: 0; background: rgba(0, 0, 0, .25); border: 0; outline: 0; padding: 7px 8px; text-transform: uppercase; }
#favForm button { width: 34px; border: 0; border-left: 1px solid var(--cy-faint); background: rgba(255, 181, 46, .16); color: var(--fav); font-size: 18px; line-height: 1; }
#favForm button:hover { background: rgba(255, 181, 46, .4); }
/* Hinweistexte nur, solange man im Eingabefeld ist */
#favHint { margin: 0 12px 8px; display: none; }
#favForm:focus-within ~ #favHint { display: block; }
#favList .empty { display: none; }
#favForm:focus-within ~ #favList .empty { display: block; }
#favForm { margin-bottom: 10px; }
#favList { overflow-y: auto; padding: 0 6px 14px; scrollbar-width: thin; scrollbar-color: var(--cy-dim) transparent; }
.fav { display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 8px; align-items: center; padding: 7px 6px; border-left: 2px solid transparent; cursor: pointer; }
.fav + .fav { border-top: 1px solid rgba(95, 220, 255, .1); }
.fav:hover { background: rgba(95, 220, 255, .08); }
.fav.sel { border-left-color: var(--fav); background: rgba(255, 181, 46, .1); }
.fav .ico { grid-row: span 2; width: 20px; height: 20px; opacity: .35; }
.fav.live .ico { opacity: 1; filter: drop-shadow(0 0 5px var(--fav)); }
.fav .ico path { fill: var(--fav); }
.fav .name { color: #ffe6b3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.fav .st { grid-column: 2; font-size: 11px; color: var(--cy-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav.live .st { color: var(--sea); }
.fav .btns { grid-row: 1 / span 2; grid-column: 3; display: flex; gap: 2px; opacity: 0; }
.fav:hover .btns, .fav:focus-within .btns { opacity: 1; }
.fav .btns button { background: none; border: 1px solid transparent; color: var(--cy-dim); width: 22px; height: 22px; padding: 0; line-height: 1; }
.fav .btns button:hover { color: #fff; border-color: var(--cy-faint); }
.fav .btns .del:hover { color: var(--mil); border-color: var(--mil); }
.fav input.ren { grid-column: 2; grid-row: 1; background: rgba(0, 0, 0, .4); border: 1px solid var(--fav); outline: 0; padding: 1px 4px; width: 100%; }
.empty { padding: 10px 8px 4px; color: var(--cy-dim); font-size: 11px; line-height: 1.5; }

/* ───── Zielinfo ───── */
#info { top: 74px; right: 16px; width: 300px; }
#infoClose { background: none; border: 0; color: var(--cy); font-size: 18px; line-height: 1; padding: 0 2px; }
#infoClose:hover { color: #fff; }
#infoTitle { padding: 12px 14px 4px; }
#infoTitle .big { font-family: var(--disp); font-weight: 800; font-size: 22px; letter-spacing: .1em; color: #fff; text-shadow: 0 0 14px rgba(95, 220, 255, .7); word-break: break-all; }
#infoTitle .small { color: var(--cy-dim); font-size: 11px; letter-spacing: .12em; margin-top: 2px; }
#info.is-fav #infoTitle .big { text-shadow: 0 0 14px rgba(255, 181, 46, .9); }
#info.is-old { border-color: rgba(138, 151, 163, .55); }
#info.is-old .phead { color: #a9b4bd; border-color: rgba(138, 151, 163, .4); background: linear-gradient(to right, rgba(138, 151, 163, .18), transparent 80%); }
#info.is-old #infoTitle .big { color: #c3ccd3; text-shadow: none; }
#infoTitle .note { margin-top: 10px; padding: 7px 10px; border: 1px dashed rgba(138, 151, 163, .7); background: rgba(138, 151, 163, .1); color: #b9c3cb; font-size: 12px; line-height: 1.4; }
#infoTitle .note b { display: block; color: #d5dde3; font-family: var(--disp); font-weight: 500; font-size: 11px; letter-spacing: .16em; }
#info.is-emg { border-color: var(--emg); box-shadow: inset 0 0 28px rgba(255, 59, 78, .16); }
#info.is-emg .phead { color: var(--emg); border-color: rgba(255, 59, 78, .45); background: linear-gradient(to right, rgba(255, 59, 78, .2), transparent 80%); }
#info.is-emg #infoTitle .big { text-shadow: 0 0 14px rgba(255, 59, 78, .95); }
#infoTitle .alert { margin-top: 10px; padding: 7px 10px; border: 1px solid var(--emg); border-left-width: 3px; background: rgba(255, 59, 78, .14); color: #ffd9dd; font-size: 12px; line-height: 1.4; letter-spacing: .06em; text-transform: uppercase; }
#infoTitle .alert b { display: block; color: var(--emg); font-family: var(--disp); font-weight: 800; font-size: 13px; letter-spacing: .14em; }
#infoRows { padding: 6px 14px 4px; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
#infoRows dt { color: var(--cy-dim); font-size: 11px; letter-spacing: .12em; align-self: center; }
#infoRows dd { margin: 0; text-align: right; color: #e6faff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#infoRows dd small { color: var(--cy-dim); font-size: 11px; }
#infoRows dd .warn { color: var(--mil); }
#info.is-old #infoRows dd { color: #aab4bc; }
#infoActions { padding: 8px 14px 18px; display: flex; flex-direction: column; gap: 6px; }
#infoActions button, dialog button {
  background: rgba(255, 181, 46, .12); border: 1px solid rgba(255, 181, 46, .55); color: var(--fav);
  padding: 7px 10px; letter-spacing: .12em; font-size: 11px; text-align: left;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
#infoActions button:hover, dialog button:hover { background: rgba(255, 181, 46, .32); color: #fff; }
#infoActions button.rm { background: rgba(255, 77, 109, .1); border-color: rgba(255, 77, 109, .5); color: var(--mil); }
#infoActions a { color: var(--cy-dim); font-size: 11px; letter-spacing: .1em; text-decoration: none; }
#infoActions a:hover { color: var(--cy); }
#infoActions .more { margin-top: 6px; padding-top: 9px; border-top: 1px solid rgba(95, 220, 255, .16); display: flex; flex-direction: column; gap: 6px; }
#infoActions .more span { font-size: 10px; letter-spacing: .2em; color: rgba(95, 220, 255, .45); }
#infoActions .more a { text-transform: uppercase; }

/* ───── Ereignisprotokoll ───── */
#log { left: 16px; bottom: 56px; width: 420px; pointer-events: none; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
#log div { font-size: 11px; color: var(--cy); text-shadow: 0 0 6px rgba(95, 220, 255, .5); animation: logfade 14s forwards; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#log div.warn { color: var(--fav); }
#log div.err { color: var(--mil); }
#log div.ok { color: var(--sea); }
#log div::before { content: '> '; opacity: .6; }
@keyframes logfade { 0% { opacity: 0; transform: translateX(-8px); } 3% { opacity: 1; transform: none; } 80% { opacity: .85; } 100% { opacity: 0; } }

/* ───── Fußzeile ───── */
#bottom {
  left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center; gap: 20px; padding: 0 18px;
  background: linear-gradient(to top, rgba(1, 8, 16, .94), rgba(1, 8, 16, .6) 75%, transparent);
  border-bottom: 2px solid var(--cy-faint);
}
.coords { display: flex; gap: 14px; min-width: 300px; white-space: pre; }
.toggles { display: flex; gap: 6px; margin: 0 auto; }
.toggles button { background: rgba(3, 20, 34, .7); border: 1px solid rgba(95, 220, 255, .2); color: var(--cy-dim); font-size: 10px; letter-spacing: .16em; padding: 5px 12px; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.toggles button.on { color: #e6faff; border-color: var(--cy); background: rgba(95, 220, 255, .18); text-shadow: 0 0 8px rgba(95, 220, 255, .8); }
.toggles button:hover { border-color: var(--cy); }
.toggles button { white-space: nowrap; }
/* größte Schriftstufe: die Legende weicht, damit die Knopfleiste Platz hat */
/* Auswahlmenü über der Knopfleiste */
.fontctl { display: flex; align-items: center; gap: 4px; }
.fontctl button { width: 22px; height: 22px; padding: 0; line-height: 1; font-size: 14px; background: rgba(3, 20, 34, .7); border: 1px solid rgba(95, 220, 255, .3); color: var(--cy); }
.fontctl button:hover { border-color: var(--cy); color: #fff; }
.fontctl button:disabled { opacity: .3; cursor: default; }
.fontctl .fsbtn { margin-left: 8px; display: grid; place-items: center; }
.fontctl .fsbtn.on { border-color: var(--cy); color: #fff; }
.fontctl span { min-width: 44px; text-align: center; font-size: 10px; letter-spacing: .08em; color: var(--cy-dim); }
#emgMenu { z-index: 8; width: 250px; padding-bottom: 12px; }
#emgMenu button { display: block; position: relative; width: calc(100% - 24px); margin: 8px 12px 0; padding: 8px 10px 8px 30px; text-align: left; background: rgba(3, 20, 34, .7); border: 1px solid rgba(95, 220, 255, .2); color: var(--cy-dim); font-size: 11px; letter-spacing: .14em; }
#emgMenu button::before { content: ''; position: absolute; left: 11px; top: 50%; width: 8px; height: 8px; margin-top: -5px; border: 1px solid var(--cy-dim); border-radius: 50%; }
#emgMenu button:hover { border-color: var(--cy); }
#emgMenu button.on { color: #e6faff; border-color: var(--cy); background: rgba(95, 220, 255, .16); }
#emgMenu button.on::before { background: var(--cy); border-color: var(--cy); box-shadow: 0 0 8px var(--cy); }
.legend { display: flex; gap: 14px; font-size: 10px; letter-spacing: .1em; color: var(--cy-dim); min-width: 300px; justify-content: flex-end; }
.lg { display: inline-block; width: 8px; height: 8px; margin-right: 5px; transform: rotate(45deg); }
.lg.air { background: var(--cy); box-shadow: 0 0 6px var(--cy); }
.lg.sea { background: var(--sea); box-shadow: 0 0 6px var(--sea); }
.lg.old { background: rgba(138, 151, 163, .2); border: 1px solid #8a97a3; }
.lg.fav { background: var(--fav); box-shadow: 0 0 6px var(--fav); }
.lg.emg { background: var(--emg); box-shadow: 0 0 6px var(--emg); }

/* ───── Dialog ───── */
dialog { background: rgba(3, 14, 24, .96); color: var(--txt); border: 1px solid var(--cy); padding: 0; width: min(520px, 92vw); box-shadow: 0 0 60px rgba(95, 220, 255, .25); }
dialog::backdrop { background: rgba(0, 4, 8, .7); backdrop-filter: blur(3px); }
dialog form { padding: 20px 22px; }
dialog h2 { font-family: var(--disp); font-weight: 500; font-size: 13px; letter-spacing: .2em; color: var(--cy); margin: 0 0 12px; }
dialog p { line-height: 1.55; color: #a9d6e6; margin: 0 0 14px; }
dialog code { color: var(--cy); }
dialog label { display: block; font-size: 11px; letter-spacing: .12em; color: var(--cy-dim); }
dialog input { display: block; width: 100%; margin-top: 6px; background: rgba(0, 0, 0, .35); border: 1px solid var(--cy-faint); outline: 0; padding: 9px 10px; color: #fff; }
dialog input:focus { border-color: var(--cy); }
dialog .row { display: flex; gap: 8px; margin-top: 16px; }
dialog .grow { flex: 1; }
dialog button.ghost { background: none; border-color: var(--cy-faint); color: var(--cy-dim); }
#aisState { margin-top: 8px; min-height: 16px; }

/* ───── Startsequenz ───── */
#boot { position: fixed; inset: 0; z-index: 50; background: #01050b; display: grid; place-items: center; transition: opacity .7s ease; pointer-events: none; }
#boot.done { opacity: 0; }
#bootText { font-family: var(--mono); font-size: 14px; color: var(--cy); text-shadow: 0 0 10px rgba(95, 220, 255, .7); line-height: 1.7; min-width: 420px; margin: 0; }

@media (max-width: 1500px) {
  .counts { display: none; }                               /* schafft Platz für die mittige Suche */
  .search { width: min(520px, calc(100vw / var(--ui) - 880px)); }
}
@media (max-width: 1250px) {
  .legend { display: none; }
  .coords { min-width: 0; }
}
@media (max-width: 900px) {
  .search, .links { display: none; }
  #favPanel { width: 230px; }
}
@media (prefers-reduced-motion: reduce) {
  .logo i { animation: none; }
}
