:root {
  --bg-main: #020617;
  --accent1: #f97316;
  --accent2: #22c55e;
  --accent3: #0ea5e9;
  --text: #e5e7eb;
  --muted: #9ca3af;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0b1120 0, #020617 50%, #000 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */

header {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(10px);
  background: linear-gradient(
    to right,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.6)
  );
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.9rem;
  font-weight: 700;
}

.logo-badge {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #f97316, #ef4444, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.8);
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.8);
  font-size: 0.8rem;
  color: #fecaca;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent2);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

/* MAIN */

main {
  width: 100%;
  max-width: 100%;
  padding: 10px 10px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
}

/* BUTTONS */

.cam-btn {
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.cam-btn:hover {
  background: rgba(30, 64, 175, 0.6);
  border-color: rgba(59, 130, 246, 0.9);
  transform: translateY(-1px);
}

.cam-btn.cam-btn-on {
  border-color: rgba(34, 197, 94, 0.8);
  background: rgba(22, 163, 74, 0.2);
  color: #bbf7d0;
}

.cam-btn.cam-btn-off {
  border-color: rgba(248, 113, 113, 0.8);
  background: rgba(127, 29, 29, 0.2);
  color: #fecaca;
}

.cam-fullscreen-all {
  font-size: 0.75rem;
}

/* VIDEO WALL */

.video-card {
  position: relative;
  padding: 1px;
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.9),
    rgba(249, 115, 22, 0.9)
  );
  box-shadow: 0 0 36px rgba(59, 130, 246, 0.5);
  flex: 1;
  min-height: 0;
}

.video-wrap {
  background: #020617;
  border-radius: 17px;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.video-wrap-grid {
  padding: 8px;
}

.cam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  height: 100%;
}

/* fullscreen: плитки чуть крупнее */
.video-card:fullscreen .cam-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* CAMERA CARD */

.cam-card {
  position: relative;
  background: radial-gradient(circle at top left, #020617, #000 60%);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .cam-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(15, 23, 42, 0.8);
  }
}

.cam-card.dragging {
  opacity: 0.6;
  transform: scale(0.98);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.8);
}

.cam-card.drag-over {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
}

.cam-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  cursor: grab;
}

.cam-title {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  color: #e5e7eb;
}

.cam-controls {
  display: flex;
  gap: 6px;
}

/* VIDEO AREA */

.cam-video-wrap {
  position: relative;
  background: #000;
  flex: 1;
  min-height: 140px;
}

.cam-video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}

.cam-card:fullscreen .cam-video-wrap,
.video-card:fullscreen .cam-video-wrap {
  height: 100%;
}

.cam-card:fullscreen video,
.video-card:fullscreen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  aspect-ratio: 16 / 9;
  background: #000;
}

/* OVERLAYS */

.cam-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9ca3af;
  background: radial-gradient(
    circle at center,
    rgba(15, 23, 42, 0.8),
    rgba(0, 0, 0, 0.95)
  );
  cursor: pointer;
}

.cam-overlay.hidden {
  display: none;
}

.cam-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #e5e7eb;
  background: radial-gradient(
    circle at center,
    rgba(15, 23, 42, 0.85),
    rgba(0, 0, 0, 0.98)
  );
}

.cam-loading.hidden {
  display: none;
}

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.3);
  border-top-color: var(--accent3);
  animation: spin 0.9s linear infinite;
}

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

/* CLUB MAP */

.club-map-card {
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.club-map-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  color: #e5e7eb;
}

.club-map-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.seat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-free {
  background: rgba(34, 197, 94, 0.9);
}

.legend-busy {
  background: rgba(248, 113, 113, 0.9);
}

.legend-offline {
  background: rgba(148, 163, 184, 0.9);
}

/* GRID OF SEATS */

.seat-grid {
  position: relative;
  display: grid;
  gap: 3px;
  margin-top: 2px;
}

/* SEAT TILE */

.seat-tile {
  border-radius: 9px;
  padding: 4px 6px;
  background: radial-gradient(circle at top left, #020617, #020617 45%, #000 100%);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 60px;
  position: relative;
}

/* строка с названием ПК */
.seat-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.seat-label {
  font-weight: 600;
  white-space: nowrap;
}

/* игра */
.seat-extra {
  font-size: 0.64rem;
  color: var(--muted);
}

.seat-extra strong {
  color: #e5e7eb;
}

/* СТАТУС (цвет рамки) */

.seat-free {
  border-color: rgba(34, 197, 94, 0.85);
}

.seat-busy {
  border-color: rgba(248, 113, 113, 0.9);
}

.seat-offline {
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.8);
  opacity: 0.9;
}

/* ЗОНЫ (внутренний контур / подсветка) */

.seat-zone-vip {
  box-shadow: inset 0 0 0 1px rgba(244, 114, 182, 0.75);
}

.seat-zone-ps {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.75);
}

.seat-zone-regular {
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.6);
}

/* FOOTER */

footer {
  padding: 6px 12px 10px;
  font-size: 0.75rem;
  text-align: center;
  color: var(--muted);
}

/* RESPONSIVE */

@media (max-width: 768px) {
  main {
    padding-inline: 8px;
  }

  .video-wrap-grid {
    padding: 6px;
  }

  .cam-video-wrap {
    min-height: 160px;
  }
}

