/* ЗАХІДНИЙ РАДАР — темна панель у стилі C2 / radar UI */

:root {
  --bg-deep: #0a0e14;
  --bg-panel: rgba(14, 20, 32, 0.72);
  --bg-panel-border: rgba(90, 140, 220, 0.18);
  --blue: #2563eb;
  --blue-bright: #38bdf8;
  --blue-dim: rgba(37, 99, 235, 0.35);
  --accent-soft: rgba(56, 189, 248, 0.14);
  --text: #e8edf5;
  --text-muted: #8b9cb8;
  --radius: 14px;
  --font: "Manrope", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.5;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: -20%;
  right: -10%;
  width: 55vw;
  height: 55vw;
  max-width: 720px;
  max-height: 720px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.header {
  position: relative;
  z-index: 1;
  padding: 1.75rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--bg-panel-border);
  background: linear-gradient(180deg, rgba(10, 14, 20, 0.95) 0%, rgba(10, 14, 20, 0.7) 100%);
  backdrop-filter: blur(12px);
}

.header__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 0.65rem;
}

.header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  flex-shrink: 0;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  justify-self: start;
}

.header__text {
  min-width: 0;
}

.header__logo {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(56, 189, 248, 0.4),
    0 8px 32px rgba(0, 0, 0, 0.45);
}

.header__title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  white-space: nowrap;
}

.header__subtitle {
  margin: 0.25rem 0 0;
  font-size: clamp(0.75rem, 2.1vw, 0.9rem);
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

.header__online {
  margin: 0;
  text-align: right;
  font-size: 0.95rem;
  font-weight: 600;
  color: #b9d7ff;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.header__telegram-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 1.05rem;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.75);
  background: linear-gradient(180deg, #38bdf8 0%, #1d9ed8 100%);
  color: #041320;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.32);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.header__telegram-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 10px 26px rgba(56, 189, 248, 0.42);
}

.main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.75rem clamp(1rem, 4vw, 2.5rem) 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--bg-panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bg-panel-border);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent);
}

.panel__head--split {
  align-items: flex-end;
}

.panel__head--stack {
  align-items: flex-start;
}

.panel__head-text {
  flex: 1;
  min-width: min(100%, 280px);
}

.map-disclaimer {
  margin: 0.5rem 0 0;
  max-width: 52rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
  font-weight: 500;
}

.panel__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel__badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 156, 184, 0.35);
  background: rgba(0, 0, 0, 0.2);
}

.panel__badge--accent {
  color: var(--blue-bright);
  border-color: rgba(56, 189, 248, 0.45);
  background: var(--accent-soft);
}

.status-time {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status-time__value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--blue-bright);
  letter-spacing: 0.04em;
}

.status-time__tz {
  font-size: 0.8rem;
  opacity: 0.85;
}

.map-view {
  padding: 1rem 1.25rem 1.25rem;
}

.map-view__frame {
  position: relative;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--bg-panel-border);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.map-view__img {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  max-height: min(72vh, 900px);
  object-fit: contain;
  vertical-align: middle;
}

.map-sector-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-sector-text--count {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 1.05rem;
  font-weight: 700;
  fill: rgba(226, 232, 240, 0.82);
  text-anchor: middle;
}

.map-sector-badge {
  fill: rgba(15, 23, 42, 0.35);
  stroke: rgba(56, 189, 248, 0.35);
  stroke-width: 1.5;
}

.map-sector-arrow {
  stroke: rgba(56, 189, 248, 0.62);
  stroke-width: 2.8;
  stroke-linecap: round;
  fill: none;
}

/* Легкий обертається промінь поверх карти (низька непрозорість, як раніше) */
.map-radar {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
}

.map-radar::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220%;
  height: 220%;
  margin: 0;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(56, 189, 248, 0.085) 0deg,
    rgba(56, 189, 248, 0.028) 42deg,
    transparent 58deg
  );
  animation: map-radar-sweep 10s linear infinite;
}

.map-radar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 50%,
    transparent 0%,
    transparent 38%,
    rgba(56, 189, 248, 0.055) 39%,
    transparent 40%,
    transparent 58%,
    rgba(56, 189, 248, 0.045) 59%,
    transparent 60%
  );
  opacity: 0.62;
  pointer-events: none;
}

@keyframes map-radar-sweep {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.table-wrap {
  padding: 0;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table thead {
  background: rgba(0, 0, 0, 0.32);
}

.data-table th {
  text-align: left;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aabdd4;
  border-bottom: 1px solid var(--bg-panel-border);
}

.data-table td {
  padding: 1rem 1.25rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(90, 140, 220, 0.14);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.14);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table__metric {
  max-width: 62%;
  color: #d6dee9;
  font-weight: 500;
  line-height: 1.55;
}

.data-table__value {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* Моря: одна комірка на всю ширину — без «дірки» від широкої колонки бомбардувальників */
.data-table__sea-cell {
  padding: 0.9rem 1.25rem;
  vertical-align: middle;
}

.sea-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem 1.25rem;
}

.sea-row__name {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 600;
}

.sea-row__metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.1rem;
}

.sea-metric {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
}

.sea-metric__prefix {
  font-size: 0.92rem;
  font-weight: 500;
  color: #d6dee9;
  white-space: normal;
}

.data-table--uav .data-table__metric,
.data-table--uav td:first-child {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text);
}

.data-table--uav .data-table__site {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.data-table--uav .data-table__region {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 12rem;
  white-space: normal;
}

.data-table--uav .data-table__remaining {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  white-space: nowrap;
  vertical-align: middle;
}

.data-table--uav tr.uav-row--grace {
  background: rgba(234, 179, 8, 0.1);
}

.tag--uav-wait {
  background: rgba(234, 179, 8, 0.22);
  color: #facc15;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.tag--neutral {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.tag--warn {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

/* Ймовірність Ту-95/Ту-160: як теги, кольори рівня */
.tag--risk-low {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.tag--risk-mid {
  background: rgba(234, 179, 8, 0.14);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.45);
}

.tag--risk-high {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.42);
}

.tag--risk-unknown {
  background: rgba(139, 156, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(139, 156, 184, 0.3);
}

.tag--sea-salvo {
  background: rgba(56, 189, 248, 0.08);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.35);
  white-space: normal;
  max-width: 22rem;
  text-align: left;
}

/* «Калібр» після тегу залпу — як звичайний текст, не голубий */
.sea-salvo__kalibr {
  font-size: 0.92rem;
  font-weight: 500;
  color: #d6dee9;
}

.empty-hint {
  margin: 0;
  padding: 1.25rem 1.25rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.footer {
  position: relative;
  z-index: 1;
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #aab8cc;
  border-top: 1px solid var(--bg-panel-border);
}

@media (max-width: 640px) {
  /* Шапка ~у 1.4 рази компактніша; логотип / шрифти / відступи зменшені пропорційно */
  .header {
    padding: 0.64rem 0.5rem;
  }

  .header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.35rem;
    align-items: center;
  }

  .header__actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.22rem 0.38rem;
  }

  .header__online {
    text-align: right;
  }

  .header__brand {
    gap: 0.45rem;
  }

  .header__logo {
    width: 37px;
    height: 37px;
  }

  .header__title {
    font-size: clamp(0.68rem, 3.4vw, 1.05rem);
    line-height: 1.12;
    letter-spacing: 0.04em;
    white-space: normal;
  }

  .header__subtitle {
    margin-top: 0.06rem;
    font-size: clamp(0.52rem, 2.35vw, 0.78rem);
    line-height: 1.2;
  }

  .header__online {
    font-size: clamp(0.52rem, 2.2vw, 0.72rem);
  }

  .header__telegram-btn {
    padding: 0.32rem 0.5rem;
    font-size: clamp(0.52rem, 2.2vw, 0.72rem);
    border-radius: 7px;
  }

  .data-table__metric {
    max-width: none;
  }

  .data-table th,
  .data-table td {
    padding: 0.75rem 1rem;
  }

  .panel__head--split {
    flex-direction: column;
    align-items: flex-start;
  }
}
