/* chat-room.css */

.chatroom-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: #FBF6EF;
  z-index: 30;
}

.chatroom-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.chatroom-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--orange-soft);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange-deep);
  font-size: 15px;
  cursor: pointer;
  flex: none;
}

.chatroom-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid var(--orange-soft);
}
.chatroom-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--orange-soft);
  color: var(--orange-deep);
  font-size: 15px;
}

.chatroom-name {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink);
  margin: 0;
}

.chatroom-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chatroom-loading,
.chatroom-empty {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  margin: auto 0;
}

.chatroom-bubble-row {
  display: flex;
  justify-content: flex-start;
}
.chatroom-bubble-row-mine { justify-content: flex-end; }

.chatroom-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-family: "Plus Jakarta Sans", sans-serif;
}
.chatroom-bubble p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.chatroom-bubble-time {
  display: block;
  font-size: 10.5px;
  margin-top: 4px;
  opacity: 0.7;
}

.chatroom-bubble-theirs {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.chatroom-bubble-mine {
  background: var(--orange-deep);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chatroom-inputbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid var(--line);
  flex: none;
}

.chatroom-inputbar input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #FBF6EF;
}
.chatroom-inputbar input:focus { outline: none; border-color: var(--orange-deep); }

.chatroom-inputbar button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--orange-deep);
  color: #fff;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.chatroom-inputbar button:active { transform: scale(0.94); }
