#fw-fab {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 80;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #eab300;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
#fw-fab:hover { transform: translateY(-2px); }
#fw-fab:active { transform: translateY(0); }

#fw-panel {
  position: fixed;
  right: 1.2rem;
  bottom: 5.2rem;
  z-index: 80;
  width: 360px;
  max-width: calc(100vw - 2rem);
  height: 480px;
  max-height: calc(100vh - 8rem);
  background: #0a0a0a;
  border: 1px solid #eab300;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  color: #eee;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}
#fw-panel[hidden] { display: none; }

#fw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #2a2a2a;
  color: #eab300;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
}
#fw-close {
  background: transparent;
  border: none;
  color: #999;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.4rem;
}
#fw-close:hover { color: #eab300; }

#fw-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
}
.fw-msg { display: flex; gap: 0.55rem; }
.fw-msg img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: #1a1a1a;
  border-radius: 3px;
  image-rendering: pixelated;
  border: 1px solid #333;
}
.fw-msg .fw-body { flex: 1; min-width: 0; }
.fw-msg .fw-who {
  color: #eab300;
  font-size: 0.75rem;
  font-weight: 600;
}
.fw-msg .fw-who .fw-at {
  color: #666;
  font-weight: normal;
  margin-left: 0.4rem;
}
.fw-msg .fw-text {
  color: #ddd;
  word-break: break-word;
  white-space: pre-wrap;
}

#fw-form {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem;
  border-top: 1px solid #2a2a2a;
}
#fw-form input {
  flex: 1;
  background: #111;
  color: #eee;
  border: 1px solid #333;
  padding: 0.45rem 0.6rem;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85rem;
}
#fw-form input:focus {
  outline: none;
  border-color: #eab300;
}
#fw-form button {
  background: #eab300;
  color: #000;
  border: none;
  padding: 0.45rem 0.8rem;
  border-radius: 3px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}
#fw-form button:disabled { opacity: 0.5; cursor: not-allowed; }

#fw-loggedout {
  padding: 0.75rem 1rem;
  color: #999;
  text-align: center;
  font-size: 0.85rem;
  border-top: 1px solid #2a2a2a;
  margin: 0;
}
#fw-loggedout a { color: #eab300; }

@media (max-width: 480px) {
  #fw-panel { right: 0.6rem; left: 0.6rem; width: auto; bottom: 8.5rem; }
  /* Lift the FAB above the foyer chat input on narrow screens so it doesn't
     sit on top of the text field. */
  #fw-fab { bottom: 4.5rem; }
}
