/* ХИМТРЕЙЛ·РАДАР — сделано в Блокноте, лучше всего смотреть в Netscape 4.7 при 800×600 */

:root {
  --lime: #39ff14;
  --yellow: #ffee00;
  --red: #ff2020;
  --cyan: #00e5ff;
  --pink: #ff4fd8;
  --silver: #c0c0c0;
  --lo: #808080;
  --dk: #404040;
  --navy: #000080;
  --navy2: #1084d0;
  --f-body: "Times New Roman", Times, serif;
  --f-ui: Tahoma, Verdana, Arial, sans-serif;
  --f-mono: "Courier New", Courier, monospace;
  --f-head: Impact, "Arial Black", "Haettenschweiler", sans-serif;
  --f-comic: "Comic Sans MS", "Comic Neue", "Chalkboard SE", cursive;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  color: var(--lime);
  font: 14px/1.3 var(--f-body);
  background-color: #000010;
  background-image:
    radial-gradient(1px 1px at 23px 31px, #fff, transparent),
    radial-gradient(1px 1px at 117px 93px, #ffee88, transparent),
    radial-gradient(2px 2px at 71px 163px, #fff, transparent),
    radial-gradient(1px 1px at 171px 17px, #9cf, transparent),
    radial-gradient(1px 1px at 141px 141px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 41px 97px, #f9c, transparent),
    radial-gradient(1px 1px at 193px 187px, #fff, transparent);
  background-size: 200px 200px;
  overflow: hidden;
  cursor: crosshair;
}

a { color: var(--cyan); }
a:visited { color: var(--pink); }
button, select, input { font-family: var(--f-ui); }

/* ───────────── утилиты ───────────── */
.blink { animation: blink 1s steps(2, start) infinite; }
.blink-slow { animation: blink 1.8s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.small { font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { margin: 0; padding: 8px 14px; background: #200; color: var(--yellow); font: bold 14px var(--f-ui); }
.big { font: 22px var(--f-head); letter-spacing: 1px; }

/* ───────────── окна Win98 ───────────── */
.win {
  background: var(--silver);
  border: 2px solid;
  border-color: #fff var(--dk) var(--dk) #fff;
  box-shadow: 1px 1px 0 #000, inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 var(--lo);
  padding: 3px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.titlebar {
  background: linear-gradient(90deg, var(--navy), var(--navy2));
  color: #fff;
  font: bold 12px var(--f-ui);
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
}
.tb-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.btn {
  font: bold 12px var(--f-ui);
  color: #000;
  background: var(--silver);
  border: 2px solid;
  border-color: #fff var(--dk) var(--dk) #fff;
  padding: 3px 9px;
  cursor: pointer;
  box-shadow: 1px 1px 0 #000;
}
.btn:hover { background: #d8d8d8; }
.btn:active, .btn.on { border-color: var(--dk) #fff #fff var(--dk); padding: 4px 8px 2px 10px; box-shadow: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px dotted #000; outline-offset: 1px; }

/* ───────────── каркас страницы ───────────── */
.app { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; height: 100vh; }

.disclaimer {
  display: flex; align-items: center; gap: 14px; padding: 8px 14px;
  border-bottom: 3px ridge #777; background: linear-gradient(#10002a, #000010);
}
.dc-tag { flex: none; font: 20px/1 var(--f-head); letter-spacing: 2px; color: var(--red); background: #000; border: 2px solid var(--red); padding: 5px 9px; text-shadow: 0 0 6px #f00; }
.disclaimer p { margin: 0; font: italic bold 14px/1.35 var(--f-comic); color: var(--yellow); letter-spacing: 0.3px; }

/* переключатель языка: выпадающий список (details) со ссылками на страницы языков, в духе Win98 */
.langs { position: relative; flex: none; margin-left: auto; z-index: 2500; }
.langs summary {
  display: flex; align-items: center; gap: 7px; padding: 5px 9px; cursor: pointer; user-select: none; list-style: none;
  font: bold 12px/1 var(--f-ui); color: #000; background: var(--silver);
  border: 2px solid; border-color: #fff var(--dk) var(--dk) #fff; box-shadow: 1px 1px 0 #000;
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: "\25BC"; font-size: 8px; margin-left: 2px; }
.langs summary:hover { background: #d8d8d8; }
.langs[open] summary { background: var(--yellow); border-color: var(--dk) #fff #fff var(--dk); box-shadow: none; }
.langs summary:focus-visible, .langs a:focus-visible { outline: 2px dotted #fff; outline-offset: 1px; }
.langs ul {
  position: absolute; right: 0; top: calc(100% + 2px); min-width: 100%; margin: 0; padding: 2px; list-style: none;
  background: var(--silver); border: 2px solid; border-color: #fff var(--dk) var(--dk) #fff; box-shadow: 3px 3px 0 #000;
}
.langs a, .langs a:visited {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px; white-space: nowrap;
  font: 13px/1 var(--f-ui); color: #000; text-decoration: none;
}
.langs a:hover, .langs a:focus-visible { background: var(--navy); color: #fff; }
.langs a[aria-current] { font-weight: bold; }
.langs a[aria-current]::after { content: "\2713"; margin-left: auto; padding-left: 10px; }
.flag { flex: none; width: 21px; height: 14px; border: 1px solid #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }

.marquee { overflow: hidden; background: #000; border-top: 2px solid var(--red); border-bottom: 2px solid var(--red); white-space: nowrap; }
.marquee-in { display: inline-block; padding-left: 100%; font: 16px/24px var(--f-head); letter-spacing: 1.5px; color: var(--yellow); text-shadow: 0 0 6px #f80; animation: scroll-l 55s linear infinite; }
.marquee:hover .marquee-in { animation-play-state: paused; }

/* ссылка на телеграм-канал: иконка рисуется здесь, в разметке только текст */
.tg-link, .tg-link:visited { color: var(--cyan); text-decoration: none; }
.tg-link:hover { text-decoration: underline; }
.tg-link::before {
  content: ""; display: inline-block; width: 1.25em; height: 1.25em; margin-right: 0.4em; vertical-align: -0.3em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%2329a9eb'/%3E%3Cpolygon points='5,11.9 18.9,6.5 16.7,17.7 12.7,14.8 10.9,17.2 10.6,13.9' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
}
a.btn.tg-link, a.btn.tg-link:visited { color: #000; }
a.btn.tg-link:hover { text-decoration: none; }
@keyframes scroll-l { to { transform: translateX(-100%); } }

.main { display: grid; grid-template-columns: 176px minmax(0, 1fr) 320px; gap: 8px; padding: 8px; min-height: 0; }
.left, .right, .center { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.left, .right { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--silver) #111; }

/* ───────────── левое меню ───────────── */
.menu { padding: 4px 2px 2px; }
.menu-btn { display: block; width: 100%; text-align: left; margin-bottom: 4px; font-size: 11px; padding: 4px 6px; }
.counter-box { background: #000; margin-top: 3px; padding: 6px 4px; text-align: center; color: var(--lime); border: 2px inset var(--lo); }
.counter { margin: 4px 0; }
.counter span { display: inline-block; background: #200; color: var(--red); font: bold 17px var(--f-mono); padding: 1px 3px; margin: 0 1px; border: 1px inset #555; text-shadow: 0 0 6px #f00; }
.src { background: #000; margin-top: 3px; padding: 6px; display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; border: 2px inset var(--lo); }
.b88 { width: 88px; height: 31px; font: bold 9px/10px Arial, sans-serif; display: flex; align-items: center; justify-content: center; text-align: center; border: 2px outset #bbb; }
.b-dwd { background: linear-gradient(#0a4, #063); color: #fff; }
.b-nn { background: #009; color: #ff0; }
.b-np { background: #ddd; color: #000; font-family: var(--f-mono); }
.b-res { background: #000; color: var(--lime); border-color: var(--lime); font-family: var(--f-mono); font-size: 13px; }
.b-nf { background: #a00; color: #fff; }
.construction { width: 100%; margin-top: 2px; font: bold 10px/1.3 var(--f-ui); color: var(--yellow); border: 2px dashed var(--yellow); padding: 4px; text-align: center; animation: blink 2s steps(2, start) infinite; }

/* ───────────── поиск ───────────── */
.searchwin { flex: none; overflow: visible; position: relative; z-index: 1600; }
.searchbar { display: flex; align-items: center; gap: 8px; padding: 6px 4px 4px; }
.lbl { font: bold 11px var(--f-ui); color: var(--navy); letter-spacing: 0.4px; }
.qwrap { position: relative; flex: 1; min-width: 0; }
#q {
  width: 100%; font: 15px var(--f-mono); padding: 4px 6px; color: var(--lime); background: #000;
  border: 2px solid; border-color: var(--dk) #fff #fff var(--dk); caret-color: var(--yellow);
}
#q::placeholder { color: #2c8a1a; }
.go { background: var(--yellow); }
.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: 0; list-style: none; z-index: 2000;
  background: #000; border: 2px solid var(--lime); max-height: 320px; overflow-y: auto; box-shadow: 4px 4px 0 #000;
}
.results li { padding: 5px 8px; cursor: pointer; font: 13px var(--f-mono); color: var(--lime); border-bottom: 1px dotted #164; }
.results li b { color: var(--yellow); }
.results li small { color: #7fbf7f; display: block; font-size: 11px; }
.results li:hover, .results li.sel { background: var(--navy); color: #fff; }
.results li.msg { cursor: default; color: var(--pink); }
.results li.msg:hover { background: #000; color: var(--pink); }

/* ───────────── карта ───────────── */
.mapwin { flex: 1; min-height: 0; }
.mapframe { position: relative; isolation: isolate; flex: 1; min-height: 0; margin-top: 3px; border: 2px solid; border-color: var(--dk) #fff #fff var(--dk); background: #000; }
#map { position: absolute; inset: 0; background: #031403; font-family: var(--f-ui); }
.scan {
  position: absolute; inset: 0; pointer-events: none; z-index: 640;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.6) 100%);
}
.maphint { position: absolute; left: 50px; top: 10px; z-index: 645; pointer-events: none; font: 11px var(--f-mono); color: var(--lime); background: rgba(0, 0, 0, 0.7); padding: 2px 6px; border: 1px solid var(--lime); }

.legend { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 5px 4px 2px; color: #000; font: 11px var(--f-ui); }
.lg-items { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.lg-item { display: inline-flex; align-items: center; gap: 4px; cursor: help; }
.lg-item i { width: 16px; height: 12px; border: 1px solid #000; display: inline-block; }
.lg-item.corr i { background: transparent; border: 0; border-top: 2px dotted #006a6a; height: 0; width: 18px; }
.lg-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.chk { display: inline-flex; align-items: center; gap: 4px; font-weight: bold; }
.chk select { font: 11px var(--f-ui); }

/* Leaflet под зелёный монитор */
.leaflet-tile-pane { filter: grayscale(1) sepia(1) hue-rotate(78deg) saturate(2.4) brightness(1.5) contrast(1.25); }
.leaflet-labels-pane { filter: grayscale(1) sepia(1) hue-rotate(78deg) saturate(3) brightness(1.5) contrast(1.1); }
.leaflet-container { cursor: crosshair; background: #031403; }
.haze-tile { image-rendering: auto; }
.leaflet-control-zoom a { background: var(--silver); color: #000; border-radius: 0 !important; border: 2px solid; border-color: #fff var(--dk) var(--dk) #fff; font-weight: bold; }
.leaflet-bar { border: 0; box-shadow: 1px 1px 0 #000; }
.leaflet-control-attribution { background: rgba(0, 0, 0, 0.7) !important; color: #7fbf7f !important; font: 9px var(--f-ui); }
.leaflet-control-attribution a { color: var(--lime) !important; }
.leaflet-tooltip.tip { background: #000; color: var(--lime); border: 1px solid var(--lime); border-radius: 0; font: 11px var(--f-mono); box-shadow: none; }
.leaflet-tooltip.tip::before { display: none; }

.tgt { width: 8px; height: 8px; pointer-events: none; background: none; border: 0; }
.tgt-dot { width: 8px; height: 8px; background: var(--yellow); border-radius: 50%; box-shadow: 0 0 6px var(--yellow); }

/* ───────────── досье ───────────── */
.dossierwin { flex: 1; min-height: 240px; }
.dossier { flex: 1; min-height: 0; overflow-y: auto; margin-top: 3px; background: #000; color: var(--lime); border: 2px solid; border-color: var(--dk) #fff #fff var(--dk); padding: 8px 10px; font: 13px/1.35 var(--f-mono); scrollbar-width: thin; scrollbar-color: var(--lime) #111; }
.dossier h2 { margin: 0 0 2px; font: 26px/1 var(--f-head); color: var(--yellow); letter-spacing: 1px; text-shadow: 2px 2px 0 #630; word-break: break-word; }
.dossier .where { color: #7fbf7f; margin-bottom: 8px; font-size: 12px; }
.row { display: flex; align-items: baseline; gap: 6px; font-size: 12px; }
.row .k { color: #6fdc5c; white-space: nowrap; }
.row .dots { flex: 1; border-bottom: 1px dotted #2a6a2a; transform: translateY(-3px); min-width: 10px; }
.row .v { color: #fff; text-align: right; }
.row .v em { color: var(--yellow); font-style: normal; }

.verdict { margin: 10px 0 6px; padding: 6px 8px; border: 3px double; text-align: center; background: #080808; }
.verdict .vt { font: 21px/1.05 var(--f-head); letter-spacing: 1px; }
.verdict .vx { font: 13px/1.3 var(--f-comic); color: #fff; margin-top: 4px; }
.verdict.c0 { border-color: #2e8b2e; } .verdict.c0 .vt { color: #59d85a; }
.verdict.c1 { border-color: #d8d010; } .verdict.c1 .vt { color: #ffee40; }
.verdict.c2 { border-color: #ff9a00; } .verdict.c2 .vt { color: #ffa820; }
.verdict.c3 { border-color: #ff2020; } .verdict.c3 .vt { color: #ff4a4a; }
.verdict.c4 { border-color: #ff00c8; } .verdict.c4 .vt { color: #ff4fd8; animation: blink 0.9s steps(2, start) infinite; }
.verdict.c3, .verdict.c4 { animation: edge 1.2s linear infinite; }
@keyframes edge { 50% { box-shadow: 0 0 14px currentColor; } }
.verdict.c3 { color: #ff2020; } .verdict.c4 { color: #ff00c8; }

.meter-wrap { margin: 6px 0 2px; }
.meter { position: relative; height: 16px; background: #111; border: 2px inset #555; overflow: hidden; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: linear-gradient(90deg, #39ff14, #ffee00 45%, #ff7a00 70%, #ff1a1a); transition: width 0.4s; }
.meter::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 8px, #000 8px 10px); }
.meter-cap { display: flex; justify-content: space-between; font-size: 11px; color: #7fbf7f; }
.official { margin: 8px 0; color: #9aa; font-size: 12px; border-left: 3px solid #566; padding-left: 7px; }
.official b { color: #cde; }
.tl-wrap { margin-top: 8px; }
.tl-cap { font-size: 11px; color: #7fbf7f; display: flex; justify-content: space-between; }
#tl { width: 100%; height: 64px; display: block; background: #050505; border: 1px solid #234; cursor: pointer; image-rendering: pixelated; }

/* ───────────── панель времени ───────────── */
.timewin { margin: 0 8px 4px; }
.timebody {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px 26px;
  padding: 6px 10px 8px; color: #000;
}
.daybtns { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 4px; margin-top: 2px; }
.daybtn { padding: 4px 2px; text-align: center; line-height: 1.15; }
.daybtn b { display: block; font-size: 13px; letter-spacing: 0.3px; }
.daybtn small { font: 11px var(--f-ui); }
.daybtn.on { background: var(--yellow); }
.daybtn[disabled] { opacity: 0.5; cursor: not-allowed; }

.datecol { display: flex; flex-direction: column; gap: 4px; }
.date { font: 13px var(--f-mono); padding: 2px 4px; border: 2px solid; border-color: var(--dk) #fff #fff var(--dk); background: #fff; color: #000; width: 100%; }
.datebtns { display: flex; gap: 6px; }
.datebtns .btn { flex: 1; }
.timeinfo { font: 11px/1.3 var(--f-ui); color: #000; }

.foot { padding: 3px 10px 4px; font: 10px/1.3 var(--f-ui); color: #6a9a6a; text-align: center; border-top: 1px solid #143; }

/* ───────────── тосты, диалоги, загрузка ───────────── */
.toasts { position: fixed; left: 12px; bottom: 12px; z-index: 3000; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: #000; color: var(--yellow); border: 2px solid var(--yellow); font: 13px var(--f-mono); padding: 6px 10px; max-width: 360px; box-shadow: 4px 4px 0 #000; animation: pop 0.2s ease-out; }
.toast.out { opacity: 0; transition: opacity 0.4s; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }

.dlg-wrap { position: fixed; inset: 0; z-index: 4000; background: rgba(0, 0, 16, 0.65); display: grid; place-items: center; padding: 12px; }
.dlg { width: min(520px, 94vw); max-height: 90vh; }
.dlg.wide { width: min(740px, 96vw); }
.dlg-body { background: #fff; color: #000; margin-top: 3px; padding: 10px 14px; border: 2px solid; border-color: var(--dk) #fff #fff var(--dk); font: 14px/1.4 var(--f-body); overflow-y: auto; max-height: 62vh; }
.dlg-body h3 { margin: 10px 0 4px; color: #a00000; font: 16px var(--f-head); letter-spacing: 0.5px; }
.dlg-body h3:first-child { margin-top: 0; }
.dlg-body p { margin: 4px 0; }
.dlg-body ol { margin: 4px 0; padding-left: 22px; }
.dlg-btns { display: flex; justify-content: center; gap: 10px; padding: 8px 0 4px; }
.dlg-btns .btn { min-width: 84px; }

.boot { position: fixed; inset: 0; z-index: 5000; background: rgba(0, 0, 16, 0.92); display: grid; place-items: center; }
.boot[hidden] { display: none; }
.boot-win { width: min(480px, 92vw); }
.boot-body { background: #000; margin-top: 3px; padding: 14px; border: 2px inset var(--lo); text-align: center; }
.boot-body p { margin: 6px 0; }
.progress { height: 22px; border: 2px inset #555; background: #111; margin: 10px 0; }
.progress div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--lime) 0 12px, #000 12px 14px); transition: width 0.4s; }

/* ───────────── узкие экраны ───────────── */
@media (max-width: 1100px) {
  /* левое меню превращается в полосу кнопок над картой */
  .main { grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto minmax(0, 1fr); }
  .left { grid-column: 1 / -1; flex-direction: row; overflow: visible; }
  .left .eyebox, .left .srcwin { display: none; }
  .left .menuwin { flex: 1; }
  .left .menuwin .titlebar { display: none; }
  .menu { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px; }
  .menu-btn { width: auto; flex: 1; margin: 0; white-space: nowrap; text-align: center; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  .app { display: block; height: auto; }
  .disclaimer { flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 8px; }
  .dc-tag { font-size: 16px; padding: 3px 7px; }
  .disclaimer p { font-size: 12px; }
  .langs { margin-left: 0; }
  .langs ul { right: auto; left: 0; }
  .main { display: flex; flex-direction: column; padding: 6px; }
  .center { order: 1; }
  .right { order: 2; overflow: visible; }
  .mapwin { height: 62vh; min-height: 340px; flex: none; }
  .dossierwin { min-height: 0; }
  .timewin { position: sticky; bottom: 0; z-index: 1500; margin: 0; }
  .timebody { grid-template-columns: 1fr; gap: 4px; padding: 4px 8px 6px; }
  .datecol { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .datecol .lbl { width: 100%; }
  .date { width: auto; flex: 1; }
  .searchbar .lbl { display: none; }
  .legend { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .marquee-in { padding-left: 0; }
}

/* ───── зоны ───── */
.zone { cursor: help; stroke-linejoin: miter; }
.zlabel { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; font: bold 11px/1.1 var(--f-mono); color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000, 1px 1px 0 #000; }
.zlabel b { font-size: 12px; color: var(--yellow); letter-spacing: 1px; }
.zone-tip { font: 11px/1.35 var(--f-mono); color: var(--lime); background: #000; border: 1px solid var(--lime); border-radius: 0; padding: 4px 7px; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6); }
.zone-tip b { color: var(--yellow); }
.leaflet-tooltip.zone-tip::before { display: none; }
.lg-item.zone i { background: rgba(255, 90, 0, 0.25); border: 2px dashed #ff5a00; }
.zonehit { margin: 8px 0 0; padding: 4px 6px; font: 12px/1.3 var(--f-mono); color: #fff; background: #5a0000; border: 2px dashed #ff3030; }
.zonehit b { color: var(--yellow); }
