:root {
  --bg: #0b0d12;
  --panel: #141821;
  --line: #232936;
  --text: #e7ebf3;
  --muted: #8a93a6;
  --accent: #4f8cff;
  --danger: #ff5a5a;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

/* ---------------------------------------------------------------- landing */

.landing {
  max-width: 34rem;
  margin: 0 auto;
  padding: 18vh 1.5rem 0;
  text-align: center;
}

.landing h1 {
  margin: 0 0 .5rem;
  font-size: 2.6rem;
  letter-spacing: -.03em;
}

.lede {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.notes {
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  text-align: left;
}

.notes li {
  padding: .55rem 0 .55rem 1.4rem;
  border-top: 1px solid var(--line);
  position: relative;
}

.notes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.1rem;
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--accent);
}

/* ------------------------------------------------------------------- room */

.room {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand {
  font-weight: 600;
  letter-spacing: -.02em;
}

.status, .peers {
  color: var(--muted);
  font-size: .8rem;
}

.status::before {
  content: "";
  display: inline-block;
  width: .45rem;
  height: .45rem;
  margin-right: .4rem;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
}

.peers::before {
  content: "\00b7";
  margin-right: .5rem;
}

.spacer { flex: 1; }

.quality {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.slider {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .5rem;
  height: 1.9rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--bg);
}

.slider input { width: 7rem; accent-color: var(--accent); }
.slider span { color: var(--muted); font-size: .78rem; min-width: 4.2rem; }

button, select {
  height: 1.9rem;
  padding: 0 .7rem;
  border-radius: .4rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}

button:hover, select:hover { border-color: #38415a; }

button:disabled {
  opacity: .45;
  cursor: default;
  filter: grayscale(1);
}

button:disabled:hover { border-color: var(--line); }

.ghost.active {
  border-color: var(--accent);
  color: var(--accent);
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06090f;
  font-weight: 600;
}

.primary:hover { filter: brightness(1.1); }

.primary.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.big {
  height: 2.6rem;
  padding: 0 1.4rem;
  font-size: .95rem;
}

/* ------------------------------------------------------------------ stage */

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Native-pixel mode: never let the browser resample the stream. A 4K share on
   a 1080p monitor is then scrollable instead of blurred. */
.stage.actual-size {
  overflow: auto;
  align-items: start;
  justify-content: start;
}

.stage.actual-size video {
  width: auto;
  height: auto;
  max-width: none;
  object-fit: none;
  image-rendering: pixelated;
  margin: auto;
}

.placeholder {
  position: absolute;
  max-width: 26rem;
  padding: 0 1.5rem;
  text-align: center;
  color: var(--muted);
}

.stats {
  position: absolute;
  left: .75rem;
  bottom: .75rem;
  margin: 0;
  padding: .6rem .75rem;
  border-radius: .4rem;
  background: rgba(6, 9, 15, .82);
  border: 1px solid var(--line);
  color: #a8ffcf;
  font: 12px/1.45 ui-monospace, "Cascadia Code", Consolas, monospace;
  white-space: pre;
  pointer-events: none;
}

/* ----------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: center;
  z-index: 10;
}

.toast {
  padding: .55rem .9rem;
  border-radius: .45rem;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
  transition: opacity .3s, transform .3s;
}

.toast.leaving {
  opacity: 0;
  transform: translateY(.5rem);
}

@media (max-width: 720px) {
  .quality { order: 10; width: 100%; }
  .slider input { width: 100%; }
}
