:root {
  color-scheme: dark;
  --bg: #12111a;
  --surface: #1f1d2b;
  --text: #f2f0fa;
  --muted: #b4b0c8;
  --primary: #6d5cf6;
  --danger: #e5484d;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
}

main[hidden] { display: none !important; }

#invite, #message {
  max-width: 32rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  line-height: 1.5;
}

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
p { color: var(--muted); margin: 0 0 1rem; }
.small { font-size: 0.9rem; }

.buttons { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 2rem; }

button {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.5rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

button.primary { background: var(--primary); }
button:disabled { opacity: 0.5; cursor: default; }

#call {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#remote {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg);
}

#remote:not(.active) { visibility: hidden; }

#status {
  position: relative;
  max-width: 20rem;
  text-align: center;
  font-size: 1.1rem;
  color: var(--text);
}

#local {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: 1rem;
  width: 28vw;
  max-width: 10rem;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 0.75rem;
  background: var(--surface);
  transform: scaleX(-1);
}

#local:not(.active) { display: none; }

.controls {
  position: absolute;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

button.round {
  width: 3.75rem;
  height: 3.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
}

button.round[aria-pressed="false"] { background: var(--text); color: var(--bg); }
button.round.danger { background: var(--danger); }
button.round svg { width: 1.6rem; height: 1.6rem; fill: currentColor; }
