* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: #2b2d31; /* Gray background */
  color: #e3e5e8;
  height: 100vh;
  overflow: hidden;
}

/* Layout Grid: Left Panel | Center Stage | Right Panel */
.app-layout {
  display: flex;
  justify-content: space-between;
  height: 100vh;
  width: 100vw;
}

.panel {
  width: 280px;
  height: 100vh;
  background-color: #1e1f22;
  display: flex;
  flex-direction: column;
  border-color: #383a40;
  border-style: solid;
}

.left-panel {
  border-width: 0 1px 0 0;
}

.right-panel {
  width: 340px;
  border-width: 0 0 0 1px;
}

.panel-header {
  padding: 14px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #949ba4;
  border-bottom: 1px solid #2b2d31;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge {
  background: #2b2d31;
  color: #dbdee1;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
}

/* Connected Players at Top of Left Panel */
.player-list {
  list-style: none;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background-color: #2b2d31;
  font-size: 0.92rem;
  font-weight: 500;
}

.player-avatar {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #23a55a;
}

/* Center Gray Area */
.center-stage {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.stage-placeholder {
  background: #1e1f22;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #949ba4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot.online { background: #23a55a; }
.dot.offline { background: #f23f43; }

/* Right Panel Chat */
.chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  font-size: 0.9rem;
  line-height: 1.35;
  word-wrap: break-word;
}

.msg-author {
  font-weight: 700;
  color: #ffffff;
  margin-right: 6px;
}

.msg-system {
  font-size: 0.82rem;
  color: #949ba4;
  font-style: italic;
}

.chat-input-area {
  padding: 12px;
  border-top: 1px solid #2b2d31;
  display: flex;
  gap: 8px;
}

input[type="text"] {
  flex: 1;
  background: #2b2d31;
  border: 1px solid #3f4147;
  color: #f2f3f5;
  padding: 10px 12px;
  border-radius: 6px;
  outline: none;
  font-size: 0.9rem;
}

input[type="text"]:focus {
  border-color: #5865f2;
}

button {
  background: #5865f2;
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #4752c4;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Join Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop.hidden {
  display: none;
}

.join-card {
  background: #1e1f22;
  padding: 28px;
  border-radius: 10px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid #383a40;
}

.join-card h2 {
  font-size: 1.25rem;
}

.join-card p {
  font-size: 0.88rem;
  color: #949ba4;
}

.status-text {
  font-size: 0.82rem;
  color: #f23f43;
  min-height: 1.1em;
}
