:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07111f;
  color: #f7fbff;
  --safe-x: max(5vw, env(safe-area-inset-left));
  --safe-y: max(5vh, env(safe-area-inset-top));
  --focus: #73d7ff;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 18% 20%, rgba(34, 120, 196, 0.28), transparent 36%),
    radial-gradient(circle at 82% 80%, rgba(103, 54, 188, 0.22), transparent 38%),
    #07111f;
}

.screen {
  position: fixed;
  inset: 0;
}

.centered {
  display: grid;
  place-items: center;
  padding: var(--safe-y) var(--safe-x);
}

.hidden {
  display: none !important;
}

.card {
  width: min(760px, 86vw);
  padding: clamp(36px, 5vw, 72px);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 30px;
  background: rgba(8, 22, 39, 0.9);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

.eyebrow {
  margin: 0 0 14px;
  color: #73d7ff;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow.error {
  color: #ff9d9d;
}

h1 {
  margin: 0;
  font-size: clamp(48px, 6vw, 86px);
  line-height: 1.03;
}

.description {
  margin: 24px auto 38px;
  max-width: 660px;
  color: #c7d5e4;
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.4;
}

button {
  min-width: 260px;
  min-height: 76px;
  padding: 18px 34px;
  border: 3px solid transparent;
  border-radius: 16px;
  color: #06111c;
  font: inherit;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 800;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

button:focus,
button:focus-visible {
  outline: none;
  border-color: white;
  box-shadow: 0 0 0 6px var(--focus), 0 12px 42px rgba(53, 192, 255, 0.4);
  transform: scale(1.035);
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.primary {
  background: linear-gradient(135deg, #82e7ff, #5aa7ff);
}

.danger {
  min-width: 230px;
  min-height: 68px;
  color: white;
  background: rgba(171, 31, 50, 0.94);
}

.hint {
  margin: 30px 0 0;
  color: #96aabd;
  font-size: clamp(17px, 1.6vw, 23px);
}

#video-shell,
#stream-video {
  width: 100%;
  height: 100%;
}

#stream-video {
  display: block;
  background: #000;
  object-fit: contain;
}

#stream-audio {
  display: none;
}

.status-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  width: min(780px, 82vw);
  padding: 34px 42px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  background: rgba(6, 17, 31, 0.92);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}

.spinner {
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  margin-right: 30px;
  border: 8px solid rgba(255, 255, 255, 0.18);
  border-top-color: #73d7ff;
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

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

.status-label,
.status-detail {
  margin: 0;
}

.status-label {
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 800;
}

.status-detail {
  margin-top: 8px;
  color: #b4c7d8;
  font-size: clamp(18px, 1.8vw, 26px);
}

.stream-controls {
  position: absolute;
  top: var(--safe-y);
  right: var(--safe-x);
  left: var(--safe-x);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.stream-controls button {
  pointer-events: auto;
}

.live-badge {
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(5, 16, 29, 0.8);
  color: #7df6aa;
  font-size: clamp(18px, 1.7vw, 25px);
  font-weight: 850;
  letter-spacing: 0.08em;
}

.remote-hint {
  position: absolute;
  right: var(--safe-x);
  bottom: var(--safe-y);
  left: var(--safe-x);
  z-index: 4;
  margin: 0;
  padding: 13px 20px;
  border-radius: 12px;
  background: rgba(5, 16, 29, 0.78);
  color: #d7e5f0;
  font-size: clamp(17px, 1.55vw, 23px);
  text-align: center;
  pointer-events: none;
}

.error-card {
  border-color: rgba(255, 104, 104, 0.32);
}

@media (max-height: 600px) {
  .card {
    padding: 26px 42px;
  }

  .description {
    margin: 14px auto 24px;
  }

  .hint {
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
