:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  background: #050505;
  color: white;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at center, #202020 0%, #050505 65%);
}

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  transition: grid-template-columns 200ms ease;
}

#stage.layout-split {
  grid-template-columns: 1fr 1fr;
}

#stage.layout-left-focus {
  grid-template-columns: 7fr 3fr;
}

#stage.layout-right-focus {
  grid-template-columns: 3fr 7fr;
}

.pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid #222;
}

.pane video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: black;
}

.pane.connected .empty-state {
  display: none;
}

.pane-label {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 4;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgb(0 0 0 / 60%);
  backdrop-filter: blur(10px);
  font-weight: 700;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #777;
  font-size: clamp(20px, 3vw, 44px);
}

#stage.layout-pip-left,
#stage.layout-pip-right {
  display: block;
}

#stage.layout-pip-left .pane,
#stage.layout-pip-right .pane {
  position: absolute;
  inset: 0;
}

#stage.layout-pip-left #left-pane,
#stage.layout-pip-right #right-pane {
  z-index: 3;
  inset: auto 3vw 4vh auto;
  width: 28vw;
  height: 28vh;
  border: 3px solid white;
  border-radius: 18px;
  box-shadow: 0 20px 70px rgb(0 0 0 / 65%);
}

#join-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  display: flex;
  gap: 12px;
  opacity: 0.93;
  transition: opacity 200ms ease;
}

#join-panel.hidden {
  opacity: 0;
  pointer-events: none;
}

.join-card {
  width: 150px;
  padding: 12px;
  border-radius: 16px;
  background: rgb(10 10 10 / 82%);
  backdrop-filter: blur(14px);
  text-align: center;
}

.join-card h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.join-card img {
  display: block;
  width: 126px;
  height: 126px;
  background: white;
  border-radius: 8px;
}

#controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 10px;
  transform: translateX(-50%);
  border-radius: 18px;
  background: rgb(0 0 0 / 70%);
  backdrop-filter: blur(14px);
}

button {
  appearance: none;
  border: 1px solid #444;
  border-radius: 11px;
  padding: 10px 14px;
  background: #1d1d1d;
  color: white;
  cursor: pointer;
  font-weight: 650;
}

button:hover {
  background: #303030;
}

#status {
  position: fixed;
  left: 18px;
  bottom: 20px;
  z-index: 20;
  color: #aaa;
  font-size: 13px;
}
