:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1020;
  color: #f4f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(73, 118, 255, 0.25), transparent 30%),
    radial-gradient(circle at bottom right, rgba(132, 67, 255, 0.22), transparent 35%),
    #0b1020;
}

h1, h2, p {
  margin-top: 0;
}

a {
  color: inherit;
}

.card,
.panel {
  width: min(900px, 100%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
}

.layout {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

video {
  width: 100%;
  border-radius: 18px;
  background: #050811;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  text-decoration: none;
  color: #081020;
  background: #8fb4ff;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

label {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  color: rgba(244, 247, 251, 0.85);
  font-weight: 650;
}

input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 12px 14px;
  color: #f4f7fb;
  background: rgba(0,0,0,0.28);
}

.room-form {
  margin-top: 20px;
}

.muted,
.hint {
  color: rgba(244, 247, 251, 0.72);
  line-height: 1.6;
}

.status {
  display: grid;
  gap: 8px;
  color: rgba(244, 247, 251, 0.78);
}

.remote-section {
  margin-top: 18px;
}

.remote-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.remote-section__header h2 {
  margin: 0;
}

.remote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.participant-tile {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.participant-tile video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.participant-label {
  padding: 10px 12px;
  font-size: 14px;
  color: rgba(244, 247, 251, 0.78);
}

.viewer-body {
  padding: 0;
  display: block;
  background: transparent;
  overflow: hidden;
}

.viewer-shell {
  position: fixed;
  inset: 0;
  background: transparent;
}

.viewer-shell video {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  object-fit: cover;
  background: transparent;
}

.overlay {
  position: fixed;
  left: 24px;
  bottom: 24px;
  max-width: 420px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(8, 12, 24, 0.72);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
}

.overlay.hidden {
  display: none;
}

.local-preview {
  position: fixed;
  top: 24px;
  right: 24px;
  width: min(24vw, 260px);
  height: auto;
  z-index: 5;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

@media (max-width: 860px) {
  .local-preview {
    width: min(34vw, 180px);
    top: 16px;
    right: 16px;
  }
}
