       }
            if (curIsTarget && typed < full.length && ((Date.now() / 500) % 1) < 0.7) {
              const caretX = startX + ctx.measureText(full.slice(0, typed)).width + 1;
              ctx.fillStyle = '#22d3ee';
              ctx.fillRect(caretX, y - fsize/2, 2, fsize);
            }
          }
        }

        function roundRect(ctx, x, y, w, h, r) {
          const rr = Math.min(r, Math.min(w, h) / 2);
          ctx.beginPath();
          ctx.moveTo(x + rr, y);
          ctx.arcTo(x + w, y