* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: #0b1020;
  color: white;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.app {
  width: min(900px, 100%);
  height: min(700px, 90vh);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.sidebar {
  padding: 20px;
  border-right: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.sidebar h1 {
  margin: 0 0 16px;
  font-size: 1.3rem;
}

.sidebar label {
  display: block;
  font-size: 0.9rem;
  color: #aab3d1;
  margin: 14px 0 8px;
}

.sidebar input,
.sidebar button {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

.sidebar input {
  background: rgba(255,255,255,0.08);
  color: white;
  outline: none;
}

.sidebar button {
  margin-top: 16px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.room-info {
  margin-top: 18px;
  font-size: 0.9rem;
  color: #aab3d1;
  line-height: 1.6;
}

.chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.chat-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header strong {
  font-size: 1rem;
}

.status {
  font-size: 0.9rem;
  color: #fca5a5;
}

.messages {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 75%;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
}

.message .meta {
  font-size: 0.78rem;
  color: #9fb0da;
  margin-bottom: 6px;
}

.message.self {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(124,58,237,0.35), rgba(6,182,212,0.28));
}

.chat-form {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.chat-form input {
  border: 0;
  outline: none;
  border-radius: 14px;
  padding: 14px;
  font: inherit;
  background: rgba(255,255,255,0.08);
  color: white;
}

.chat-form button {
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  background: white;
  color: #111827;
  cursor: pointer;
}

@media (max-width: 780px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
}