/* AI Team Office — full-viewport canvas + HUD */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1220;
  color: #e5e7eb;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#c {
  display: block;
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  z-index: 0;
}

#hud,
.hud-panel {
  position: fixed;
  z-index: 10;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: min(280px, calc(100vw - 24px));
  pointer-events: none;
}

.hud-controls {
  display: flex;
  gap: 8px;
  pointer-events: none;
}

#hud button,
.hud-controls button {
  pointer-events: auto;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

#hud button:active,
.hud-controls button:active {
  transform: scale(0.97);
}

#hud button[aria-pressed="true"],
.hud-controls button[aria-pressed="true"],
#hud button.is-active {
  border-color: rgba(147, 197, 253, 0.7);
  background: rgba(30, 58, 138, 0.75);
}

.hud-bots {
  pointer-events: auto;
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  width: 100%;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-bot {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.25;
  min-height: 22px;
}

.hud-bot-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-bot-status {
  color: #cbd5e1;
  font-size: 12px;
  opacity: 0.9;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ca3af;
  box-shadow: 0 0 6px currentColor;
}

.status-dot.status-working {
  background: #ffbf00;
  color: #ffbf00;
}
.status-dot.status-thinking {
  background: #8b5cf6;
  color: #8b5cf6;
}
.status-dot.status-idle {
  background: #22c55e;
  color: #22c55e;
}
.status-dot.status-done {
  background: #3b82f6;
  color: #3b82f6;
}
.status-dot.status-unknown {
  background: #9ca3af;
  color: #9ca3af;
}

@media (max-width: 480px) {
  #hud,
  .hud-panel {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    max-width: none;
    align-items: stretch;
  }

  .hud-controls {
    justify-content: flex-end;
  }

  .hud-bots {
    max-height: 40vh;
  }
}
