/* ── Canvas ── */
#canvas {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

/* ── Bubble anchor (handles positioning + push) ── */
.bubble-anchor {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 0;
  will-change: transform;
  z-index: 1;
}
.bubble-anchor.active  { z-index: 10; }
.bubble-anchor.locked  { z-index: 20; }

/* ── Bubble visual (handles sizing + border-radius) ── */
.bubble {
  position: absolute;
  transform: translate(-50%, -50%);
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
  border-radius: 50%;
  --ring: transparent;
  box-shadow:
    0 0 0 2.5px var(--ring),
    0 8px 32px rgba(0,0,0,0.35),
    0 2px 8px rgba(0,0,0,0.18),
    inset 0 0 0 1px rgba(255,255,255,0.1);

  transition:
    width  0.55s cubic-bezier(0.34, 1.4, 0.64, 1),
    height 0.55s cubic-bezier(0.34, 1.4, 0.64, 1),
    border-radius 0.45s ease,
    box-shadow 0.4s ease;
  will-change: width, height, border-radius;
}

.bubble.expanded {
  border-radius: 10px;
  box-shadow:
    0 0 0 2.5px var(--ring),
    0 20px 60px rgba(0,0,0,0.35),
    0 4px 16px rgba(0,0,0,0.2),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}

.bubble.locked {
  border-radius: 10px;
  box-shadow:
    0 0 0 2.5px var(--lock-border),
    0 0 40px var(--lock-glow),
    0 20px 60px rgba(0,0,0,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}

/* ── Bubble inner (gradient fill) ── */
.bubble-fill {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  pointer-events: none;
  transition: transform 0.6s ease;
}
.bubble:hover .bubble-fill {
  transform: scale(1.03);
}

/* ── Grain overlay ── */
.bubble-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  background-size: 200px;
  opacity: 0.6;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ── Label ── */
.bubble-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 18px 14px;
  background: linear-gradient(transparent, rgba(4,4,4,0.82));
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e8e0d4;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  font-weight: 300;
}
.bubble.expanded .bubble-label,
.bubble.locked   .bubble-label {
  opacity: 1;
  transform: translateY(0);
}

/* ── Lock indicator ── */
.bubble-lock-dot {
  position: absolute;
  top: 12px; right: 12px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lock-border);
  box-shadow: 0 0 8px var(--lock-glow);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.bubble.locked .bubble-lock-dot {
  opacity: 1;
}
