body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #0f0f14;
  color: #e0e0ff;
}

html, body {
  height: 100%;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

header {
  padding: 12px;
  background: #151522;
  text-align: center;
  font-weight: bold;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.msg {
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #1c1c2e;
  border-radius: 10px;
  max-width: 85%;
  display: block;
  clear: both;
}

#inputBar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #151522;
  padding: 10px;
  z-index: 100;
}

#chatForm {
  display: flex;
}

#msgInput {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  outline: none;
  font-size: 16px;
  background: #ffffff;
  color: #000000;
}

#sendBtn {
  margin-left: 8px;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: #6b5cff;
  color: white;
}

input {
  font-size: 16px;
}

#statusBar {
  position: fixed;
  top: 8px;
  left: 10px;
  font-size: 14px;
  font-family: monospace;
  z-index: 1000;
}

#serverStatus {
  margin-right: 6px;
}

#serverStatus.online { color: #00ff66; }
#serverStatus.offline { color: #ff4444; }

#compass {
  text-align: center;
  background: #151522;
  white-space: nowrap;
  border-radius: 8px;
  padding: 4px 4px;
  margin-inline: auto;
  width: fit-content;
  font-family: monospace;
  font-size: 14px;
  color: #e0e0e0;
  opacity: 0.9;
}

/* World View */
#worldView {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 90px; /* space for input bar */
}

/* Floating Chat */
#chatWindow {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: 300px;
  height: 240px;
  display: flex;
  flex-direction: column;
  background: rgba(20, 20, 40, 0.45);
  backdrop-filter: blur(3px);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 999;
}

#chatHeader {
  padding: 10px;
  text-align: center;
  background: rgba(255,255,255,0.09);
  border-radius: 14px 14px 0 0;
  font-weight: bold;
  cursor: move;
  touch-action: none;
  user-select: none;
}

#chatWindow #messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: block;
  width: fit-content;
  clear: both;
}

#chatWindow #inputBar {
  position: relative;
  background: transparent;
  opacity: 0.75;
}

.blank-line {
  height: 10px;
}

.echo {
  font-family: monospace;
  font-size: 14px;
  color: #808080;
  opacity: 0.6;
}

/* Docked Chat */
.chat-docked {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px; /* Adjust as needed */
  border-radius: 0;
  backdrop-filter: blur(5px);
  background: rgba(10, 10, 20, 0.7);
  box-shadow: -5px 0 15px rgba(0,0,0,0.3);
}

#exitBar {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  justify-content: center;
}

.exit-btn {
  background: #22223a;
  border: 1px solid #444;
  color: #ddd;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.exit-btn:hover {
  background: #3a3a6b;
}

#commandPalette {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 420px;
  background: rgba(15,15,30,0.9);
  border-radius: 12px;
  padding: 12px;
  display: none;
  z-index: 2000;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

#commandPalette input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  outline: none;
}

#commandList div {
  padding: 6px;
  margin-top: 6px;
  cursor: pointer;
}

#commandList div:hover {
  background: rgba(255,255,255,0.08);
}
