/* ==========================================================================
   Bubble cluster (notes/input-controls-for-refinement.html, Prototype 2)

   The container, the bubbles and the budget meter. Cards, buttons and badges
   come from proto-ui.css; the physics lives in js/bubble-cluster.js, which
   sizes and places everything inside .bc-stage.
   ========================================================================== */

.bubble-cluster .bc-stage {
  position: relative;
  height: 320px;
}

.bubble-cluster .bc-container {
  position: absolute;
  top: 0;
  left: 0;
  border: 1.5px dashed var(--bd-ring);
  border-radius: 50%;
  background: var(--bd-muted);
  transition: border-color 150ms ease-out;
}

.bubble-cluster .bc-container.is-target {
  border-style: solid;
  border-color: var(--bd-primary);
}

/* Left out: plain and quiet. In the container: filled. About to be pushed
   out: dashed, so the cost shows before you let go. */
.bubble-cluster .bc-bubble {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--bd-border);
  border-radius: 50%;
  background: var(--bd-background);
  color: var(--bd-muted-foreground);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  will-change: transform;
  transition:
    background-color 150ms ease-out,
    border-color 150ms ease-out,
    color 150ms ease-out,
    box-shadow 150ms ease-out;
}

.bubble-cluster .bc-bubble.is-in {
  border-color: var(--bd-primary);
  background: color-mix(in oklch, var(--bd-primary) 8%, var(--bd-background));
  color: var(--bd-foreground);
}

.bubble-cluster .bc-bubble.is-leaving {
  border-style: dashed;
  border-color: var(--bd-muted-foreground);
  background: var(--bd-background);
  color: var(--bd-muted-foreground);
}

.bubble-cluster .bc-bubble.is-dragging {
  z-index: 2;
  cursor: grabbing;
  box-shadow: 0 6px 16px rgb(0 0 0 / 0.12);
}

.bubble-cluster .bc-bubble:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--bd-ring) 50%, transparent);
}

.bubble-cluster .bc-label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.bubble-cluster .bc-size {
  display: flex;
}

.bubble-cluster .bc-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  outline: none;
  transition: background-color 150ms ease-out;
}

@media (hover: hover) {
  .bubble-cluster .bc-step:hover {
    background: color-mix(in oklch, var(--bd-foreground) 8%, transparent);
  }
}

.bubble-cluster .bc-step:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--bd-ring) 70%, transparent);
}

.bubble-cluster .bc-step:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Budget meter: one segment per unit of budget */
.bubble-cluster .bc-meter {
  display: flex;
  gap: 2px;
}

.bubble-cluster .bc-meter i {
  width: 6px;
  height: 14px;
  border-radius: 2px;
  background: var(--bd-border);
  transition: background-color 150ms ease-out;
}

.bubble-cluster .bc-meter i.is-on {
  background: var(--bd-primary);
}
