:root {
  color-scheme: light;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #222;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  width: min(100%, 32rem);
  padding: 2rem;
}

section {
  background: #fff;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

h1,
h2,
p {
  margin: 0;
  text-align: center;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
}

input,
button,
select {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  min-height: 44px;
}

button,
select,
input[type="submit"] {
  cursor: pointer;
}

button.primary {
  background: #0078d7;
  border: none;
  color: #fff;
  font-weight: 600;
  transition: background 0.2s ease;
}

button.primary:disabled {
  background: rgba(0, 120, 215, 0.5);
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  border: 1px solid #0078d7;
  color: #0078d7;
  font-weight: 600;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0f6ff;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

@media (min-width: 48rem) {
  body {
    align-items: stretch;
  }

  main {
    padding: 3rem;
  }
}

body.state-call {
  background: #000;
  align-items: stretch;
}

body.state-call main {
  width: 100%;
  max-width: none;
  padding: 0;
  height: 100vh;
  display: flex;
}

body.state-call section[data-screen='call'] {
  position: relative;
  flex: 1 1 auto;
  background: #000;
  color: #fff;
  border-radius: 0;
  box-shadow: none;
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
}

body.state-call .call-stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

body.state-call #remote-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

body.state-call #local-video {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 25vw;
  max-width: 16rem;
  min-width: 6rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.4);
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
}

body.state-call #local-video[hidden] {
  display: none;
}

body.state-call #no-media {
  position: absolute;
  bottom: calc(1.5rem + 4.5rem);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  text-align: center;
  z-index: 2;
}

body.state-call .call-controls {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  width: calc(100% - 3rem);
  max-width: 22rem;
  z-index: 3;
}

body.state-call .call-controls button.secondary {
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  backdrop-filter: blur(6px);
}
