:root {
  color-scheme: light dark;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --danger: #f87171;
  --ok: #4ade80;
  --border: #334155;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 16px;
}

.hidden { display: none !important; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto 16px;
}

h1 { font-size: 1.4rem; margin: 0 0 8px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 0.9rem; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  max-width: 720px;
  margin: 0 auto 16px;
}

.login-card { margin-top: 15vh; text-align: center; }

form { display: flex; gap: 8px; flex-wrap: wrap; }

input {
  flex: 1;
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 1rem;
}

button {
  background: var(--accent);
  color: #0f172a;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

button:hover { opacity: 0.9; }
button.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
button.danger { background: var(--danger); color: #1e0a0a; }

.error { color: var(--danger); }
.warning {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  text-align: left;
}

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
.dot.online { background: var(--ok); box-shadow: 0 0 6px var(--ok); }

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--muted);
  vertical-align: middle;
}

.list { list-style: none; padding: 0; margin: 0; }
.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.list li:last-child { border-bottom: none; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-content { text-align: center; max-width: 360px; }
.modal-content img { width: 200px; height: 200px; background: #fff; border-radius: 8px; padding: 8px; }
.invite-code {
  font-family: ui-monospace, monospace;
  font-size: 1.6rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  margin: 12px 0;
}
