:root {
  --bg: #111316;
  --panel: #1d2026;
  --text: #eef0f3;
  --muted: #a3a9b3;
  --accent: #3b82f6;
  --danger: #dc2626;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
[hidden] { display: none !important; }
h1 { font-size: 1.4rem; margin: 0 0 .5rem; }
p { color: var(--muted); line-height: 1.5; margin: 0 0 1.25rem; }

.button {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: .7rem 1.2rem;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: #2c313a;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { filter: brightness(1.15); }
.button:disabled { opacity: .5; cursor: default; filter: none; }
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button.primary { background: var(--accent); }
.button.danger { background: var(--danger); }
.button[aria-pressed="true"] { background: #f3f4f6; color: #111; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Landing page */
body.landing { display: grid; place-items: center; padding: 1rem; }
.card { max-width: 26rem; background: var(--panel); padding: 2rem; border-radius: 16px; }

/* Call page */
#stage { position: fixed; inset: 0; background: #000; }
#remote { width: 100%; height: 100%; object-fit: contain; background: #000; }
#local {
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: min(28vw, 240px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #222;
  transform: scaleX(-1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .5);
}
body.in-lobby #local { inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
body.in-lobby #status { display: none; }

.status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(90vw, 32rem);
  text-align: center;
  background: rgba(0, 0, 0, .6);
  padding: .8rem 1.2rem;
  border-radius: 12px;
}
.status:empty { display: none; }

.panel {
  position: fixed;
  left: 50%;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(92vw, 28rem);
  background: rgba(29, 32, 38, .95);
  padding: 1.5rem;
  border-radius: 16px;
}

.controls {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: .5rem;
  padding: .5rem;
  border-radius: 999px;
  background: rgba(29, 32, 38, .85);
}

.floating { position: fixed; left: 50%; top: 1.5rem; transform: translateX(-50%); }

@media (max-width: 480px) {
  .controls .button { padding: .6rem .8rem; font-size: .9rem; }
}
