* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
}

body.dark,
body.viewer {
  background: #08090d;
  color: #fff;
}

.landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #11131a;
  color: #fff;
}

.card {
  width: min(560px, 92vw);
  padding: 35px;
  border-radius: 18px;
  background: #1b1e27;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.card h1 {
  margin-top: 0;
}

.card label,
.card input {
  display: block;
  width: 100%;
}

.card input,
.share input {
  margin: 8px 0 16px;
  padding: 13px;
  border-radius: 8px;
  border: 1px solid #3b4050;
  background: #0f1117;
  color: #fff;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  background: #303544;
  color: #fff;
  font-weight: 600;
}

button:hover {
  filter: brightness(1.15);
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.primary {
  width: 100%;
  background: #6d4aff;
  margin-bottom: 10px;
}

.linkbox {
  margin-top: 30px;
  padding: 18px;
  border-radius: 12px;
  background: #11131a;
}

.linkbox code {
  display: block;
  word-break: break-all;
  margin: 10px 0;
  color: #b9aaff;
}

.topbar,
.viewerbar {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: #11131a;
  border-bottom: 1px solid #272b36;
}

.status {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 13px;
}

.online { background: #174d31; }
.live { background: #8d2634; }
.offline { background: #343844; }

.host-layout {
  height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 1fr 330px;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  background: #050609;
  overflow: hidden;
}

.stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #777d8d;
}

.panel {
  padding: 25px;
  background: #151821;
  border-left: 1px solid #272b36;
}

.panel button {
  width: 100%;
  margin-bottom: 10px;
}

.share {
  display: flex;
  gap: 5px;
}

.share input {
  min-width: 0;
  margin: 0;
  flex: 1;
}

.hint {
  color: #9298a7;
  line-height: 1.5;
  font-size: 14px;
}

.viewer {
  min-height: 100vh;
  overflow: hidden;
}

.viewerbar {
  position: fixed;
  z-index: 10;
  width: 100%;
  top: 0;
}

.viewer-stage {
  position: fixed;
  inset: 60px 0 0;
  display: grid;
  place-items: center;
  background: #000;
}

.viewer-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.viewer-message {
  position: absolute;
  text-align: center;
  color: #9ba1b0;
}

.fullscreen {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
}

@media (max-width: 800px) {
  .host-layout {
    display: block;
    height: auto;
  }

  .stage {
    height: 60vh;
  }

  .panel {
    border-left: 0;
    border-top: 1px solid #272b36;
  }

  .topbar {
    font-size: 13px;
  }
}
