:root {
  --bg: #0f1115;
  --card: #181b22;
  --fg: #e8eaed;
  --muted: #9aa0a6;
  --accent: #3b82f6;
  --danger: #b00020;
  --ok: #1e8e3e;
}

/* Download page */
.dl-grid { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0 8px; }
.dl-card {
  flex: 1; min-width: 200px; text-decoration: none; color: var(--fg);
  background: #0e1117; border: 1px solid #2a2f3a; border-radius: 12px;
  padding: 22px; text-align: center; transition: border-color .15s, transform .05s;
}
.dl-card:hover { border-color: var(--accent); }
.dl-card:active { transform: translateY(1px); }
.dl-os { font-size: 20px; font-weight: 700; }
.dl-meta { color: var(--muted); font-size: 13px; margin: 4px 0 16px; }
.dl-btn { background: var(--accent); color: #fff; border-radius: 9px; padding: 11px 0; font-weight: 600; }
.steps { color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 22px; padding-left: 20px; }
.steps b { color: var(--fg); }
/* Looks like plain text; quiet personal shortcut to the OS-correct download. */
a.plain { color: inherit; text-decoration: none; cursor: text; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 0 16px 32px;
}

.site-header {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 22px 4px 26px;
}
.brand { font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.brand-mark {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 7px;
  margin-right: 2px;
}
.brand-tag { color: var(--muted); font-size: 14px; }

.trust {
  color: var(--muted);
  font-size: 12.5px;
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid #262a33;
}
.site-footer {
  color: var(--muted);
  font-size: 13px;
  margin-top: 26px;
  text-align: center;
}

.card {
  background: var(--card);
  border: 1px solid #262a33;
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 900px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

h1 { margin: 0 0 4px; font-size: 28px; }
h2 { margin: 0 0 16px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 20px; }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choices > button { margin-top: 10px; }
.choicehint { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.join { display: flex; gap: 10px; margin-top: 14px; border-top: 1px solid #262a33; padding-top: 18px; }

button {
  font-size: 15px;
  padding: 12px 18px;
  border-radius: 9px;
  border: 1px solid #3a3f4b;
  background: #232733;
  color: var(--fg);
  cursor: pointer;
}
button:hover { background: #2b3140; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.big { padding: 14px 20px; font-size: 16px; }

input {
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid #3a3f4b;
  background: #0e1117;
  color: var(--fg);
  letter-spacing: 2px;
  text-transform: uppercase;
  flex: 1;
}

.linkbox { display: flex; gap: 10px; margin-bottom: 18px; }
.linkbox input {
  flex: 1;
  letter-spacing: 0;
  text-transform: none;
  font-size: 14px;
  color: #cbd5e1;
}
.linkbox button { white-space: nowrap; }

.codebox { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.codebox .label { color: var(--muted); }
.code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 34px;
  letter-spacing: 8px;
  color: #fff;
  background: #0e1117;
  padding: 6px 18px;
  border-radius: 10px;
  border: 1px solid #2a2f3a;
}

.status { color: var(--muted); margin: 8px 0 16px; }

.toggle { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.toggle label { display: flex; align-items: center; gap: 8px; }
.pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #2a2f3a;
  color: var(--muted);
}
.pill.ok { background: rgba(30, 142, 62, 0.2); color: #6ee7a0; }

video {
  width: 100%;
  background: #000;
  border-radius: 10px;
  display: block;
  margin-bottom: 16px;
}

.screenwrap { position: relative; }
.screenwrap:fullscreen { background: #000; display: flex; align-items: center; }
.screenwrap:fullscreen video { width: 100%; height: 100%; object-fit: contain; margin: 0; }
.screenwrap:fullscreen #inputCatcher { inset: 0; }
#inputCatcher {
  position: absolute;
  inset: 0 0 16px 0;
  border-radius: 10px;
  outline: none;
  cursor: crosshair;
}
#inputCatcher:focus { box-shadow: 0 0 0 3px var(--accent) inset; }

/* When a session is live, the controller fills the entire browser window. */
#ctrlView.live {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 8px;
  border-radius: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  z-index: 60;
}
#ctrlView.live > h2,
#ctrlView.live #ctrlInviteSection,
#ctrlView.live #ctrlStatus { display: none; }
#ctrlView.live .screenwrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#ctrlView.live .screenwrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0;
  border-radius: 0;
}
#ctrlView.live #inputCatcher { inset: 0; }
#ctrlView.live .ctrlbar { padding: 6px 4px 2px; }

.ctrlbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kbdhint { color: var(--muted); font-size: 13px; }

.banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.banner button {
  background: #fff;
  color: var(--danger);
  border: none;
  padding: 6px 12px;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.modal-card {
  background: var(--card);
  border: 1px solid #2a2f3a;
  border-radius: 14px;
  padding: 26px;
  max-width: 440px;
}
.modal-card h3 { margin: 0 0 12px; }
.modal .warn { color: #f6b73c; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.hidden { display: none !important; }
