* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

:root {
  --bg: #11131a;
  --panel: #1b1e2b;
  --panel-2: #232737;
  --text: #e8eaf2;
  --muted: #8a90a6;
  --accent: #5b7cfa;
  --danger: #e5484d;
  --green: #3dd68c;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.screen { min-height: 100vh; display: flex; flex-direction: column; }

.hint { color: var(--muted); font-size: 14px; }
.error { color: var(--danger); font-size: 14px; }

/* --- Lobby --- */
#lobby { align-items: center; justify-content: center; padding: 16px; }

.card {
  background: var(--panel);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.card h1 { font-size: 24px; }

.card input {
  background: var(--panel-2);
  border: 1px solid #333a52;
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
}
.card input:focus { border-color: var(--accent); }

.card button {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  padding: 12px;
}
.card button:hover { filter: brightness(1.1); }
.card button:disabled { opacity: 0.5; cursor: default; }

/* --- Call --- */
#call { max-width: 720px; margin: 0 auto; width: 100%; padding: 16px; gap: 16px; }

#call header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#call header h2 { font-size: 20px; word-break: break-all; }

#copy-link {
  background: var(--panel-2);
  border: none;
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  padding: 10px 14px;
  white-space: nowrap;
}
#copy-link:hover { background: #2c3148; }

#participants {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.participant {
  background: var(--panel);
  border-radius: 14px;
  border: 2px solid transparent;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s;
}
.participant.speaking { border-color: var(--green); }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.p-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.p-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-name .you { color: var(--muted); font-weight: 400; }

.p-volume { display: flex; align-items: center; gap: 10px; }

.p-volume input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

.vol-label { color: var(--muted); font-size: 13px; min-width: 42px; text-align: right; }

.mute-peer {
  background: var(--panel-2);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  padding: 8px 10px;
  flex-shrink: 0;
}
.mute-peer:hover { background: #2c3148; }
.participant.muted-by-me { opacity: 0.55; }
.participant.muted-by-me .p-volume { visibility: hidden; }

.status { color: var(--muted); font-size: 13px; }

/* --- Footer controls --- */
#call footer {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding-bottom: 8px;
}

.control {
  background: var(--panel-2);
  border: none;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 22px;
}
.control:hover { filter: brightness(1.15); }
.control.danger { background: var(--danger); color: #fff; }
.control.mic-off { background: var(--danger); color: #fff; }
