* {
  box-sizing: border-box;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #e5ddd5;
  padding: 20px;
}

/* Room / username panel */
body > div:first-child {
  background: #fff;
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  width: 520px;
  max-width: 100%;
}

body > div:first-child p {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  color: #3b4a54;
  font-size: 14px;
  font-weight: 600;
}

#roomId,
#username {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d7db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#roomId:focus,
#username:focus {
  border-color: #25d366;
}

/* Chat panel */
/* body > div:last-child {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
} */

#chat {
  width: 500px !important;
  max-width: 100%;
  height: 320px !important;
  border: none;
  border-radius: 0 0 10px 10px;   /* top flat, bottom rounded */
  background: #efeae2;
  padding: 14px;
  font-size: 14px;
  color: #111b21;
  line-height: 1.5;
  box-shadow: inset 0 0 0 1px #e2ddd6;
}

#chat:disabled {
  cursor: default;
  opacity: 1;
}

/* Message input row */
body > div:last-child > div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  background: #f0f2f5;
  border-radius: 12px;
  padding: 6px;
}

#prompt {
  flex: 1;
  width: 83% !important;
  border: 1px solid #d1d7db;
  background: #fff;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  border-radius: 10px;
  transition: border-color 0.2s;
}

#prompt:focus {
  border-color: #25d366;
}

#send {
  border: none;
  background: #25d366;
  color: #fff;
  padding: 0 24px;
  height: 44px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#send:hover {
  background: #1da851;
}

#send:active {
  transform: scale(0.97);
}

body > div:first-child p span {
  width: 80px;
  flex-shrink: 0;
}



/* Make #chat a vertical stack so bubbles sit in a column */
#chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;   /* scroll when messages overflow */
}

/* The bubble */
.message {
  background: #202c33;          /* dark bubble like the screenshot */
  color: #e9edef;
  padding: 8px 12px;
  border-radius: 10px;
  max-width: 75%;              /* bubble only as wide as it needs */
  align-self: flex-start;      /* left-aligned (incoming) */
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  position: relative;
}

.message.mine {
  align-self: flex-end;   /* pushes bubble to the right */
  background: #005c4b;     /* green outgoing bubble */
  color: #e9edef;
}

/* The message text */
.msg-text {
  margin: 0 0 2px 0;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

/* The timestamp */
.msg-time {
  display: block;
  text-align: right;
  font-size: 11px;
  color: #8696a0;              /* muted gray */
  margin-top: 2px;
}

/* .header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 500px;
  max-width: 100%;
  padding: 8px 16px;
  background: #fff;
  border-radius: 12px;
  border-bottom: 0px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  font-size: 14px;
} */
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 500px;
  max-width: 100%;
  padding: 8px 16px;
  background: #fff;
  border-radius: 12px 12px 0 0;   /* top rounded, bottom flat */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  font-size: 14px;
}

/* chat panel */
body > div:last-child {
  background: #fff;
  border-radius: 0 0 12px 12px;   /* bottom rounded, top flat */
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.header-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #111b21;
  white-space: nowrap;
}

.header-members {
  color: #667781;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}