html, body { height: 100%; margin: 0; }
body { background: rgb(228, 238, 241); color: #e8e8e8; font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; }
#app { position: fixed; inset: 0; }

/* Top bar */
.toolbar {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px;
  background: rgba(20,22,26,0.85); backdrop-filter: blur(6px); border-bottom: 1px solid rgba(255,255,255,0.08);
}
.toolbar input[type="text"] { flex: 1; min-width: 0; background: #181a1f; border: 1px solid #2a2e36; color: #eee; padding: 8px 10px; border-radius: 6px; }
.toolbar button, .toolbar label {
  background: #2a2e36; color: #eee; border: 1px solid #3a404a; border-radius: 6px; padding: 8px 12px; cursor: pointer;
}
.toolbar button:hover, .toolbar label:hover { background: #323846; }
.toolbar .spacer { flex: 0 0 8px; }
.toolbar small { opacity: 0.7; }

/* Canvas container */
#viewport { position: relative; width: 100%; height: 100%; }
canvas { display: block; width: 100%; height: 100%; }

/* HUD */
.hud { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.chip { font-size: 12px; background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.08); padding: 6px 8px; border-radius: 8px; }

/* When chatbar is present, lift HUD above it */
.has-chat .hud { bottom: 64px; }

/* Chatbar */
.chatbar {
  position: absolute;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  width: calc(100% - 48px); max-width: 300px;
  display: flex; align-items: center;
  padding: 8px 8px 8px 20px;
  background: #3bbcd0;
  border-radius: 999px;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.chatbar input[type="text"] {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: #fff; font-size: 16px;
  padding: 8px 0;
}
.chatbar input[type="text"]::placeholder { color: rgba(255,255,255,0.85); }
.chatbar button {
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: #fff; color: #222;
  border: none; border-radius: 50%;
  font-size: 20px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: background 0.15s;
  position: relative;
}
.chatbar button:hover { background: #f0f0f0; }
.chatbar button.loading { cursor: default; color: transparent; }
.chatbar button.loading::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border: 2.5px solid #ddd;
  border-top-color: #3bbcd0;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Accessibility */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 1px, 1px);
  white-space: nowrap; border: 0;
}

.drop-hint {
  pointer-events: none; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 14px; color: #cdd6f4; opacity: 0; transition: opacity 0.2s ease; border: 2px dashed rgba(255,255,255,0.18); border-radius: 12px; margin: 12px;
}
.drop-active .drop-hint { opacity: 1; background: rgba(49, 51, 56, 0.35); }

a { color: #8ab4ff; text-decoration: none; }
a:hover { text-decoration: underline; }
