* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0b0b12;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.chat-card {
  width: 100%;
  max-width: 486px;
  height: 605px;
  background: #101018;
  border: 1px solid #2b2b45;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(99, 91, 255, 0.15), 0 20px 50px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #1e1e2e;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #f5f5f7;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d17a;
  box-shadow: 0 0 8px #34d17a;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.watchers {
  font-size: 13px;
  color: #8b8b9e;
}

/* body */
.chat-body {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.messages {
  height: 100%;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.messages::-webkit-scrollbar {
  width: 6px;
}
.messages::-webkit-scrollbar-thumb {
  background: #2b2b45;
  border-radius: 3px;
}

.empty-state {
  color: #6b6b80;
  font-size: 14px;
  text-align: center;
  margin-top: 40px;
}

.message {
  font-size: 15px;
  line-height: 1.5;
  color: #e6e6ee;
  word-wrap: break-word;
}

.message .user {
  font-weight: 700;
  margin-right: 6px;
}

/* join overlay */
.join-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 16, 24, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.join-overlay.hidden {
  display: none;
}

.join-box {
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.join-title {
  font-size: 18px;
  font-weight: 700;
  color: #f5f5f7;
  margin-bottom: 16px;
}

.join-row {
  display: flex;
  gap: 10px;
}

.join-row input {
  flex: 1;
  background: #16161f;
  border: 1px solid #3b3bd6;
  border-radius: 8px;
  padding: 12px 14px;
  color: #f5f5f7;
  font-size: 14px;
  outline: none;
}

.join-row input::placeholder {
  color: #6b6b80;
}

.join-row button,
.chat-input-row button {
  background: #4f46e5;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.join-row button:hover,
.chat-input-row button:hover:not(:disabled) {
  background: #4338ca;
}

/* input row */
.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #1e1e2e;
}

.chat-input-row input {
  flex: 1;
  background: #16161f;
  border: 1px solid #2b2b45;
  border-radius: 8px;
  padding: 12px 14px;
  color: #f5f5f7;
  font-size: 14px;
  outline: none;
}

.chat-input-row input::placeholder {
  color: #6b6b80;
}

.chat-input-row input:disabled,
.chat-input-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-input-row button {
  min-width: 72px;
}