* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050817;
  color: #f9fafb;
}

.background-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.25), transparent 60%),
    radial-gradient(circle at 80% 0%, rgba(129, 140, 248, 0.35), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(236, 72, 153, 0.3), transparent 55%);
  filter: blur(40px);
  opacity: 0.9;
  z-index: -1;
}

.app-card {
  width: 96%;
  max-width: 900px;
  max-height: calc(100vh - 32px);
  padding: 20px 22px 22px;
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow:
    0 0 40px rgba(15, 23, 42, 0.8),
    0 0 80px rgba(56, 189, 248, 0.4);
  backdrop-filter: blur(20px) saturate(140%);
  display: flex;
  flex-direction: column;
}

.title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.7),
    0 0 24px rgba(56, 189, 248, 0.4);
}

.subtitle {
  margin-top: 4px;
  color: #9ca3af;
  font-size: 13px;
}

.room-section {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.room-section input {
  flex: 1;
  padding: 9px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  outline: none;
  font-size: 14px;
}

.room-section input::placeholder {
  color: #6b7280;
}

.room-section button {
  padding: 9px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.room-section button:hover {
  filter: brightness(1.05);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.9);
  transform: translateY(-1px);
}

.room-section button:active {
  transform: translateY(1px) scale(0.98);
}

.status {
  margin-top: 10px;
  font-size: 12px;
  color: #a5b4fc;
}

.controls {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.controls button {
  flex: 1 1 120px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.controls button:hover:not(:disabled) {
  background: rgba(30, 64, 175, 0.85);
  border-color: rgba(129, 140, 248, 0.8);
}

.controls button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* -------- окна дмки -------- */

.video-wrapper {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  flex: 1;
  min-height: 0; /* чтобы работал flex внутри app-card */
}

.video-block {
  position: relative;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-block h2 {
  font-size: 13px;
  margin: 8px 12px 4px;
  color: #c7d2fe;
  flex: 0 0 auto;
}

.video-block video {
  flex: 1 1 auto;
  width: 100%;
  min-height: 140px;
  background: #020617;
  border: none;
  object-fit: contain;
  cursor: pointer;
}

/* fullscreen */

video:fullscreen {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #020617;
}

.hint {
  margin-top: 10px;
  font-size: 11px;
  color: #9ca3af;
}

/* ---------- адаптив ---------- */

/* планшет и уже */
@media (max-width: 900px) {
  .app-card {
    padding: 16px 16px 18px;
    border-radius: 20px;
    max-height: 100vh;
  }

  .title {
    font-size: 22px;
  }

  .logo-img {
    width: 34px;
    height: 34px;
  }

  .room-section {
    margin-top: 10px;
  }

  .controls {
    gap: 8px;
  }

  .video-wrapper {
    margin-top: 12px;
  }

  .video-block video {
    min-height: 130px;
  }
}

/* телефоны */
@media (max-width: 640px) {
  body {
    align-items: stretch;
    justify-content: stretch;
  }

  .app-card {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    padding: 14px 10px 12px;
  }

  .title {
    font-size: 20px;
  }

  .subtitle {
    font-size: 12px;
  }

  .room-section input {
    font-size: 13px;
  }

  .controls {
    flex-wrap: wrap;
  }

  .controls button {
    flex: 1 1 calc(50% - 6px);
    font-size: 12px;
    padding: 7px 8px;
  }

  .video-wrapper {
    grid-template-columns: 1fr; /* Вы / Собеседник друг под другом */
    margin-top: 10px;
    gap: 10px;
  }

  .video-block video {
    min-height: 150px;
  }

  .hint {
    font-size: 10px;
    margin-top: 8px;
  }
}
