/* css/styles.css */

/* ========================================
   Переменные
   ======================================== */
:root {
  --bg-dark: #000b15;
  --text-light: #ffffff;--header-bg: rgba(0, 0, 0, 0.7);
  --cam-border-1: #9c27b0;   /* Фиолетовый */
  --cam-border-2: #ff9800;   /* Оранжевый */
  --cam-border-3: #00c003;   /* Зеленый */
  --cam-border-4: #ffeb3b;   /* Желтый */
  --cam-border-5: #0371f4;   /* Голубой - НОВЫЙ ЦВЕТ для 5-й камеры */
  --header-height: 36px; /* родная высота шапки */
}

/* ========================================
   Глобальные сбросы
   ======================================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: Arial, sans-serif;
  overflow: hidden;
}

h2 {
    font-size: 1.4em;
}

/* ========================================
   Шапка и боковое меню
   ======================================== */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--header-bg);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  z-index: 1000;
}

/* ===== Кнопка «⋮» в шапке ===== */
.menu-btn {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 24px;
  cursor: pointer;
  z-index: 1004; /* стало выше, чем у .menu-panel (1003) */
  line-height: 1;
}

/* ===== Боковое меню камер ===== */
.menu-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: 231px;
  background: rgba(0,0,0,0.85);
  padding: 8px;
  border-radius: 6px;
  display: none;
  z-index: 1003;
}

.menu-panel.visible {
  display: block;
}

.menu-panel .menu-item,
.menu-panel button {
  display: block;
  width: 100%;
  font-size: 15px;
  text-align: left;
  padding: 8px 12px;
  margin: 3px 0;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

.menu-panel .menu-item:hover,
.menu-panel button:hover {
  background: rgba(255,255,255,0.1);
}

/* ===== Адаптив: смартфоны ===== */
@media (max-width: 768px) {
  .menu-panel {
    width: 90%;
    right: 0;
    left: auto;
    font-size: 18px;
    z-index: 1003;
  }
  .menu-panel .menu-item,
  .menu-panel button {
    font-size: 1.2em;
  }
}




/* ========================================
   Селектор камер («колёсики»)
   ======================================== */
.camera-selector {
  position: fixed;
  top: calc(var(--header-height) + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  padding: 0 10px;
  /*overflow-x: auto;*/
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  z-index: 1000;
}

.camera-selector::-webkit-scrollbar {
  display: none;
}

.camera-item {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 4px solid transparent;
  background-color: rgba(255,255,255,0.44);
  background-size: cover;
  background-position: center;
  opacity: 0.9;
  position: relative;
  cursor: pointer;
  box-shadow: 0 0px 9px -7px rgba(6, 24, 44, 0.5);
}

.camera-item::after {
  content: attr(data-cam-index);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  color: #0d1a29;
  font-size: 20px;
  opacity: 0.8;
}

.camera-item[data-cam-index="1"] { border-color: var(--cam-border-1); }
.camera-item[data-cam-index="2"] { border-color: var(--cam-border-2); }
.camera-item[data-cam-index="3"] { border-color: var(--cam-border-3); }
.camera-item[data-cam-index="4"] { border-color: var(--cam-border-4); }
.camera-item[data-cam-index="5"] { border-color: var(--cam-border-5); } /* НОВОЕ ПРАВИЛО */

.camera-item.active {
  opacity: 1;
}

/* ========================================
   Видео-контейнер
   ======================================== */
#video-container {
  position: absolute;
  top: var(--header-height);
  left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

video {
  position: absolute;
  top: 50%; left: 50%;
  transform-origin: center;
  width: auto !important;
  height: auto !important;
}

/* Safari/WebKit: высота с учётом доступного пространства */
@supports (height: -webkit-fill-available) {
  #video-container {
    height: calc(-webkit-fill-available - var(--header-height));
    bottom: auto;
  }
}

#video-container {
  background-color: #000;
}

#video-container video {
  background-color: #000;
}

/* ========================================
   Оверлеи
   ======================================== */
.offline-overlay,
.stream-loader-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.offline-overlay {
  background: transparent !important;
  color: var(--text-light);
  font-size: 18px;
  text-align: center;
  padding: 20px;
  z-index: 950;
}

.offline-overlay.visible {
  display: flex;
}

.stream-loader-overlay {
  background: transparent;
  z-index: 2000;
}

.stream-loader {
  position: relative;
  margin-top: -45px;
  width: 164px;
  height: 164px;
}

.stream-loader-ring {
  width: 100%;
  height: 100%;
  border: 15px solid rgba(255,255,255,0.2);
  border-top-color: #f58720;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  animation: stream-spin 1s linear infinite;
}

.stream-loader-percent {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
}

@keyframes stream-spin {
  to { transform: rotate(360deg); }
}


/* проценты по центру спинера */
.stream-loader-progress {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}

/* крупный красный текст "временно недоступна" */
.offline-overlay.offline-unavailable {
  color: rgba(255, 80, 80, 0.5);
  font-weight: 700;
  font-size: 35px;
}






/* ========================================
  Кнопки основных действий
  ======================================== */
.resume-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 24px;
  background: #424242b3;
  color: #fff;
  border: 2px solid #ffffffcc;
  border-radius: 30px;
  font-size: 16px;
  white-space: nowrap;
  display: none;
  z-index: 960;
  cursor: pointer;
}

.resume-btn.visible {
  display: block;
}

.flip-btn,
.settings-btn {
  position: fixed;
  bottom: 15px;
  width: 60px; height: 60px;
  border: 3px solid #fff;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  font-size: 24px;
  cursor: grab;
  z-index: 999;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: left 0.2s, top 0.2s;
}

.flip-btn {
  right: 15px;
}

.settings-btn {
  left: 15px;
}

.settings-btn.hidden {
  display: none;
}

/* Кнопка «Записи камеры» */
.records-btn {
  position: fixed;
  bottom: 15px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid #b8b8b8;
  background: rgb(0 14 39 / 50%);
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAA37SURBVHjaYvz//z/DcAAAAcigghwGYRiWtGxBhdvEv/YHPsVn+A1w4dYT3boGtysnFDlyZFuR3OS1bCtRUiciY9f1b2ONI9UEiavnA8TCmZ6k9K15Wz0x98FcvJlG/usPIFVc95WFhZHXWBimVKr0wzL5F0o+Qgiz934SaXdrGsj34ofhRacAYgTFyOMnj7mEBIVWcHNz+2Lx7H+oY7Hx/yMchZWPbg4yYCRCPVj8169f1z58+Bj899+/G6ysLAzMIP8zMsA9JSQoyAAQQOAY4eXhzQF54u/ff/v//f1bwcTE9OY/JFRA4CsjI2MYMzPzhL9//y4B4nKg57n+//sPNgicNKHJE2YwUD0UMzGCXMLIxPQfxAfzGBkxvATU9+Pfv382bGxsy4H0eiDOB5rJAhTnZWJirgaKhwkI8K999/5dEDByb7IyszH8YwS5EGEQQACBPcLBweEBov/8/V0EtPwCIsgYwfYCwQuIjf8/AvEzRiRHI7sJnLzQA5UJKgJMqb///oMHPhMjEwPQwQx///1lACZpkKefQDV9Aso+BqVGJkiwx/z98+c30DPRwkLCW798+ezzl+HfDUYG1AABCCAWaAjygvwBTIMvkT0B8gWyc0EkMEaAIcxIQjZkBPvw3/9/oDQfBjRSCpRnwAHByMD85/efA8AUcJqNjRWugRmcFkAe/Q/y4G+gP5L+/fvFwAr0DC8v3wagZ4DJ7P9VZhZmuC0AAQTzCMydYPPBiZMJH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JREjZHIC2Eb8BdR3GKjiEyPaAB9sZpgRUR/AIwUggFiw19T/kSbymGEdH0ZQkmNjZGHg4OacBOxw+dKq2fXt2/f8Xz9/TWLnYEfECBPI44xI1QDqiA9AALGgNwtgw0LgMh1t9AXUx2bm4AC1UOe/+/zlPbDj8wtX4wmzgfkfZYQRMd2AktiZ2NjY/nFysh1gZ2eDtxeRS1/UHIKIZYAAQsvskHLpz5/fQN9Dak0W2Kw80jzH7z9/1r948XL99+8/wCMR/6DpmwlpZuPf//9IlSl4cBpeJYDyHagSBKdzRsjQLGzAm4+fl0FOThqcR/8jOsfgJAVrEfyD6mVmZGaEBQhAAKasIAdAEIYZnSEx8WQi/3+dB48eGcxWx/QKjKQwtraIa4CLLWMW2bTqUUoZjGBAAaaUPgAYJ0iG5ry7S2jxKEN52e/nqts31vmae7mxpnm6vLfEdOK2UIRPtx+96GirRnUooEws/6AnK057QczJ+VsAgVX9/PnzACcnpwswOTX//f2vGij0neE/eAbkHzCRcUM8+0cGaMAroCA7KGQ4gEkMqQJFtO2Qx3shbEYo/R/LKD98nAA678IIcjxsthjYFvsI9IcgeHUGO4cYAzuDBDDZcwLF2ZiZWapAwqBFN6AhJ4AAAlv6/MVLwe/fvx/8jwD/0Nn/oADKpzdGdgucD/TE+efPn8uB/AAQQCzQEuH9p8+fAoHRmcfJweEI5HMARf/BJ/SgI6HoTX1sBQXKECd81B1LbwWRfxj//4dNkDGiTZ/8Z0DMT4M67+BKjQkYnj++fft2EFi6TQbG4CuQIoAAYhwuC88AAgwA3zydFTUug20AAAAASUVORK5CYII=');
  background-position: center;
  background-repeat: no-repeat;
  background-size: 60% 60%;
  cursor: grab;
  z-index: 999;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.records-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: flex-start;
  z-index: 1200;
}

.records-overlay.visible {
  display: flex;
}

.records-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
}

.records-overlay__content {
  position: relative;
  margin-top: 0;
  padding: 10px 48px 10px 16px;
  background: rgba(0, 0, 0, 0.95);
  color: #fff;
  font-size: 18px;
  width: 100%;
  max-width: none;
  border-radius: 0 0 8px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  text-align: left;
}

.records-overlay__close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
}


/* ========================================
   Панель настроек
   ======================================== */
.settings-panel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  padding: 16px 24px;
  border-radius: 8px;
  display: none;
  z-index: 1000;
}

.settings-panel.visible {
  display: block;
}

.settings-panel label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0;
  color: #fff;
}

.settings-panel label span {
  margin-right: 12px;
}

/* ========================================
   Модальные окна
   ======================================== */
/* Общие */
.camera-modal,
.server-modal,
.delete-confirm-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1100;
  align-items: center;
  justify-content: center;
}

.camera-modal.visible,
.server-modal.visible,
.delete-confirm-overlay.visible {
  display: block;
}

/* Фон-маска */
.camera-modal__overlay,
.server-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

/* Окна */
.camera-modal__box,
.server-modal__box {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #1a2735;
  padding: 20px;
  border-radius: 8px;
  width: 320px;
  max-width: 90%;
  color: var(--text-light);
}

.camera-modal__close,
.server-modal__close {
  position: absolute;
  top: 8px; right: 8px;
  background: none;
  border: none;
  font-size: 20px;
  color: #fff;
  cursor: pointer;
}

/* Список камер */
.camera-list {
  margin-top: 12px;
}

.camera-list .cam-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  background: rgba(255,255,255,0.05);
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.camera-list .cam-item .alias {
  flex: 1 1 auto;
  word-break: break-word;
  white-space: normal;
}

.camera-list .cam-item .status {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}

.camera-list .cam-item .status.active   { background: #8bc34a; }
.camera-list .cam-item .status.inactive { background: #f44336; }

.camera-list .cam-item button {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-list .cam-item button.toggle-btn {
  background: #6b6b6b;
  color: #fff;
}

.camera-list .cam-item button.toggle-btn.active {
  background: #579114;
}

.camera-list .cam-item button.delete-btn {
  background: #f44336;
  color: #fff;
}

/* Форма добавления камеры */
.camera-modal__box .add-form {
  margin-top: 12px;
}

.camera-modal__box .add-form label {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.camera-modal__box .add-form input,
.camera-modal__box .add-form select {
  width: 100%;
  padding: 4px 6px;
  background: #0a1a2a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #fff;
  margin: 0;
  font-size: 14px;
}

.camera-modal__box .add-form button {
  width: 100%;
  margin-top: 12px;
  padding: 8px 0;
  background: #ff9800;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Модалка удаления камеры */
.delete-confirm-overlay {
  background: rgba(0,0,0,0.75);
  z-index: 10000;
}

.delete-confirm-modal {
  background: #172025;
  border-radius: 12px;
  padding: 24px 32px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  text-align: center;
}

.delete-confirm-modal h3 {
  margin: 0 0 16px;
  font-size: 1.4em;
  color: #6f7a7f;
}

.delete-confirm-modal label {
  display: flex;
  align-items: center;
  font-size: 1em;
  margin-bottom: 24px;
  color: #ccccd1;
}

.delete-confirm-modal input[type="checkbox"] {
  width: 20px; height: 20px;
  margin-right: 10px;
  accent-color: #f58720;
}

.delete-confirm-buttons {
  display: flex;
  gap: 12px;
}

.delete-confirm-buttons button {
  flex: 1;
  padding: 12px 0;
  font-size: 1em;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.delete-confirm-buttons .btn-cancel {
  background: #3b3e4c;
  color: #aaa;
}

.delete-confirm-buttons .btn-cancel:hover {
  background: #4e5162;
}

.delete-confirm-buttons .btn-delete {
  background: #762000;
  color: #fff;
}

.delete-confirm-buttons .btn-delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   ПАНЕЛЬ УПРАВЛЕНИЯ СЕРВЕРАМИ
   ======================================== */
.server-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.server-list .server-item {
  padding: 0;
  margin-bottom: 0;
  background: none;
}

/* карточка сервера */
.server-card {
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 20px;
  margin: 12px auto;
  max-width: 360px;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* заголовок */
.server-card__header {
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
}

/* графики CPU / RAM */
.server-card__body {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 24px;
}

/* полукруглые gauge */
.gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 64px;
}
.gauge svg {
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
}
.gauge .bg {
  fill: none;
  stroke: #4b5563;
  stroke-width: 3;
}
.gauge .meter {
  fill: none;
  stroke-width: 3;
  transition: stroke-dasharray 0.3s;
}
.gauge text {
  transform: rotate(90deg);
  transform-origin: center;
  fill: #fff;
  font-size: 0.65rem;
  dominant-baseline: middle;
  text-anchor: middle;
}
.gauge__label {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* счётчик камер */
.server-card__cams {
  text-align: center;
}
.server-card__cams .count {
  font-size: 1.3rem;
  font-weight: bold;
  color: #fff;
  display: block;
}
.server-card__cams .label {
  color: #9ca3af;
  font-size: 0.85rem;
}

/* список подключений по камерам (новое!) */
.server-card__conns {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.server-card__conns .conn-item {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: #ccc;
}
.server-card__conns .conn-item .name {
  flex: 1 1 auto;
}
.server-card__conns .conn-item .bar {
  flex: 0 0 60%;
  height: 6px;
  background: #2d3748;
  border-radius: 3px;
  overflow: hidden;
  margin-left: 8px;
}
.server-card__conns .conn-item .bar > div {
  height: 100%;
  background: #38b2ac;
  width: 0%; /* будет устанавливаться через JS */
  transition: width 0.5s;
}

/* кнопки */
.server-card__actions {
  display: flex;
  gap: 10px;
}
.server-card__actions button {
  flex: 1;
  padding: 10px 0;
  background: #f59e0b;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.server-card__actions button:hover {
  background: #d97706;
}



/* ========================================
   Информация о парковке
   ======================================== */
.parking-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  row-gap: 4px;
}

.parking-info .pi-label {
  color: #aaa;
  margin: 0;
}

.parking-info .pi-main {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  margin: 0;
  padding: 0;
}

/* ========================================
   Адаптивность
   ======================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 28px;
  }
}




.s-dashboard {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}
.gauge {
  text-align: center;
  font-size: 12px;
  overflow: visible;
}
.gauge svg {
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
}
.gauge .bg {
  fill: none;
  stroke: #eee;
  stroke-width: 3;
}
.gauge .meter{
  transition:stroke-dasharray .6s ease;
  /* stroke: #28c940;  ← УДАЛИТЬ */
}


/* =====================================================
   Цифры в gauge: уменьшить размер и опустить вниз под дугой
   ===================================================== */
.gauge svg text {
  font-size: 0.6rem;           /* нужный размер цифр */
  fill: #fff;                  /* цвет цифр */
  dominant-baseline: hanging;  /* выравниваем по верхнему краю текста */
  transform: rotate(90deg) translateY(2px);  /* опускаем вниз под дугу */
  overflow: visible;           /* Разрешаем всё, что выходит за viewBox */
}



/* =====================================================
   3) CSS для .gauge-text: размер и смещение цифр под дугой
   ===================================================== */
.gauge-text {
  font-size: 0.6rem;
  fill: #fff;
  dominant-baseline: hanging;
}

/* ——————————————
   1) Разрешаем «вылезание» цифр за границу viewBox
   —————————————— */
.gauge,
.gauge svg {
  overflow: visible;
}

/* ——————————————
   2) Настраиваем размер и вертикальное смещение цифр
   —————————————— */
/* Этот селектор в точности бьёт по <text> внутри SVG */
.gauge svg text {
  font-size: 0.7rem;          /* увеличиваем размер цифр */
  fill: #fff;
  dominant-baseline: hanging; /* выравниваем по верхней линии */
  /* если нужно дополнительно опустить: */
  /*transform: translateY(4px);  */
}


/* ========================================
   МОДАЛКА КАДРИРОВКИ (чистовая версия)
   ======================================== */

/* ---- корневая модалка + фон ---- */
.crop-modal{
  position:fixed; inset:0;
  display:none; align-items:center; justify-content:center;
  z-index:1200;
}
.crop-modal.visible{display:flex;}

.crop-modal__overlay{
  position:absolute; inset:0;
  background:rgba(0,0,0,.7);
}

/* ---- «коробка» ---- */
.crop-modal__box{
  position:relative;
  background:#1a2735;
  padding:16px;
  border-radius:8px;

  /* вписываемся в экран и даём внутренний скролл при совсем маленьком H */
  max-width:96vw;
  max-height:calc(96vh - 48px);

  display:flex; flex-direction:column;
  overflow:visible;           /* - нужна чтобы крестик и ручки не резались */
}

/* ============================================================
   ВИДЕО  +  ОБЁРТКА
   ============================================================ */
/* ---------- обёртка видео + рамки ---------- */
.crop-video-wrapper{
    position:relative;

    /* ❶ обёртка живёт строго внутри своего окна */
    width:100%;
    max-width:100%;
    max-height:70vh;        /* не выше 70 % окна — чтобы кнопки не исчезали */

    /* ❷ если высота ограничит, видео сужается пропорционально */
    height:auto;

    overflow:visible;       /* рамка и ручки могут «вылезать» наружу */
    margin-bottom:8px;
}

/* само видео */
.crop-video-wrapper video#crop-video{
    display:block!important;

    /* ❸ всегда вписываемся по ширине wrapper-а */
    width:100%!important;
    height:auto!important;      /* высота сохраняет пропорции */

    max-width:100%!important;   /* на всякий случай */
    max-height:70vh!important;  /* то же ограничение, что у wrapper-а */

    object-fit:contain;         /* <— ключевой момент: вписать и сохранить пропорции */

    position:static!important;
    transform:none!important;
}

/* ============================================================
   РАМКА  +  РУЧКИ  +  КРЕСТИК
   ============================================================ */
.crop-box{
  position:absolute; inset:0;
  border:2px dashed #f58720;
  box-sizing:border-box;
  cursor:move;
  z-index:10;
  touch-action:none;
}
.crop-box .handle{
  position:absolute; width:12px; height:12px;
  background:#f58720; border-radius:50%;
  z-index:15; touch-action:none;
}
.crop-box .handle.top-left     {top:-6px;  left:-6px;  cursor:nwse-resize;}
.crop-box .handle.top-right    {top:-6px;  right:-6px; cursor:nesw-resize;}
.crop-box .handle.bottom-left  {bottom:-6px;left:-6px; cursor:nesw-resize;}
.crop-box .handle.bottom-right {bottom:-6px;right:-6px;cursor:nwse-resize;}

/* крестик-закрытие */
.btn-close-crop{
  position:absolute; top:8px; right:8px;
  width:28px; height:28px;
  background:none; border:none; font-size:20px;
  color:#fff; cursor:pointer; z-index:20;
}

/* ============================================================
   КНОПКИ «Сбросить / Сохранить»
   ============================================================ */
.crop-modal__controls{
  flex:0 0 auto;
  display:flex; gap:8px; justify-content:flex-end;
}
.crop-modal__controls button{
  padding:6px 12px;
  border:none; border-radius:4px;
  background:#f59e0b; color:#fff; cursor:pointer;
}
.crop-modal__controls button.reset{background:#6b6b6b;}

/* ============================================================
   МОБИЛЬНАЯ ДОПРАВКА  (≤ 600 px по ширине)
   ============================================================ */
@media(max-width:600px){
  .crop-modal__box{
    max-height:calc(100vh - 24px);
    padding:12px;
  }
  .crop-video-wrapper{
    max-height:60vh;
  }
}


/* —————————————
   Новое для модалки кадрировки
————————————— */

/* Разрешаем «вылезание» крестика и ручек за пределы .crop-modal__box */
.crop-modal__box {
  overflow: visible; /* вместо hidden по умолчанию */
}

/* Стили крестика закрытия */
.btn-close-crop {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  font-size: 20px;
  color: #fff;
  cursor: pointer;
  z-index: 20; /* выше остальных элементов внутри модалки */
}

/* Убедимся, что видео лежит ниже всех рамок и крестика */
.crop-video-wrapper video {
  position: relative;
  z-index: 1;
}

/* Рамка и ручки — над видео */
.crop-box {
  z-index: 10;
}
.crop-box .handle {
  z-index: 15;
}

/* ========================================
   Изоляция стилей для видео в модалке кадрировки
======================================== */
.crop-modal .crop-video-wrapper{
    position:relative;
    width:  100%;      /* подгоняемся по ширине «коробки»            */
    height: auto;      /* …а высоту берём по самому video           */
    max-height:70vh;   /* страхуемся, чтобы кнопки не съехали        */
    flex:0 0 auto;     /* ⬅️  больше НЕ растягиваемся по колонке     */
    overflow:visible;
    margin-bottom:8px;
}

/* Делаем так, чтобы именно это видео не наследовало глобальные абсолюты */

.crop-modal video#crop-video{
  position: static   !important;   /* снимем absolute/globals */
  top: auto          !important;
  left: auto         !important;
  transform: none    !important;

  width: 100%        !important;   /* заполним wrapper целиком */
  height: auto       !important;
  max-width: 100%    !important;
  object-fit: contain!important;   /* вписываем, сохраняя AR */

  display: block     !important;
}

/* Рамка ровно по обёртке */
.crop-modal .crop-box {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 2px dashed #f58720;
  box-sizing: border-box;
  cursor: move;
  z-index: 10;
}

/* Ручки — над рамкой */
.crop-modal .crop-box .handle {
  z-index: 15;
}

/* Крестик — поверх всего */
.crop-modal .btn-close-crop {
  z-index: 20 !important;
}

.server-card__body{
  display:flex;
  align-items:flex-start;      /* выравнивание по верхнему краю */
  gap:32px;
  margin-top:12px;
}
.gauge svg{display:block;width:72px;height:72px}
.gauge-text{font-size:9px;fill:#fff;dominant-baseline:middle}
.g-label{font-size:11px;text-align:center;margin-top:4px;line-height:1.2}
.server-card__cams{display:flex;flex-direction:column;align-items:center;justify-content:flex-start}
.server-card__cams .count{font-size:32px;font-weight:600;margin-top:6px}
.server-card__cams .label{font-size:12px;color:#aaa;margin-top:-4px}

/* зелёная третья кнопка */
.server-card__actions .btn-restart {
  background:#28c940;
}
.server-card__actions .btn-restart:hover {
  background:#1ea32f;
}

/* прогресс-полоса внутри server-card */
.server-card__progress {
  height: 4px;
  width: 0%;
  background: #34d399;          /* зелёная как и gauge <70 % */
  transition: width .4s ease;
  border-radius: 2px;
  margin-top: 8px;
  opacity: 0;
}
.server-card__progress.visible { opacity: 1; }


.toast{
  position:fixed;left:50%;top:30px;transform:translateX(-50%) scale(.9);
  padding:10px 18px;border-radius:8px;font-size:15px;font-weight:600;
  color:#fff;background:#2d3748;opacity:0;pointer-events:none;
  transition:opacity .25s,transform .25s;
  z-index:12000;
}
.toast-ok      { background:#16a34a; }
.toast-error   { background:#dc2626; }
.toast.visible { opacity:1;transform:translateX(-50%) scale(1); }


/* ======== Универсальное текстовое модальное окно ======== */
.text-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.text-modal.visible {
  opacity: 1;
  pointer-events: all;
}

.text-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}

.text-modal__box {
  position: relative;
  background: #1a2735;
  padding: 30px 30px 36px;
  border-radius: 12px;
  max-width: 90%;
  width: 500px;
  color: #bccbdf;
  line-height: 1.5;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  z-index: 10;
}

.text-modal.visible .text-modal__box {
  transform: translateY(0);
}

.text-modal__close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.text-modal__title {
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.4em;
}

.text-modal__content {
  margin-bottom: 20px;
  font-size: 16px;
}

.text-modal__content a {
  color: #3a8cc9;
  font-weight: bold;
  word-break: break-all;
  display: inline-block;
  margin: 5px 0;
}

.text-modal__actions {
  text-align: center;
  margin-top: 26px;
}

.text-modal__close-btn {
  padding: 10px 28px;
  background: #ff9800;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 1em;
  box-shadow: 0px 0px 15px -5px rgb(0 14 31 / 39%);
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
  .text-modal__box {
    padding: 20px 15px 33px;
    width: 95%;
  }
  
  .text-modal__title {
    font-size: 1.3em;
  }
  
  .text-modal__content {
    font-size: 1.0em;
  }
}


/*======================================*/

/* Градиентный бордер с переливом и скругленными углами */
.qr-gradient-border {
  position: relative;
  display: inline-block;
}


.qr-gradient-border img {
    display: block;
    width: 100%;
    border-radius: 26px;
    border: 0px solid white;
    background: white;
}


.qr-download-btn {
    margin: 25px auto 10px auto;
    padding: 14px 28px;
    background: linear-gradient(135deg, #344d69, #122335);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgb(119 119 119 / 30%);
    display: block; /* Это центрирует кнопку */
    width: fit-content; /* Ширина по содержимому */
}

.qr-download-btn:hover {
    background: linear-gradient(135deg, #344d69, #344d69);
    transform: translateY(-2px);
}


/* ================================================================
   Buttons
================================================================== */
.qr-download-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(245,135,32,.3);
}

/* ================================================================
   Top row circles (main screen) + "ещё"
================================================================== */
.camera-item{
  position: relative;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(255,255,255,.25); /* color may be overridden inline */
}
.camera-item--more{
  display:inline-flex; align-items:center; justify-content:center;
  font-size:13px; color:#fff;
  background: rgba(255,255,255,.25);
  border: 2px dashed rgba(255,255,255,.70);
  user-select:none;
}
.camera-item--more span{ pointer-events:none; }

/* replace old data-cam-index number with a new data-cam-num center badge */
.camera-item::after{ content:none !important; }
.camera-selector .camera-item[data-cam-index]::after{ content:none !important; }
.camera-selector .camera-item[data-cam-num]::after{
  content: attr(data-cam-num) !important;
  position:absolute; top:50%; left:50%;
  transform: translate(-50%, -50%);
  font-size:14px; font-weight:700; 
  color:rgba(0,11,21,.9);
  pointer-events:none;
}

/* Hide labels under top-row chips */
.camera-item__label{ display:none !important; }

/* keep the selector above video */
#video-container .camera-selector{ position:relative; z-index:60; }

/* ================================================================
   Video helpers
================================================================== */
#video-container{ overflow:hidden; }

/* fade-in layer */
#video-container .video-fade{
  position:absolute; inset:0; background:#000; opacity:1;
  pointer-events:none; transition:opacity .5s ease; z-index:2;
}
#video-container .video-fade.hidden{ opacity:0; }

/* soft shade below the top chips (08–20, toggled via JS) */
#video-container .cam-strip-shade{
  position:absolute; left:0; right:0; top:-12px; height:80px;
  background: linear-gradient(to bottom, rgba(0,11,21,.7), rgba(0,11,21,0));
  pointer-events:none; z-index:1; display:none;
}
#video-container .cam-strip-shade.visible{ display:block; }

/* iOS-friendly video positioning */
#video-container video#video,
#video-container video#crop-video{
  position:absolute; left:50%; top:50%;
  transform-origin:center center; will-change:transform;
  object-fit:contain;
}

/* HLS loader overlay smooth fade */
.stream-loader-overlay{ opacity:0; pointer-events:none; transition:opacity 1s ease; }
.stream-loader-overlay.is-visible{ opacity:1; pointer-events:auto; }

/* ================================================================
   Draggable round map overlay (mini-map at top-left)
================================================================== */
#mapOverlay{
  position:fixed; left:3px; top:117px; z-index:50;
  width:120px; height:120px; border-radius:50%;
  background: rgb(0 11 21 / 60%);
  backdrop-filter: blur(1px);
  overflow:hidden; touch-action:none; user-select:none;
  display:none;
  border:2px dotted rgb(232 244 255 / 50%);
}
#mapOverlay img{
  width:100%; height:100%; object-fit:contain; padding:11px;
  box-sizing:border-box; pointer-events:none; opacity:.95; background:transparent;
}

/* ================================================================
   ⋮ Menu (collapsible sections) — inside the "ещё" overlay
================================================================== */
.menu-panel{ max-height:70vh; overflow:auto; }
.menu-section{ margin:6px 0 8px; }
.menu-section__head{
  width:100%; text-align:left; cursor:pointer;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  padding:8px 10px; border-radius:8px;
}
.menu-section__body{
  max-height:0; overflow:hidden; transition:max-height .2s ease; padding-left:8px;
}
.menu-section__body.open{ max-height:600px; padding-top:6px; }
.menu-panel .menu-item{
  width:100%; text-align:left; cursor:pointer;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  margin:4px 0; padding:8px 10px; border-radius:8px;
}

/* ================================================================
   Overlay “Камеры” (full-screen sheet with groups & chips)
================================================================== */
.camera-overlay{ position:fixed; inset:0; z-index:50; display:none; pointer-events:none; opacity:0; }
.camera-overlay.visible{ display:block; pointer-events:auto; opacity:1; z-index:9999; }

.camera-overlay__backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  pointer-events:auto;
}
.camera-overlay__panel{
  position:absolute; left:0; right:0; top:0; bottom:0;
  background: linear-gradient(to bottom, rgba(00,11,21,.50), rgba(00,11,21,.60));
  padding:12px 14px 14px;
  overflow:hidden; display:flex; flex-direction:column;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.camera-overlay__bar{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.camera-overlay__title{ color:#fff; font-weight:600; font-size:22px; }
.camera-overlay__close{
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 10000; /* всегда выше заголовка */
}

/* scroll area — hidden scrollbar */
.camera-overlay__list{
  flex:1 1 auto; overflow:auto; padding-right:6px;
  -ms-overflow-style:none; scrollbar-width:none;
}
.camera-overlay__list::-webkit-scrollbar{ display:none; }

/* Section: round mini map + chips line */
.ovSection{
  display:grid; grid-template-columns:132px 1fr;
  gap:14px; align-items:center; padding:8px 0;
}
.ovSep{ border:0; border-top:1px solid rgba(255,255,255,.08); margin:12px 0; }

/* circular mini map */
.ovMapCircle{
  width:120px; height:120px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  background: radial-gradient(circle at 50% 40%, rgb(00 20 30 / 70%), rgb(0 0 0 / 70%));
  outline:1px dotted rgba(255,255,255,.32);
  outline-offset:-4px;
}
.ovMapCircle img{ width:100%; height:100%; object-fit:contain; padding:10px; box-sizing:border-box; opacity:.98; pointer-events:none; }
.ovMapCircle__ph{ font-size:12px; color:#bbb; }

/* pretty chips — компактная чистая версия (как в гисте) */
.ovChipLine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 12px 0 8px;
}

.ovChipWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 60px;
}

.ovChip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(2px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ovChip:hover {
  transform: scale(1.06);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.25);
}

.ovChip.on {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25) inset;
}

.ovChip__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 50%;
  font-size: 11px;
  padding: 2px 5px;
  line-height: 1;
  color: #fff;
  font-weight: 500;
  backdrop-filter: blur(3px);
}

.ovChipLabel {
  font-size: 11px;
  opacity: 0.8;
  text-align: center;
  color: #fff;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================================================================
   Global when overlay opened
================================================================== */
body.menu-open{ overflow:hidden; }




/* CAM STATUS DOTS — scoped, не ломает меню */
.camera-item.cam-has-dot,
.ovChip.cam-has-dot { position: relative; }

.camera-item .cam-dot,
.ovChip .cam-dot {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: #e74c3c; /* offline */
  box-shadow: none;
  z-index: 3;
  pointer-events: none;
}

.camera-item .cam-dot.on,
.ovChip .cam-dot.on { background: #27ae60; } /* online */



.camera-modal .camera-list{
  max-height: calc(100vh - 340px); /* деликатно: подстраивается под высоту экрана */
  overflow: auto;
  -webkit-overflow-scrolling: touch; /* плавный скролл на тач-устройствах */
  overscroll-behavior: contain;
}

/* Скрываем полосы прокрутки (и вертикальную, и горизонтальную) */
.camera-modal .camera-list{ scrollbar-width: none; }
.camera-modal .camera-list::-webkit-scrollbar{ width: 0; height: 0; display: none; }


:root{ --modal-gap:24px; }

/* РОВНО один блок-переопределение: окно влезает в экран с зазорами,
   форма остаётся сверху, список камер ниже и прокручивается внутри */
.camera-modal{
  padding-top:var(--modal-gap);
  padding-bottom:var(--modal-gap);
  box-sizing:border-box;
}

.camera-modal .camera-modal__box{
  display:flex;
  flex-direction:column;
  max-height:calc(100vh - var(--modal-gap) * 2);
  overflow:hidden; /* скролл только у списка, коробка без полосы */
}

/* верхняя форма (первая форма внутри коробки) не тянется */
.camera-modal .camera-modal__box > form{ flex:0 0 auto; }

/* сам список камер растягивается и скроллится внутри */
.camera-modal .camera-modal__box .camera-list{
  flex:1 1 auto;
  min-height:160px;          /* чтобы список был виден сразу */
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  scrollbar-width:none;
}
.camera-modal .camera-modal__box .camera-list::-webkit-scrollbar{ width:0; height:0; display:none; }
#video-container {
  background: transparent !important;
}


